1 2007-08-17 Marek Safar <marek.safar@gmail.com>
3 * linq.cs: MethodGroupExpr update.
5 2007-08-14 Marek Safar <marek.safar@gmail.com>
7 ** C# 3.0 Object and collection initializers
9 * cs-parser.jay: Grammar update.
11 2007-08-11 Marek Safar <marek.safar@gmail.com>
14 * generics.cs (TypeInferenceContext.LowerBoundInference): Don't
15 terminate type inference when an array is not paired.
17 2007-08-10 Miguel de Icaza <miguel@novell.com>
19 * generic.cs (DefaultValueExpression): Add CloneTo support to this
22 2007-08-09 Marek Safar <marek.safar@gmail.com>
24 ** C# 3.0 Anonymous Types (update to the latest standard)
26 * cs-parser.jay: Updated parameters and type names.
28 2007-08-03 Raja R Harinath <harinath@gmail.com>
30 * cs-parser.jay (class_declaration): Update to changes in class.cs.
31 Move calling of 'AddBasesForPart' to ...
32 (class_bases): ... here.
33 (struct_declaration, interface_declaration): Update to changes.
35 2007-08-02 Raja R Harinath <harinath@gmail.com>
37 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
38 * cs-parser.jay: Some whitespace cleanups.
39 (method_header): Refer to the correct symbol for parameters.
41 2007-08-01 Marek Safar <marek.safar@gmail.com>
44 * cs-parser.jay: Ignore partial keyword inside block expression.
46 2007-08-01 Marek Safar <marek.safar@gmail.com>
48 ** C# 3.0 Type Inference (major bits are working)
50 * generic.cs: Introduced new abstract class as an entry point to type
51 inference. Old type inference moved to TypeInferenceV2. Implemented C# 3.0
52 type inference as descibed in the standard in TypeInferenceV2 class.
54 * linq.cs (ALinqExpression): Disabled caching because it's wrong.
56 2007-07-25 Jb Evain <jbevain@novell.com>
58 * Makefile: don't install on net_2_1.
60 2007-07-18 Marek Safar <marek.safar@gmail.com>
62 * cs-parser.jay: Use ImplicitLambdaParameter everywhere.
64 2007-07-17 Marek Safar <marek.safar@gmail.com>
66 * cs-parser.jay: Correct placeholder for implicit linq parameter.
68 * linq: Add ImplicitArgument.
70 2007-07-03 Marek Safar <marek.safar@gmail.com>
72 * cs-parser.jay: Switch to ImplicitLambdaParameter.
74 2007-07-03 Marek Safar <marek.safar@gmail.com>
76 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
79 * linq.cs (QueryExpression.DoResolve): Resolve implicitly typed query
82 2007-06-20 Marek Safar <marek.safar@gmail.com>
84 * cs-parser.jay: Reworked var keyword handling. We cannot handle var as
85 static keyword because var becomes keyword only if no type with the var
86 name exists in the scope of variable which uses var declaration.
88 2007-06-18 Marek Safar <marek.safar@gmail.com>
90 * cs-parser.jay: Add implicitly typed local variable checks.
92 2007-06-15 Marek Safar <marek.safar@gmail.com>
94 * cs-parser.jay: Correctly split generic arguments and generic
95 parameters. Correctly implemented typeof of generic unbound types.
97 2007-06-14 Marek Safar <marek.safar@gmail.com>
99 * cs-parser.jay: Assembly and module attributes must precede all other
100 elements except using clauses and extern alias declarations.
102 2007-06-08 Marek Safar <marek.safar@gmail.com>
104 * cs-parser.jay: Uses newly defined GroupBy class.
106 * linq.cs (GroupBy): Implemented.
107 (AQueryClause.BuildQueryClause): Refactored to allow customize query
110 2007-06-08 Marek Safar <marek.safar@gmail.com>
112 * generics.cs (InferTypeArguments): Uses AnonymousMethodExpression
115 2007-06-06 Marek Safar <marek.safar@gmail.com>
117 * generics.cs (TypeArguments): New contructor fow known number of
120 2007-06-04 Raja R Harinath <rharinath@novell.com>
122 * linq.cs (Select.DoResolve): Pass the created parameters to the
125 2007-05-29 Raja R Harinath <rharinath@novell.com>
127 * cs-parser.jay: Update to changes in ToplevelBlock.
128 (top_current_block): Remove.
130 2007-05-27 Raja R Harinath <harinath@gmail.com>
132 * cs-parser.jay: Update to new ExplicitBlock invariant.
134 * cs-parser.jay: Update to changes introduced in Block and
137 2007-05-25 Raja R Harinath <rharinath@novell.com>
139 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
140 modifying current_block directly.
142 2007-05-22 Scott Peterson <lunchtimemama@gmail.com>
144 * cs-parser.jay: Implemented automatic properties (C# 3.0)
146 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
148 * cs-parser.jay: Improved grammar for object and collection
151 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
153 This code is contributed under the MIT X11 license
155 * cs-parser.jay: Added support for C# 3.0 language features:
156 Variable type inference (the "var" keyword)
159 Object initialization
160 Collection initialization
162 2007-05-06 Marek Safar <marek.safar@gmail.com>
165 * cs-parser.jay: Add special handling for coalescing operator.
167 2007-05-02 Raja R Harinath <rharinath@novell.com>
169 Fix regression in cs0631-3.cs
170 * cs-parser.jay (operator_declarator): Add opt_attributes to error
171 fallback. Make error fallback catch more cases.
173 2007-05-01 Miguel de Icaza <miguel@novell.com>
175 * cs-parser.jay: Allow parameters in operator declarations to have
178 2007-04-27 Miguel de Icaza <miguel@novell.com>
180 * generic.cs (TypeManager.LambdaInfer): now this routine will
181 make only one inference from the list of lambda expression that
182 have not participated in inferring a type.
184 (TypeManager.InferTypeArguments): The logic that drives the type
185 inference in lambda expressions is now driven here.
187 2007-04-23 Miguel de Icaza <miguel@novell.com>
189 * generic.cs: Large update to LambdaInfer, this is merely an
190 update to start the lambda type inference. It is by no means
191 complete. It is currently merely able to build a sample program
192 (with no iteration for the type parameters).
194 2007-04-12 Duncan Mak <duncan@a-chinaman.com>
196 * cs-parser.jay (interface_method_declaration_body): Fixed typo.
198 2007-04-08 Marek Safar <marek.safar@gmail.com>
200 * cs-parser.jay, linq.cs: First select implementation (hacky).
202 * generic.cs (InferTypeArguments): Simplified.
204 2007-03-31 Marek Safar <marek.safar@gmail.com>
206 * generic.cs (InferTypeArguments): Restored validation check.
207 (InferTypeArguments): Move all logic to Compatible method for re-usability.
209 2007-03-25 Marek Safar <marek.safar@gmail.com>
211 * generic.cs (InferTypeArguments): Infer arguments before they are used
212 for compatibility check.
214 2007-03-15 Marek Safar <marek.safar@gmail.com>
216 * generic.cs (InflatedConstraints): Fixed the check order.
217 (TypeArguments.Resolve): Small optimization for generic parameters.
218 (InferTypeArguments): Add infering support for anonymous methods.
220 2007-03-15 Martin Baulig <martin@ximian.com>
225 (TypeParameter.HasConstructorConstraint): Removed.
226 (ConstraintChecker.HasDefaultConstructor): Removed the
227 `TypeBuilder' argument here; correctly check for the ctor
228 constraint on type parameters.
230 2007-03-15 Martin Baulig <martin@ximian.com>
235 (TypeParameter): Create a `MemberCache' here as well. Note that
236 we need to create this on-demand when it's actually used.
238 2007-03-10 Marek Safar <marek.safar@gmail.com>
240 * generic.cs (TypeArguments.Resolve): Avoid redundant checks.
242 2007-03-09 Raja R Harinath <rharinath@novell.com>
244 * cs-parser.jay (WHERE): Move before QUERY_FIRST_TOKEN. 'where'
245 is a valid keyword outside a linq expression too.
247 2007-03-03 Marek Safar <marek.safar@gmail.com>
249 * cs-parser.jay: Implemented basic linq grammar.
251 * linq.cs: New file for hosting query specific classes.
253 2007-02-26 Marek Safar <marek.safar@gmail.com>
255 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
257 2007-02-20 Marek Safar <marek.safar@gmail.com>
260 * cs-parser.jay: Anonymous container starts at constructor declaration
261 and not at block beginning because it has to be usable in constructor
264 2007-02-18 Marek Safar <marek.safar@gmail.com>
266 A fix for bug #80493 by Atsushi Enomoto
267 * cs-parser.jay: Ignore invalid attribute target.
269 2007-02-15 Miguel de Icaza <miguel@novell.com>
271 * Remove the call to SetExpression for lambda expressions, we do
272 not actually need it.
274 Remove expression tracking code as its not needed.
276 2007-02-11 Miguel de Icaza <miguel@novell.com>
278 * cs-parser.jay (lambda_expression_body): when the body is an
279 expression add a statement of the form:
281 contextual-return expression.
283 Where `contextual-return' is similar to `return', the difference
284 being that if the delegate that the lambda will be converted to
285 has a void return type, it will check that the result is a
286 ExpressionStatement and the result is a plain ret (no return
287 values on the stack). If the return type of the delegate is of a
288 given type, this turns into a return with a value and does the
289 regular checking to check that the computed value can be
290 implicitly converted to the delegate return.
292 2007-01-30 Miguel de Icaza <miguel@novell.com>
294 * cs-parser.jay (anonymous_method_expression): move the
295 before/after productions to the start_anonymous and end_anonymous
296 methods so the code can be reused for lambda functions.
298 (lambda_expression_body): wrap expressions implicitly into a
301 (block): factor out the setup/teardown of parsing a block so we
302 can reuse that in lambda_expression_body
304 (lambda_expression): use new anonymous method helper methods.
306 2007-01-29 Miguel de Icaza <miguel@novell.com>
308 * cs-parser.jay: oob_stack make it static (am guessing that is why
309 we no longer initialize it anymore) and reuse it across
312 2007-01-28 Miguel de Icaza <miguel@novell.com>
314 * cs-parser.jay (open_parens): Introduce new non-terminal that
315 abstracts OPEN_PARENS and OPEN_PARENS_LAMBDA as the later can now
316 be returned in places where types are followed by identifiers
317 (this is expected in declaration, fixed, using, foreach and catch
320 Use open_parens in those places, keep OPEN_PARENS in the
323 cs-parser.jay: New grammar bits for parsing lambda expressions.
325 2007-01-28 Raja R Harinath <rharinath@novell.com>
327 Fix #80534, gtest-309.cs
328 * generic.cs (UnifyType): Rename from InferType. Make unification
329 of generic insts simpler and don't insist on inferring all generic
330 parameters in a single generic inst unification.
332 (InferGenericInstance): Remove.
333 Analysis and initial patch by David Mitchell <dmitchell@logos.com>.
335 2007-01-20 Marek Safar <marek.safar@gmail.com>
337 * cs-parser.jay: Better parameter error handling.
339 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
340 Raja R Harinath <rharinath@novell.com>
342 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
343 Note the order in which accessors are declared in the source.
345 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
347 * generic.cs (TypeParameter.FindMembers): Use the generic
348 constraints, not the constraints to check for methods (first fix
351 2006-12-30 Marek Safar <marek.safar@gmail.com>
353 * cs-parser.jay: Better syntax errors handling.
355 2006-11-21 Marek Safar <marek.safar@gmail.com>
357 * cs-parser.jay: Tiny change to work with mcs tokenizer.
359 * cs-tokenizer.cs: Remove after unification with mcs.
361 2006-10-28 Marek Safar <marek.safar@gmail.com>
364 * generic.cs (ConstructedType.AsAccessible): Check accessibility of type
367 2006-10-26 Marek Safar <marek.safar@gmail.com>
370 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous methods.
372 2006-10-25 Brian Crowell <brian@fluggo.com>
375 * generic.cs (CheckConstraints): Allow generic parameters with
376 inheritance constraints to satisfy reference type constraints.
378 2006-10-09 Martin Baulig <martin@ximian.com>
381 (NullCoalescingOperator.DoResolve): Fix #78964; added gtest-294.cs.
383 2006-09-25 Martin Baulig <martin@ximian.com>
385 * class.cs: Remove after unification with mcs source.
387 2006-09-24 Raja R Harinath <harinath@gmail.com>
389 * convert.cs: Remove after unification with mcs source.
391 2006-09-24 Marek Safar <marek.safar@seznam.cz>
393 * class.cs (MemberBase.VerifyClsCompliance): When method has type
394 parameters verify them as well.
396 * generic.cs (Constraints.VerifyClsCompliance): Verify CLS-Compliance of
397 the type parameter constraints.
398 (Generics.VerifyClsCompliance): Ditto.
400 2006-09-24 Marek Safar <marek.safar@seznam.cz>
402 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
403 for anonymous block with out argument.
405 2006-09-24 Marek Safar <marek.safar@seznam.cz>
407 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
408 not used private events only.
410 2006-09-23 Marek Safar <marek.safar@seznam.cz>
412 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
414 * cs-parser.jay: Parse correctly cast of default (T).
416 * generic.cs (DefaultValueExpression.DoResolve): Check for void type.
417 Store original type via EmptyConstantCast.
419 2006-09-22 Martin Baulig <martin@ximian.com>
421 * delegate.cs: Removed; this file is now shared with mcs.
423 * attribute.cs: Removed; this file is now shared with mcs.
425 2006-09-22 Martin Baulig <martin@ximian.com>
427 * ecore.cs: Removed; this file is now shared with mcs.
429 2006-09-21 Marek Safar <marek.safar@seznam.cz>
431 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
433 * ecore.cs (NullCast): Derives from NullConstant.
435 * generic.cs (DefaultValueExpression): Fixed to cope with the constant
438 2006-09-21 Martin Baulig <martin@ximian.com>
440 * decl.cs: Removed; this file is now shared with mcs.
442 2006-09-21 Raja R Harinath <rharinath@novell.com>
444 * rootcontext.cs: Remove after unification with mcs source.
446 * report.cs: Remove after unification with mcs source.
447 * generic.cs (AddTypeParameter, LookupTypeParameter): Move to
449 (InitGenerics, CleanUpGenerics): Remove.
451 * support.cs: Remove after unification with mcs source.
453 2006-09-20 Raja R Harinath <rharinath@novell.com>
455 * codegen.cs: Remove after unification with mcs source.
457 2006-09-19 Martin Baulig <martin@ximian.com>
459 * expression.cs: Removed; this file is now shared with mcs.
461 2006-09-19 Martin Baulig <martin@ximian.com>
464 (TypeManager.IsEqual): Moved into ../mcs/typemanager.cs.
465 (TypeManager.DropGenericTypeArguments): Likewise.
466 (TypeManager.DropGenericMethodArguments): Likewise.
467 (TypeManager.GetTypeArguments): Likewise.
468 (TypeManager.HasGenericArguments): Likewise.
470 2006-09-19 Martin Baulig <martin@ximian.com>
472 * ecore.cs (PropertyExpr.InstanceResolve): Fix the CS1540 check.
474 2006-09-19 Martin Baulig <martin@ximian.com>
476 * typemanager.cs: Removed; this file is now shared with mcs.
478 2006-09-16 Raja R Harinath <rharinath@novell.com>
480 * Makefile (LOCAL_MCS_FLAGS): Use instead of PROFILE_MCS_FLAGS.
481 * AssemblyInfo.cs, driver.cs: Remove after unification with mcs source.
483 2006-09-16 Marek Safar <marek.safar@seznam.cz>
486 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
487 only if parent type is class.
488 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
491 2006-09-15 Marek Safar <marek.safar@seznam.cz>
494 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
496 * typemanager.cs(CSharpName): Converts NullType to null.
498 2006-09-15 Martin Baulig <martin@ximian.com>
500 * pending.cs: Removed; this file is now shared with mcs.
502 2006-09-15 Martin Baulig <martin@ximian.com>
504 * statement.cs: Removed; this file is now shared with mcs.
506 2006-09-15 Martin Baulig <martin@ximian.com>
508 * rootcontext.cs (RootContext.BrokenCircularDeps): Removed.
510 * driver.cs: Removed the `--broken-cycles' argument.
512 2006-09-15 Martin Baulig <martin@ximian.com>
514 * namespace.cs: Removed; this file is now shared with mcs.
516 2006-09-15 Martin Baulig <martin@ximian.com>
518 * decl.cs (MemberName): Minor code cleanups.
520 2006-09-15 Martin Baulig <martin@ximian.com>
522 * parameter.cs: Removed; this file is now shared with mcs.
524 2006-09-15 Martin Baulig <martin@ximian.com>
526 * enum.cs: Removed; this file is now shared with mcs.
528 2006-09-15 Martin Baulig <martin@ximian.com>
530 * Makefile: Define `GMCS_SOURCE'.
532 * flowanalysis.cs: Removed; this file is now shared with mcs.
534 2006-09-15 Martin Baulig <martin@ximian.com>
536 Removed modifiers.cs, literal.cs, location.cs, roottypes.cs,
537 assign.cs, const.cs, cfold.cs, constant.cs, symbolwriter.cs and
538 doc.cs - they are now shared with mcs.
540 * gmcs.exe.sources: Include these files from ../mcs/.
542 2006-09-15 Martin Baulig <martin@ximian.com>
544 * old-code.cs, gen-il.cs, gen-treedump.cs: Removed old stuff.
545 * g1.cs, sample-hello.cs, sample-stack.il: Likewise.
547 2006-09-14 Marek Safar <marek.safar@seznam.cz>
549 * assign.cs, ecore.cs, expression.cs: Share error message text.
550 * class.cs (FieldMember.Define): Check for variable of static type.
551 * decl.cs (check_type_parameter): Report correct type name.
552 * driver.cs (LoadAssembly): Uses error output for errors.
553 * generic.cs (Constraints.Resolve): Add check for constraint accessibility
554 (TypeArguments.Resolve): Static class cannot be used as an argument.
555 * statement.cs (ResolveMeta): Constants cannot be generic types.
557 2006-09-12 Martin Baulig <martin@ximian.com>
559 * generic.cs (TypeManager.IsIList): Moved into convert.cs.
561 * convert.cs (Convert.Array_To_IList): Moved here and correctly
562 implement it; fixes #79345.
564 2006-09-08 Marek Safar <marek.safar@seznam.cz>
566 * decl.cs (DeclSpace.SetParameterInfo): Check for nonexistent type
568 * expression.cs (TypeOf.GetAttributableValue): Check for open generic
570 * generic.cs: Improved error messages.
571 * typemanager.cs (RemoveGenericArity): Made public.
573 2006-09-08 Martin Baulig <martin@ximian.com>
575 * typemanager.cs (TypeManager.interlocked_type): New public field.
576 (TypeManager.int_interlocked_compare-exchange): New public field.
577 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
578 enumerator types here and call InitGenericCoreTypes().
579 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
580 after calling InitEnumUnderlyingTypes().
583 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
584 `classes_second_stage'.
586 2006-09-07 Marek Safar <marek.safar@seznam.cz>
588 * class.cs, generic.cs (GenericMethod.Define): Check for type parameter
590 * statement.cs (Block.Variables): Made public.
592 2006-09-07 Martin Baulig <martin@ximian.com>
595 (MainDriver): Revert r62663 from Marek; see #70506 for details.
597 2006-09-01 Martin Baulig <martin@ximian.com>
600 (TypeManager.IsIList): Also handle base classes and interfaces.
602 2006-09-01 Raja R Harinath <rharinath@novell.com>
605 * expression.cs (Invocation.MoreSpecific): Check for reference
608 2006-08-29 Miguel de Icaza <miguel@novell.com>
610 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
612 2006-08-17 Miguel de Icaza <miguel@novell.com>
614 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
615 #52019 and #79064, the use of the \uXXXX sequence in source code
616 to represent unicode characters.
618 2006-08-15 Marek Safar <marek.safar@seznam.cz>
620 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
622 * class.cs, ecore.cs, statement.cs: Merged to one error message.
624 2006-08-14 Raja R Harinath <rharinath@novell.com>
627 * cs-tokenizer.cs (parse_less_than): Allow '*' to appear in a type
628 parameter too. This only avoids a parse error -- the semantic
629 error is caught elsewhere.
631 2006-08-13 Miguel de Icaza <miguel@novell.com>
633 * assign.cs: Catch attempts to assign to a method groups in += and
636 2006-08-13 Marek Safar <marek.safar@seznam.cz>
639 * cs-parser.jay: Don't destroy current array type by typeof of array's.
641 2006-08-12 Marek Safar <marek.safar@seznam.cz>
643 * cs-parser.jay: Check whether a constraint clause has already been
644 specified for type parameter.
645 * generic.cs (Constraints): Exposed location.
647 2006-08-12 Marek Safar <marek.safar@seznam.cz>
649 * class.cs (Method.Define): Issue a warning when generic method looks like
651 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
653 * report.cs: New warning number.
655 2006-08-09 Marek Safar <marek.safar@seznam.cz>
657 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
659 * decl.cs (MemberCache.FindMembers): When container is interface we need to
660 search all base interfaces as a member can be ambiguous.
661 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
662 Constructor member type filter.
663 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
664 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
665 reporting for returned memberinfos.
666 * report.cs: Updated.
667 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
668 version to work on all runtimes.
669 (TypeManager.RealMemberLookup): Removed members filtering.
671 2006-08-08 Raja R Harinath <rharinath@novell.com>
673 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
674 (PropertyExpr.EmitAssign): Likewise.
675 * expression.cs (Indirection.EmitAssign): Likewise.
676 (LocalVariableReference.EmitAssign): Likewise.
677 (ParameterReference.EmitAssign): Likewise.
678 (Invocation.EmitArguments): Likewise.
679 (ArrayAccess.EmitAssign): Likewise.
680 (IndexerAccess.EmitAssign): Likewise.
681 (This.EmitAssign): Likewise.
682 (ConditionalLogicalOperator.Emit): Likewise.
685 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
686 instead of ArrayList. If the hashtable has a LocalBuilder, don't
687 leave it in after returning it.
688 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
690 2006-08-06 Marek Safar <marek.safar@seznam.cz>
692 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
695 2006-08-05 Marek Safar <marek.safar@seznam.cz>
697 * class.cs (TypeContainer.AddPartial): Add check for partial declarations
698 with different type names.
699 (TypeContainer.UpdateTypeParameterConstraints): Updated an error message.
701 2006-08-03 Raja R Harinath <rharinath@novell.com>
703 Fix cs0146-3.cs and cs0146-4.cs.
704 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
705 enclosing types don't depend on the current type.
707 2006-08-02 Raja R Harinath <rharinath@novell.com>
710 * class.cs (TypeContainer.DoDefineMembers): Use
711 FindBaseMemberWithSameName on Parent, since we're interested in
712 whether we hide inherited members or not.
713 (FindBaseMemberWithSameName): Make slightly more robust.
716 * codegen.cs (IResolveContext.GenericDeclContainer): New.
717 (EmitContext): Implement new interface requirement.
718 * namespace.cs (UsingEntry, LocalAliasEntry): Likewise.
719 * decl.cs (MemberCore): Likewise.
720 (DeclSpace.GenericDeclContainer): Rename from DeclContainer.
721 * ecore.cs (SimpleName.ResolveAsTypeTerminal): Use
722 ec.GenericDeclContainer to check for generic parameters.
723 (SimpleName.DoSimpleNameResolve): Likewise.
724 * generic.cs (TypeParameter.DeclContainer): Remove override.
726 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
727 declspaces for doppelgangers too.
728 (UsingEntry): Implement IResolveContext.
729 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
730 'this' as the resolve context.
731 (LocalAliasEntry): Likewise.
733 Implement parts of #77403
734 * roottypes.cs (RootDeclSpace): New. Used to represent the
735 toplevel declaration space. Each namespace declaration introduces
736 a "partial" root declaretion space.
737 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
738 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
739 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
740 from 'current_namespace.SlaveDeclSpace'.
741 (namespace_declaration): Likewise.
742 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
743 check. It can't happen now.
744 * decl.cs (DeclSpace.LookupType): Likewise.
745 * driver.cs (MainDriver): Sanity check.
747 2006-08-01 Raja R Harinath <rharinath@novell.com>
749 * decl.cs (DeclSpace.FindNestedType): Remove.
750 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
751 LookupTypeContainer to get the container of the nested type.
752 * class.cs (TypeContainer.FindNestedType): Make non-override.
754 2006-07-31 Raja R Harinath <rharinath@novell.com>
756 * decl.cs (DeclSpace.PartialContainer): Move field from ...
757 * class.cs (TypeContainer.PartialContainer): ... here.
758 (TypeContainer.AddBasesForPart): New helper.
759 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
761 * cs-parser.jay (current_class): Convert to DeclSpace.
762 (struct_declaration, interface_declaration, class_declaration):
763 Use AddBasesForPart instead of .Bases directly.
764 * const.cs, iterators.cs: Update to changes.
766 2006-07-28 Raja R Harinath <rharinath@novell.com>
768 * class.cs (TypeContainer.AddMemberType): Rename from
770 (TypeContainer.AddMember): Rename from AddToMemberContainer.
771 (AddTypeContainer): New. Combine AddClassOrStruct and
773 (AddPartial): Update. Add 'is_partial' argument.
774 * roottypes.cs: Update to changes.
775 * cs-parser.jay (push_current_class): New helper for handling
776 current_container and current_class.
777 (struct_declaration, interface_declaration, class_declaration):
780 2006-07-26 Raja R Harinath <rharinath@novell.com>
782 * roottypes.cs: Rename from tree.cs.
784 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
785 * tree.cs (Tree, ITreeDump): Remove types.
786 * rootcontext.cs (tree, Tree): Remove fields.
787 (root, ToplevelTypes): New.
788 * *.cs: Update to rename.
790 * tree.cs (Tree.RecordDecl): Remove.
791 (RootTypes.AddToTypeContainer): Record the toplevel type in its
793 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
795 2006-07-23 Raja R Harinath <harinath@gmail.com>
797 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
798 DoFlowAnalysis and OmitStructFlowAnalysis here.
799 (ec.With): Rename from WithUnsafe and generalize.
800 (ec.WithCheckState): Remove. All users can be handled by 'With'.
801 (ec.WithFlowAnalyis): New.
802 * ecore.cs, expression.cs, statement.cs: Update.
804 2006-07-22 Raja R Harinath <harinath@gmail.com>
806 * statement.cs (Block.ResolveMeta): Simplify slightly.
808 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
809 multiple boolean fields. Convert InUnsafe, constant_check_state,
810 check_state to flags.
811 (CheckState, ConstantCheckState): Update.
812 (InUnsafe): New read-only property.
813 (FlagsHandle): Rename from CheckStateHandle and convert to handle
815 (WithUnsafe): New helper similar to WithCheckState.
816 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
817 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
819 2006-07-21 Raja R Harinath <rharinath@novell.com>
821 Make comparisons use the same IL irrespective of whether they're
822 in a 'checked' or 'unchecked' context: one of the issues in #78899
823 * codegen.cs (EmitContext.CheckState): Make read-only property.
824 (EmitContext.ConstantCheckState): Likewise.
825 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
826 helper that implement a save/restore stack for CheckState
827 values. This is the only way to change check-state.
828 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
829 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
830 (CheckedExpr.EmitBranchable): New forwarding method.
831 (UnCheckedExpr): Likewise.
832 * statement.cs (Block.ResolveMeta): Use WithCheckState.
833 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
834 (Checked.Resolve, checked.DoEmit): Likewise.
836 2006-07-21 Martin Baulig <martin@ximian.com>
838 * generic.cs (TypeManager.InferType): When inferring an array
839 type, also allow IList<T> and ICollection<T>. Fixes #78900.
841 2006-07-21 Martin Baulig <martin@ximian.com>
843 * generic.cs (TypeManager.IsIEnumerable): Renamed into IsIList()
844 and allow IList`1 and all its base interfaces.
846 * convert.cs (Convert.ImplicitReferenceConversion): Allow
847 converting from an array-type of T to IList<T>.
849 2006-07-21 Martin Baulig <martin@ximian.com>
851 * ecore.cs (SimpleName.DoSimpleNameResolve): Added CS0307 check.
853 2006-07-20 Miguel de Icaza <miguel@novell.com>
855 * anonymous.cs: Cache the resolved anonymous delegate, and return
856 this so that the ResolveTopBlock is only triggered once, not
859 Currently we trigger ResolvetopBlock twice due to a first pass of
860 argument check compatibility, and a second pass that does the
863 2006-07-15 Marek Safar <marek.safar@seznam.cz>
865 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
867 * rootcontext.cs (Reset): Add helper_classes.
869 2006-07-15 Marek Safar <marek.safar@seznam.cz>
872 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
875 2006-07-13 Miguel de Icaza <miguel@novell.com>
877 * statement.cs (Lock): Handle expressions of type
878 TypeManager.null_type specially. Fixes #78770
880 2006-07-08 Marek Safar <marek.safar@seznam.cz>
882 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
885 2006-07-08 Marek Safar <marek.safar@seznam.cz>
887 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
888 for accessors as well.
889 * ecore.cs (EventExpr): Add AccessorTable.
891 2006-07-03 Martin Baulig <martin@ximian.com>
893 * ecore.cs (UnboxCast.Emit): Also use `Unbox_Any' for generic
894 instances of value types.
896 * convert.cs (Convert.ExplicitConversion): Correctly handle
897 object->nullable conversions.
899 2006-07-01 Marek Safar <marek.safar@seznam.cz>
902 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
903 for CS0122 where appropriate.
904 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
906 (Filter): Assembly can be null in the case of top level attributes.
908 2006-06-28 Raja R Harinath <rharinath@novell.com>
911 * generic.cs (TypeManager.InferParamsTypeArguments): If there are
912 no arguments, return 'false': nothing can be inferred.
914 2006-06-25 Marek Safar <marek.safar@seznam.cz>
918 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
919 is done at global level.
921 2006-06-24 Marek Safar <marek.safar@seznam.cz>
923 A fix for #77002, Implemented TypeForwarder support.
925 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
926 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Add TypeForwarder
928 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
929 * typemanager.cs (): Add type_forwarder_attr_type.
931 2006-06-24 Marek Safar <marek.safar@seznam.cz>
933 * report.cs: Add CS0469 warning.
935 2006-06-22 Martin Baulig <martin@ximian.com>
938 (TypeContainer.GetNormalBases): Also use ResolveAsBaseTerminal()
939 for interfaces; fixes #78686, which is a modification of #78380
940 with interfaces instead of classes.
942 2006-06-21 Martin Baulig <martin@ximian.com>
944 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
945 the `try'-block, so we also report CS0016 etc. there.
947 2006-06-21 Martin Baulig <martin@ximian.com>
949 * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
950 handle SetAssigned() and SetMemberIsUsed() for generic types;
953 2006-06-21 Martin Baulig <martin@ximian.com>
956 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
958 2006-06-21 Martin Baulig <martin@ximian.com>
960 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
961 also report CS1686 for parameters.
963 2006-06-21 Martin Baulig <martin@ximian.com>
965 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
966 instead of an error if the value is not implicitly convertible to
967 the switch types; fixes #77964.
969 2006-06-21 Raja R Harinath <rharinath@novell.com>
972 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
973 FieldBuilder is null.
976 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
977 'left' and 'right' before error-checking.
979 2006-06-19 Martin Baulig <martin@ximian.com>
982 (Convert.ImplicitConversionStandard): Cleanup and correctly
983 implement nullable conversions.
984 (Convert.ImplicitStandardConversionExists): Likewise.
985 (Convert.ExplicitConversion): Likewise.
987 2006-06-19 Martin Baulig <martin@ximian.com>
990 (Nullable.Wrap.Create, Nullable.Unwrap.Create): New public static
991 methods; make the ctors protected.
993 2006-06-19 Martin Baulig <martin@ximian.com>
995 Fixed #78380; added gtest-273.cs.
998 (Expression.ResolveAsBaseTerminal): Move the constraint checking
999 into ResolveAsTypeTerminal().
1002 (ConstraintChecker.HasDefaultConstructor): Use the non-cache based
1003 TypeManager.FindMembers() to check for the default ctor.
1005 2006-06-18 Marek Safar <marek.safar@seznam.cz>
1007 * generic.cs: Fixed NullableInfo accessibility.
1009 2006-06-16 Martin Baulig <martin@ximian.com>
1012 (Constraints.InflatedConstraints.inflate): Correctly inflate
1013 generic types; fixes #78400.
1015 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
1017 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
1019 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
1020 (FieldExpr.DoResolve): likewise.
1021 (PropertyExpr.InstanceResolve): likewise.
1022 (EventExpr.InstanceResolve): likewise.
1024 2006-06-15 Martin Baulig <martin@ximian.com>
1027 (SwitchLabel.ResolveAndReduce): Added `bool allow_nullable'
1028 argument; always allow a `null' label if true.
1029 (Switch.SwitchGoverningType): Take an `Expression expr' argument.
1030 (Switch.TableSwitchEmit, Switch.SimpleSwitchEmit): Check whether
1031 we have a `null' label and mark the new `null_target' label;
1032 default to the `default' label.
1033 (Switch.Resolve): Add support for nullable types. Fixes #78630.
1035 2006-06-15 Martin Baulig <martin@ximian.com>
1037 * class.cs (Operator.Define): Allow an implicit/explicit operator
1038 to convert to/from a nullable value of the enclosing type.
1040 * generic.cs (TypeManager.IsNullableTypeOf): New public method.
1041 (Nullable.Unwrap, Nullable.Wrap): Make these classes public.
1044 (Convert.ImplicitStandardConversionExists): Add support for lifted
1045 implicit/explicit conversions.
1046 (Convert.ImplicitConversionStandard): Likewise.
1048 2006-06-13 Martin Baulig <martin@ximian.com>
1050 * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
1051 type arguments and create a ConstructedType if necessary. Fixes #78400.
1053 2006-06-04 Marek Safar <marek.safar@seznam.cz>
1055 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
1056 attribute applicable tests for attribute argument.
1058 2006-06-02 Raja R Harinath <rharinath@novell.com>
1061 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
1062 (Binary.OverloadResolve_PredefinedIntegral): New.
1063 (Binary.OverloadResolve_PredefinedFloating): New.
1064 (Binary.OverloadResolve_PredefinedString): New.
1065 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
1066 Follow the standard more closely, and treat numeric promotions in
1067 terms of overload resolution.
1068 (Binary.CheckShiftArguments): Simplify.
1070 2006-06-01 Raja R Harinath <rharinath@novell.com>
1072 * flowanalysis.cs (MyBitVector): Simplify representation.
1073 (MyBitVector.Clone): Avoid allocating BitArray.
1074 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
1075 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
1076 (*): Update. Change all references to MyBitVector.And and
1077 MyBitVector.Or to &= and |=.
1079 2006-05-31 Raja R Harinath <rharinath@novell.com>
1081 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
1082 Use bne.un instead of ceq+brfalse.
1085 * typemanager.cs (IsUnmanagedType): Disallow generic types and
1088 2006-05-29 Raja R Harinath <rharinath@novell.com>
1091 * cs-parser.jay (formal_parameter_list): Extend the pattern below
1092 to param arguments too.
1094 2006-05-26 Miguel de Icaza <miguel@novell.com>
1096 * cs-parser.jay: Catch another parsing form for arglist being
1097 followed by other arguments. Fixes #78313.
1099 2006-05-25 Raja R Harinath <rharinath@novell.com>
1102 * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
1103 also when one of the operands is a null literal.
1104 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
1105 to improve clarity, and generate slightly better code.
1107 2006-05-24 Raja R Harinath <rharinath@novell.com>
1109 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
1110 checking of out parameters to ...
1111 (FlowBranchingToplevel.Merge): ... here.
1112 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1113 set, propagate the origin upward, and only complain if there was
1115 (FlowBranchingException.AddContinueOrigin): Likewise.
1116 (FlowBranchingException.AddReturnOrigin): Likewise.
1117 (FlowBranchingException.AddGotoOrigin): Likewise.
1119 2006-05-23 Raja R Harinath <rharinath@novell.com>
1121 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1122 unreachable, skip it.
1123 (FlowBranchingException.Merge): Always propagate jumps, even if
1124 the finally block renders subsequent code unreachable.
1126 2006-05-18 Raja R Harinath <rharinath@novell.com>
1129 * statement.cs (Goto.Resolve): Move responsibility for resolving
1130 'goto' to FlowBranching.AddGotoOrigin.
1131 (Goto.SetResolvedTarget): New. Callback to set the
1132 LabeledStatement that's the target of the goto.
1133 (Goto.DoEmit): Use Leave instead of Br when crossing an
1134 unwind-protect boundary.
1135 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1136 LookupLabel and adjust to new semantics.
1137 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1138 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1139 Goto.SetResolvedTarget to update target.
1140 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1141 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1142 AddBreakOrigin & co. Delay propagation until ...
1143 (FlowBranchingException.Merge): ... this.
1145 * statement.cs (Block.Resolve): Always depend on flow-branching to
1146 determine unreachability. Kill workaround that originally emitted
1147 only one statement after an "unreachable" label (see infloop in
1150 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1151 This is still "wrong", but anything better would probably need a
1152 multi-pass algorithm.
1153 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1154 usage vector. Force current usage vector to be reachable, to
1155 optimistically signify backward jumps.
1156 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1158 (FlowBranchingLabeled.Merge): New. If no backward jump was
1159 detected, return the original salted-away usage vector instead,
1160 updated with appropriate changes. Print unreachable warning if
1162 * statement.cs (Block.Resolve): Don't print unreachable warning on
1163 a labeled statement.
1165 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
1167 * driver.cs: Pass filename without path to AssemblyBuilder's
1168 AddResourceFile. Fixes bug #78407.
1170 2006-05-17 Raja R Harinath <rharinath@novell.com>
1172 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1173 * flowanalysis.cs (FlowBranchingLabeled): ... here.
1174 (FlowBranching.MergeChild): Overwrite
1175 reachability information from Labeled branchings too.
1177 2006-05-16 Raja R Harinath <rharinath@novell.com>
1179 * statement.cs (Goto.Resolve): Merge jump origins here ...
1180 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1182 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1183 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
1184 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
1185 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1187 * statement.cs (Goto.Resolve): ... not here.
1188 (Goto.Emit): Remove CS1632 check.
1190 2006-05-14 Marek Safar <marek.safar@seznam.cz>
1192 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1195 2006-05-11 Raja R Harinath <rharinath@novell.com>
1197 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1198 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1199 (FlowBranchingException.Label): Likewise.
1201 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
1203 (MyBitVector.Or): Use it to avoid losing information (Count).
1204 (FlowBranching.MergeOrigins): Likewise.
1206 * flowanalysis.cs (UsageVector.IsDirty): Remove.
1207 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1208 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1209 (UsageVector.ToString): Simplify.
1210 (UsageVector.MergeSiblings): Move here from ...
1211 (FlowBranching.Merge): ... here.
1212 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1215 2006-05-10 Raja R Harinath <rharinath@novell.com>
1217 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1218 null bitvector is treated as all-true.
1220 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1221 (MyBitVector): Rationalize invariants. 'vector != null' implies
1222 that we have our own copy of the bitvector. Otherwise,
1223 'InheritsFrom == null' implies all inherited bits are true.
1225 2006-05-09 Marek Safar <marek.safar@seznam.cz>
1227 * statement.cs (LocalInfo): Add IsConstant.
1228 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1229 local variable for constants.
1231 2006-05-09 Raja R Harinath <rharinath@novell.com>
1233 * flowanalysis.cs (MyBitVector.Empty): New.
1234 (MyBitVector): Don't allow InheritedFrom to be null.
1235 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1236 (UsageVector, FlowBranching): Update to changes.
1238 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1239 recursion. The 'Parent == null' condition isn't sufficient for
1241 (FlowBranching.AddBreakOrigin): Likewise.
1242 (FlowBranching.AddContinueOrigin): Likewise.
1243 (FlowBranching.AddReturnOrigin): Likewise.
1244 (FlowBranching.StealFinallyClauses): Likewise.
1245 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1246 (FlowBranching.CheckOutParameters): Likewise.
1247 (FlowBranchingToplevel): Terminate all the above recursions here.
1248 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1249 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1251 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
1253 (FlowBranchingToplevel): New. Empty for now.
1254 (FlowBranching.MergeTopBlock): Update.
1255 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1256 branching for the anonymous delegate.
1257 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1259 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1260 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1261 information at the start of the merge. Reorganize.
1263 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1265 * class.cs (MethodData.Define): Method cannot implement interface accessor.
1267 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1269 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1270 to newly introduced ctor.
1272 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1273 message to one place.
1274 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1277 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1279 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1281 * ecore.cs (Expression.ResolveAsConstant): Updated.
1283 * statement.cs (ResolveMeta): Updated.
1285 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1287 * cs-parser.jay: __arglist cannot be used in initializer.
1289 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1292 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1295 2006-05-05 Raja R Harinath <rharinath@novell.com>
1297 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1298 (LabeledStatement): Add 'name' parameter.
1299 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1300 (Block.AddLabel): Update to changes.
1301 * cs-parser.jay (labeled_statement): Likewise.
1303 * flowanalysis.cs (BranchingType.Labeled): New.
1304 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1305 (FlowBranchingLabeled): New. Does nothing for now, but will
1306 eventually handle 'goto' flows.
1307 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1308 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1309 that's terminated ...
1310 (Block.Resolve): ... here.
1312 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1313 (UsageVector.MergeFinallyOrigins): Likewise.
1314 (FlowBranching.InTryOrCatch): Likewise.
1315 (FlowBranching.AddFinallyVector): Likewise.
1316 (FlowBranchingException): Update to changes.
1319 * statement.cs (Return.Resolve): Move error checking to ...
1320 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1321 (FlowBranchingException): Handle return origins like break and
1323 (FlowBranching.UsageVector.CheckOutParameters): Remove.
1325 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1328 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1331 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1334 * class.cs (MethodData.Define): Do public accessor check only when method
1335 implements an interface.
1337 2006-05-04 Raja R Harinath <rharinath@novell.com>
1339 Remove special handling of 'break'
1340 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1341 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
1342 (UsageVector.Break): Remove.
1343 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1345 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1347 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1348 UsageVector.Breaks (). Don't set NeedsReturnLabel.
1350 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1353 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1354 be the interface member.
1356 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1359 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1360 for emitting small (int) values.
1362 2006-05-03 Raja R Harinath <rharinath@novell.com>
1365 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1366 control-flow passes through the 'finally' after merging-in all the
1367 control-flows from 'try' and the 'catch' clauses.
1369 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1370 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
1371 always true at the only non-recursive entry point.
1372 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1373 FlowBranchingBreakable.
1374 (FlowBranchingLoop): Remove.
1375 * statement.cs (Return.DoResolve): Update to changes.
1378 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1379 (FlowBranching.CreateBranching): Handle it: create a
1380 FlowBranchingContinuable.
1381 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1382 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1383 except that it handles the 'continue' command.
1384 (FlowBranching.UsageVector.MergeOrigins): Rename from
1386 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1387 except that it overrides AddContinueOrigin.
1388 (FlowBranchingException): Override AddContinueOrigin, similar to
1390 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1391 Create a new branching around the embedded statement.
1392 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
1393 control flow after the embedded statement.
1394 (Continue.Resolve): Move all error checking to AddContinueOrigin.
1396 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1397 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1398 FlowBranchingBreakable.
1399 (FlowBranchingSwitch): Remove.
1402 * statement.cs (Break.Resolve): Simplify. Move responsibility for
1403 error reporting to ...
1404 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1405 Rename from 'AddBreakVector'. Add new location argument. Return
1406 a bool indicating whether the 'break' crosses an unwind-protect.
1407 (FlowBranchingException.AddBreakOrigin): Add.
1408 (FlowBranchingException.Merge): Propagate 'break's to surrounding
1409 flowbranching after updating with the effects of the 'finally'
1411 (FlowBranchingBreakable): New common base class for
1412 FlowBranchingLoop and FlowBranchingSwitch.
1414 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1416 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1418 2006-05-02 Raja R Harinath <rharinath@novell.com>
1420 * statement.cs (Do.Resolve): If the loop is infinite, set the
1422 (While.Resolve, For.Resolve): Set a barrier after the embedded
1423 statement. There's no direct control flow that goes from the end
1424 of the embedded statement to the end of the loop.
1425 * flowanalysis.cs (FlowBranching.Infinite): Remove.
1426 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
1427 above ensure that the reachability is correctly computed.
1429 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1430 (UsageVector.MergeBreakOrigins): If the current path is
1431 unreachable, treat it as if all parameters/locals are initialized.
1432 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
1433 infinite loops before merging-in break origins.
1435 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1436 (Reachability.Reachable): Split part into ...
1437 (Reachability.Unreachable): ... this. Simplify.
1438 (Reachability.IsUnreachable): Use 'Unreachable' instead.
1440 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1441 (Reachability.SetThrowsSometimes): Likewise.
1442 (FlowBranchingBlock.MergeTopBlock): Don't compare against
1443 TriState.Always, use corresponding property.
1444 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1445 (Block.Resolve): Likewise. Remove some redundant checks.
1447 2006-05-02 Raja R Harinath <harinath@gmail.com>
1449 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1450 (Reachability.Meet): Don't bother checking AlwaysThrows --
1451 barrier is always set.
1452 (FlowBranchingBlock.Merge): Likewise.
1454 2006-05-01 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
1456 * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
1457 defined, so it's references should also compile only for NET_2_0
1458 (as occurs in mcs version)
1460 2006-05-01 Raja R Harinath <harinath@gmail.com>
1462 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1463 checks for unreachable.
1465 2006-05-01 Marek Safar <marek.safar@seznam.cz>
1468 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1470 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1471 whether field is really assigned.
1473 2006-04-30 Raja R Harinath <harinath@gmail.com>
1475 * flowanalysis.cs (Reachability): Make 4-argument constructor
1477 (Reachability.Meet): Rename from 'And'. Remove static variant.
1478 (Reachability.Always): Rename from the highly misleading
1479 'Reachability.Never'.
1480 (FlowBranching.Merge): Update to changes. Mark an impossible
1481 situation with a 'throw'.
1482 (*): Update to changes.
1484 2006-04-29 Raja R Harinath <harinath@gmail.com>
1486 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1488 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1489 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1490 (*): Update to changes.
1491 * statement.cs: Update to changes.
1493 2006-04-28 Marek Safar <marek.safar@seznam.cz>
1496 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1498 2006-04-28 Raja R Harinath <harinath@gmail.com>
1500 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1503 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1504 argument to two arguments: an usage-vector and a bool. Move call
1505 to FlowBranching.Merge () ...
1506 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1508 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1509 handling of loop and switch reachability to ...
1510 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1512 2006-04-27 Raja R Harinath <harinath@gmail.com>
1514 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1515 handling to FlowBranchingLoop.InLoop.
1516 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1518 2006-04-26 Marek Safar <marek.safar@seznam.cz>
1521 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1522 anonymous method is allowed from AnonymousContainer here.
1524 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1526 2006-04-24 Raja R Harinath <rharinath@novell.com>
1529 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1531 2006-04-23 Marek Safar <marek.safar@seznam.cz>
1534 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1535 (DoubleConstant.Reduce): Ditto.
1537 2006-04-23 Raja R Harinath <rharinath@novell.com>
1539 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1540 Remove 'lvalue_right_side' argument. Move parts to ...
1541 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1542 (LocalVariable.DoResolveLValue): ... these.
1544 2006-04-21 Raja R Harinath <rharinath@novell.com>
1547 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1548 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1549 (LocalVariableReference.DoResolveBase): Use it to implement new
1551 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1552 (Argument.Resolve): Simplify. Move CS1510 check ...
1553 * ecore.cs (Expression.ResolveLValue): ... here.
1554 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1555 (PropertyExpr.DoResolveLValue): Likewise.
1556 (FieldExpr.Report_AssignToReadonly): Likewise.
1557 (FieldExpr.DoResolve): Add 'out_access' argument. Use
1558 LValueMemberAccess or LValueMemberOutAccess on instance depending
1560 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1561 DoResolve as appropriate.
1563 2006-04-20 Raja R Harinath <rharinath@novell.com>
1566 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1567 implicit conversions on 'out' and 'ref' arguments.
1569 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1570 improve clarity. Remove dead code.
1573 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1574 (Catch.Resolve): Resolve VarBlock if it exists.
1576 2006-04-19 Miguel de Icaza <miguel@novell.com>
1578 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1579 twice, this was some residual code, the enumerator was emitted
1580 properly in the two branche of if later.
1584 Thanks to Martin for finding the source of the problem
1586 2006-04-19 Raja R Harinath <rharinath@novell.com>
1588 * expression.cs (Cast.ResolveLValue): Remove. The result of a
1589 cast is never an lvalue.
1590 (Cast.DoResolve, Cast.ResolveRest): Combine.
1591 (Argument.Emit): Simplify slightly. Move 'Expr is
1592 IMemoryLocation' check ...
1593 (Argument.Resolve): ... here.
1594 (Argument.Error_LValueRequired): Remove. Inline into only user.
1596 Simplifications. Fix cs0191-2.cs
1597 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1598 CS1649 and CS1651 to ...
1599 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
1600 the actual selection of the error code and message to a lookup
1601 table. Add a dummy return value to simplify callsites.
1602 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1603 readonly fields of other instances of the same type. Move CS0197
1605 * expression.cs (Argument.Resolve): ... here. Simplify code.
1606 Ensure that ec.InRefOutArgumentResolving is only set during LValue
1607 resolution of an out or ref argument. The code simplification
1608 above uses this invariant.
1610 2006-04-18 Raja R Harinath <rharinath@novell.com>
1612 Possibly fix #77752. Fix cs1690-[4-7].cs.
1613 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1614 CheckMarshallByRefAccess. Drop parameter.
1615 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
1617 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1619 * report.cs (AllWarnings): Add CS1690.
1620 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1622 (LocalVariableReference.DoResolveBase): Update.
1624 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1626 * class.cs (MethodOrOperator): Moved common parts from method class.
1627 detect obsolete attributes.
1628 (Method.Define): Simplified as it reuses code from base.
1629 (Constructor.ValidAttributeTargets): Fixed issue found during
1631 (Destructor.ValidAttributeTargets): Fixed issue found during
1633 (Operator): Finished refactoring set off by #78020. Operator class is now
1634 ordinary method class.
1636 * anonymous.cs: Updated.
1638 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1640 * class.cs (Constructor.Emit): Don't emit the attributes twice.
1642 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1644 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1645 detect obsolete attributes.
1646 (Method.CreateEmitContext): Moved to MethodOrOperator.
1648 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1651 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1652 customized exception to make crash detection easier.
1653 (MethodOrOperator): Started to work on new base class for methods and
1655 (Method): Derives from MethodOrOperator.
1656 (Constructor.Emit): Emits its own attributes.
1657 (AbstractPropertyEventMethod.Emit): Ditto.
1658 (Operator): Derives from MethodOrOperator, will refactor fully in extra
1660 (Operator.Emit): It's temporary more tricky than should be.
1662 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1664 * report.cs (InternalErrorException): Add ctor with inner exception.
1666 2006-04-08 Marek Safar <marek.safar@seznam.cz>
1669 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1672 2006-04-07 Marek Safar <marek.safar@seznam.cz>
1675 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1678 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1680 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1681 attribute is present and Guid not.
1682 (Interface.ApplyAttributeBuilder): Ditto.
1684 * attribute.cs: Add error message.
1686 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1690 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1691 sources (it's composite) so hold them in extra array as they are used in
1692 Emit phase only. It worked in the previous versions by mistake.
1693 (Attribute.Emit): Emit attribute for more owners when exist.
1695 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1696 it has now different behaviour.
1698 2006-04-04 Marek Safar <marek.safar@seznam.cz>
1700 * constant.cs (Constant.IsDefaultInitializer): New method.
1702 * class.cs: Updated.
1704 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1705 re-initialize default values. It saves KBs almost for every assembly.
1706 Thanks Zoltan for the idea.
1707 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1708 (ArrayCreation.DoResolve): Resolve only once.
1709 (ArrayCreation.Emit): Emit static initializer only when it is faster.
1710 (ArrayCreation.GetAttributableValue): Cope with optimized values.
1712 2006-04-03 Zoltan Varga <vargaz@gmail.com>
1714 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1717 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1719 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1720 in an embedded statement too.
1722 2006-04-01 Raja R Harinath <rharinath@novell.com>
1725 * typemanager.cs (IsNestedChildOf): Drop generic arguments before
1729 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1732 * report.cs (SymbolRelatedToPreviousError): Drop generic type
1733 arguments before checking whether a type is reflected or not.
1736 * expression.cs (Invocation.IsApplicable): Ensure a generic method
1737 definition doesn't take part in overload resolution.
1738 (Invocation.IsParamsMethodApplicable): Likewise.
1739 (Invocation.OverloadResolve): When replacing a reflected override
1740 method with its base definition, ensure that type arguments are
1743 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1747 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1750 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1752 2006-03-31 Marek Safar <marek.safar@seznam.cz>
1754 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1757 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1758 LocalTemporary change.
1760 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1762 (ClassOrStruct.DefineFieldInitializers): Implemented static field
1763 initializers optimization.
1764 (ClassOrStruct.TypeAttr): Moved from modifiers.
1765 (Constructor.CheckBase): Don't crash when static ctor has parameters.
1766 (FieldBase.ResolveInitializer): Resolves initializer.
1767 (FieldBase.HasDefaultInitializer): New property.
1769 * cs-parser.jay: Removed message.
1771 * expression.cs (CompilerGeneratedThis): New specialization.
1773 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1775 2006-03-28 Marek Safar <marek.safar@seznam.cz>
1777 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1779 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1781 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1782 be now EnumConstants only.
1784 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1786 * attribute.cs, driver.cs: Reset more caches.
1788 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1790 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1792 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1794 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1795 for easier reuse. Updated all overrides.
1796 (IntegralConstant): New base class for all integral constants.
1797 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1798 of the constant range, report custom error.
1799 (UIntConstant.Reduce): Fixed uint conversion.
1801 * ecore.cs, literal.cs: Reduce updates.
1803 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1807 * class.cs (Constructor.Define): Removed extra if for default ctors.
1808 A patch from Atsushi Enomoto.
1810 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1812 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1813 GetAttributableValue.
1815 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1818 * convert.cs (ImplicitConversionRequired): Error message moved to
1821 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1822 automatic implicit conversion of an output value.
1823 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1825 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1827 (TypeOf.GetAttributableValue): Add extra handling for object type.
1829 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1830 special error message.
1832 2006-03-25 Marek Safar <marek.safar@seznam.cz>
1834 * class.cs (Constructor.Emit): Don't crash when struct ctor is
1836 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1837 compatible with MS runtime.
1839 2006-03-23 Marek Safar <marek.safar@seznam.cz>
1841 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1842 attribute arguments here.
1844 * class.cs (Indexer.Define): The check was moved to attribute class.
1846 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1848 * expression.cs (StringConcat.Append): Reverted back to no warning state.
1850 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1852 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1854 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1857 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
1859 * doc-bootstrap.cs : fix build.
1861 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1863 * expression.cs (StringConcat.Append): Issue a warning when empty string
1866 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1868 * assign.cs (CompoundAssign.ResolveSource): Removed.
1870 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1873 * class.cs (TypeContainer.FindMethods): Removed.
1874 (TypeContainer.CheckMemberUsage): Made static.
1876 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1878 * constant.cs (CheckRange): Removed unused type argument.
1879 (CheckUnsigned): Removed unused type argument.
1881 * cs-parser.jay: Updated after MemberAccess clean up.
1882 Uses Length for empty string test.
1884 * cs-tokenizer.cs: Uses Length for empty string test.
1885 (IsCastToken): Made static.
1886 (is_hex): Made static.
1887 (real_type_suffix): Made static.
1889 * decl.cs (SetupCache): Made static.
1890 (OnGenerateDocComment): Removed unused ds argument.
1892 * delegate.cs (VerifyDelegate): Removed unused argument.
1894 * doc.cs: Uses Length for empty string test.
1896 * driver.cs: Uses Length for empty string test.
1898 * enum.cs (IsValidEnumType): Made static
1900 * expression.cs (EnumLiftUp): Removed unused argument.
1901 (ResolveMethodGroup): Ditto.
1902 (BetterConversion): Ditto.
1903 (GetVarargsTypes): Ditto.
1904 (UpdateIndices): Ditto.
1905 (ValidateInitializers): Ditto.
1906 (MemberAccess.ctor): Ditto.
1907 (GetIndexersForType): Ditto.
1909 * flowanalysis.cs: (MergeFinally): Removed unused argument.
1911 * iterators.cs: Updated after MemberAccess clean up.
1913 * location.cs: Uses Length for empty string test.
1915 * namespace.cs: Uses Length for empty string test.
1917 * report.cs (CheckWarningCode): Made static.
1919 * statement.cs (LabeledStatement): Removed unused argument.
1921 * typemanager.cs (FilterNone): Removed.
1923 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1925 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1928 * class.cs: Updated.
1930 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1932 * cs-parser.jay.cs: __arglist is not allowed for delegates.
1934 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1938 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
1940 (AnonymousMethod.ImplicitStandardConversionExists): New method.
1941 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1942 Add more error reporting; Fixed issue with params.
1944 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1946 * cs-parser.jay: AnonymousMethod requires host container.
1948 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1950 2006-03-18 Raja R Harinath <harinath@gmail.com>
1952 * class.cs: Change 'TypeContainer ds' constructor argument to
1953 'DeclSpace parent'. Some classes were missed below due to
1954 different naming convention.
1956 * class.cs (MemberCore.Parent): Delete. This makes the
1957 ParentContainer changes below enforceable by the compiler.
1959 Treat pointers to enclosing declaration space as 'DeclSpace', not
1961 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1962 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1964 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1966 (Block.AddThisVariable): Likewise.
1967 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1968 (AbstractPropertyEventMethod.Emit): Likewise.
1969 (AbstractPropertyEventMethod.EmitMethod): Likewise.
1970 (GetMethod.Define, SetMethod.Define): Likewise.
1971 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1972 (DelegateMethod.EmitMethod): Likewise.
1974 Fix regression test-partial-13.cs.
1975 Rationalize use of PartialContainer. Ensure that the partial
1976 class semantics can be tied to type-correctness, i.e., any
1977 violation will cause a compile error.
1978 * class.cs, const.cs: Access all fields that belong to class
1979 TypeContainer via ParentContainer. Arguments of EmitContexts and
1980 Resolve()-like functions still use 'Parent'.
1982 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1983 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1984 (PropertyMethod.CheckModifiers): Remove unused argument.
1985 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1988 2006-03-28 Raja R Harinath <rharinath@novell.com>
1990 * decl.cs (DeclSpace.LookupGeneric): Update to changes.
1992 2006-03-17 Raja R Harinath <harinath@gmail.com>
1994 Make semantics of PartialContainer simpler.
1995 * decl.cs (DeclSpace.IsPartial): Remove.
1996 * class.cs (TypeContainer.IsPartial): Likewise.
1997 (TypeContainer..ctor): Set PartialContainer to point to self.
1998 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1999 (TypeContainer.FindNestedType): Likewise.
2000 (MemberCore.ParentContainer): Simplify. Remove deprecation.
2002 2006-03-17 Marek Safar <marek.safar@seznam.cz>
2004 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
2006 2006-03-15 Marek Safar <marek.safar@seznam.cz>
2008 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
2011 2006-03-15 Marek Safar <marek.safar@seznam.cz>
2013 * class.cs (Operator.Define): An error for base conversion was not
2016 2006-03-13 Marek Safar <marek.safar@seznam.cz>
2018 A fix for #77593, #77574.
2020 * class.cs (MethodCore.CheckBase): Another if for operator.
2022 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2026 * expression.cs (VerifyArgumentsCompat): Reverted to double error
2027 reporting, it's more tricky than I thought.
2029 2006-03-09 Marek Safar <marek.safar@seznam.cz>
2031 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
2034 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
2035 (DelegateCreation.ImplicitStandardConversionExists): New method for just
2038 * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
2041 2006-03-04 Marek Safar <marek.safar@seznam.cz>
2045 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
2046 (Event.Define): ditto
2047 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
2049 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
2050 Removed redundant code and set NewSlot for Invoke method too.
2052 * parameter.cs (Parameters.ctor): Add custom, type ctor.
2053 (Parameters.MergeGenerated): New method. Use this method when you merge
2054 compiler generated argument with user arguments.
2056 2006-03-03 Marek Safar <marek.safar@seznam.cz>
2058 * attribute.cs (ResolveAsTypeTerminal): Removed.
2060 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
2061 specialization for predefined types; 30% speed up.
2062 Finally placed obsolete check to right place.
2063 (Expression.ResolveType): Removed.
2065 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
2066 Updated after ResolveType was removed.
2068 * expression.cs (Cast.ctor): Check void cast.
2069 (Binary.ResolveAsTypeTerminal): Is never type.
2070 (Conditional.ResolveAsTypeTerminal): Is never type.
2072 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
2074 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2076 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
2078 2006-03-23 Martin Baulig <martin@ximian.com>
2080 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
2081 type check if either of the types is an open generic type.
2083 2006-03-23 Martin Baulig <martin@ximian.com>
2086 (Convert.ExplicitTypeParameterConversion): New method; implement
2087 explicit type parameter conversions.
2089 2006-03-23 Martin Baulig <martin@ximian.com>
2091 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
2092 blindly allow all conversions if we do not have any constraints.
2094 2006-02-27 Marek Safar <marek.safar@seznam.cz>
2096 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
2097 these two separated members to simplify the code.
2098 (Attribute.Resolve): Refactored to use new fields and methods.
2099 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
2100 implemented obsolete attribute checking.
2101 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
2102 implemented obsolete checking again. It look line never ending quest ;-)
2103 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
2105 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
2107 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
2109 *class.cs (Property.Define): Add RegisterProperty call.
2111 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
2112 argument groups (only 2).
2114 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
2115 encoding expression to arguments.
2116 (Expression.ExprClassToResolveFlags): Just turned to property.
2118 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
2119 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2120 optimized as well as implemented support for zero-length attributes.
2122 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2123 Add caching of PropertyInfo's.
2125 2006-02-25 Marek Safar <marek.safar@seznam.cz>
2127 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2128 error multiple times.
2130 2006-02-25 Marek Safar <marek.safar@seznam.cz>
2132 New partial class implementation.
2133 A fix for #77027, #77029, #77403
2135 * attribute.cs (Attributable): Made attributes protected.
2137 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2138 the replacements of ClassPart and PartialContainer.
2139 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2140 (TypeContainer.AddInterface): Ditto.
2141 (TypeContainer.AddPartial): The main method for partial classes. It checks
2142 for errors and merges ModFlags and attributes. At the end class is added to
2144 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2146 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2147 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2148 from the rest of partial classes.
2149 (TypeContainer.GetClassBases): Simplified.
2150 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2152 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2153 (TypeContainer.HasExplicitLayout): Uses Flags now.
2154 (PartialContainer): Removed.
2155 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2156 (StaticClass): Was merged with Class.
2157 (Class.GetClassBases): class and static class bases are verified here.
2158 (Class.TypeAttr): Added static attributes when class is static.
2159 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2160 (MemberBase): In some cases we need to call parent container for partial
2161 class. It should be eliminated but it's not easy now.
2163 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2165 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2166 partial classed to accumulate class comments.
2167 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2169 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2171 * driver.cs (MainDriver): Tree.GetDecl was removed.
2173 * modifiers.cs (Modifiers): Add partial modifier.
2175 * tree.cs (Tree.decl): Removed.
2176 (RootTypes): Started to use this class more often for root types
2179 2006-03-23 Raja R Harinath <rharinath@novell.com>
2181 * generic.cs (TypeParameter.UpdateConstraints): Update
2182 'constraints' if null.
2184 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2188 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2189 external interface does not have an attribute.
2191 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2193 Another prerequisites for new partial classs implementation.
2195 * attribute.cs (Attribute.Equal): Implemented.
2196 (Attribute.Emit): Changed as attributes can be applied more than twice.
2197 (Attributes.Emit): Check for duplicate attributes here.
2199 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2200 as a parameter, clean-up.
2202 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2206 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2207 contains obsolete attribute check which can in some cases look for base
2208 type of current class which is not initialized yet.
2209 (TypeContainer.BaseType): Replacement of ptype.
2211 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2213 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2215 First of prerequisites for new partial classs implemention.
2217 * attribute.cs (Attributable): Extended by ResolveContext;
2218 Attributes finally have correct context for resolving in all cases.
2219 (AttachTo): Attribute owner is assigned here.
2221 * codegen.cs (IResolveContext): Introduce new interface to hold
2222 all information needed in resolving phase.
2223 (EmitContext): Implements IResolveContext; more clean-up needed here.
2225 * decl.cs (MemberCore): Implemented IResolveContext.
2227 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2228 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2229 parameter.cs, statement.cs, tree.cs, typemanager.cs:
2230 Refactored to use new IResolveContext instead of EmitContext; cleanup
2232 2006-03-22 Raja R Harinath <rharinath@novell.com>
2234 Support ParameterDefaultValueAttribute in gmcs. Also applied to
2235 mcs to keep code differences small.
2236 * attribute.cs (Attribute.GetParameterDefaultValue): New.
2237 * typemanager.cs (parameter_default_value_attribute_type): New.
2238 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
2241 2006-03-22 Martin Baulig <martin@ximian.com>
2244 (Nullable.NullableLiteral): Derive from `NullLiteral'.
2247 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
2248 instead of the normal `NullLiteral'.
2250 2006-03-21 Martin Baulig <martin@ximian.com>
2253 * generic.cs (TypeManager.InferType): If `pt' is a generic
2254 parameter, don't check whether `pt == at'.
2256 2006-03-20 Raja R Harinath <rharinath@novell.com>
2259 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
2260 (TypeParameter.Resolve): Update to change.
2261 (ConstraintChecker.CheckConstraints): Resolve type-argument
2262 constraints before use.
2264 2006-03-16 Martin Baulig <martin@ximian.com>
2267 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
2268 and don't have any instance constructors, also lookup in the base class.
2269 (TypeManager.IsNullableValueType): New public method.
2271 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
2272 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
2273 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
2275 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
2276 instead of just TypeManager.IsNullableType() to determine whether
2277 a lifted operator exists.
2278 (UnaryMutator.DoResolve): Likewise.
2279 (Conditional.DoResolve): Likewise.
2280 (Binary.DoResolve): A lifted operator only exists if both operands
2281 are valuetypes and at least one of them is a nullable type.
2283 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
2285 * iterator.cs : yield break is allowed in try statement which has
2286 catch clauses. Fixed bug #77767.
2288 2006-03-12 Martin Baulig <martin@ximian.com>
2290 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
2291 private IsSignatureEqual() to compare types; see the comment in
2292 that method; fixes #77674.
2294 2006-03-10 Raja R Harinath <rharinath@novell.com>
2296 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
2297 (Expression.ResolveAsTypeTerminal): Likewise.
2298 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
2299 * expression.cs, generic.cs, iterators.cs: Likewise.
2300 * parameter.cs, statement.cs, typemanager.cs: Likewise.
2302 2006-03-09 Martin Baulig <martin@ximian.com>
2304 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
2305 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
2307 2006-03-09 Martin Baulig <martin@ximian.com>
2309 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
2310 `prepared' flag is set.
2312 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
2313 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
2314 issues; see gtest-254.cs.
2316 2006-03-07 Martin Baulig <martin@ximian.com>
2318 * generic.cs (TypeManager.InferType): Allow infering
2319 `IEnumerable<T>' with an array of T; see gtest-251.cs.
2321 2006-03-06 Martin Baulig <martin@ximian.com>
2324 (TypeManager.InferType): Fix gtest-250.cs.
2327 (TypeManager.IsSubclassOf): Also check the base class.
2330 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
2333 2006-03-01 Raja R Harinath <rharinath@novell.com>
2336 * expression.cs (ParameterReference.DoResolveBase): Change return
2338 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2342 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2345 * typemanager.cs (GetFullNameSignature): Don't nullref on
2346 protected accessors.
2348 2006-02-16 Martin Baulig <martin@ximian.com>
2351 (TypeManager.GetGenericFieldDefinition): New public method; use it
2352 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
2354 2006-02-14 Martin Baulig <martin@ximian.com>
2356 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
2358 2006-02-14 Martin Baulig <martin@ximian.com>
2361 (TypeManager.DropGenericMethodArguments): New public method; don't
2362 use GetGenericMethodDefinition() on something which is not a
2365 2006-02-14 Martin Baulig <martin@ximian.com>
2368 (ConstraintChecker.CheckConstraints): If a type parameter has the
2369 `struct' constraint, the type must be a non-nullable valuetype.
2371 2006-02-10 Martin Baulig <martin@ximian.com>
2374 (TypeManager.IsOverride): Make this work for instantiated methods
2375 in a generic class; fixes #77509.
2376 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
2377 rather than calling it directly; fixes #77488.
2379 2006-02-08 Martin Baulig <martin@ximian.com>
2381 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
2382 reporting into CheckConstraint() so we can use the correctly
2385 2006-02-08 Martin Baulig <martin@ximian.com>
2387 * expression.cs (BaseAccess): Add support for generic methods.
2389 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
2390 the new MethodGroupExpr.
2392 2006-02-07 Martin Baulig <martin@ximian.com>
2394 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
2395 also reference types; fixes #77483.
2397 2006-02-07 Martin Baulig <martin@ximian.com>
2400 (TypeManager.IsGenericMethod): We now return whether something is
2401 an instantiated generic method (and not a generic method def).
2402 (TypeManager.IsGenericMethodDefinition): New public method.
2405 (TypeManager.CSharpSignature): Only include type arguments for
2406 "real" generic methods, not for any instantiated method.
2407 (TypeManager.GetMethodName): Likewise, but also allow generic
2408 method definitions here.
2410 2006-02-06 Miguel de Icaza <miguel@novell.com>
2412 * codegen.cs (EmitScopeInitFromBlock): check here the
2413 capture_context, there is no need to make two calls to the
2416 * anonymous.cs: Add some debugging messages that might help me
2417 track other instances of this problem in the future (the
2418 regression of test 467).
2420 * cs-parser.jay: track the variable block, as we need to initalize
2421 any captured variables declared in this block for the "catch"
2422 portion of the "Try" statement.
2424 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2425 scope initialization for captured variables.
2427 Also, move the emit for the variables after the block location has
2430 2006-02-06 Marek Safar <marek.safar@seznam.cz>
2432 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2434 2006-02-06 Martin Baulig <martin@ximian.com>
2436 * class.cs (TypeContainer.DefineType): If we're a struct, pass
2437 `TypeManager.value_type' as parent type to
2438 ModuleBuilder.DefineType(). Fixes #77358.
2440 2006-02-02 Miguel de Icaza <miguel@novell.com>
2442 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2443 commit yesterday, the initialization for the roots is necessary.
2444 What is not necessary is the scope activation.
2446 2006-02-02 Raja R Harinath <rharinath@novell.com>
2448 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2449 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2451 (Argument.Resolve): Remove CS0206 checks.
2453 2006-02-01 Miguel de Icaza <miguel@novell.com>
2455 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2456 scopes for all the roots, the scopes will now be emitted when the
2457 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2459 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2460 code. This reduces a lot of existing cruft.
2462 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2463 that the ScopeInfo is generated as we enter the scope, not at the
2464 time of use, which is what we used to do before.
2466 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2467 every time a Block is about to be emitted if we have a
2470 2006-02-01 Raja R Harinath <rharinath@novell.com>
2472 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
2473 attribute for mscorlib too.
2475 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2477 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2479 * typemanager.cs (cons_param_array_attribute): Make private.
2480 (Reset): Set it to null.
2481 (InitCoreHelpers): Don't initialize it.
2482 (ConsParamArrayAttribute): New. Initialize it as needed.
2483 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2485 2006-01-31 Miguel de Icaza <miguel@novell.com>
2487 * expression.cs: There might be errors reported during the
2488 selection of applicable methods. If there are errors, do not
2489 continue execution as it will lead the compiler to crash.
2491 2006-01-30 Miguel de Icaza <miguel@novell.com>
2493 * expression.cs: Member access is not allowed on anonymous
2494 methods. Fixes #77402.
2496 2006-01-30 Raja R Harinath <rharinath@novell.com>
2499 * cs-parser.jay (VariableDeclaration): Don't set
2500 current_array_type to null.
2501 (field_declaration, event_declaration, declaration_statement):
2502 Set it to null here.
2504 2006-01-29 Raja R Harinath <harinath@gmail.com>
2507 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
2509 2006-01-28 Raja R Harinath <harinath@gmail.com>
2511 * typemanager.cs (GenericParameterPosition): New.
2514 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
2516 * doc.cs : To process "include" elements, first we should create
2517 another list than XmlNodeList, because it could result in node
2518 removal, which could result in that the XmlNodeList gives up
2521 2006-01-25 Miguel de Icaza <miguel@novell.com>
2523 * expression.cs: Introduce an error report that we were not
2524 catching before. Gonzalo ran into it.
2526 2006-01-23 Miguel de Icaza <miguel@novell.com>
2528 A fix for bug: #76957
2530 * iterators.cs (MoveNextMethod.CreateMethodHost): call
2531 ComputeMethodHost before creating the method, this is a new
2534 * anonymous.cs (AnonymousContainer): Now we track all the scopes
2535 that this method references (RegisterScope). The actual scope
2536 where the method is hosted is computed with the ComputeMethodHost
2537 before we create the method.
2539 Moved the Deepest routine here.
2541 (AnonymousContainer.ComputeMethodHost): New routine used to
2542 compute the proper ScopeInfo that will host the anonymous method.
2544 (ScopeInfo): Deal with multiple roots. The problem was that we
2545 did not have a unique root where all ScopeInfos could be hanged
2546 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
2549 Remove AdjustMethodScope which is now computed at the end. Remove
2550 LinkScope which did a partial link, instead link all ScopeInfos
2551 before code generation from the new "LinkScopes" routine.
2553 Simplify all the Add* routines as they no longer need to maintain
2554 the tree, they just need to record that they are using variables
2557 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2558 routines to produce the forest of ScopeInfo trees.
2560 * class.cs (TypeContainer.AppendMethod): This is just like
2561 AddMethod, but ensures that an interface implementation method
2562 (IEnumerable.XXX) is not inserted at the beginning of the queue of
2563 methods, but at the end.
2565 We use this functionality to ensure that the generated MoveNext
2566 method in the iterator class is resolved/emitted before the
2567 enumerator methods created.
2569 This is required because the MoveNext method computes the right
2570 ScopeInfo for the method. And the other methods will eventually
2571 need to resolve and fetch information computed from the anonymous
2575 2006-01-23 Raja R Harinath <rharinath@novell.com>
2577 Improve implementation of section 14.4.2.2 (Better function member).
2578 * expression.cs (Invocation.MoreSpecific): Compare all type
2579 arguments before deciding if one type is more specific than
2580 another. Handle array types too. Return the more specific type.
2581 (Invocation.BetterFunction): Add more tie-breaking rules from
2582 section 14.4.2.2. Perform "more specific" check after
2583 other tie-breaking rules. Compare all parameter types before
2584 choosing the "more specific" method.
2586 2006-01-21 Raja R Harinath <harinath@gmail.com>
2587 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2590 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2592 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2593 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2595 2006-01-18 Martin Baulig <martin@ximian.com>
2597 * class.cs (TypeContainer.AddToMemberContainer): Use
2598 `symbol.MemberName.MethodName' instead of just `symbol.Name';
2601 2006-01-18 Martin Baulig <martin@ximian.com>
2603 Fix #76417: a generic class may now have methods which may unify
2604 for some type parameter substitutions.
2606 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
2607 for methods which may unify anymore.
2609 * expression.cs (Invocation.MoreSpecific): New private static
2610 method; checks whether one method is more specific than another
2611 according to 14.4.2.2 of the spec.
2612 (Invocation.BetterFunction): Implement the tie-breaking rules from
2613 14.4.2.2 of the spec: if two methods unify for some type parameter
2614 substitution, we need to pick the more specific one.
2616 2006-01-18 Raja R Harinath <rharinath@novell.com>
2618 Fix #76656, cs0231-2.cs.
2619 * cs-parser.jay (formal_parameter_list): Make error case catch
2621 (parenthesized_expression_0): Add CS1026 check.
2622 (invocation_expression): Remove unused { $$ = lexer.Location }.
2624 2006-01-17 Raja R Harinath <rharinath@novell.com>
2627 * cs-parser.jay (statement_expression): Don't list out the
2628 individual statement-expressions. Convert syntax error into
2631 2006-01-16 Raja R Harinath <rharinath@novell.com>
2634 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2635 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
2636 CheckIntermediateModification.
2637 (FieldExpr.DoResolve): Add new two-argument version that
2638 allows us to resolve the InstanceExpression as an lvalue.
2639 The one-argument variant is now just a wrapper.
2640 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2641 Resolve the lhs as an lvalue if the it has a value type.
2642 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2643 from Assign.DoResolve.
2644 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2645 resolved as an lvalue.
2646 (PropertyExpr.DoResolve): Update.
2647 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2648 has a value type. Move CS1612 check here from
2649 CheckIntermediateModification.
2650 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2651 * expression.cs (EmptyExpression.OutAccess): New. Used as the
2652 'right_side' of a ResolveLValue on an 'out' argument.
2653 (EmptyExpression.LValueMemberAccess): New. Used as the
2654 'right_side' of a propagated ResolveLValue on a value type.
2655 (LocalVariableReference.DoResolveBase): Recognize
2656 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2658 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2659 EmptyExpression.Null.
2661 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
2663 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
2664 Type.IsGenericParameter(). Fixed bug #77183.
2665 * doc.cs : it is now identical to doc.cs in mcs.
2667 2006-01-16 Martin Baulig <martin@ximian.com>
2669 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
2671 2006-01-16 Martin Baulig <martin@ximian.com>
2673 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
2674 ctors; fixes #77250.
2676 2006-01-12 Miguel de Icaza <miguel@novell.com>
2678 This fixes the problem where we used ldfld instead of ldflda to
2679 load the "THIS" pointer on captured parameters, when THIS is a
2680 value type. See bug #77205.
2682 * iterators.cs (CapturedThisReference.Emit): Pass false to
2683 EmitThis (we do not need the address).
2685 * codegen.cs (EmitThis): it needs to know whether we need the
2686 address of `this' or not. This is used by value types.
2688 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2689 every other call passes false.
2691 2006-01-12 Raja R Harinath <rharinath@novell.com>
2694 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2696 * expression.cs (Invocation.OverloadResolve): Update.
2697 (Invocation.DoResolve): Avoid double resolution of invocation.
2699 2006-01-11 Raja R Harinath <rharinath@novell.com>
2702 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2703 unary negation of floating point types as 0-expr; negation cannot
2704 overflow in floating point types.
2707 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2708 on operands of 'void' type.
2711 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2712 and ExclusiveOr for boolean constants too.
2714 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
2716 * expression.cs: Fix Console.WriteLine ((this = x).foo);
2718 2006-01-12 Miguel de Icaza <miguel@novell.com>
2720 * cs-tokenizer.cs (Position): New class used to save and restore
2721 the position state in the tokenizer. Before this patch the save
2722 and restore was not complete enough so the line and columns would
2723 start to drift and the debugger and stack traces will get the
2726 2006-01-10 Martin Baulig <martin@ximian.com>
2729 (TypeParameter.InflateConstraints): New public method.
2731 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
2732 constraints; fixes #77042.
2734 2006-01-10 Martin Baulig <martin@ximian.com>
2736 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
2737 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
2740 2006-01-09 Raja R Harinath <rharinath@novell.com>
2743 * expression.cs (Invocation.OverloadResolve): Replace reflected
2744 override methods with their base virtual methods, rather than
2746 * typemanager.cs (TypeManager.GetOverride): New.
2748 2005-12-21 Miguel de Icaza <miguel@novell.com>
2750 * driver.cs: Report the case of no source files and no -out:
2753 2005-12-20 Raja R Harinath <rharinath@novell.com>
2756 * expression.cs (ComposedCast.GetSignatureForError): Define.
2758 2006-01-05 Jb Evain <jbevain@gmail.com>
2760 * class.cs (Property.Define, Indexer.Define): do not tag the
2761 properties as SpecialName | RTSpecialName.
2763 2006-01-04 Miguel de Icaza <miguel@novell.com>
2765 * class.cs (MethodCore.IsDuplicateImplementation): This method was
2766 doing a low-level comparission of parameter types. It was lacking
2767 a check for __argslist.
2769 2005-12-30 Miguel de Icaza <miguel@novell.com>
2771 * expression.cs (ParameterReference.DoResolveBase): Allow
2772 reference parameters if they are local to this block.
2774 This allows the ref and out parameters of a delegate to be used in
2775 an anonymous method, for example:
2777 delegate void set (out int x);
2779 set s = delegate (out int x){
2783 This is used by functionality introduced late in the C# language.
2785 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2786 method that take ref and out parameters.
2788 Fixes #77119 which was a late change in the spec.
2790 2005-12-23 Miguel de Icaza <miguel@novell.com>
2792 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2793 parent if its the same scope. Fixes #77060.
2795 2005-12-22 Marek Safar <marek.safar@seznam.cz>
2797 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2799 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2801 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
2802 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
2803 that doesn't contain the full public key. This is a update of the
2804 friend assemblies in .Net 2.0 release.
2806 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2810 * namespace.cs (NamespaceEntry): Add extern_aliases as a
2811 ListDictionary, to contain the ExternAliasEntry entries (in
2812 addition to the NamespaceEntry.aliases hashtable). This field is
2813 shared between the original entry and its doppelganger (bodyless
2815 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2816 extern_aliases field.
2817 (NamespaceEntry.Lookup): Move the IsImplicit check after the
2818 lookup in extern_aliases.
2820 2005-12-16 Raja R Harinath <rharinath@novell.com>
2823 * class.cs (TypeContainer.Mark_HasEquals): New.
2824 (TypeContainer.Mark_HasGetHashCode): New.
2825 (ClassPart): Override them.
2826 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2828 * generic.cs (GenericMethod.DefineMembers): Update to changes.
2829 (TypeParameter.TypeParameter): Change type of 'parent' argument to
2833 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2834 'parent' argument to the base constructor.
2836 Remove all mention of TypeContainer from decl.cs.
2837 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2838 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2839 (DeclSpace.DeclSpace): Likewise.
2840 (DeclSpace.DefineMembers): Remove unused argument.
2841 * cs-parser.jay (pop_current_class): Update to changes. Simplify
2842 debugging check -- we don't care if the debug code throws an
2843 InvalidCastException instead of an InternalErrorException.
2844 * class.cs (TypeContainer.DefineMembers): Update to changes.
2845 (TypeContainer.DoDefineMembers): Likewise.
2846 (TypeContainer.GetMethods): Likewise.
2847 (PropertyMember.Define): Likewise.
2848 (MemberBase.Parent): New property that forwards to
2849 MemberCore.Parent, but ensures that we get a TypeContainer.
2850 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2851 (RootContext.PopulateTypes): Likewise. Remove special case code
2852 for !RootContext.StdLib: DefineMembers is idempotent.
2854 2005-12-13 Marek Safar <marek.safar@seznam.cz>
2856 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2858 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
2860 * doc.cs : The search for referenced namespace was insufficient to
2861 get global one as it used to do. Fixed bug #76965.
2863 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
2865 * doc.cs : check name in cref in the last phase that whether it is
2868 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2870 * cs-tokenizer.cs : reverted the latest change: it somehow broke
2873 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2875 * doc.cs : so it turned out that we cannot skip override check for
2876 interface members. Fixed bug #76954.
2878 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2880 * cs-tokenizer.cs : fixed bug #75984:
2881 - #warning and #error should not be handled when the source line
2883 - #line is not checked strictly when the source line is disabled.
2884 - #define and #undef is on the other hand checked strictly at any
2887 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
2889 * cs-tokenizer.cs : missing Location (actually, filename) in one of
2892 2005-12-15 Raja R Harinath <rharinath@novell.com>
2894 * generic.cs (TypeManager.IsGeneric): Remove unused method.
2896 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
2899 2005-12-14 Martin Baulig <martin@ximian.com>
2901 * typemanager.cs (TypeManager.GetFullName): Make this public;
2902 `Type.Fullname' now never returns null.
2904 * class.cs (Method.Define): Use TypeManager.GetFullName() for
2905 explicit interface implementations; we're now using the same
2906 naming convention than csc does.
2908 2005-12-14 Miguel de Icaza <miguel@novell.com>
2910 * convert.cs (ExplicitConversionCore): Check the return value from
2911 ExplicitConversionCore which can return null on failure. Fixes #76914
2913 2005-12-09 Raja R Harinath <rharinath@novell.com>
2915 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
2916 instead of IsGenericInstance.
2917 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
2918 code that's now covered by the more general test.
2919 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
2921 * generic.cs (DropGenericTypeArguments): New. Captures the common
2922 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
2923 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
2924 * generic.cs, report.cs, typemanager.cs: Likewise.
2926 2005-12-08 Martin Baulig <martin@ximian.com>
2928 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
2930 * typemanager.cs (TypeManager.CSharpSignature): Include type
2931 arguments in the signature of a generic method.
2933 2005-12-07 Martin Baulig <martin@ximian.com>
2935 Add support for custom attributes on type parameters.
2937 * cs-parser.jay (type_arguments): Added `opt_attributes'.
2939 * generic.cs (TypeParameterName): New public class; we use this
2940 instead of a `string' to store the name of a type parameter, so we
2941 can also have `Attributes'.
2942 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
2943 array instead of a `string[]' array.
2944 (TypeParameter.ctor): We now also take an `Attributes' argument.
2945 (TypeParameter.EmitAttributes): New public method; emit our
2946 `OptAttributes' here.
2947 (GenericMethod.EmitAttributes): New public method; emit the custom
2948 attributes on all our type parameters.
2950 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
2951 our type parameters.
2952 (MethodData.Define): If we're a generic method, call
2953 EmitAttributes() on it.
2955 2005-12-07 Martin Baulig <martin@ximian.com>
2958 (ConstraintChecker): New public abstract class; move the
2959 constraint checking here from `ConstructedType' and also do
2960 constraint checking for generic methods here.
2962 * expression.cs (Invocation.OverloadResolve): Use
2963 ConstraintChecker.CheckConstraints() if we resolved to a generic
2966 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2968 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2970 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2972 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2973 (FieldBase.Initializer): Initializer is now optional.
2974 (EventField.Define): Only event field can have initializer.
2976 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2978 * const.cs (Const): Reuse initializer.
2980 * cs-parser.jay: Updated after FieldBase changes.
2981 Added current_array_type to simplify array initializers.
2983 * ecore.cs (NullCast.IsDefaultValue): Implemented.
2985 * expression.cs, iterators.cs: Updated.
2987 * namespace.cs (NamespaceEntry): Made UsingFound private.
2989 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2991 * parameterCollection.cs: Obsolete, removed.
2992 * parser.cs: Obsolete, removed.
2994 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2997 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2999 * enum.cs (Enum.Define): Set obsolete context here.
3001 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
3004 - FindDocumentedMember() now expects 1) paramList as null
3005 when "we don't have to check the number of parameters" and
3006 2) Type.EmptyTypes when "there is no arguments".
3007 - Introduced FoundMember struct to hold the exact type which was
3008 used to find the documented member (the above change broke
3009 test-xml-044; it might be better just to use DeclaringType than
3010 what MS does, like this change does, but it depends on usage.)
3012 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
3014 * doc.cs : documented member might be from DeclaringType for nested
3015 types. Fixed bug #76782.
3017 2005-12-03 Ben Maurer <bmaurer@ximian.com>
3019 * anonymous.cs: Have the param code handle leaving copies on the
3020 stack etc. Allows anonymous params to take part in the assignment
3021 code (++, +=, etc). Fixes bug #76550
3023 * expression.cs: Handle the prepare_for_load/leave_copy by passing
3024 it down to the anon code.
3026 * iterators.cs: Use dummy var here
3028 * codegen.cs: Handle new vars
3030 2005-12-01 Marek Safar <marek.safar@seznam.cz>
3033 * class.cs (MethodData.Define): Set proper Obsolete context.
3035 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
3037 (FieldExpr.DoResolve): Ditto.
3039 2005-12-01 Marek Safar <marek.safar@seznam.cz>
3042 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
3043 parent is not obsolete.
3045 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
3047 * doc.cs : (FindDocumentedMember) find parameterless members first
3048 and get CS0419 in the early stage. Fixed first case of bug #76727.
3050 2005-11-30 Marek Safar <marek.safar@seznam.cz>
3053 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
3054 no error was reported.
3056 *expression.cs (Binary.DoResolve): left can be null.
3058 2005-12-06 Raja R Harinath <rharinath@novell.com>
3060 * class.cs (MethodCore.CheckGenericOverride): Delete unused
3061 abstract method and all overrides.
3062 * support.cs (ParameterData.GenericConstraints): Delete.
3063 (ReflectionParameters.type_params): Delete.
3064 (ReflectionParameters.ReflectionParameters): Make private.
3065 (ReflectionParameters.GetConstaints): New factory method.
3066 * generic.cs (TypeParameterDefineType): Use it.
3067 (TypeManager.GetTypeParameterConstraints): Likewise.
3069 2005-11-22 Marek Safar <marek.safar@seznam.cz>
3072 * class.cs (MethodData.Emit): Parameters should be labeled first.
3074 2005-11-21 Marek Safar <marek.safar@seznam.cz>
3077 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
3079 2005-11-18 Marek Safar <marek.safar@seznam.cz>
3081 * attribute.cs (AreParametersCompliant): Moved to Parameter.
3083 * class.cs (MethodCore): Parameter clean up.
3084 (IMethodData): Added ParameterInfo.
3085 (MethodData): Parameter clean up.
3086 (Indexer.Define): Parameter clean up.
3098 * typemanager.cs: Parameter clean up.
3100 * delegate.cs (Define): Get rid of duplicated code.
3102 * expression.cs (ParameterReference): Removed useless parameters
3104 (Invocation): Ditto.
3106 * parameter.cs (ParamsParameter): New class, params specialization.
3107 (ArglistParameter): Attemp to separate arglist.
3108 (Parameter): Refactored to be reusable and faster.
3109 (Parameter.Modifier): Made understandable.
3110 (Parameters): Changed to be used as a class for `this' assembly
3111 parameters. Refactored to use new specialized classes.
3113 * support.cs (ParameterData): Added Types property.
3114 (InternalParameters): Deleted.
3116 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3118 * doc.cs : the previous patch does not actually fix the bug.
3119 PropertyInfo override check is now implemented and really fixed it.
3120 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
3122 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3124 * doc.cs : apply "override filter" also to properties.
3127 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3129 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
3130 no need to check overrides. For classes, omit those results from
3131 interfaces since they must exist in the class. Fixed bug #76726.
3133 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3135 * typemanager.cs : (GetFullNameSignature) differentiate indexers
3136 with different parameters. Fixed the second problem in #76685.
3138 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3140 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
3141 get expected 'protected' access in CheckValidFamilyAccess()).
3144 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3146 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
3147 Fixed bug #76705. CS1569 was incorrectly commented out.
3149 2005-11-23 Martin Baulig <martin@ximian.com>
3151 * generic.cs (Constraints.Define): Removed.
3152 (TypeParameter.DefineConstraints): Removed.
3153 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
3154 on the GenericTypeParameterBuilder here.
3156 2005-11-23 Martin Baulig <martin@ximian.com>
3158 * typemanager.cs (TypeManager.GetProperty): Make this public.
3160 * generic.cs (Nullable.NullableInfo.ctor): Use
3161 TypeManager.GetProperty() rather than using reflection directly.
3163 2005-11-17 Martin Baulig <martin@ximian.com>
3165 * expression.cs (Indexers.GetIndexersForType): Added support for
3166 generic parameters; fixes #76587.
3168 2005-11-17 Martin Baulig <martin@ximian.com>
3171 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
3172 inherit the scope from our parent. Fixes #76653.
3174 2005-11-15 Martin Baulig <martin@ximian.com>
3176 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
3177 instead of `ScopeTypeBuilder' to refer to the "current" type.
3178 (AnonymousMethod.CreateScopeType): Correctly create the helper
3179 class if we're inside a generic type definition.
3181 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
3183 * doc.cs : use Invocation.IsOverride() to do real override check.
3184 * expression.cs : made Invocation.IsOverride() internal.
3186 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
3188 * doc.cs : use TypeManager.FindMembers() instead of (possible)
3189 TypeBuilder.FindMembers() and filter overriden base members out.
3192 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3194 * doc.cs : ref/out parameters are represented as '@' (instead of
3195 '&' in type FullName). Fixed bug #76630 (additionally crefs).
3197 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3199 * doc.cs : when there was no '.' in cref to methods in doc comment,
3200 then parameters were missing in the output. Fixed bug #76691.
3202 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3204 * driver.cs : don't output docs when there is an error.
3207 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3210 Now it should detect indexers. Fixed primary concern in bug #76685.
3211 Fixed CS0419 message to not show the identical member signature in
3214 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3216 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3217 instead of Type.FindMembers() since it does not handle events.
3220 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
3222 * codegen.cs: Fixed typo (speficied -> specified).
3224 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3227 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3229 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3231 * attribute.cs: Changed error message.
3233 * cs-tokenizer.cs: One more check.
3235 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3237 * statement.cs (Block.Resolve): Ignore empty statement.
3239 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3241 * report.cs: Made error/warning methods more strict to avoid
3244 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3245 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3246 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3247 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3249 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3251 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
3252 Use the more explicit AssemblyName.FullName instead of
3253 AssemblyName.Name to report errors.
3255 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3257 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
3260 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3270 * report.cs: Fixed error reporting and typos.
3272 * generic.cs (TypeParameter.GetSignatureForError): New method.
3273 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
3275 * typemanager.cs (GetFullName): Refactored.
3277 2005-11-08 Marek Safar <marek.safar@seznam.cz>
3279 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3280 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3282 * class.cs (TypeContainer.IsComImport): New property.
3283 (Constructor.Define): Create proper ctor for ComImport types.
3285 * expression.cs (New.CheckComImport): Fixed.
3287 2005-11-07 Miguel de Icaza <miguel@novell.com>
3289 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3290 that a parameter has been captured does not mean that we do not
3291 have to do the rest of the processing. This fixes the second part
3292 of #76592. If there was another anonymous method capturing
3293 values in the past, the Scope would never be set for the second
3294 method that captured the same parameter.
3296 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3297 properly manipulate the stack. Second part of fix for #76592.
3299 * expression.cs (New): Add support for invoking "new" on
3300 interfaces that have been flagged with the ComImport attribute and
3301 the CoClass. Fixes #76637
3303 * statement.cs (Try.DoEmit): When a variable is captured, do not
3304 try to emit the vi.LocalBuilder variable as it has been captured.
3305 Create a temporary variable and store the results on the
3306 FieldBuilder. Fixes #76642
3308 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3310 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3312 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3314 * expression.cs (Binary.DoResolve): Added && optimalization.
3316 * typemanager.cs (AddUserType): Removed useless argument.
3318 2005-11-04 Marek Safar <marek.safar@seznam.cz>
3320 * statement.cs (Block.variables): Uses ListDictionary.
3322 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3325 * class.cs (PartialContainer.EmitType): Customized to emit
3326 security attributes.
3327 (ClassPart.ApplyAttributeBuilder): Transform security attribute
3328 for partial classes.
3330 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3333 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3334 access has to be fixed.
3336 * typemanager.cs (IsUnmanagedType): Wrong common field type.
3338 2005-11-01 Marek Safar <marek.safar@seznam.cz>
3341 * ecore.cs (NullCast.Reduce): Implemented.
3343 * expression.cs (ArrayCreation.CheckIndices): Correcly check
3346 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3348 (Foreach.Resolve): Catch null properly.
3350 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3352 * cs-tokenizer.cs: Warning text fix.
3354 * driver.cs: AllWarningNumbers exposed on public interface.
3356 * report.cs (): Reviewed warning numbers.
3357 (IsValidWarning): Use binary search.
3359 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3361 * driver.cs: Implemeted resource visibility.
3362 (Resources): New class for code sharing between /res: and
3365 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3367 decl.cs (CurrentTypeParameters): Fixed to be public.
3369 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3371 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
3373 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3375 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
3377 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
3379 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
3381 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3383 Add friend assembly access support.
3384 * typemanager.cs: assembly_internals_vis_attrs
3385 cache for friend assembly access.
3386 (TypeManager.IsFriendAssembly): New method for
3387 checking friend assembly access.
3388 (TypeManager.Error_FriendAccessNameNotMatching): New
3390 (TypeManager.CompareKeyTokens): Likewise.
3391 (TypeManager.Filter): Handle friend accessible
3394 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
3395 friend accessible types.
3397 * ecore.cs (Expression.IsAccessorAccessible): Handle
3398 friend accessible properties.
3400 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
3403 2005-10-28 Marek Safar <marek.safar@seznam.cz>
3406 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3409 * convert (Convert.ImplicitReferenceConversion): NullCast holds
3412 * ecore.cs (NullCast): Child is contant only.
3414 * literal.cs (NullLiteral.Reduce): null can be converted to any
3417 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
3419 * driver.cs: Use Encoding.Default as default code page instead
3422 2005-10-27 Raja R Harinath <rharinath@novell.com>
3425 * expression.cs (Invocation.Error_InvalidArguments): Handle
3426 __arglist parameters.
3427 (Invocation.VerifyArgumentsCompat): Likewise.
3428 * support.cs (ReflectionParameters.GetSignatureForError): Print
3429 __arglist parameters.
3430 (InternalParamters.GetSignatureForError): Likewise.
3431 * parameter.cs (Parameters.GetSignatureForError): Likewise.
3433 2005-10-26 Marek Safar <marek.safar@seznam.cz>
3435 * attribute.cs (GetPropertyValue): Made public.
3437 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3439 Add new property WrapNonExceptionThrows to handle 2.0 assembly
3441 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3444 * driver.cs: Reflect method name change.
3446 * statement.cs (Try.Resolve): Warn when try has both general
3449 * typemanager.cs: runtime_compatibility_attr_type new predefined
3452 2005-10-26 Raja R Harinath <harinath@gmail.com>
3455 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3456 treat it as an empty parameter list.
3458 2005-10-26 Raja R Harinath <rharinath@novell.com>
3461 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
3462 ResolveAsTypeStep silent.
3463 * statement.cs (Block.AddConstant): Mark block as used.
3464 (Block.ResolveMeta): Avoid piling on error messages
3465 if a constant initializer resolution fails.
3467 2005-10-25 Raja R Harinath <rharinath@novell.com>
3469 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3471 (NamespaceEntry.VerifyAllUsing): New.
3472 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
3473 behaviour. Delegates actual resolution of alias to ...
3474 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
3475 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3477 * driver.cs (Driver.MainDriver): Update.
3479 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3480 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3482 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3484 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3485 RootNamespace.DefineNamespacesForAll.
3487 2005-10-24 Raja R Harinath <harinath@gmail.com>
3489 * typemanager.cs (assemblies, external_aliases, modules)
3490 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3491 (ComputeNamespaces, GetRootNamespace): Remove extra staging
3492 overhead. Move resposibility ...
3493 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
3494 * driver.cs, attribute.cs, codegen.cs: Update to changes.
3496 2005-10-23 Raja R Harinath <harinath@gmail.com>
3498 * namespace.cs (RootNamespace.all_namespaces): Renamed from
3499 cached_namespaces. Improve usage.
3500 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3501 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3502 Move from GlobalRootNamespace and simplify.
3503 (RootNamespace.Global): Make instance variable.
3504 (RootNamespace.RootNamespace): Add "alias name" parameter.
3505 (GlobalRootNamespace): Simplify drastically.
3506 (Namespace.Lookup): Don't use GetNamespace.
3507 * typemanager.cs (GetRootNamespace): Rename from
3508 ComputeNamespaceForAlias.
3509 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3511 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3513 * anonymous.cs (AnonymousContainer): Don't crash when container
3516 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3518 * expression.cs (Binary.DoResolve): Warn when comparing same
3521 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3524 * expression.cs (Binary.DoResolve): It looks like there are no
3525 convetsion rules in enum context.
3527 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3529 Add support for extern alias qualifiers.
3530 * typemanager.cs: Move some LookupTypeReflection code
3531 to namespace.cs, to have cleaner code. Added some methods
3532 to help us keep track of the extern aliased references.
3533 * driver.cs: Add suport for extern alias assemblies on command
3534 line and check for their warnings/errors. Also keep track of the
3535 extern aliased assemblies.
3536 * namespace.cs: Move the global functionality of Namespace
3537 to GlobalRootNamespace/RootNamespace. Now the global namespace
3538 is GlobalRootNamespace.Globa. Also the code moved from
3539 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
3540 Finally added LocalAliasEntry (AliasEntry before) and
3541 ExternAliasEntry, to handle alias statements.
3542 * cs-parser.jay: Add support in the grammar for extern alias
3544 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
3545 Update callings to Namespace (now in GlobalRootNamespace).
3547 2005-10-25 Martin Baulig <martin@ximian.com>
3549 * convert.cs (ImplicitTypeParameterConversion): Make base
3550 interfaces actually work; fixes #76557.
3552 2005-10-25 Martin Baulig <martin@ximian.com>
3555 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
3556 all the type parameters; fixes #76551.
3558 2005-10-25 Martin Baulig <martin@ximian.com>
3563 (GenericMethod.ctor): Added `Expression return_type' and
3564 `Parameters parameters' arguments.
3565 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
3566 parameter and return types to check their constraints if they're
3569 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
3572 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3573 constraints of a generic type if `ec.ResolvingGenericMethod'.
3575 * class.cs (MethodCore.DoDefineParameters): Set
3576 `ec.ResolvingGenericMethod' if we're a generic method.
3577 (MemberBase.MemberType): Likewise.
3579 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3581 * typemanager.cs (TypeManager): Added
3582 TypeManager.internals_visible_attr_type to cache
3583 S.R.CompilerServices.InternalsVisibleToAttribute.
3585 * codegen.cs (AssemblyClass): Added checks for
3586 InternalsVisibleToAttribute in new method
3587 CheckInternalsVisibleAttribute () and also cache the
3588 AssemblyName in AssemblyClass.Name.
3590 2005-10-24 Martin Baulig <martin@ximian.com>
3593 (TypeManager.ExpandInterfaces): Added overloaded version which
3594 just takes a `Type[]' array.
3597 (Constraints.Resolve): Don't expand the interfaces here; ie. we
3598 just use the interfaces which were explicitly specified and not
3599 the interfaces they inherit. Fixes #76482.
3600 (TypeParameter.FindMembers): Expand the interfaces here.
3602 2005-10-21 Martin Baulig <martin@ximian.com>
3605 (Constraints.Resolve): Also resolve the actual types here.
3606 (Constraints.ResolveTypes): Just check the constraints here.
3607 Fixes #76363; see gtest-218.cs.
3609 2005-10-21 Martin Baulig <martin@ximian.com>
3612 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
3613 instead of a `BoxedCast'; fixes gtest-217.cs.
3615 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
3617 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
3618 1) "new()" is specified as generic parameter constraint and 2) the
3619 type is TypeBuilder and 3) the type is abstract even if it has a
3620 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
3622 2005-10-20 Martin Baulig <martin@ximian.com>
3625 (GenericConstraints.TypeParameter): New public property.
3626 (TypeParameter.ctor): Also take a `DeclSpace' argument.
3627 (TypeParameter.DeclSpace): New public property.
3628 (TypeParameter.DefineType): Inflate the constraints if our
3629 `DeclSpace' is an `Iterator'.
3631 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
3633 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
3634 GenericMethod argument to compare methods' generic type arguments.
3637 2005-10-19 Martin Baulig <martin@ximian.com>
3639 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
3640 not ResolveType() when resolving the base type, so we're not
3641 checking the constraints here.
3642 (TypeContainer.ResolveType): Call ResolveType() on our base_type
3645 2005-10-19 Martin Baulig <martin@ximian.com>
3647 * generic.cs (ConstructedType.CheckConstraints): Committing
3648 untested fix for #76441.
3650 2005-10-18 Raja R Harinath <rharinath@novell.com>
3653 * class.cs (TypeContainer.DefineType): Move updating of
3654 topological sort earlier in the code.
3655 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3657 2005-10-18 Marek Safar <marek.safar@seznam.cz>
3660 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3662 * constant.cs (Constant.TryReduce): Moved from Cast class.
3663 (Reduce): Made little bit more OO and fixed missing conversions.
3665 * ecore.cs (Reduce): Implemented.
3666 (Binary.EnumLiftUp): New method to upgrade values to enum values.
3668 * literal.cs (Reduce): Implemented.
3670 * class.cs: Reverted Miguel's wrong commit.
3672 2005-10-14 Miguel de Icaza <miguel@novell.com>
3674 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3676 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
3678 * cs-parser.jay, expression.cs : CS0214 was missing error location
3679 for constants. Fixed bug #76404.
3681 2005-10-10 Raja R Harinath <rharinath@novell.com>
3683 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3685 (PropertyExpr.EmitCall): Likewise.
3686 * expression.cs (Invocation.EmitArguments): Handle case where
3688 (Invocation.EmitCall): Avoid allocating temporary variable if
3689 there are no arguments.
3691 2005-10-11 Marek Safar <marek.safar@seznam.cz>
3694 * convert.cs (ExplicitConversionCore): Fixed object->enum
3697 2005-10-07 Raja R Harinath <rharinath@novell.com>
3700 * convert.cs (ImplicitConversionStandard): Move conversion of
3701 void* to arbitrary pointer types ...
3702 (ExplicitConversionStandard): .. here.
3703 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3704 error to always print typenames.
3706 2005-10-07 Raja R Harinath <rharinath@novell.com>
3708 * convert.cs (GetConversionOperator): Rename from
3709 GetConversionOperators. Move operator selection code from ...
3710 (UserDefinedConversion): ... here.
3712 2005-10-06 Marek Safar <marek.safar@seznam.cz>
3714 * convert.cs (ExplicitConversionCore): Removed duplicate enum
3717 2005-10-05 Marek Safar <marek.safar@seznam.cz>
3719 * assign.cs (Assign.DoResolve): Error method changed.
3721 * cfold.cs (DoConstantNumericPromotions): Error method changed.
3723 * const.cs (ResolveValue): Reset in_transit immediately.
3725 * constant.cs: Error method changed.
3727 * convert.cs: Removed useless location parameter.
3728 (ExplicitNumericConversion): Don't do double enum check.
3729 (ExplicitConversionCore): Renamed from ExplicitConversion.
3730 (ExplicitUnsafe): Extracted from ExplicitConversion.
3731 (ExplicitConversion): Uses for error reporting.
3733 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3735 (ResolveBoolean): Uses common error method.
3736 (CastToDecimal): Get rid of ec.
3737 (CastFromDecimal): Optimized.
3738 (ConvCast): Get rid of ec.
3740 * enum.cs (ResolveValue): Reset in_transit immediately.
3741 (Emit): Return after first error.
3743 * expression.cs: Convert changes.
3745 * literal.cs: Error method changed.
3747 * statement.cs: Error method changed.
3749 2005-10-06 Raja R Harinath <rharinath@novell.com>
3751 Fix gtest-131.cs and gtest-211.cs.
3752 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
3753 Only emit code for a label if it is used. Unreachable code can
3754 violate ECMA evaluation stack invariants.
3756 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3758 * anonymous.cs: Implemented ExprClassName.
3760 * assign.cs (Assign.DoResolve): Don't chrash when type is not
3763 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3766 * class.cs (StaticClass.DefineContainerMembers): Report protected
3769 * codegen.cs: if(ed) PRODUCTION.
3771 * convert.cs (Error_CannotImplicitConversion): Better error
3774 * cs-parser.jay: More error checks.
3776 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3778 * driver.cs (CSCParseOption): Enabled wrong option check.
3780 * ecore.cs (Expression.ExprClassName): Turned to property.
3781 (MemberExpr.CheckIntermediateModification): For checking boxed
3782 value types modification.
3784 * statement.cs (Fixed.Resolve): Expression type must be
3785 convertible to fixed type.
3786 (CollectionForeach.GetEnumeratorFilter,TryType):
3787 Small refactoring for easier error checking.
3789 2005-09-26 Marek Safar <marek.safar@seznam.cz>
3791 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3794 * class.cs (GeneratedBaseInitializer): New class for customization
3795 compiler generated initializers.
3796 (MemberBase.DoDefine): Check Obsolete attribute here.
3797 (FieldMember.DoDefine): Ditto.
3799 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3802 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3803 (MemberCore.GetObsoleteAttribute): Removed argument.
3804 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3805 (MemberCore.CheckObsoleteType): New helper.
3809 * statement.cs: Updates after MemberCore changes.
3811 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3812 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3814 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3815 obsolete attribute for compiler construct.
3816 (As.DoResolve): Cache result.
3818 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3820 2005-10-01 Miguel de Icaza <miguel@novell.com>
3822 * expression.cs (Probe): instead of having a "Type probe_type"
3823 keep the extra information as a TypeExpr probe_type_expr since the
3824 "As" operator needs to perform some type checks.
3826 * (As.DoResolve): If the type is a type parameter, ensure that it
3827 is constrained by a class.
3829 2005-09-22 Miguel de Icaza <miguel@novell.com>
3831 * statement.cs (Lock): Use the TemporaryVariable class instead of
3832 manually using local variables as those do not work when variables
3835 * ecore.cs: Moved the TemporaryVariable class from being a nested
3836 class inside Foreach to be a public class that can be employed in
3839 2005-09-19 Marek Safar <marek.safar@seznam.cz>
3841 * cs-parser.jay: interface_accessors replaced by
3842 accessor_declarations.
3844 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3847 * statement.cs (GotoCase.Resolve): Convert null constant to
3849 (SwitchLabel.ResolveAndReduce): Ditto.
3850 (SwitchLabel.NullStringCase): Custom null stamp.
3851 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3853 typemanager.cs (CSharpSignature): Don't skip first argument
3856 2005-09-16 Marek Safar <marek.safar@seznam.cz>
3858 * cfold.cs, constant.cs, convert.cs, ecore.cs,
3859 expression.cs, iterators.cs, literal.cs: Store constants and
3862 * class.cs (MemberBase.ShortName): Pass location.
3864 * cs-parser.jay: Some location fixes.
3866 * ecore.cs (Expression.Location): Made virtual.
3868 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3871 * const.cs (Const.ResolveValue): Check for assigning non-null
3872 value to reference type.
3874 2005-09-26 Raja R Harinath <rharinath@novell.com>
3877 * expression.cs (This.VerifyFixed): In a value type T, the type of
3878 'this' is T&, iow, 'this' is either an out or ref parameter. In a
3879 value type R, 'this' is treated as a value parameter.
3881 2005-09-05 Miguel de Icaza <miguel@novell.com>
3883 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3884 if the underlying types are the same, otherwise we need to produce
3885 code that will do the proper cast.
3887 This was exposed by Marek's constant rewrite which produced
3888 invalid code for the call site:
3891 void Method (X v) {}
3895 This fixes test-49.cs
3897 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3899 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3900 Type/Object should be allowed as well. Fixed bug #75968.
3902 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3904 * expression.cs : (Binary.DoResolve): when one is enum constant and
3905 another is constant 0, then return enum one *as enum type*.
3908 2005-10-04 Martin Baulig <martin@ximian.com>
3910 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
3911 `SetMemberIsUsed()' work for generics, too.
3913 2005-10-04 Martin Baulig <martin@ximian.com>
3915 * expression.cs (DelegateInvocation.EmitStatement): Make this work
3916 for corlib. Fixes #75691.
3918 2005-09-28 Marek Safar <marek.safar@seznam.cz>
3921 * driver.cs: Fix compilation files with full root path.
3923 2005-09-25 Miguel de Icaza <miguel@novell.com>
3925 * report.cs (SymbolRelatedToPreviousError): Format the output so
3926 it does not use an open parenthesis that is never closed.
3928 * driver.cs: Follow coding guidelines
3930 2005-09-18 Miguel de Icaza <miguel@novell.com>
3932 * driver.cs: Set InEmacs based on the environment variable EMACS.
3934 * location.cs (InEmacs): in this mode, do not report column
3935 location as it confuses Emacs.
3937 2005-10-03 Raja R Harinath <rharinath@novell.com>
3939 * support.cs (SeekableStreamReader.Position): Don't error out when
3940 the requested position is just beyond the end of the current
3943 2005-09-28 Raja R Harinath <rharinath@novell.com>
3945 * support.cs (SeekableStreamReader): Simplify drastically. Don't
3946 try to keep in sync with the byte count of the underlying Stream.
3947 However, this limits us to a window size of 2048 characters: i.e.,
3948 the maximum lookahead of our lexer/parser can be 2048 characters.
3950 2005-09-22 Martin Baulig <martin@ximian.com>
3952 * driver.cs: Removed a debugging FIXME.
3954 2005-09-21 Raja R Harinath <rharinath@novell.com>
3956 * cs-parser.jay (type_arguments): Add CS1644 check.
3957 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
3959 2005-09-15 Raja R Harinath <rharinath@novell.com>
3961 * Makefile (PROGRAM): Make profile specific.
3962 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
3963 the current directory.
3966 * expression.cs (Invocation.EmitCall): Remove optimization on
3967 this_call since it doesn't handle 'this' being a value type.
3969 2005-09-05 Geoff Norton <gnorton@customerdna.com>
3971 * driver.cs: Ensure file handles are closed after parsing
3973 2005-09-05 Miguel de Icaza <miguel@novell.com>
3975 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3976 if the underlying types are the same, otherwise we need to produce
3977 code that will do the proper cast.
3979 This was exposed by Marek's constant rewrite which produced
3980 invalid code for the call site:
3983 void Method (X v) {}
3987 This fixes test-49.cs
3989 2005-09-05 Martin Baulig <martin@ximian.com>
3991 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
3992 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
3994 * cs-parser.jay (delegate_declaration): Small fix for #75852.
3996 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3998 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
3999 to be a pointer type due to the spec 25.2, so check if declaring
4000 type is generic type definition. Fixed bug #75772.
4002 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
4005 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
4006 both types are not defined by methods.
4007 * expression.cs : (Invocation.IsApplicable): it should work when
4008 the argument type is equal to the parameter type, not only when
4009 ImplicitConversionExists() returns true.
4011 2005-09-02 Raja R Harinath <rharinath@novell.com>
4013 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
4017 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
4018 flow-branching for LocalVariableReferences in case we were invoked
4019 from a MemberAccess.
4020 * expression.cs (LocalVariableReference.VerifyAssigned): New.
4022 (LocalVariableReference.DoResolveBase): ... this.
4023 (MemberAccess.Resolve): Do the check that was disabled during
4026 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
4029 (PartialContainer.Create): check abstract/sealed/static strictly
4030 but abstract/sealed can exist only at one side. Fixed bug #75883.
4032 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
4035 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
4036 specified, don't default to UnmanagedType.I4.
4038 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
4040 * expression.cs : conditional operator should check possibly
4041 incorrect assign expression. Fixed bug #75946.
4043 2005-08-30 Raja R Harinath <rharinath@novell.com>
4046 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
4047 (ScopeInfo.EmitScopeType): Use it to construct field names from
4048 names of captured locals.
4051 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
4052 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
4053 Pass 'target_type' to BoxedCast. Don't default to 'object'.
4054 (ExplicitConversion): Remove enum cases already handled by
4055 implicit conversion. Move implicit conversion check to the beginning.
4056 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
4057 * expression.cs (ArrayCreation.EmitDynamicInitializers):
4058 Don't treat System.Enum as a struct.
4060 2005-08-30 Jb Evain <jbevain@gmail.com>
4062 * attribute.cs: handles as expression in parameters.
4064 2005-08-30 Raja R Harinath <rharinath@novell.com>
4067 * class.cs (TypeContainer.VerifyClsName): Don't use a
4068 PartialContainer when verifying CLS compliance.
4069 (AbstractPropertyEventMethod): Set Parent here, ...
4070 (PropertyMethod): ... not here.
4072 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
4074 * attribute.cs : escaped attribute name should not be allowed to be
4075 resolved (e.g. @class as classAttribute). Fixed bug #75930.
4077 2005-08-29 Raja R Harinath <rharinath@novell.com>
4080 * convert.cs (ImplicitStandardConversionExists): Allow zero also
4081 when converting a long constant to unsigned long.
4082 * expression.cs (Invocation.OverloadResolve): Add sanity check to
4083 detect where IsApplicable and VerifyArgumentsCompat disagree.
4085 2005-08-29 Raja R Harinath <rharinath@novell.com>
4086 and Carlos Alberto Cortez <carlos@unixmexico.org>
4089 * class.cs (TypeContainer.CanElideInitializer): New helper.
4090 (TypeContainer.EmitFieldInitializers): Use it to determine if we
4091 can safely emitting the initializer of a field.
4093 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4095 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
4096 allowed inside a switch (without loop). Fixed bug #75433.
4098 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
4100 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4101 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4103 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4105 * driver.cs : kinda reverting the default encoding changes (not exact
4106 revert since I noticed that "codepage:reset" might not work fine).
4108 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4110 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
4111 Location. Now getter and setter store location correctly.
4112 (errors/cs0111-12.cs now reports the expected location.)
4114 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4116 * driver.cs : Use default encoding on the environment.
4117 Removed (now that) extra parameter for SeekableStreamReader.
4118 * support.cs : (SeekableStreamReader) third .ctor() argument for
4119 StreamReader is not required (always true). preamble size could
4120 be acquired in simpler and safe way.
4122 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
4124 * cs-parser.jay: report CS0642 at warning level 3
4125 and report CS0642 for an if else statement also
4126 fixes bug #74745. Patch by John Luke (and a bit
4128 Removed extra CS0642 warning check for "while",
4130 * statement.cs: In Block.Resolve(), CS0642 check
4131 is reimplemented to check a sequence of an empty
4132 statement and a block.
4134 Both fix bug #66777.
4136 2005-08-24 Marek Safar <marek.safar@seznam.cz>
4138 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
4139 detection until I fix it.
4141 * cs-tokenizer.cs: Changed error message.
4143 * cs-parser.jay: Fixed 2 error locations.
4145 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
4146 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
4149 * enum.cs (GetSignatureForError): Fixed.
4151 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
4155 * typemanager.cs (RegisterProperty): Removed.
4157 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
4159 2005-08-24 Raja R Harinath <rharinath@novell.com>
4162 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
4163 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
4165 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4167 * expression.cs : tiny fix is required for not warning positive ulong.
4170 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4172 * expression.cs : add CS0652 check for constant and integral
4173 expression. Fixed bug #53974.
4175 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4177 * expression.cs : in DoNumericPromotions(), check if there is implicit
4178 conversion overload for string (to check CS0034). Fixed bug #52492.
4180 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4182 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
4184 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4186 * ecore.cs : report location when it is *not* Null.
4188 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4194 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
4195 correctly. Fixed bug #75721.
4197 2005-08-23 Raja R Harinath <rharinath@novell.com>
4199 * support.cs (SeekableStreamReader.Position): Avoid an expensive
4200 loop that performs 'min (pos, char_count)'.
4203 * expression.cs (Unary.ResolveOperator): Don't discard implicit
4204 converted value in Operator.OnesComplement.
4206 2005-08-22 Ben Maurer <bmaurer@ximian.com>
4208 * anonymous.cs: If the anon method is pulled into a helper class,
4209 it needs to be `internal' not `private'. Fixes runtime behavior on
4212 2005-08-17 Marek Safar <marek.safar@seznam.cz>
4215 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4218 2005-08-16 Marek Safar <marek.safar@seznam.cz>
4220 The big constants rewrite
4221 Fix #75746, #75685 and more
4222 As a side effect saved 1MB for MWF ;-)
4224 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4225 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4226 enum based for corlib compilation.
4228 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4231 * class.cs (FixedField.Define): Use ResolveAsConstant.
4233 * const.cs (IConstant): Interface constants and enums.
4234 (Const.ResolveValue): New method for constant resolvning.
4235 (ExternalConstant): Constants from imported assemblies.
4237 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4238 conversion; like enums.
4239 (Constant.ToType): Converts this constant to different type.
4240 (Constant.Increment): Adds 1.
4242 * convert.cs (ImplicitConversionRequired): Simplified.
4244 * cs-parser.jay: Create EnumMember directly.
4246 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4248 * doc.cs (GenerateEnumDocComment): Removed.
4250 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4251 (ConvertIntLiteral): Removed.
4252 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4254 * enum.cs (EnumMember): Implement IConstant.
4255 (Enum.IsValidEnumConstant): Removed.
4256 (Enum.GetNextDefaultValue): Removed.
4257 (Enum.FindMembers): Updated.
4258 (Enum.GenerateDocComment): Iterate enum members.
4260 * expression.cs (Cast.TryReduce): Handle enums correctly.
4261 (New.Constantify): Made public.
4262 (MemberAccess.DoResolve): Removed contant specific if(s).
4264 * literal.cs (NullLiteral): Implement new abstract methods.
4266 * statement.cs (GotoCase.Resolve): Use new constant methods.
4267 (SwitchLabel.ResolveAndReduce): Use new constant methods.
4269 * typemanager.cs (LookupEnum): Removed.
4270 (IsEnumType): Fixed to work with corlib.
4271 (RegisterConstant): Removed.
4272 (LookupConstant): Removed.
4273 (GetConstant): Changed to work with IConstant.
4275 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
4277 * location.cs : Fixed overflown (>255) column number.
4279 2005-08-03 Raja R Harinath <rharinath@novell.com>
4281 First cut of the qualified-alias-member feature.
4282 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4284 * cs-parser.jay (DOUBLE_COLON): New token.
4285 (namespace_or_type_name): Add rule for recognizing
4286 qualified-alias-members.
4287 (primary_expression): Likewise.
4288 (element_access): Allow QualifiedAliasMember as a possible
4289 type-bearing expression.
4290 (local_variable_type, local_variable_pointer_type): Likewise.
4291 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
4292 aliases in the current and enclosing namespace declarations.
4293 (NamespaceEntry.UsingAlias): Add CS0440 warning.
4294 * decl.cs (MemberName.is_double_colon): New.
4295 (MemberName.MemberName): Add new constructor for alias-member.
4296 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4297 * expression.cs (QualifiedAliasMember): New expression type.
4299 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4301 * location.cs : it borked when no argument was specified.
4303 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4305 * location.cs : tiny ToString() format fix.
4307 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4309 * statement.cs : oops, it was missing.
4311 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4313 A set of fixes for precise line/column location.
4316 "token" field now holds a file/line "delta", a line number offset
4317 from the segment, and a column number. See also:
4318 http://lists.ximian.com/pipermail/mono-devel-list/2004-
4319 December/009508.html
4320 Removed static IsNull. Use instance IsNull property instead.
4322 For some tokens it stores Location. For Identifier it stores
4323 LocatedToken which is a pair of string name and location.
4324 Column numbers are adjusted only at getChar().
4326 Use Location.ToString() for reporting (it now contains column).
4328 Largely modified to use LocatedToken instead of
4329 string (IDENTIFIER), and to acquire Location from some tokens.
4330 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4331 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4333 Now MemberName holds Location. DeclSpace.ctor() receives Location
4334 as a parameter. Removed extra parameters to all derived classes.
4335 Replaced Location.IsNull() with instance property.
4336 * assign.cs, expression.cs :
4337 Added .ctor() overload that omits Location.
4339 Added "nameEscaped" flag that indicates the identifier was escaped
4340 in the source file. This fixes bug #57047.
4342 2005-09-02 Martin Baulig <martin@ximian.com>
4344 * class.cs: Make CS3005 a warning, not an error.
4346 2005-08-02 Marek Safar <marek.safar@seznam.cz>
4348 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4349 New method, looking for lo-case imported cls type.
4351 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4354 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4356 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4358 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4360 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4362 Optimized to save 3.5 MB for SWF compilation.
4364 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4366 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4367 (PartialContainer.Create): Moved logic AddToContainer.
4368 (PartialContainer.MarkForDuplicationCheck): Shares name.
4370 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4373 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4375 (Namespace.GetSignatureForError): New method.
4377 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4378 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4380 2005-08-01 Raja R Harinath <rharinath@novell.com>
4383 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4384 member lookup rather than qualifier_type, since qualifier_type can
4387 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4389 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4392 2005-07-31 Miguel de Icaza <miguel@novell.com>
4394 * statement.cs: Copy the local exception into the exception
4395 captured local. Fixes 75674
4397 2005-07-31 Raja R Harinath <harinath@gmail.com>
4400 * expression.cs (Invocation.OverloadResolve): Don't report error
4401 CS1501 if error CS1502 has been reported.
4402 (New.DoResolve): Delegate CS1501 reporting to
4403 Invocation.OverloadResolve.
4406 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4407 invariant-meaning-in-block property in an enclosing block if
4410 2005-07-29 Marek Safar <marek.safar@seznam.cz>
4412 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4413 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4414 (Switch.CheckSwitch): Just save 50kb for SWF.
4416 2005-07-27 Martin Baulig <martin@ximian.com>
4418 * anonymous.cs (CaptureContext.AddField): Added
4419 `AnonymousContainer am' argument; compute its toplevel scope if
4420 it's not already computed. Fixes #75649.
4422 2005-07-26 Raja R Harinath <rharinath@novell.com>
4425 * class.cs (Constructor.Emit): Reset block to null if the block
4428 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4430 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4432 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4434 * class.cs (MethodData.Define): Check whether accessor implementing
4435 interface is public.
4437 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4439 2005-07-22 Marek Safar <marek.safar@seznam.cz>
4442 * namespace.cs (LookupType): Moved same type check to...
4444 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4447 2005-07-21 Raja R Harinath <rharinath@novell.com>
4449 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4450 already found a typebuilder.
4451 * class.cs (MethodCore.IsDuplicateImplementation): Compare
4452 MemberNames, not strings.
4454 * const.cs (Error_ExpressionMustBeConst):
4455 Rename from Error_EpressionMustBeConst.
4456 * const.cs, class.cs, statement.cd: Update.
4458 2005-07-21 Marek Safar <marek.safar@seznam.cz>
4462 * const.cs (Const.LookupConstantValue): Report missing contant expression
4464 (Error_EpressionMustBeConstant): Only one error method.
4466 * class.cs, statement.c: Updated.
4468 2005-07-20 Raja R Harinath <rharinath@novell.com>
4470 * statement.cs (Block.Flags): Add back HasVarargs.
4471 (Block.flags): Make protected.
4472 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4474 * typemanager.cs (types, typecontainers, user_types): Remove.
4475 (UserTypes, TypeContainers): Likewise.
4476 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4477 (CleanUp, Reset): Update.
4478 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
4479 (GetNestedType): Use Type.GetNestedType.
4480 (CoreLookupType): Take two arguments, the namespace and the
4481 basename of the type. Update to use the Namespace.Lookup
4483 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4484 (RealMemberLookup): Use IsNestedChildOf instead of playing with
4485 string concatenation and substring matches.
4486 * class.cs, enum.cs, delegate.cs: Update to changes.
4488 2005-07-20 Marek Safar <marek.safar@seznam.cz>
4490 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4491 Expression and made virtual.
4493 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4494 (ImplicitStandardConversionExists): Fixed `byte' typo ?
4496 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4498 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4501 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4504 2005-07-18 Marek Safar <marek.safar@seznam.cz>
4507 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4508 AssemblyCultureAttribute is not used on executable.
4511 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4513 2005-07-16 Raja R Harinath <rharinath@novell.com>
4516 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4517 New. Reports CS0252/CS0253.
4518 Mostly taken from preliminary patch by Duncak Mak.
4519 (Binary.DoResolveOperator): Store results of operator lookup.
4520 Use them to detect if we need to warn about unintended reference
4523 2005-07-15 Raja R Harinath <rharinath@novell.com>
4526 * namespace.cs (Namespace.Lookup): Add back location parameter.
4527 (Namespace.LookupType): Add CS0436 report. Add location parameter.
4528 * delegate.cs, ecore.cs, expression.cs: Update to changes.
4530 * codegen.cs (EmitContext.DeclSpace): Make readonly.
4531 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4532 (Namespace.LookupType): ... this.
4533 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4535 * typemanager.cs (LookupTypeReflection): Remove buggy code that
4536 purported to handle pointers.
4537 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4540 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4542 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4545 2005-07-15 Raja R Harinath <rharinath@novell.com>
4547 * namespace.cs (Namespace.Lookup): Drop location parameter.
4548 (NamespaceEntry.LookupAlias): Remove. Merge into ...
4549 (NamespaceEntry.Lookup): ... this.
4550 (NamespaceEntry.Error_AmbiguousTypeReference):
4551 Move here from DeclSpace.
4552 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4554 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4555 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4556 Move to NamespaceEntry.
4557 * delegate.cs, expression.cs: Update to changes.
4559 2005-08-31 Martin Baulig <martin@ximian.com>
4561 Committing a patch from Atsushi Enomoto for #75850.
4563 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
4564 Prefer a generic enumerator over a non-generic one.
4566 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
4568 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4569 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4571 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4573 * driver.cs : reverting default encoding change as well as mcs.
4575 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4577 * driver.cs, support.cs : merged r48826.
4579 > could you integrate your mcs changes to gmcs otherwise
4580 > gmcs cannot compile some files.
4582 2005-08-20 Martin Baulig <martin@ximian.com>
4584 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4585 scope if we don't already have it.
4587 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4588 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4591 2005-07-31 Miguel de Icaza <miguel@novell.com>
4593 * statement.cs: Copy the local exception into the exception
4594 captured local. Fixes 75674
4596 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4598 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4601 2005-08-12 Martin Baulig <martin@ximian.com>
4603 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
4604 for nested types here to avoid hitting the cache too early.
4606 2005-08-09 Miguel de Icaza <miguel@novell.com>
4608 * enum.cs: On the new compiler CLS error 3005 is now a warning not
4611 2005-08-03 Martin Baulig <martin@ximian.com>
4613 Make iterators in generic methods work; see gtest-191.cs.
4616 (Constraints.Resolve): Protect against being called twice.
4619 (TypeContainer.GetClassBases): Make this `protected virtual'.
4621 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
4622 (Iterator.GetClassBases): Override this and compute the base
4624 (Iterator.DefineNestedTypes): If we're a generic method, all our
4625 method type parameters become class type parameters on the proxy
4629 (ToplevelBlock.Parameters): Make this a property, not a field.
4630 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
4632 2005-08-03 Martin Baulig <martin@ximian.com>
4634 * typemanager.cs (TypeManager.IsSubclassOf): Use
4635 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
4636 (TypeManager.GetFullName_recursed): Improved.
4638 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4641 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
4642 Private accessor case, using TypeManager.IsPrivateAccessible instead of
4643 invocation_type == mi.DeclaringType, since the first one also checks
4644 other condition used by generic instances.
4646 2005-07-27 Martin Baulig <martin@ximian.com>
4648 * anonymous.cs (CaptureContext.AddField): Added
4649 `AnonymousContainer am' argument; compute its toplevel scope if
4650 it's not already computed. Fixes #75649.
4652 2005-07-14 Marek Safar <marek.safar@seznam.cz>
4654 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4655 CheckAttributeType and refactored.
4656 (Attribute.ResolvePossibleAttributeType): Changed to reuse
4657 ResolveAsTypeTerminal error handling.
4658 (ResolveAsTypeTerminal): Introduced because of global attributes extra
4660 (GetSignatureForError): Print errors in same way.
4663 * codegen.cs: Reflect attribute GetSignatureForError change.
4666 * expression.cs: Add silent parameter to ResolveAsTypeStep.
4668 * namespace.cs (UsingEntry): Refactored to make fields private.
4671 statement.cs: Error_UnexpectedKind has extra parameter.
4673 2005-07-14 Raja R Harinath <rharinath@novell.com>
4675 * ecore.cs (IAlias): Remove.
4676 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
4677 that implement the interface.
4678 * namespace.cs (Namespace): Likewise.
4679 (Namespace.declspaces): Renamed from 'defined_names'.
4680 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
4681 DeclSpace instead of an IAlias.
4682 * tree.cs (Tree.AddDecl): Update.
4684 2005-07-12 Raja R Harinath <rharinath@novell.com>
4686 * statement.cs (Block.Flags); Remove HasVarargs.
4687 (Block.HasVarargs): Move to ToplevelBlock.
4688 (Block.ThisVariable, Block.AddThisVariable): Likewise.
4689 (Block.Variables): Make protected. Initialize variable hashtable
4691 (Block.AddVariable): Update.
4692 (Block.Resolve): Update to changes.
4693 (ToplevelBlock.HasVarargs): New boolean.
4694 (ToplevelBlock.ThisVariable): Move here from Block.
4695 (ToplevelBlock.AddThisVariable): Likewise.
4696 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
4697 * expression.cs (This.ResolveBase): Update to changes.
4698 (ArglistAccess.DoResolve): Likewise.
4700 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4703 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4705 * class.cs (TypeContainer.VerifyMembers): Distinguish between
4706 not used and not used & assigned.
4707 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4709 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4712 * expression.cs (Is.DoResolve): null is never provided type.
4714 2005-07-08 Marek Safar <marek.safar@seznam.cz>
4717 * cs-parser.jay: Less strict event error rule to catch more errors.
4719 2005-07-11 Martin Baulig <martin@ximian.com>
4721 * generic.cs (ConstructedType.CheckConstraints): Improve the check
4722 for the constructor constraint: we do not only have to check
4723 whether the class has a public constructor, but also ensure that
4724 it's parameterless. Fixes #75492.
4726 2005-07-11 Martin Baulig <martin@ximian.com>
4728 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
4729 between type parameters if they either have the reference type
4730 constraint or the class constraint.
4732 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
4734 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
4736 2005-07-07 Marek Safar <marek.safar@seznam.cz>
4739 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4740 (ExtractSecurityPermissionSet): Cope with self referencing security
4741 attributes properly.
4743 * driver.cs (SetOutputFile): Made public property OutputFile.
4745 2005-07-07 Raja R Harinath <rharinath@novell.com>
4748 * class.cs (TypeContainer.first_nonstatic_field): Rename from
4749 has_nonstatic_fields. Make into a FieldBase pointer.
4750 (TypeContainer.AddField): Add CS0282 check.
4751 (TypeContainer.EmitType): Update.
4753 2005-07-06 Miguel de Icaza <miguel@novell.com>
4755 * cs-tokenizer.cs (consume_identifier): Do not create strings to
4756 compare if they start with __.
4758 2005-07-06 Raja R Harinath <rharinath@novell.com>
4760 * statement.cs (Switch.SwitchGoverningType): Only look at
4761 UserCasts that don't need implicit standard conversions to one of
4762 the allowed switch types (Fixes test-322.cs).
4763 (LocalInfo.Resolve): Re-enable sanity-test.
4765 2005-07-06 Marek Safar <marek.safar@seznam.cz>
4767 * cs-tokenizer.cs (consume_identifier): Detect double undescores
4769 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4771 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4773 2005-07-06 Raja R Harinath <rharinath@novell.com>
4776 * ecore.cs (SimpleName.GetSignatureForError): Add.
4777 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4778 (MemberAccess.GetSignatureForError): Add.
4780 2005-07-05 Marek Safar <marek.safar@seznam.cz>
4782 The big error and warning messages review.
4812 * typemanager.cs: Updated.
4814 * class.cs: (MethodCore.SetYields): Moved here to share.
4815 (PropertyMethod.Define): Moved iterator setup here.
4817 * iterators.cs: Add orig_method to have full access to parent
4820 2005-07-05 Raja R Harinath <rharinath@novell.com>
4822 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4823 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4824 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4825 variable of struct type.
4826 * expression.cs (Unary.ResolveOperator): Update to change.
4827 (Indirection.VerifyFixed): Likewise.
4828 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4829 (ParameterReference.VerifyFixed): Value parameters are fixed.
4830 (This.VerifyFixed): Treat 'this' as a value parameter.
4831 * statement.cs (LocalInfo.IsFixed): Remove.
4833 2005-07-01 Martin Baulig <martin@ximian.com>
4835 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4836 `ec.EmitThis ()' to get the correct scope.
4838 2005-07-01 Martin Baulig <martin@ximian.com>
4840 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4841 instance is a ParameterReference; fixes #75299.
4843 2005-06-30 Raja R Harinath <rharinath@novell.com>
4846 * expression.cs (Indexers.map): Remove.
4847 (Indexers.Append): Filter out inaccessible setters and getters.
4848 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4851 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
4853 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4854 (FieldExpr.Emit, PropertyExpr.Emit): Update.
4855 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4856 * expression.cs (Invocation.EmitCall): Add CS0120 check.
4858 2005-06-30 Marek Safar <marek.safar@seznam.cz>
4861 * class.cs (FieldBase.GetInitializerExpression): One more field
4864 2005-06-28 Miguel de Icaza <miguel@novell.com>
4866 * pending.cs: Do not define a proxy if the base method is virtual,
4867 it will be picked up by the runtime (bug 75270).
4869 2005-07-08 Martin Baulig <martin@ximian.com>
4871 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4872 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4874 2005-07-07 Martin Baulig <martin@ximian.com>
4876 * generic.cs (ConstructedType.CheckConstraint): Use
4877 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
4878 called recursively; fixes #75329.
4880 2005-07-06 Martin Baulig <martin@ximian.com>
4882 * generic.cs (TypeManager.InferTypeArguments): Added support for
4883 anonymous methods; fixes #75461.
4885 2005-07-01 Martin Baulig <martin@ximian.com>
4887 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4888 `ec.EmitThis ()' to get the correct scope.
4890 2005-07-01 Martin Baulig <martin@ximian.com>
4892 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
4893 instance is `This'; fixes #75299.
4895 2005-06-30 Martin Baulig <martin@ximian.com>
4897 * class.cs (Indexer): Implement IIteratorContainer; added support
4898 for iterators in indexers.
4901 (EmitContext.CurrentIterator): Make this a property, not a field.
4903 * anonymous.cs (AnonymousContainer.Iterator): New public property.
4905 2005-06-28 Miguel de Icaza <miguel@novell.com>
4907 * pending.cs: Do not define a proxy if the base method is virtual,
4908 it will be picked up by the runtime (bug 75270).
4910 2005-06-28 Martin Baulig <martin@ximian.com>
4912 * cs-parser.jay (interface_method_declaration): Avoid a
4913 reduce/reduce conflict by moving some of the code into a separate
4914 `interface_method_declaration_body' rule; fixes #75368.
4916 2005-06-28 Martin Baulig <martin@ximian.com>
4918 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
4919 array check after the check for TypeBuilder's.
4921 2005-06-21 Raja R Harinath <rharinath@novell.com>
4923 * convert.cs (FindMostEncompassedType): Add two trivial special
4924 cases (number_of_types == 0 || number_of_types == 1).
4925 (FindMostEncompasingType): Likewise.
4927 2005-06-17 Raja R Harinath <rharinath@novell.com>
4929 Some cleanups preparing for the fix of #75283.
4930 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4932 (EventExpr.InstanceResolve): Likewise.
4933 (EventExpr.DoResolve): Remove redundant checks.
4935 2005-06-08 Miguel de Icaza <miguel@novell.com>
4937 * class.cs: Small fix.
4939 2005-06-08 Raja R Harinath <rharinath@novell.com>
4942 * class.cs (GetPartialBases): Fix return value check of
4945 2005-06-07 Raja R Harinath <rharinath@novell.com>
4947 Ensure that partial classes are registered in their enclosing
4948 namespace. Initial part of fix of #75160.
4949 * tree.cs (Tree.RecordDecl): Add new namespace argument.
4950 Register declspace with namespace here, not in
4951 DeclSpace.RecordDecl.
4952 * cs-parser.jay: Pass namespace to RecordDecl.
4953 * class.cs (PartialContainer.Create): Likewise.
4954 (ClassPart.DefineType): New sanity-check. Throws an exception if
4956 * decl.cs (Declspace.RecordDecl): Remove.
4957 * namespace.cs (NamespaceEntry.DefineName): Remove.
4959 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4961 * rootcontext.cs: Reset TargetExt as well.
4963 2005-06-03 Raja R Harinath <rharinath@novell.com>
4965 * ecore.cs (Expression.Resolve): Emit CS0654 error when
4968 2005-06-02 Raja R Harinath <rharinath@novell.com>
4970 Fix #75080, cs0119.cs.
4971 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
4973 (Expression.Resolve): ... this. Use it. Remove bogus code
4974 allowing ExprClass.Type and ExprClass.Namespace for
4975 ResolveFlags.VariableOrValue.
4976 (Expression.Resolve) [1-argument variant]: Change default resolve
4977 flags based on language version.
4978 (Expression.Error_UnexpectedKind): Use a simple string array
4979 rather than an ArrayList.
4980 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4982 (TypeOfVoid.DoResolve): Likewise.
4983 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
4984 flags argument -- it always has the same value.
4986 2005-05-31 Raja R Harinath <rharinath@novell.com>
4989 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4990 Use it in the error message.
4991 * assign.cs, expression.cs, statement.cs: Update.
4993 2005-05-30 Raja R Harinath <rharinath@novell.com>
4996 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4997 the "almostMatchedMember" case too.
4998 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4999 that failed the accessibility checks to 'almost_match'.
5001 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
5003 * attribute.cs: Use internal MethodBuilder methods to set
5004 ExactSpelling and SetLastError on PInvoke methods, instead
5005 of passing them via charset. Fixes #75060.
5007 2005-05-27 Raja R Harinath <rharinath@novell.com>
5009 * parameter.cs (Parameter): Remove TODO comment.
5010 (Parameter.DefineParameter): Remove Location parameter.
5011 (Parameters.LabelParameters): Likewise.
5012 * class.cs (Constructor.Emit): Update to change.
5013 (MethodData.Emit): Likewise.
5014 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
5015 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
5017 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
5020 Removed Parameters.Location and added Parameter.Location instead.
5021 Removed Location parameter from Emit() and GetSignature().
5028 Modified all related calls.
5030 2005-06-21 Martin Baulig <martin@ximian.com>
5032 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
5033 left-hand side is not a nullable type; fixes #75328.
5035 2005-06-21 Martin Baulig <martin@ximian.com>
5038 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
5039 (TypeManager.GetFullNameSignature): Likewise.
5041 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
5042 `source.FullName' and `target.FullName' to check whether there are
5043 two conflicting definitions.
5045 2005-06-21 Martin Baulig <martin@ximian.com>
5047 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
5048 a BoxedCast - also for reference types - to be compatible with csc.
5050 2005-06-21 Martin Baulig <martin@ximian.com>
5052 * expression.cs (MemberAccess.DoResolve): Add support for nested
5053 types in a generic instance; fixes #75320.
5055 2005-06-20 Martin Baulig <martin@ximian.com>
5057 * generic.cs (TypeManager.InferType): Also walk the class
5058 hierarchy for generic instances; fixes #75261.
5060 2005-06-17 Martin Baulig <martin@ximian.com>
5062 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
5063 to make things work for corlib.
5065 2005-06-15 Martin Baulig <martin@ximian.com>
5067 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
5068 obsolete `SecurityAction' values.
5070 2005-06-06 Marek Safar <marek.safar@seznam.cz>
5072 * rootcontext.cs: Reset TargetExt as well.
5074 2005-06-09 Martin Baulig <martin@ximian.com>
5076 * delegate.cs (Delegate.VerifyMethod): Added
5077 `MethodGroupExpr old_mg' argument; inherit its
5078 `HasTypeParameters'; fix #75085.
5080 2005-06-09 Martin Baulig <martin@ximian.com>
5082 * expression.cs (Invocation.OverloadResolve): Correctly handle
5083 generic methods for the SetMemberIsUsed(); fix #75064.
5085 2005-06-09 Martin Baulig <martin@ximian.com>
5087 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
5090 2005-06-08 Martin Baulig <martin@ximian.com>
5092 * cs-parser.jay (nullable_type_or_conditional): If we put the
5093 nullable back and our `type' is a `ComposedCast', remove the
5094 nullable from it. Fixes #75156.
5096 * expression.cs (ComposedCast.RemoveNullable): New public method.
5098 2005-06-08 Martin Baulig <martin@ximian.com>
5100 The big Iterators rewrite :-)
5102 * iterators.cs: Rewrite this to use the anonymous methods framework.
5104 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
5105 before the TypeContainers; see 2test-21.cs.
5108 (TypeContainer.DefineType): Don't create a new EmitContext if we
5109 already have one (this only happens if we're an Iterator).
5110 (TypeContainer.Define): Also call Define() on all our iterators.
5111 (Method.CreateEmitContext): Added support for iterators.
5114 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
5115 (AnonymousContainer.CreateMethodHost): Moved here from
5116 AnonymousMethod and made abstract.
5117 (AnonymousContainer.CreateScopeType): New abstract method.
5118 (AnonymousContainer.IsIterator): New public property.
5119 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
5120 get the ScopeTypeBuilder rather than manually defining it here.
5121 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
5124 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
5125 before RootContext.DefineTypes().
5127 * codegen.cs (EmitContext.RemapToProxy): Removed.
5128 (EmitContext.CurrentAnonymousMethod): Changed type from
5129 AnonymousMethod -> AnonymousContainer.
5130 (EmitContext.ResolveTopBlock): Protect from being called twice.
5131 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
5132 (EmitContext.EmitThis): Removed the iterators hacks; use the
5133 anonymous methods framework for that.
5136 (ToplevelBlock.Container): Make this a property, not a field.
5137 (ToplevelBlock.ReParent): New public method; move the
5138 ToplevelBlock into a new container.
5139 (Foreach.TemporaryVariable): Simplify.
5141 2005-06-05 Martin Baulig <martin@ximian.com>
5143 * statement.cs (LocalInfo.CompilerGenerated): New flag.
5144 (Block.AddTemporaryVariable): New public method; creates a new
5145 `LocalInfo' for a temporary variable.
5146 (Block.EmitMeta): Create the LocalBuilders for all the temporary
5148 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
5149 non-iterator variables.
5151 2005-06-05 Martin Baulig <martin@ximian.com>
5153 * statement.cs (Foreach.TemporaryVariable): Create the
5154 LocalBuilder in the Emit phase and not in Resolve since in some
5155 situations, we don't have an ILGenerator during Resolve; see
5156 2test-19.cs for an example.
5158 2005-06-04 Martin Baulig <martin@ximian.com>
5160 The big Foreach rewrite - Part II.
5162 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
5163 with `PropertyInfo ienumerator_getcurrent'.
5165 * codegen.cs (VariableStorage): Removed.
5168 (Foreach): Derive from Statement, not ExceptionStatement.
5169 (Foreach.CollectionForeach): New nested class. Moved all the code
5170 dealing with collection foreach here.
5171 (Foreach.ForeachHelperMethods): Removed.
5172 (Foreach.TemporaryVariable): Implement IMemoryLocation.
5174 2005-05-23 Martin Baulig <martin@ximian.com>
5176 * statement.cs (Try.DoResolve): Don't create a `finally' if we
5177 don't need to. Fix #75014.
5179 2005-05-26 Raja R Harinath <rharinath@novell.com>
5181 Improve user-defined conversion handling.
5182 * convert.cs (GetConversionOperators): Rewrite. Return only the
5183 applicable operators.
5184 (AddConversionOperators): New. Helper for GetConversionOperators.
5185 (FindMostEncompassedType, FindMostEncompassingType): Verify that
5186 there is only one most encompassed/encompassing type.
5187 (FindMostSpecificSource, FindMostSpecificTarget): Remove
5188 "applicable operator" handling.
5189 (UserConversion): Move cache here from GetConversionOperators.
5190 Directly cache the chosen operator, rather than the whole
5192 (ExplicitNumericConversion): Fix buggy implementation of Decimal
5193 case. Allow conversion of decimal to sbyte and byte too.
5194 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5195 New static methods. Used to avoid allocating EmptyExpressions in
5198 2005-05-24 Duncan Mak <duncan@novell.com>
5200 * ecore.cs (CastFromDecimal): New class for casting a decimal to
5201 another class, used in Convert.ExplicitNumericConversion.
5202 (CastToDecimal): New class, similar to above, but casts to
5203 System.Decimal, used in Convert.ImplicitNumericConversion and also
5204 in explicit convesion from double/float to decimal.
5206 * convert.cs (ImplicitNumericConversion): Handle implicit
5207 conversions to System.Decimal.
5208 (ExplicitNumericConversion): handle explicit conversions to
5213 2005-05-20 Miguel de Icaza <miguel@novell.com>
5215 * typemanager.cs: Do not throw an exception in the TypeBuilder
5216 case, we take care of it on the TypeCode.
5218 2005-05-17 Marek Safar <marek.safar@seznam.cz>
5220 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5223 * cs-parser.jay: Catch more lexical errors.
5225 * report.cs: Add one more Error method.
5228 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5230 2005-05-20 Martin Baulig <martin@ximian.com>
5232 * class.cs (TypeContainer.CircularDepException): Removed.
5233 (TypeContainer.DefineType): Removed the `InTransit' stuff.
5234 (TypeContainer.CheckRecursiveDefinition): Check for circular class
5235 (CS0146) and interface (CS0529) dependencies here.
5237 2005-05-20 Martin Baulig <martin@ximian.com>
5239 * expression.cs (New.DoResolve): Move the CS0712 check above the
5240 CS0144 check; otherwise it can never be reached.
5242 2005-05-20 Martin Baulig <martin@ximian.com>
5244 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
5246 2005-05-20 Martin Baulig <martin@ximian.com>
5248 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
5250 * typemanager.cs (TypeManager.IsAttributeType): New public method.
5252 2005-05-19 Martin Baulig <martin@ximian.com>
5255 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5256 to disable error reporting.
5258 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5259 here since we don't want to report an error; see the new test-336.cs.
5261 2005-05-19 Raja R Harinath <rharinath@novell.com>
5263 * statement.cs (ToplevelBlock.GetParameterReference)
5264 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5265 Move here from class Block.
5266 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5267 * expression.cs (ParameterReference.DoResolveBase): Likewise.
5269 2005-05-18 Martin Baulig <martin@ximian.com>
5274 (FlowBranching.Reachability): Add non-static public And() and Or()
5276 (FlowBranchingSwitch): New class; do the `break_origins' thing
5277 like in FlowBranchingLoop.
5278 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5279 reachability, not just locals and parameters.
5280 (FlowBranching.MergeChild): Remove some of the hacks for loop and
5281 switch; MergeBreakOrigins() now takes care of that.
5283 2005-05-18 Martin Baulig <martin@ximian.com>
5285 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5286 a loop and may leave it, reset the barrier; fixes #74974.
5288 2005-05-16 Raja R Harinath <rharinath@novell.com>
5290 Fix test-382.cs. Emit values of decimal constants.
5291 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5293 (TypeContainer.AddField): ... this.
5294 (TypeContainer.EmitFieldInitializers): Allow the list of fields
5295 with initializers to include 'Const's.
5296 (ClassPart.RegisterFieldForInitialization): Forward to
5298 * const.cs (Const.Const): Pass initializer to base class.
5299 (Const.Define): In case of decimal constants, register them for
5300 initialization in a static constructor.
5302 2005-05-14 Martin Baulig <martin@ximian.com>
5304 * statement.cs (Block.Resolve): Correctly handle unreachable code;
5305 do not call ResolveUnreachable() on unreachable statements in
5306 here, see the comment in the source code.
5308 2005-05-13 Raja R Harinath <rharinath@novell.com>
5311 * expression.cs (BinaryResolveOperator): If one of the operands of
5312 an equality comparison is 'null' and the other is a pointer type,
5313 convert the null to a NullPointer.
5314 * convert.cs (ImplicitReferenceConversion): If the expression is a
5315 NullLiteral and the target type is a pointer type, return a
5316 NullPointer instead.
5317 (ImplicitConversionStandard): Likewise.
5319 2005-05-13 Marek Safar <marek.safar@seznam.cz>
5321 * cs-parser.jay: Set readonly context based on special constructs.
5323 * expression.cs (LocalVariableReference.DoResolveBase): Improved
5324 readonly variable error handling.
5326 * rootcontext.cs (EmitCode): Don't verify members when error
5329 * statement.cs (LocalInfo): Add reaodnly context information.
5330 (SetReadOnlyContext, GetReadOnlyContext): New methods.
5332 2005-05-17 Martin Baulig <martin@ximian.com>
5334 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5337 2005-05-13 Martin Baulig <martin@ximian.com>
5339 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
5340 handle unreachable blocks.
5342 2005-05-13 Martin Baulig <martin@ximian.com>
5345 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
5346 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
5349 2005-05-13 Martin Baulig <martin@ximian.com>
5351 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5352 instance variable, not a local. Fix #74873.
5353 (Block.ResolveUnreachable): Set it to true here.
5355 2005-05-12 Martin Baulig <martin@ximian.com>
5357 * cs-parser.jay (property_declaration): Pass the `current_class',
5358 not the `current_container' to Property's .ctor. Fixes #74912.
5360 2005-05-11 Martin Baulig <martin@ximian.com>
5362 * typemanager.cs (Closure): Copy this from MCS and merge all the
5363 GMCS-specific changes into it.
5365 2005-05-12 Raja R Harinath <harinath@gmail.com>
5368 * typemanager.cs (unmanaged_enclosing_types): New.
5369 (IsUnmanagedType): Avoid infloops by using
5370 'unmanaged_enclosing_types' to talk with recursive invocations.
5372 2005-05-11 Duncan Mak <duncan@novell.com>
5374 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5375 continuing to process for 'arg'.
5376 (handle_preprocessing_directive): Check the argument of the #endif
5377 directive and report error CS1025 if there are any trailing
5380 According to the C# spec, having even whitespace after the #endif
5381 directive is illegal; however, because we call arg.TrimEnd ()
5382 beforehand, we have the same behavior as csc, allowing whitespace
5383 after the directive.
5387 2005-05-11 Marek Safar <marek.safar@seznam.cz>
5391 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5392 (Constructor.GetObsoleteAttribute): Implemented correctly.
5394 2005-05-10 Martin Baulig <martin@ximian.com>
5396 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
5397 resolve the type; fixes #74864.
5398 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
5399 in DoResolve(); fixes #74862.
5401 2005-05-10 Martin Baulig <martin@ximian.com>
5403 * support.cs (ReflectionParameters.ParameterModifier): Use
5404 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5405 and `ParameterAttributes.In'. Fixes #74884.
5407 2005-05-10 Martin Baulig <martin@ximian.com>
5409 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
5410 the cache if we're just looking for `MemberTypes.NestedType' in a
5413 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
5414 constraints if we're still resolving the type tree.
5415 (Expression.MemberLookup): If we're resolving the type tree, only
5416 look for `MemberTypes.NestedType' since we're only interested in
5419 * class.cs (TypeContainer.DefineType): Don't resolve the type
5420 parameters here; do this later in ResolveType() after the type
5421 tree has been resolved.
5422 (TypeContainer.ResolveType): New public method; this is called
5423 after the type tree is resolved and before the types are being
5424 populated. We resolve the generic constraints here.
5425 (TypeContainer.DoDefineMember): Check the constraints on our base
5426 class and interfaces.
5428 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
5429 set the `ResolvingTypeTree' flag on the EmitContext.
5431 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
5433 2005-05-10 Marek Safar <marek.safar@seznam.cz>
5435 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5437 * expression.cs (Argument.GetParameterModifier): Turned to property.
5438 (Invocation.Error_InvalidArguments): Add more descriptive errors.
5440 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5443 2005-05-09 Raja R Harinath <rharinath@novell.com>
5446 * decl.cs (MemberCache.AddMethods): Register override methods,
5447 rather than non-override methods.
5448 * typemanager.cs (RegisterOverride): New.
5449 (IsOverride): Update.
5451 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5453 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
5455 2005-05-06 Martin Baulig <martin@ximian.com>
5458 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
5459 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
5461 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5465 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5466 recursive declaration.
5468 * statement.cs (Block.ResolveMeta): Report any error in resolving.
5470 2005-05-06 Marek Safar <marek.safar@seznam.cz>
5472 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5474 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5476 2005-05-05 Raja R Harinath <rharinath@novell.com>
5479 * decl.cs (DeclSpace.FamilyAccessible):
5480 Use TypeManager.IsNestedFamilyAccessible.
5482 Fix reopened #64812.
5483 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5486 2005-05-04 Raja R Harinath <rharinath@novell.com>
5487 Abin Thomas <projectmonokochi@rediffmail.com>
5488 Anoob V E <projectmonokochi@rediffmail.com>
5489 Harilal P R <projectmonokochi@rediffmail.com>
5492 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5493 allow access to all static members.
5495 2005-05-04 Martin Baulig <martin@ximian.com>
5497 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5499 2005-05-04 Martin Baulig <martin@ximian.com>
5503 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5504 section at the end; make things work if `default' is not the last
5507 2005-05-04 Martin Baulig <martin@ximian.com>
5511 * statement.cs (Switch): Replaced the `got_default' field with a
5512 `default_section' one.
5513 (Switch.CheckSwitch): Set `default_section' here.
5514 (Switch.Resolve): If we're a constant switch and the constant is
5515 not found, use the default section.
5517 2005-05-03 Martin Baulig <martin@ximian.com>
5519 * expression.cs (ArrayAccess.EmitGetLength): New public method.
5521 * statement.cs (Foreach.ArrayForeach): New nested class.
5522 (Foreach.TemporaryVariable): New nested class.
5523 (Foreach.EmitArrayForeach): Removed; this is now in the new
5526 2005-05-03 Raja R Harinath <rharinath@novell.com>
5528 * pending.cs (BaseImplements): Move the #74773 fix here. This is
5530 (VerifyPendingMethods): Revert change below.
5532 * typemanager.cs (IsOverride, RegisterNonOverride): New.
5533 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5534 that used to trigger warning -28. Remove warning -28.
5535 * expression.cs (Invocation.OverloadResolve): Use
5536 TypeManager.IsOverride to distinguish override methods.
5539 * pending.cs (VerifyPendingMethods): If a base type implements the
5540 requested interface, don't bother checking individual methods of
5541 the base type. As a side-effect, this prevents the creation of
5542 unnecessary proxies.
5544 2005-05-02 Martin Baulig <martin@ximian.com>
5548 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5549 Also `And' the locals if the old vector is null.
5550 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5551 null; in this case we basically reset all the variables.
5553 2005-05-02 Martin Baulig <martin@ximian.com>
5557 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5558 Added `FlowBranching branching' argument; always `and' the
5559 variables instead of `or'ing them unless we're an infinite loop.
5561 * statement.cs (While.Resolve): Create a new sibling unless we're
5564 2005-05-02 Martin Baulig <martin@ximian.com>
5568 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5569 arguments; use it instead of creating a new TopLevelBlock.
5570 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5571 our ConstructorInitializer.
5574 (TopLevelBlock.TopLevelBranching): New public property.
5575 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5576 and create our `TopLevelBranching'.
5578 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5579 anonymous method host, use `block.TopLevelBranching' rather than
5580 creating a new branching.
5582 2005-04-20 Miguel de Icaza <miguel@novell.com>
5584 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5585 a ScopeInfo, if any of the current children is a child of the new
5586 entry, move those children there.
5588 2005-04-30 Martin Baulig <martin@ximian.com>
5590 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5591 at the beginning of a SwitchSection. Fix #73335.
5593 2005-04-27 Marek Safar <marek.safar@seznam.cz>
5596 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5598 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5599 (FieldExpr.DoResolve): Obsolete members are ignored for field
5602 2005-04-26 Marek Safar <marek.safar@seznam.cz>
5604 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5605 of arrays detection.
5607 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5609 (Field.VerifyClsCompliance): Volatile fields are not compliant.
5611 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5614 2005-04-25 Ben Maurer <bmaurer@ximian.com>
5616 * cs-parser.jay: Use the prefered version of -unsafe in error
5619 2005-04-22 Marek Safar <marek.safar@seznam.cz>
5621 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5624 2005-04-20 John Luke <john.luke@gmail.com>
5626 * driver.cs: fix typo in error message, --outout to --output
5628 2005-04-30 Martin Baulig <martin@ximian.com>
5630 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
5631 handle the .NET 2.x security attributes.
5633 2005-04-30 Martin Baulig <martin@ximian.com>
5636 (TypeManager.ExpandInterfaces): Don't add things twice.
5639 (TypeContainer.VerifyClsCompliance): Allow generic instances.
5641 2005-04-29 Martin Baulig <martin@ximian.com>
5643 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
5645 * anonymous.cs: Added support for anonymous generic methods.
5647 2005-04-29 Martin Baulig <martin@ximian.com>
5649 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
5652 2005-04-29 Martin Baulig <martin@ximian.com>
5654 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
5656 * expression.cs (New.DoResolve): Fix the CS0304 check.
5658 2005-04-29 Martin Baulig <martin@ximian.com>
5660 * typemanager.cs (TypeManager.GetFullName): Updated to the new
5663 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
5664 explicit interface implementation, compare the interface types.
5665 (MethodData.Define): Use the new naming scheme from the latest
5667 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
5669 * decl.cs (MemberName.GetMemberName): Removed.
5670 (MemberName.MethodName, FullName): New properties.
5672 2005-04-25 Raja R Harinath <rharinath@novell.com>
5674 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
5676 2005-04-22 Martin Baulig <martin@ximian.com>
5678 * generic.cs (GenericMethod): Create the EmitContext in the
5679 `Define()'; in `Define(MethodBuilder)', create the type parameters
5680 before calling `Define()'. Fixes #73933.
5682 2005-04-22 Martin Baulig <martin@ximian.com>
5685 (Constraints.Resolve): Make things work wrt. the new type lookup system.
5686 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
5688 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
5689 ConstructedType, check its constraints.
5691 2005-04-20 Marek Safar <marek.safar@seznam.cz>
5693 * codegen.cs (InRefOutArgumentResolving): New field.
5695 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5696 fields outside contructor.
5698 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5700 2005-04-19 Miguel de Icaza <miguel@novell.com>
5702 * anonymous.cs (CaptureContext.EmitParameterInstance): The
5703 parameter code was not completed ever, so it was not as up-to-date
5704 as local variables. Must finish it.
5706 The bug fix was to compare the Toplevel of the block, not the
5707 current block. Thanks for Ben for pointing this out.
5709 2005-04-19 Raja R Harinath <rharinath@novell.com>
5711 * decl.cs (AddMethods): Use the declaring type of the problem
5712 method to determine if we want to squash a warning.
5714 2005-04-19 Marek Safar <marek.safar@seznam.cz>
5716 * attribute.cs: Removed debug output.
5718 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5720 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5723 2005-04-18 Raja R Harinath <rharinath@novell.com>
5726 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5727 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5728 all null comparisons against reference types.
5730 2005-04-18 Marek Safar <marek.safar@seznam.cz>
5733 * class.cs (TypeContainer.CircularDepException) New nested
5735 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5736 (TypeContainer.DefineType): Removed error, reset InTransit before
5738 (Class.DefineType): Throw exception when is in Transit.
5739 Catch exception and report error.
5740 (Struct.DefineType): Throw exception when is in Transit.
5741 Catch exception and report error.
5742 (Interface.DefineType): Throw exception when is in Transit.
5743 Catch exception and report error.
5745 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5746 handle nested exception handlers.
5748 * flowanalysis.cs (InTryWithCatch): New method, search for try with
5751 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5752 InFinally and InCatch storage.
5754 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5755 (Catch.Resolve): Set and Restore ec.InCatch.
5756 (Try.Resolve): Set and Restore ec.InFinally.
5757 (Try.HasCatch): True when try has catch.
5759 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
5761 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5762 for the same event member, so exclude such cases from warning 419.
5765 2005-04-16 Miguel de Icaza <miguel@novell.com>
5767 * expression.cs (Binary.ResolveOperator): Apply patch from John
5768 Luke to fix bug 59864: operators &, | and ^ on enumerations
5769 require that the same enum type on both sides.
5771 * driver.cs: Add warnings to old flag usage, this is to assist
5772 people who produce Makefiles and hope that the Makefiles will be
5775 * class.cs (TypeContainer.EmitType): Moved the definition of the
5776 special $PRIVATE$ field from the resolve phase to the Emit phase.
5777 During resolve we do not know if we are a struct with
5778 HasExplicitLayout, we know this only after the attributes for the
5781 Set the FieldOffset to zero on the dummy field that we create for
5782 the class. Fixes 74590.
5784 2005-04-16 Raja R Harinath <rharinath@novell.com>
5787 * ecore.cs (PropertyExpr.resolved): New.
5788 (DoResolve): Use it to handle a case of double resolution here.
5789 Handle a case of identical-name-and-type-name.
5790 * expression.cs (ArrayCreation.CheckIndices): Avoid double
5791 resolution by storing the results of expression resolution back
5792 into the "probes" array.
5794 2005-04-15 Raja R Harinath <rharinath@novell.com>
5796 Fix cs0208-7.cs and cs0208-8.cs.
5797 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5798 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
5799 error reporting to point out the reason a struct is not unmanaged.
5801 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5803 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
5804 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5806 2005-04-13 Raja R Harinath <rharinath@novell.com>
5809 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5810 IdenticalNameAndTypeName here.
5811 (EventExpr.InstanceResolve): Likewise.
5813 2005-04-13 Marek Safar <marek.safar@seznam.cz>
5815 C# 2.0 DefaultCharSetAttribute implementation
5817 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5818 which allows us to set GlobalNamespace for every resolve.
5819 (Attribute.ResolveArguments): Cut from Resolve.
5820 (Attribute.GetCharSetValue): Returns CharSet named argument.
5821 (Attribute.DefinePInvokeMethod): Gets default charset from
5823 (GlobalAttribute.ResolveAsTypeStep): Override.
5824 (GlobalAttribute.ResolveArguments): Override.
5826 * class.cs (TypeAttr): Is protected.
5828 * codegen.cs (ModuleClass.DefaultCharSet): New member.
5829 (ModuleClass.DefaultCharSetType): New memeber.
5830 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5832 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5833 charset from module.
5835 * delegate.cs (TypeAttr): Override.
5836 (Delegate.DefineType): Use this TypeAttr.
5838 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5839 at very early stage (before types are defined) to resolve model
5840 module attributes. It will probably not work with corlib but it
5843 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5844 charset from module.
5846 * typemanager.cs (default_charset_type): New type.
5848 2005-04-13 Raja R Harinath <rharinath@novell.com>
5850 * decl.cs (MemberCache.AddMethods): Don't warn if
5851 System.Object.Finalize has buggy MethodAttributes.
5853 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5856 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5858 * doc.cs : detect ambiguous reference to overloaded members.
5859 Fixed bug #71603. MS 1.1 csc does not detect it.
5861 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5863 * doc.cs : delegates must not be referenced with parameters.
5866 2005-04-12 Miguel de Icaza <miguel@novell.com>
5868 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5870 2005-04-10 Miguel de Icaza <miguel@novell.com>
5872 * driver.cs (MainDriver): Stop processing if the CLS stage found
5875 (CompilerCallableEntryPoint.InvokeCompiler): Always
5876 reset after execution; Take a TextWriter argument for the
5879 * report.cs: Use the error stream instead of hardcoding stderr.
5881 2005-04-09 Miguel de Icaza <miguel@novell.com>
5883 * class.cs: Reduce code paths to test, too small of an
5884 optimization to make it worth the extra testing. Always perform
5887 2005-04-08 Raja R Harinath <rharinath@novell.com>
5890 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5891 operators that had errors reported on them.
5893 2005-04-08 Marek Safar <marek.safar@seznam.cz>
5895 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5897 (Attribute.Resolve): Add named argument type checking.
5899 * class.cs (FixedField.Define): Use IsPrimitiveType
5901 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5903 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5904 unsafe parameter types.
5906 * statement.cs (Using.ResolveExpression): Add better error description.
5908 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5910 2005-04-08 Raja R Harinath <rharinath@novell.com>
5913 * attribute.cs (Attribute.GetAttributeUsage): Resolve
5914 AttributeUsageAttribute in the emitcontext of the attribute class,
5915 not in the emitcontext of the attributable entity it was attached to.
5916 * cs-parser.jay: Use 'current_class', not 'current_container',
5917 when creating a GlobalAttribute.
5919 2005-04-08 Alp Toker <alp@atoker.com>
5921 * pending.cs: The fix to #58413 failed to compile methods implementing
5922 interfaces with/without params modifiers and vice versa, even though
5923 params modifiers aren't part of the signature. Make the modifier check
5924 less strict as in csc.
5926 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
5927 Anoob V E <projectmonokochi@rediffmail.com>
5928 Harilal P R <projectmonokochi@rediffmail.com>
5931 * pending.cs (TypeAndMethods.mods): New. Store the parameter
5932 modifiers of pending methods.
5933 (PendingImplementation.PendingImplementation): Initialize it.
5934 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5935 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5936 with ParameterData. Add check for modifiers.
5937 * class.cs (MethodData.Define): Update to changes.
5939 2005-04-07 Raja R Harinath <rharinath@novell.com>
5941 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5943 2005-04-07 Marek Safar <marek.safar@seznam.cz>
5945 * class.cs (PropertyMethod.Define): Check private accessor in abstract
5948 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5951 * typemanager.cs: Registered RequiredAttributeAttribute.
5953 2005-04-06 Marek Safar <marek.safar@seznam.cz>
5955 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5956 Warning CS0169 is back at level 3.
5957 (IMethodData.SetMemberIsUsed): New method.
5959 * decl.cs (IsUsed): New value; moved from FieldBase.Status
5960 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5962 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5964 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5966 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5969 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5972 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5973 to avoid the problems with nested types.
5975 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
5976 Anoob V.E <projectmonokochi@rediffmail.com>
5977 Harilal P.R <projectmonokochi@rediffmail.com>
5978 Raja R Harinath <rharinath@novell.com>
5981 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5983 * typemanager (GetConstructor): Make public.
5985 2005-04-05 John Luke <john.luke@gmail.com>
5986 Raja R Harinath <rharinath@novell.com>
5989 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5990 struct too. Return false quicker in a few cases.
5991 (VerifyUnManaged): Use it.
5993 2005-04-05 Raja R Harinath <rharinath@novell.com>
5996 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5997 not 'unreachable_seen'.
5999 2005-04-04 Marek Safar <marek.safar@seznam.cz>
6001 * attribute.cs (Attribute.GetValue): Removed unused.
6003 * codegen.cs (CodeGen.TrimExt): Removed unused.
6005 * cs-parser.jay (output): Removed unused.
6007 * cs-tokenizer.cs (hex_digits): Removed unused.
6009 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
6011 * expression.cs (Indirection.LoadExprValue): Removed unused.
6012 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
6014 * iterators.cs (Iterator.param_types): Removed unused.
6016 * statement.cs (Goto.block): Removed unused.
6017 (ToplevelBlock.did): Removed unused.
6018 (Switch.ResolveConstantSwitch): Removed unused.
6020 2005-04-01 Ben Maurer <bmaurer@ximian.com>
6022 * rootcontext.cs: Allow mcs to bootstrap with the compilation
6025 2005-04-19 Martin Baulig <martin@ximian.com>
6027 Merged r42462 from MCS and made it work for GMCS.
6029 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
6031 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
6033 2005-04-01 Raja R Harinath <rharinath@novell.com>
6035 Fix #74232 and cs0208-3.cs.
6036 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
6037 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
6038 unmanaged type. Don't use FieldBuilders when 't' is a
6039 TypeBuilder. Use ModFlags and MemberType fields.
6040 * class.cs (MemberBase.member_type): Rename from MemberType.
6041 (MemberBase.MemberType): New property. Determines member_type on
6043 (MemberBase.DoDefine): Don't initialize MemberType here.
6044 (FieldMember.Define): Likewise.
6046 2005-04-01 Marek Safar <marek.safar@seznam.cz>
6049 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
6050 Attributes are emitted there.
6052 2005-04-01 Raja R Harinath <rharinath@novell.com>
6054 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
6055 keyword in 'partial enum' too.
6056 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
6058 Report from Kamil Skalski <nazgul@omega.pl>.
6061 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
6062 have partial containers too.
6064 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
6065 in block' checks to Block.CheckInvariantMeaningInBlock.
6066 * statement.cs (Block.GetKnownVariableInfo): Make private.
6067 (Block.IsVariableUsedInChildBlock): Remove.
6068 (Block.IsVariableUsedInBlock): Likewise.
6069 (Block.CheckInvariantMeaningInBlock): New. Show location of
6070 conflicting declaration.
6071 (Block.AddVariable): Make error messages less long-winded and more
6072 specific. Show location of conflicting declaration.
6073 * parameter.cs (Parameters.Location): New readonly property.
6075 2005-03-31 Raja R Harinath <rharinath@novell.com>
6077 Clean up semantics of invoking ResolveMemberAccess.
6078 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
6079 can have an instance, ensure that we pass in a non-TypeExpression
6080 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
6081 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
6082 argument. Update to changes and simplify.
6083 (FieldExpr.Emitinstance): Remove CS0120 check.
6084 (PropertyExpr.EmitInstance): Likewise.
6085 * expression.cs (Argument.Resolve): Likewise.
6086 (Invocation.DoResolve): Update to changes in semantics of
6089 2005-03-31 Marek Safar <marek.safar@seznam.cz>
6092 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
6095 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
6097 2005-03-31 Raja R Harinath <rharinath@novell.com>
6099 Fix difference in behaviour with commandline invocation.
6100 * driver.cs (Driver.Reset): New.
6101 (CompilerCallableEntryPoint): Call it.
6103 * statement.cs (If.Resolve): Avoid spurious "uninitialized
6104 variable" warnings if the boolean expression failed to resolve.
6106 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
6108 * attribute.cs: Fix the union of several permissions when some of them
6109 are unrestricted (so the result isn't an unrestricted permission set).
6112 2005-03-30 Raja R Harinath <rharinath@novell.com>
6114 * ecore.cs (MemberExpr): New class. Convert from interface
6116 (MemberExpr.ResolveMemberAccess): Refactor and move here from
6117 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
6119 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
6120 (MethodGroupExpr.IsExplicitImpl): Remove.
6121 (Expression.GetFieldFromEvent): Remove.
6122 (SimpleName.MemberStaticCheck): Remove.
6123 (SimpleName.DoSimpleNameResolve): Update to changes.
6124 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
6125 (MemberAccess.IdenticalNameAndTypeName): Remove.
6126 (MemberAccess.error176): Move to MemberExpr.
6127 (MemberAccess.DoResolve): Update to changes.
6128 (BaseAccess.DoResolve): Likewise.
6130 2005-03-30 Marek Safar <marek.safar@seznam.cz>
6132 C# 2.0 Conditional attribute class implementation
6134 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
6135 Analyzes class whether it has attribute which has ConditionalAttribute
6136 and its condition is not defined.
6138 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
6139 (Class.IsExcluded): New method. Search for at least one defined
6140 condition in ConditionalAttribute of attribute class.
6142 2005-03-30 Raja R Harinath <rharinath@novell.com>
6144 * ecore.cs (PropertyExpr): Derive from Expression, not
6145 ExpressionStatement.
6146 (PropertyExpr.EmitStatement): Remove.
6148 2005-03-29 Raja R Harinath <rharinath@novell.com>
6151 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
6152 internal field "value__" of an enum be private. The examples for
6153 "value__" that I found on MSDN all used FieldAttributes.Private.
6155 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
6156 Don't mention IL method attribute names.
6158 Fix #47991. Remove a TODO.
6159 * statement.cs (Block.Toplevel): Make into a field.
6160 (Block.Parameters): Move into ToplevelBlock.
6161 (Block.known_variables): Rename from child_variable_names.
6162 (Block.Block): Remove variants that take Parameters. Initialize
6163 'Toplevel' with the immediately surrounding toplevel block.
6164 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
6165 LocalInfo parameter.
6166 (Block.GetKnownVariableInfo): New.
6167 (Block.IsVariableNameUsedInChildBlock): Update.
6168 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
6169 the block, even though it may not be in scope.
6170 (Block.AddVariable): Remove Parameters parameter. Use
6171 Toplevel.Parameters instead.
6172 (Block.AddConstant): Remove Parameters parameter.
6173 (Block.GetParameterReference): Update to use Toplevel.Parameters.
6174 (Block.IsParamaterReference): Likewise.
6175 (Block.IsLocalParameter): Likewise. Simplify a lot.
6176 (ToplevelBlock.Parameters): New. Moved from Block.
6177 (ToplevelBlock.ToplevelBlock): Update to changes. Always
6178 initialize Parameters to a non-null value.
6179 * cs-parser.jay: Update to changes.
6180 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
6181 simple names that mean different things in the same block. Use
6182 Block.IsVariableNameUsedInBlock.
6184 2005-03-28 Raja R Harinath <rharinath@novell.com>
6186 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
6188 2005-03-26 Raja R Harinath <harinath@acm.org>
6191 * assign.cs (Assign.DoResolve): When the RHS of an assignment
6192 fails to resolve, ensure that the LHS is still resolved as an
6195 2005-03-25 Raja R Harinath <harinath@acm.org>
6197 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6199 (Enum.current_ec): Remove.
6200 (Enum.LookupEnumValue): Remove EmitContext argument.
6201 Just uses the one created during DefineType.
6202 (Enum.FindMembers): Update.
6203 * expression.cs (MemberAccess.DoResolve): Update.
6205 2005-03-22 Marek Safar <marek.safar@seznam.cz>
6207 * assign.cs (Assign.DoResolve): Check for CS1717 when
6208 source and target are same (uses Equals).
6210 * expression.cs (LocalVariableReference, ParameterReference,
6211 This): Implemented Equals, GetHashCode.
6213 * statement.cs (Block.GetParameterReference): Removed useless
6216 2005-03-22 Raja R Harinath <rharinath@novell.com>
6219 * statement.cs (Block.AddVariable): Ensure that we skip implicit
6220 blocks before deciding whether the error is cs0136 or cs0128.
6222 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6223 (using_alias_directive, using_namespace_directive): Pass
6224 MemberName, not an expression to Namespace.UsingAlias and
6226 (MakeName): Use the MemberName of the namespace.
6227 * namespace.cs (Namespace.MemberName): New.
6228 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6229 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6231 * decl.cs (MemberName.Name): Make readonly.
6232 (MemberName.FromDotted): New "constructor".
6233 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6234 (MemberCore.Name): Compute from MemberName on demand.
6235 (MemberCore.SetMemberName): Provide a way to change the
6237 (MemberCore.AddToContainer): Don't take a fullname parameter.
6238 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6239 fully qualified name of the container to the member name.
6240 (TypeContainer.AddToTypeContainer): Use a fully qualified name
6241 only if the type is a member of the root container.
6242 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6243 MemberName.Left rather than searching for an embedded ".".
6244 (PartialContainer.CreatePart): Update to changes in RootContext.
6245 (MemberBase.ShortName): Turn into a property. Use
6246 MemberCore.SetMemberName.
6247 (MemberBase.ExplicitInterfaceName): Remove.
6248 (MemberBase.UpdateMemberName): Remove.
6249 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6250 (PropertyBase.SetMemberName): New override.
6251 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6252 (Tree.GetDecl): New.
6253 (Tree.AllDecls): Rename from Decls.
6254 * attribute.cs, enum.cs, report.cs: Update to changes.
6255 * driver.cs (MainDriver): Use MemberName.FromDotted on
6256 RootContext.MainClass.
6258 2005-03-21 Marek Safar <marek.safar@seznam.cz>
6260 * class.cs (FixedField.Define): Check for CS1664 and more sanity
6263 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6265 2005-03-18 Marek Safar <marek.safar@seznam.cz>
6267 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6268 property accessor modifiers.
6270 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6271 fixed buffer attribute (CS1716).
6272 (PropertyMethod.HasCustomAccessModifier): When property accessor
6273 has custom modifier.
6275 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6277 (PropertyExpr.DoResolveLValue): Add CS0272.
6279 2005-03-17 Miguel de Icaza <miguel@novell.com>
6281 * convert.cs: When converting to a pointer, use the proper Conv.U
6282 or Conv.I depending on the source data type.
6284 * cs-tokenizer.cs: Make the size for large decimal constants,
6287 2005-03-17 Martin Baulig <martin@ximian.com>
6289 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6290 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
6292 2005-03-17 Martin Baulig <martin@ximian.com>
6294 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6295 to bool so we can return an error condition.
6296 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6299 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
6301 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6304 2005-03-16 Raja R Harinath <rharinath@novell.com>
6306 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6307 Refactor to avoid traversing the list of assemblies, and to avoid
6308 string concatenation.
6309 * typemanager.cs (guid_attr_type): Remove.
6310 (negative_hits, pointers, references): Remove hashes.
6312 (GetConstructedType): New. Uses type_hash to handle constructed
6313 types (arrays, references, pointers).
6314 (GetReferenceType, GetPointerType): Use it.
6315 (GetNestedType): New. Uses type_hash to handle nested types of
6317 (LookupType, LookupTypeDirect): Remove.
6318 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
6319 'types' hash and LookupTypeReflection directly.
6320 (params_string, params_object): Use GetConstructedType.
6321 * namespace.cs (Namespace.cached_types): New. Cache of reflected
6323 (Namespace.Lookup): Use cached_types.
6324 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6325 provided by old TypeManager.LookupType.
6326 * rootcontext.cs (MakeFQN): Remove.
6327 * decl.cs (DeclSpace.MakeFQN): Likewise.
6328 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6329 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6330 TypeManager.GetConstructedType.
6331 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6333 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
6335 * cs-parser.jay: Fix build.
6337 2005-03-15 Marek Safar <marek.safar@seznam.cz>
6339 * class.cs (TypeContainer.CircularDepException) New nested
6340 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
6342 * cs-parser.jay: Reports CS1527 for any namespace element.
6344 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6347 * expression.cs (ParameterReference.IsAssigned): Changed error to
6349 (Error_WrongNumArguments): Moved CS0245 detection here.
6351 * statement.cs (Return.Resolve): Add CS1622 report.
6353 2005-03-11 Marek Safar <marek.safar@seznam.cz>
6355 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6357 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
6359 * attribute.cs expression.cs: Get rid of some allocations.
6361 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
6363 * doc.cs : just eliminate the latest change.
6365 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6367 * doc.cs : commented out the latest change. It breaks xml-030.cs
6369 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6371 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6372 fail. So invoke CreateType() in FindDocumentedType().
6374 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6376 * cs-tokenizer.cs : added IsKeyword().
6377 * doc.cs : Detect keyword incorrectly used as identifier.
6378 Allow identifiers prefixed by @.
6380 2005-03-10 Marek Safar <marek.safar@seznam.cz>
6382 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6383 It caused exception in namespace resolving (again!).
6385 * class.cs (Class.ctor): Removed exit.
6386 (PropertyMethod.ctor): ditto.
6388 * codegen.cs (Codegen.Reset): Reset static data.
6389 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6391 * cs-tokenizer.cs (Cleanup): Removed.
6393 * driver.cs (GetSystemDir): Rewrote to one line command.
6394 It caused problem with unloaded dynamic modules.
6395 (UnixParseOption): Removed Exit.
6396 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6397 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6398 Now can be mcs used as library.
6400 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6403 * location.cs (Reset): Reset static data.
6405 * namespace.cs (Reset): Reset static data.
6407 * report.cs (Report.Reset): Reset static data.
6409 * rootcontext.cs (RootContext.Reset): Reset static data.
6411 * tree.cs (RootTypes.ctor): Use Location.Null
6413 * typemanager.cs (TypeManager.Reset): Reset static data.
6414 (CoreLookupType): Removed Exit.
6415 (TypeHandle.Reset): Reset static data.
6417 2005-03-10 Raja R Harinath <rharinath@novell.com>
6420 * typemanager.cs (ComputeNamespaces): Import namespaces from
6421 referenced modules too.
6423 2005-03-09 Raja R Harinath <rharinath@novell.com>
6425 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6428 2005-03-09 Raja R Harinath <rharinath@novell.com>
6430 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6431 enclosing DeclSpace. This ensures that a name-lookup populates
6432 more caches and there are fewer 'TypeExpression's. Carve out
6433 nested type lookup into ...
6434 (LookupNestedTypeInHierarchy): ... this.
6436 2005-04-15 Martin Baulig <martin@ximian.com>
6438 Merged r41590 from MCS and make it work in the generics land.
6440 * generic.cs (TypeParameter.UpdateConstraints): Removed the
6443 * class.cs (PartialContainer.UpdateConstraints): Removed.
6444 (PartialContainer.CheckConstraints): Removed.
6445 (PartialContainer.SetParameterInfo): Store the constraints here.
6446 (PartialContainer.DefineTypeParameters): New public method;
6447 resolve the type parameter's constraints here. Note that the
6448 PartialContainer doesn't have an EmitContext anymore, so we must
6449 do this in the ClassPart.
6451 2005-03-09 Raja R Harinath <rharinath@novell.com>
6453 Clean up a few partial-class semantics.
6454 Fixes test-357.cs and cs1618-2.cs.
6455 * cs-parser.jay (struct_declaration): Use 'current_class' as
6456 parent of newly-created struct. Remove call to Register ().
6457 Use 'pop_current_class' to complete handing the current struct.
6458 (interface_declaration): Likewise.
6459 (class_declaration): Likewise.
6460 (enum_declaration): Use 'current_class' as parent of newly created
6462 (delegate_declaration): Likewise.
6463 (pop_current_class): New function. This is used to handle closing
6464 up the 'current_class' and 'current_container', and pointing them
6465 to the enclosing class/container.
6466 (CSharpParser): Initialize 'current_class' too.
6467 * decl.cs (MemberCore): Add check for invariant: a partial
6468 container is not a parsed entity, and thus does not enclose any
6470 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6471 (DeclSpace.BaseTypeExpr): Use it.
6472 (DeclSpace.LookupType): Add check for invariant.
6473 * class.cs (TypeContainer): Add check for invariant: a nested
6474 class should have the same NamespaceEntry as its enclosing class.
6475 (TypeContainer.EmitFieldInitializers): Make virtual.
6476 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6478 (TypeContainer.Register): Remove.
6479 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6480 null. Use TypeResolveEmitContext for resolving base types and
6481 interfaces. Move initialization of Parts.TypeBuilder here from
6483 (TypeContainer.DefineNestedTypes): ... here.
6484 (PartialContainer): Take a Namespace not a NamespaceEntry.
6485 (PartialContainer.Create): Don't use Register. Call the
6486 appropriate Add... function directly.
6487 (ClassPart): Take both the PartialContainer and the enclosing
6488 class as constructor arguments.
6489 (ClassPart.EmitFieldInitializers): Override.
6490 (ClassPart.PartFindNestedTypes): Remove.
6491 (FieldBase.GetInitializerExpression): Resolve the initializer
6492 expression in the emit context of the enclosing class.
6493 * tree.cs (RootTypes): Remove Register ().
6495 2005-03-08 Marek Safar <marek.safar@seznam.cz>
6497 * cs-parser.jay: Removed CS0134.
6499 * driver.cs: Removed CS1901.
6501 * expression.cs (SizeOf.DoResolve): Don't report CS0233
6502 for predefined types.
6504 2005-03-07 Duncan Mak <duncan@novell.com>
6506 * codegen.cs (Save): Catch UnauthorizedAccessException as
6507 well. Fixes bug #73454.
6509 2005-03-07 Marek Safar <marek.safar@seznam.cz>
6511 * cs-tokenizer.cs (xtoken): Add CS1035.
6513 * class.cs (MethodData.Define): Add CS0683.
6514 (FieldMember.ctor): Add CS0681.
6516 2005-03-07 Raja R Harinath <rharinath@novell.com>
6518 * ecore.cs (SimpleName.DoResolve): Rename from
6519 SimpleName.DoResolveAllowStatic.
6520 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6521 Pass 'intermediate' flag to MemberStaticCheck.
6522 (SimpleName.MemberStaticCheck): Skip "static check" only in case
6523 of "intermediate" lookups via MemberAccess.
6524 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
6525 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6527 2005-03-07 Raja R Harinath <rharinath@novell.com>
6530 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6531 slipped in because of variable names that are identical to a
6532 builtin type's BCL equivalent ('string String;', 'int Int32;').
6533 (PropertyExpr.EmitInstance): Likewise.
6535 2005-03-04 Marek Safar <marek.safar@seznam.cz>
6537 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6539 * report.cs (warning_ignore_table): Made public.
6541 2005-03-04 Raja R Harinath <rharinath@novell.com>
6544 * class.cs (MethodData.Emit): Pass 'container' to
6545 container.GetObsoleteAttribute instead of 'container.Parent'.
6547 2005-03-03 Marek Safar <marek.safar@seznam.cz>
6549 * cs-parser.jay: Add 1534 error test.
6551 * iterators.cs (Yield.CheckContext): Add error 1629.
6552 (Iterator.ctor): Save unsafe modifier.
6553 (MoveNextMethod.DoEmit): Restore unsafe context.
6555 * namespace.cs (UsingAlias): Better error message.
6557 2005-03-03 Dan Winship <danw@novell.com>
6559 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6560 the warning message [#73219]
6562 2005-03-03 Raja R Harinath <rharinath@novell.com>
6564 Fix compile with MCS 1.0.0.0.
6565 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6566 w_restore to not depend on string constant folding.
6568 2005-03-03 Raja R Harinath <rharinath@novell.com>
6570 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
6571 CS0246 check to users who passed 'silent = false'.
6572 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6574 (SimpleName.SimpleNameResolve): Update.
6575 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6576 (MemberAccess.IdenticalNameAndTypeName): Update.
6577 * doc.cs (FindDocumentedTypeNonArray): Update.
6579 2005-03-03 Raja R Harinath <rharinath@novell.com>
6581 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6582 * parameters.cs (ComputeAndDefineParameters): Remove.
6583 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6584 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6585 Use GetParameterInfo.
6587 2005-03-02 Marek Safar <marek.safar@seznam.cz>
6589 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6591 2005-03-02 Raja R Harinath <rharinath@novell.com>
6593 Unify DeclSpace.LookupType and DeclSpace.FindType.
6594 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
6595 is in charge of defining nested types on demand.
6596 (DeclSpace.LookupType): Use it when the current_type is a
6597 TypeBuilder. Use LookupTypeDirect for reflected types.
6598 (DeclSpace.FindType): Remove.
6599 (DeclSpace.LookupInterfaceOrClass): Likewise.
6600 (DeclSpace.DefineTypeAndParents): Likewise.
6601 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6602 DeclSpace.LookupType.
6603 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6604 * typemanager.cs (LookupType): Simplify.
6605 (AddUserType): Remove type from negative_hits.
6606 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6607 * class.cs (TypeContainer.FindMembers): Move handling of nested
6609 (TypeContainer.FindMembers_NestedTypes): ... here.
6610 (TypeContainer.FindNestedType): Implement override.
6611 (ClassPart.FindNestedType): Delegate to PartialContainer.
6612 (ClassPart.PartFindNestedType): Looks up the nested types of the
6615 2005-04-14 Martin Baulig <martin@ximian.com>
6617 * generic.cs (ConstructedType): Moved all the type lookup and
6618 nested class logic into SimpleName.
6619 (ConstructedType.ResolveConstructedType): Our underlying type is
6620 already fully resolved; all the type lookup stuff is in
6623 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
6624 constructed types here instead of in ConstructedType.
6626 * decl.cs (MemberName.GetTypeExpression): Always create a
6627 SimpleName, not a ConstructedType.
6628 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
6630 2005-03-02 Martin Baulig <martin@ximian.com>
6632 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6633 static constructor in static classes.
6635 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
6637 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6638 sizeParamIndex is not specified.
6640 2005-03-01 Marek Safar <marek.safar@seznam.cz>
6643 * report.cs (WarningMessage.IsEnabled): Missing null check.
6645 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6647 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6648 in the fields and not in the properties.
6650 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
6652 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
6655 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6657 * attribute.cs: Small refactoring (improved robustness).
6658 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6659 (ValidateGuid): Removed.
6660 (Resolve): Removed referenced to above mentioned.
6661 (GetAttributeUsage): Made private and changed to work without
6663 (GetIndexerAttributeValue): Don't crash.
6664 (GetConditionalAttributeValue): Ditto.
6665 (GetClsCompliantAttributeValue): Ditto.
6666 (ExtractSecurityPermissionSet): All attributes exceptions are
6668 (GetPropertyValue): New helper.
6669 (GetMethodImplOptions): New method.
6670 (DefinePInvokeMethod): Reuse common code. Implemented handling of
6671 some missing properties.
6673 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6674 (Method.ApplyAttributeBuilder): Updated.
6676 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6679 2005-02-28 Raja R Harinath <rharinath@novell.com>
6682 * report.cs (Report.SymbolRelatedToPreviousError): Handle
6683 non-simple types (array, pointer, reference).
6685 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6687 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6689 * class.cs (MethodCore.IsDuplicateImplementation): Special error
6691 (Method.CheckBase): Catch wrong destructor here.
6692 (MethodData.Define): Add errors 550, 668.
6694 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6696 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6698 * pending.cs (VerifyPendingMethods): Add error 551.
6700 * typemanager.cs (CSharpName): Next error report helper.
6702 2005-02-25 Marek Safar <marek.safar@seznam.cz>
6704 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6705 attributes. Removed useless attribute double check.
6706 It saves almost 2MBs for corlib.
6708 2005-02-25 Raja R Harinath <rharinath@novell.com>
6711 * statement.cs (ExpressionStatement.Resolve): Make robust to being
6712 called twice in case of error.
6714 2005-02-23 Chris Toshok <toshok@ximian.com>
6716 Fix compiler portions of #72827.
6717 * statement.cs (Block.Emit): call Begin/EndScope on the
6718 EmitContext instead of the ILGenerator.
6720 * codegen.cs (EmitContext.BeginScope): new method, call
6721 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6723 (EmitContext.BeginScope): same, but EndScope and CloseScope
6725 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6726 offset and call the superclass's OpenScope(int) with it.
6727 (SymbolWriter.CloseScope): get the current il
6728 offset and call superclass's CloseScope(int) with it.
6730 2005-02-23 Marek Safar <marek.safar@seznam.cz>
6732 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6733 CS1677 for out and ref as well.
6735 * class.cs (Method.Define): Add error CS1599 detection.
6737 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6739 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6741 * delegate.cs (Delegate.Define): Add error CS1599 detection.
6743 * support.cs.cs (ModifierDesc): New helper method.
6745 2005-02-23 Raja R Harinath <rharinath@novell.com>
6746 Abin Thomas <projectmonokochi@rediffmail.com>
6747 Anoob V E <projectmonokochi@rediffmail.com>
6748 Harilal P R <projectmonokochi@rediffmail.com>
6751 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6752 MemberLookup (used for error reporting) actually returns a result.
6753 Fix error report number (122, not 112).
6755 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
6756 Anoob V E <projectmonokochi@rediffmail.com>
6757 Harilal P R <projectmonokochi@rediffmail.com>
6760 * pending.cs (PendingImplementation.GetAbstractMethods):
6761 Find NonPublic members too.
6763 2005-02-22 Marek Safar <marek.safar@seznam.cz>
6765 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6768 * class.cs (MethodCore.CheckMethodAgainstBase):
6769 Add error 239 report.
6771 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6773 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6775 * class.cs (Operator.Define): Add error 217 report.
6777 2005-02-21 Raja R Harinath <rharinath@novell.com>
6780 * expression.cs (Invocation.IsApplicable): Make public.
6781 (Invocation.IsParamsMethodApplicable): Likewise.
6782 * delegate.cs (Delegate.VerifyApplicability): Don't use
6783 Invocation.VerifyArgumentCompat for parameter applicability
6784 testing. Use Invocation.IsApplicable and
6785 Invocation.IsParamsMethodApplicable.
6787 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6789 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6791 * class.cs (Operator.Define): Add error 217 report.
6793 2005-02-21 Raja R Harinath <rharinath@novell.com>
6795 * namespace.cs (UsingEntry.Resolve): Undo change below.
6797 2005-02-21 Raja R Harinath <rharinath@novell.com>
6800 * ecore.cs (Expression.MemberLookupFailed): Add argument to
6801 disable the error message when the extended MemberLookup also
6803 (Expression.MemberLookupFinal): Update.
6804 (SimpleName.DoSimpleNameResolve): Update.
6805 * expression.cs (MemberAccess.ResolveNamespaceOrType):
6806 Don't use MemberLookupFinal.
6807 (New.DoResolve): Update.
6808 (BaseAccess.CommonResolve): Update.
6810 2005-02-21 Raja R Harinath <rharinath@novell.com>
6813 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6814 occured previously, don't resolve again.
6816 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6819 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6820 argument. Call ResolveAttributeUsage for unresolved.
6821 when types doesn't match ctor arguments.
6823 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6824 for nested attribute classes.
6825 (Class.attribute_usage): Removed.
6826 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6827 for attribute class.
6829 * ecore.cs (IsAttribute): Removed.
6831 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6833 * rootcontext.cs (RegisterAttribute): Removed, attributes are
6835 (attribute_types): Removed.
6836 (EmitCode): Global attributes are emited as the latest.
6838 2005-02-18 Marek Safar <marek.safar@seznam.cz>
6840 * class.cs (EmitFieldInitializers): Don't emit field initializer
6841 for default values when optimilization is on.
6843 * constant.cs (Constant.IsDefaultValue): New property.
6845 * driver.cs: Add /optimize handling.
6849 * literal.cs: Implement new IsDefaultValue property.
6851 * rootcontext.cs (Optimize): New field, holds /optimize option.
6853 2005-02-18 Raja R Harinath <rharinath@novell.com>
6855 Fix crasher in re-opened #72347.
6856 * namespace.cs (Namespace.Lookup): Return null if
6857 DeclSpace.DefineType returns null.
6860 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6862 2005-02-18 Raja R Harinath <rharinath@novell.com>
6864 Fix remainder of #63202. Change semantics of DoResolveLValue: it
6865 now returns null if it cannot resolve to an lvalue.
6866 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6867 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6868 returned null. Remove check for SimpleName.
6869 (EventExpr.DoResolveLValue): New.
6870 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6871 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
6873 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
6875 (Unary.ResolveOperator): Move CS0211 check ...
6876 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
6878 (Unary.DoResolveLValue): Simplify.
6879 (AddressOf.DoResolveLValue): New.
6880 (ArrayAccess.DoResolveLValue): New.
6882 2005-02-16 Marek Safar <marek.safar@seznam.cz>
6884 * attribute.cs (Attribute.Resolve): Add arguments casting for
6885 when types doesn't match ctor arguments.
6887 2005-02-16 Raja R Harinath <rharinath@novell.com>
6889 Fix parts of #63202.
6890 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6891 lookup of operator in base type. Ensure that all checks happen
6892 when the operator resolves to an "op_..." method.
6894 2005-02-15 Raja R Harinath <rharinath@novell.com>
6897 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6898 'ignore_cs0104' parameter. Pass it to ...
6899 (NamespaceEntry.Lookup): ... this.
6900 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6901 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6902 (TypeLookupExpression.DoResolveAsTypeStep): Update.
6903 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6904 Update. Request that cs0104 errors be ignored.
6905 (ComposedCast.ResolveAsTypeStep): Update.
6907 2005-02-14 Raja R Harinath <rharinath@novell.com>
6910 * expression.cs (Invocation.BetterFunction): Remove support for
6911 comparing virtual functions and their overrides.
6912 (Invocation.IsOverride): New.
6913 (Invocation.OverloadResolve): Don't consider 'override' functions
6914 during candidate selection. Store them in a lookaside list.
6915 If the selected method is a 'virtual' function, use the list to
6916 find any overrides that are closer to the LHS type.
6918 2005-02-14 Marek Safar <marek.safar@seznam.cz>
6920 * expression.cs (New.DoResolve): Add complex core type reduction.
6921 (New.Constantify): Converts complex core type syntax like 'new int ()'
6924 2005-02-14 Raja R Harinath <rharinath@novell.com>
6926 * decl.cs (EntryType.EntryType): New constructor to create an
6927 updated copy of a cache entry.
6928 (MemberCache.AddMethods): Use it.
6929 (MemberCache.ClearDeclaredOnly): Remove.
6930 (MemberCache.MemberCache): Update.
6932 2005-02-11 Miguel de Icaza <miguel@novell.com>
6934 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6935 variable. This one is represents the actual low-level declaration
6936 of the method, as opposed to the semantic level `IsStatic'.
6938 An anonymous method which is hosted into a static method might be
6939 actually an instance method. IsStatic would reflect the
6940 container, while MethodIsStatic represents the actual code
6943 * expression.cs (ParameterReference): Use the new MethodIsStatic
6944 instead of IsStatic.
6946 * anonymous.cs (AnonymousMethod.Compatible): Pass the
6947 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6948 set on the current EmitContext.
6950 * expression.cs (Cast): Overload DoResolveLValue so we can pass
6951 resolve our casted expression as an LValue. This triggers the
6952 proper LValue processing that is later required by Assign.
6956 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6958 2005-02-11 Marek Safar <marek.safar@seznam.cz>
6960 C# 2.0 Fixed buffer implementation
6962 * anonymous.cs: Update after RegisterHelperClass renaming.
6964 * attribute.cs (AttributeTester.fixed_buffer_cache):
6965 Cache of external fixed buffers.
6966 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6967 implementation if field is fixed buffer else null.
6970 (TypeContainer.AddField): Accept FieldMember instead of Field.
6971 (FieldBase.IsFieldClsCompliant): Extracted code from
6972 VerifyClsCompliance descendant customization.
6973 (FixedField): New class handles fixed buffer fields.
6974 (FixedFieldExternal): Keeps information about imported fixed
6976 (IFixedField): Make access to internal or external fixed buffer
6979 * cs-parser.jay: Add fixed buffer parsing.
6981 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6984 * expression.cs (Indirection): Extended implementation to accept
6986 (PointerArithmetic.Emit): Get element from fixed buffer as well.
6987 (ElementAccess.MakePointerAccess): Get type as parameter.
6988 (DoResolve): Add fixed buffer field expression conversion.
6989 (DoResolveLValue): Ditto.
6990 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6991 (ArrayPtr): Derives from FixedBufferPtr.
6992 (ArrayPtr.Emit): Add extra emit for array elements.
6994 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6996 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6997 for compiler generated types.
6998 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
7000 * statement.cs (Fixed): Refactored to be easier add fixed buffer
7001 and consume less memory.
7002 (Fixed.Resolve): Add fixed buffer case.
7004 * typemanager.cs (compiler_generated_attr_ctor,
7005 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
7006 (HasElementType): Add our own implementation to work on every
7009 2005-02-11 Miguel de Icaza <miguel@novell.com>
7011 * anonymous.cs (CaptureContext): Track whether `this' has been
7014 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
7015 only captured `this' if it was implicitly done (instance
7016 methods/variables were used).
7018 * codegen.cs (EmitContext.CaptureThis): New method to flag that
7019 `this' must be captured.
7021 2005-01-30 Miguel de Icaza <miguel@novell.com>
7023 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
7024 is null it means that there has been no need to capture anything,
7025 so we just create a sibling.
7027 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
7029 Just a partial fix. The other half is fairly elusive.
7031 2005-02-10 Raja R Harinath <rharinath@novell.com>
7033 Fix #52586, cs0121-4.cs.
7034 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
7035 and return a hashtable.
7036 (MemberCache.ClearDeclaredOnly): New.
7037 (MemberCache.MemberCache): Update to change. Make a deep copy of
7038 the method_hash of a base type too.
7039 (MemberCache.AddMethods): Adapt to having a deep copy of the base
7040 type methods. Overwrite entries with the same MethodHandle so
7041 that the ReflectedType is correct. The process leaves in base
7042 virtual functions and their overrides as distinct entries.
7043 (CacheEntry): Now a class instead of a struct. It shouldn't alter
7044 matters since it was boxed in a ArrayList before.
7045 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
7047 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
7048 case of a virtual function and its override (choose the overload
7050 (Invocation.OverloadResolve): Avoid 'override' members during
7051 'applicable_type' calculation.
7053 2005-03-28 Raja R Harinath <rharinath@novell.com>
7055 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
7056 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
7057 GetTypeHandle. It is possible for a reflected type to derive from
7058 a TypeBuilder (e.g., int[] derives from the TypeBuilder
7059 System.Array during mscorlib compilation).
7060 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
7061 contain a method_hash, don't create one either. Don't create a
7062 deep copy of the base cache's method_hash.
7063 (MemberCache.SetupCache): Rename back from DeepCopy.
7064 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
7065 already initialized. If we see an override function, add its
7066 underlying base virtual function to the member_hash too.
7068 2005-02-09 Raja R Harinath <rharinath@novell.com>
7070 Combine two near-redundant caches.
7071 * typemanager.cs (method_params): Rename from method_internal_params.
7072 (TypeManager.GetParameterData): New. Replace
7073 Invocation.GetParameterData.
7074 (TypeManager.LookupParametersByBuilder): Remove.
7075 * expression.cs (Invocation.method_parameter_cache): Remove.
7076 (Invocation.GetParameterData): Remove.
7078 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
7081 2005-02-08 Raja R Harinath <rharinath@novell.com>
7084 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
7085 TypeManager.multicast_delegate_type is null, resolve it by looking
7086 up "System.MulticastDelegate".
7087 * rootcontext.cs (RootContext.ResolveCore): Simplify.
7089 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
7090 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
7091 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
7094 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
7095 (LabeledStatement.AddReference): New. Set 'referenced'.
7096 (Goto.Resolve): Use it.
7098 2005-02-05 John Luke <john.luke@gmail.com>
7100 * driver.cs: remove duplicate -doc line in Usage ()
7102 2005-02-04 Raja R Harinath <rharinath@novell.com>
7104 * location.cs (Location.AddFile): Fix CS2002 error report.
7106 2005-02-02 Martin Baulig <martin@ximian.com>
7108 * delegate.cs (Delegate.DefineType): Report an internal error if
7109 TypeManager.multicast_delegate_type is null. See bug #72015 for
7112 2005-02-02 Raja R Harinath <rharinath@novell.com>
7114 Fix a crasher in a variant of #31984.
7115 * const.cs (Constant.CheckBase): New override that defers the
7116 new-or-override check in case the base type hasn't been populated
7118 (Constant.Define): Ensure the new-or-override check is performed.
7120 2005-02-01 Duncan Mak <duncan@ximian.com>
7122 * const.cs (LookupConstantValue): Check that `ce' is not null
7123 before calling GetValue ().
7125 2005-02-01 Raja R Harinath <rharinath@novell.com>
7127 Fix test-334.cs (#69519).
7128 * cs-parser.jay (using_alias_directive): Pass in an expression to
7129 NamespaceEntry.UsingAlias.
7130 (using_namespace_directive): Pass in an expression to
7131 NamespaceEntry.Using.
7132 (namespace_name): Don't flatten to a string.
7133 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
7134 (NamespaceEntry.AliasEntry.Resolve): Lookup using
7136 (NamespaceEntry.UsingEntry): Likewise.
7137 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
7139 (NamespaceEntry.LookupForUsing): Remove.
7140 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
7142 (NamespaceEntry.Lookup): Remove support for dotted names.
7144 2005-02-01 Raja R Harinath <rharinath@novell.com>
7146 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
7148 (NamespaceEntry.ImplicitParent): Compute on demand.
7149 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
7150 parallels the current.
7151 (NamespaceEntry.LookupForUsing): Use it.
7152 (NamespaceEntry.Lookup): If the current namespace-entry is
7153 implicit, don't search aliases and using tables.
7155 2005-02-01 Raja R Harinath <rharinath@novell.com>
7158 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
7160 (TypeContainer.BaseCache): Compute on demand.
7161 (TypeContainer.FindMembers): Define constants and types if they're
7162 not already created.
7163 (FieldMember.Define): Move resetting of ec.InUnsafe before error
7165 * const.cs (Constant.Define): Make idempotent.
7167 2005-01-29 Miguel de Icaza <miguel@novell.com>
7169 * pending.cs: Produce better code (no nops produced by using Ldarg
7172 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7173 i - 1' it should be arg + 1.
7177 2005-01-28 Raja R Harinath <rharinath@novell.com>
7179 * attribute.cs (Attribute.CheckAttributeType): Make private
7181 (Attribute.ResolveType): Make virtual.
7182 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
7183 handling of RootContext.Tree.Types.
7185 2005-01-27 Raja R Harinath <rharinath@novell.com>
7187 Update attribute-handling to use the SimpleName/MemberAccess
7189 * cs-parser.jay (attribute): Pass in an expression to the
7190 constructors of Attribute and GlobalAttribute.
7191 * attribute.cs (Attribute): Take an expression for the name.
7192 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
7193 passed in attribute name expression.
7194 (Attribute.CheckAttributeType): Use it.
7195 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7196 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7197 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
7198 argument to prevent error messages if the lookup fails.
7200 2005-01-27 Marek Safar <marek.safar@seznam.cz>
7202 * expression.cs (Indirection): Implemented IVariable interface
7203 to support indirection in AddressOf operator.
7204 (PointerArithmetic.Emit): Add optimalization for case where
7205 result can be precomputed.
7207 2005-01-26 Martin Baulig <martin@ximian.com>
7209 * class.cs (TypeContainer.AttributeTargets): Return the correct
7210 AttributeTargets depending on our `Kind' instead of throwing an
7211 exception; fixes #71632.
7213 2005-01-26 Marek Safar <marek.safar@seznam.cz>
7216 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7219 2005-03-17 Martin Baulig <martin@ximian.com>
7221 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
7222 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
7224 2005-03-17 Martin Baulig <martin@ximian.com>
7226 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
7227 to bool so we can return an error condition.
7228 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
7231 2005-03-17 Martin Baulig <martin@ximian.com>
7233 * generic.cs (TypeMananager.IsIEnumerable): New public method.
7235 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
7236 converting from an array-type of T to `IEnumerable<T>'.
7238 2005-03-16 Martin Baulig <martin@ximian.com>
7240 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
7241 (Nullable.LiftedUnaryMutator): New public class.
7243 * expression.cs (UnaryMutator.DoResolve): Added support for
7246 2005-03-14 Martin Baulig <martin@ximian.com>
7248 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
7250 2005-03-14 Martin Baulig <martin@ximian.com>
7252 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
7253 the comparision operators `<', `>', `<=' and `>='.
7255 2005-03-13 Martin Baulig <martin@ximian.com>
7258 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
7259 avoid confusion with the `NullLiteral'.
7260 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
7262 2005-03-13 Martin Baulig <martin@ximian.com>
7264 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
7265 comparing arbitrary types with the null literal.
7267 2005-03-13 Martin Baulig <martin@ximian.com>
7269 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
7270 boolean operators '&&', '||', '&' and '|'.
7271 (Nullable.OperatorTrueOrFalse): New public class.
7273 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
7274 instead of a `StaticCallExpr'; added support for nullables.
7276 2005-03-10 Martin Baulig <martin@ximian.com>
7279 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
7280 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
7282 2005-03-07 Martin Baulig <martin@ximian.com>
7284 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
7285 it work if `expr' is not an IMemoryLocation.
7286 (Nullable.Lifted): Implement IMemoryLocation.
7287 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
7290 2005-03-05 Martin Baulig <martin@ximian.com>
7292 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
7293 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
7294 (Nullable): Added support for lifted unary and binary operators.
7296 * expression.cs (Unary.DoResolve): Added support for nullable types.
7297 (Binary.DoResolve): Likewise.
7298 (Conditional.DoResolve): Likewise.
7300 2005-03-02 Martin Baulig <martin@ximian.com>
7302 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
7304 * class.cs (ClassPart.SetParameterInfo): Override this.
7305 (PartialContainer.SetParameterInfo): Override this.
7306 (TypeContainer.CheckConstraints): New protected method.
7307 (PartialContainer.CheckConstraints): Override this and check
7308 whether the same contraints were specified in all parts of a
7309 partial generic type definition.
7310 (PartialContainer.UpdateConstraints): New public method.
7312 * generic.cs (TypeParameter.UpdateConstraints): New public method.
7314 2005-03-02 Martin Baulig <martin@ximian.com>
7316 Committing a patch from Carlos Alberto Cortez to fix #72887.
7318 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
7319 casts from `T []' to `int []'.
7321 2005-03-02 Martin Baulig <martin@ximian.com>
7323 * generic.cs (TypeManager.IsEqual): Make this symmetric.
7325 * expression.cs (Binary.ResolveOperator): When resolving a
7326 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
7327 `=='. Fixes #71866. See gen-127.cs.
7329 2005-03-02 Martin Baulig <martin@ximian.com>
7331 * class.cs (TypeContainer.DoDefineMembers): We also need a default
7332 static constructor in static classes.
7334 2005-03-02 Martin Baulig <martin@ximian.com>
7337 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
7338 (Nullable.LiftedConversion): Added support for user-defined
7341 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
7343 * cs-parser.jay: Use ComposedCast everywhere instead of
7344 NullableType, so we don't need to check for NullableType
7346 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
7347 case where we'll be resolved into a `parenthesized_expression_0'
7351 (Convert.UserDefinedConversion): Added nullable conversions.
7353 2005-02-28 Martin Baulig <martin@ximian.com>
7355 * generic.cs (TypeManager.IsNullableType): New static method.
7356 (Nullable): New abstract class.
7357 (Nullable.NullLiteral): New public class.
7358 (Nullable.LiftedConversion): New public class.
7360 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
7361 `builtin_types opt_nullable'.
7364 (Convert.ImplicitConversionStandard): Added nullable conversions.
7365 (Convert.ExplicitConversionStandard): Likewise.
7366 (Convert.ExplicitConversion): Likewise.
7368 2005-02-26 Martin Baulig <martin@ximian.com>
7370 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
7371 begin with a "?", for instance "?[]". Don't do a type lookup if
7374 2005-02-25 Martin Baulig <martin@ximian.com>
7376 The first part of Nullable Types :-)
7378 * generic.cs (NullableType): New public class.
7379 (NullCoalescingOperator): New public class.
7380 (TypeArguments.Resolve): Add a CS0306 check.
7382 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
7383 (opt_nullable): New rule.
7384 (type): Added `opt_nullable' to `namespace_or_type_name',
7385 `builtin_types' and `pointer_type'.
7386 (array_type): Added `opt_nullable'.
7387 (opt_rank_specifier_or_nullable): New rule; this is the
7388 combination of `opt_rank_specifier' and `opt_nullable'.
7389 (opt_error): New rule; catch errors here.
7390 (nullable_type_or_conditional): New rule; we use this to check for
7391 nullable and still detect the conditional operator.
7392 (local_variable_type): Use `opt_rank_specifier_or_nullable'
7393 instead `opt_rank_specifier'.
7395 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
7398 2005-02-24 Martin Baulig <martin@ximian.com>
7400 * README, README.Changes: Removed; they're old and obsolete.
7402 2005-02-22 Martin Baulig <martin@ximian.com>
7404 * generic.cs (TypeParameter.Resolve): If resolving the constraints
7405 returned an error, set `constraints' to null to avoid a crash
7407 (TypeParameter.ResolveType): Likewise.
7409 2005-02-22 Martin Baulig <martin@ximian.com>
7412 (Constraints.ResolveTypes): Protect against being called twice.
7413 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
7414 (TypeParameter.ResolveType): New public method; calls
7415 constraints.ResolveTypes().
7416 (TypeParameter.DefineType): Moved constraints.ResolveType() out
7417 into the new ResolveType().
7418 (GenericMethod.Define): Call ResolveType() on all our
7421 2005-02-21 Martin Baulig <martin@ximian.com>
7424 (TypeManager.generic_nullable_type): New static public field.
7425 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
7428 (RootContext.ResolveCore): Resolve "System.Nullable`1".
7430 2005-02-15 Martin Baulig <martin@ximian.com>
7432 * generic.cs (ConstructedType.Constraints): Correctly check
7433 constraints if the argument type is a type parameter; fixes
7436 2005-02-02 Martin Baulig <martin@ximian.com>
7438 * delegate.cs (Delegate.DefineType): Report an internal error if
7439 TypeManager.multicast_delegate_type is null. See bug #72015 for
7442 2005-01-29 Miguel de Icaza <miguel@novell.com>
7444 * pending.cs: Produce better code (no nops produced by using Ldarg
7447 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7448 i - 1' it should be arg + 1.
7452 2005-01-26 Martin Baulig <martin@ximian.com>
7454 * cs-parser.jay (indexer_declarator): Don't report an error if we
7455 have type parameters since we can be an explicit interface
7456 implementation; fixes #71449.
7458 2005-01-26 Martin Baulig <martin@ximian.com>
7460 * class.cs (TypeContainer.AttributeTargets): Return the correct
7461 AttributeTargets depending on our `Kind' instead of throwing an
7462 exception; fixes #71632.
7464 2005-01-26 Martin Baulig <martin@ximian.com>
7466 * delegate.cs (Delegate.DefineType): Correctly define our type
7467 parameters. Fixes #71483.
7469 2005-01-25 Raja R Harinath <rharinath@novell.com>
7472 * expression.cs (MemberAccess.DoResolve): Don't complain with
7473 cs0572 when the LHS of a member access has identical name and type
7476 2005-01-25 Marek Safar <marek.safar@seznam.cz>
7479 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7481 Create custom PermissionSet only for PermissionSetAttribute.
7483 2005-01-24 Marek Safar <marek.safar@seznam.cz>
7486 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7487 delegates in static class.
7489 2005-01-24 Martin Baulig <martin@ximian.com>
7491 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7492 merging an implicit block, just use its reachability.
7494 * statement.cs (Block.Resolve): Make the unreachable code check
7495 work wrt. implicit blocks; see test-337 from #63842.
7497 2005-01-21 Alp Toker <alp@atoker.com>
7499 * cs-parser.jay: destructor_declaration's container is PartialContainer
7500 not Class when partial types are used, so use Kind prop instead of
7503 2005-01-22 Miguel de Icaza <miguel@ximian.com>
7505 * cs-parser.jay: Improve error reporting when an interface
7508 2005-01-20 Dick Porter <dick@ximian.com>
7510 * support.cs: SeekableStreamReader fix from Sandor Dobos
7511 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7512 chars are read. Fixes bug 70369.
7514 2005-01-20 Raja R Harinath <rharinath@novell.com>
7516 * cs-parser.jay (catch_clause): Simplify current_block handling
7519 2005-01-17 Miguel de Icaza <miguel@ximian.com>
7521 * convert.cs (ImplicitStandardConversionExists): Synchronize the
7522 code with ImplicitStandardConversion to handle the implicit
7523 conversion of method groups into valid delegate invocations.
7525 The problem is that in parameter handling we were using this code
7526 path. Fixes bug #64698
7528 2005-01-19 Raja R Harinath <rharinath@novell.com>
7530 * cs-parser.jay: Fix several infelicities.
7531 - Avoid assigning to the parser value stack. Code like
7532 '$3 = null' is unclean. Synthesize a value for the code block
7534 - Avoid using oob_stack for storing location information. Use ...
7535 (_mark_): ... this. New (empty) rule. Saves the current location
7537 (foreach_statement): Avoid using oob_stack for current_block
7538 handling. Use technique used in for_statement and
7539 using_statement. Synthesize a value for the code block to store
7540 additional intermediate information.
7542 2005-01-13 Miguel de Icaza <miguel@ximian.com>
7544 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7545 of a different type is only allowed to private fields of a
7546 containing type, not on fields of a base class.
7548 See test-174.cs and error cs0122-9.cs
7550 2005-01-13 Raja R Harinath <rharinath@novell.com>
7552 Fix test-335.cs (bug #58126).
7553 * cs-parser.jay (argument): Split out non-expression parts of the
7554 rule into 'non_simple_argument'.
7555 (invocation_expression): Support parenthesized invocations with
7556 multiple arguments, and with single non-simple arguments.
7558 2005-01-13 Raja R Harinath <rharinath@novell.com>
7560 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7563 2005-01-12 Raja R Harinath <rharinath@novell.com>
7565 Fix cs0038-1.cs, cs1640-6.cs.
7566 * ecore.cs (Expression.Resolve): Remove special-case for
7567 SimpleName in error-handling.
7568 (Expression.almostMatchedMembers): Relax access permission to
7570 (Expression.MemberLookupFailed): Handle duplicates in
7571 almostMatchedMembers list.
7572 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7573 * expression.cs (New.DoResolve): Report CS1540 for more cases.
7574 * typemanager.cs (GetFullNameSignature): Use the MethodBase
7575 overload if the passed in MemberInfo is a MethodBase.
7577 2005-01-25 Martin Baulig <martin@ximian.com>
7580 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
7582 2005-01-12 Marek Safar <marek.safar@seznam.cz>
7585 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7586 for non-CAS & merge permission sets properly.
7588 2005-01-11 Raja R Harinath <rharinath@novell.com>
7590 Improve standard-compliance of simple name and member access
7591 resolution. Fixes bugs #52697, #57200, #67520, #69519.
7592 * ecore.cs (FullNamedExpression): New abstract base class
7593 for Namespaces and TypeExpressions.
7594 (ResolveFlags.SimpleName): Remove.
7595 (SimpleName): Remove support for dotted names.
7596 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
7597 DeclSpace.FindType and DeclSpace.LookupType.
7598 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7599 (Expression.ExprClassName): Make member function.
7600 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7601 a namespace. Remove creation of dotted "SimpleName"s.
7602 (MemberAccess.DoResolve): Likewise.
7603 * decl.cs (DeclSpace.Cache): Make private.
7604 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7605 (DeclSpace.FindType): Update.
7606 (DeclSpace.LookupType): Move here from RootContext. Return a
7607 FullNamedExpression.
7608 * namespace.cs (Namespace): Derive from FullNamedExpression
7609 so that it can be part of expression resolution.
7610 (Namespace.Lookup): Return an FullNamedExpression.
7611 (NamespaceEntry.LookupAlias): Lookup aliases only in current
7613 * rootcontext.cs (NamespaceLookup): Remove.
7614 (LookupType): Move to DeclSpace.
7615 * attribute.cs (CheckAttributeType): Update.
7616 * doc.cs (FindDocumentedType): Remove allowAlias argument.
7617 (FindDocumentedTypeNonArray): Likewise.
7619 2005-01-11 Raja R Harinath <rharinath@novell.com>
7621 Fix cs0509.cs, cs1632.cs.
7622 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7623 is the same as IsInterface.
7624 (TypeContainer.GetClassBases): Likewise.
7625 * statement.cs (LabeledStatement.ig): New field.
7626 (LabeledStatement.LabelTarget): Save ILGenerator which created the
7628 (LabeledStatement.DoEmit): Check that the label was created with
7629 the same ILGenerator.
7631 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7634 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7635 accessors to its properties.
7637 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7638 from accessors to property.
7640 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7643 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7646 2005-01-08 Miguel de Icaza <miguel@ximian.com>
7648 * attribute.cs: Check for null and empty strings.
7650 I have lost another battle to Paolo.
7652 2005-01-07 Marek Safar <marek.safar@seznam.cz>
7655 * class.cs (PropertyMethod): Set Parent field in ctors.
7656 (SetMethod.InternalParameters): Add unsafe switch hack.
7657 Override MarkForDuplicationCheck where it is appropriate.
7659 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7660 It says whether container allows members with the same name.
7662 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7663 Removed is_method parameter.
7665 2005-01-06 Duncan Mak <duncan@ximian.com>
7667 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7668 because the previous change led to incorrect reporting of CS1032
7669 ("Cannot define/undefine preprocessor symbols after first token in
7670 file"). Instead of using `tokens_seen' as the only flag that
7671 triggers CS1040, introduce `comments_seen'. This new flag is used
7672 to signify having seen comments on the current line, so it is
7673 unset after a newline.
7675 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7677 * doc.cs : When searching for a type, find nested type too.
7678 This fixes bug #71040.
7680 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7683 - Warn missing member comment on those classes which also does not
7684 have doc comments. Fixed bug #71041.
7685 - Don't warn missing doc comment on default constructor.
7688 2005-01-06 Duncan Mak <duncan@ximian.com>
7690 * cs-tokenizer.cs (xtoken): After handling traditional C-style
7691 comments, set `tokens_seen' to true. This allows us to detect
7692 misplaced preprocessor directives (i.e. not at the beginning of
7693 the a line, nor after whitespaces). In that case, report error
7694 CS1040. This fixes bug #56460.
7696 * cs-parser.jay (interface_member_declaration): Add checks for
7697 IsExplicitImpl, and report CS0541 error if an interface member is
7698 defined as an explicit interface declaration.
7700 2005-01-06 Marek Safar <marek.safar@seznam.cz>
7703 * class.cs (PropertyMethod): Set Parent field in ctors.
7704 (SetMethod.InternalParameters): Add unsafe switch hack.
7706 * decl.cs (MemberCore.Parent): Cannot be readonly.
7708 2005-01-06 Raja R Harinath <rharinath@novell.com>
7710 * decl.cs (DeclSpace.ResolveType): Remove.
7711 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7712 Merge in code from ...
7713 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
7714 * class.cs, enum.cs: Update to changes.
7716 2005-01-06 Miguel de Icaza <miguel@ximian.com>
7718 * anonymous.cs: Ensure that we init the scope of our parent if it
7719 has not been initialized yet.
7721 2004-12-30 Duncan Mak <duncan@ximian.com>
7723 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7724 if field.FieldBuilder is null. Fixes #70758.
7726 * convert.cs: Fixed some typos and updated some of the comments.
7727 (ImplicitStandardConversionExists):
7728 (TryImplicitIntConversion): If `target_type' is an interface and
7729 the type of `ic' implements this interface, return true or a new
7730 BoxedCast instead of null. This fixes #70468.
7732 2004-12-29 Duncan Mak <duncan@ximian.com>
7734 * expression.cs (Argument.Emit): Check that Expr is
7735 IMemoryLocation before casting to it, and report CS1510 otherwise.
7739 2004-12-21 Ben Maurer <bmaurer@ximian.com>
7741 * statement.cs (Block.ThisVariable): remove the recursion here, to
7742 make the --profile more sane.
7744 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
7746 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7747 assembly, by JB Evain.
7749 2004-12-17 Raja R Harinath <rharinath@novell.com>
7751 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
7752 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7753 "parent" refers to enclosing type/class. "base" refers to superclass.
7755 2004-12-17 Raja R Harinath <rharinath@novell.com>
7757 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7758 Ensure that we only have GlobalAttributes.
7759 * attribute.cs (Attribute.Emit): Make non-virtual.
7760 (GlobalAttribute.Emit): Remove.
7761 (Attribute.Resolve): Make virtual.
7762 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
7763 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7764 the argument. Don't create one.
7765 (Attribute.GetObsoleteAttribute): Likewise.
7766 (Attribute.GetClsCompliantAttributeValue): Likewise.
7767 * class.cs, decl.cs: Update to changes.
7769 2004-12-17 Marek Safar <marek.safar@seznam.cz>
7771 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7773 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7775 * statement.cs (Foreach.Resolve): Add error 186 report.
7777 2004-12-16 Marek Safar <marek.safar@seznam.cz>
7779 * expression.cs (Conditional.DoResolve): Add warning 429.
7781 * statement.cs (If.Resolve): Add warning 665.
7783 2004-12-16 Raja R Harinath <rharinath@novell.com>
7785 New invariant: RootContext.Tree.Types.NamespaceEntry == null
7786 except when in the parser, and in GlobalAttribute.
7787 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7788 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7789 RootContext.Tree.Types.NamespaceEntry once work is done.
7790 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
7791 and resets RootContext.Tree.Types.NamespaceEntry.
7793 2004-12-15 Marek Safar <marek.safar@seznam.cz>
7795 * cs-parser.jay: Don't create a block for every variable.
7797 2004-12-14 Miguel de Icaza <miguel@ximian.com>
7799 * location.cs: Provide extra information.
7801 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7802 variables from the captured environment, it is the ldarg_0.
7804 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7806 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7809 * class.cs: Changed warning level for 169 to avoid developer
7810 displeasure from warning flooding. It will be changed back when they
7811 fix most of current BCL warnings.
7813 * RootContext.cs: Pushed default WarningLevel to 3.
7815 * statement.cs: Removed unused variable.
7817 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7819 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7820 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7821 Add error 502 report.
7822 (StaticClass.DefineType): Add error 441 report.
7823 (Class.AllowedModifiersProp): New virtual property as temporary
7824 extension to AllowedModifiers.
7825 (Class.DefineType): Add error 418 report. Moved ModFlags check here
7826 to share implementation with StaticClass and don't call virtual
7829 * driver.cs (MainDriver): Add error 1558 test.
7831 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7832 report. Moved error 36 test here.
7834 * statement.cs (Throw.Resolve): Add error 724 report.
7836 * typemanager.cs: Add out_attribute_type core type.
7838 2004-12-13 Marek Safar <marek.safar@seznam.cz>
7840 * class.cs (TypeContainer.VerifyClsCompliance): Add error
7842 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7844 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7847 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7849 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
7850 Add error 3023 report.
7851 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7853 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7856 2004-12-12 John Luke <john.luke@gmail.com>
7858 * driver.cs (AddArgs): take -- into account when
7859 adding arguments, fixes bug 65710
7861 2004-12-12 Martin Baulig <martin@ximian.com>
7863 * expression.cs (Unary.TryReduceNegative): Added support for
7864 SByteConstant and ByteConstant.
7865 (Unary.Reduce): Check error values from TryReduceNegative().
7867 2004-12-10 Marek Safar <marek.safar@seznam.cz>
7869 * attributes.cs (Attribute.Resolve): Avoid multiple error report
7870 and report exception as error 182.
7872 2004-12-10 Raja R Harinath <rharinath@novell.com>
7874 * driver.cs (Main): Fix message when there are warnings.
7876 2004-12-09 Miguel de Icaza <miguel@ximian.com>
7878 * delegate.cs: Fixed my fix from yesterday, sorry about that.
7880 2004-12-09 Marek Safar <marek.safar@seznam.cz>
7882 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
7883 Reduced number of warnings.
7885 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7887 2004-12-08 Miguel de Icaza <miguel@ximian.com>
7889 * driver.cs: Removed message.
7891 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7893 2004-12-08 <vargaz@freemail.hu>
7895 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7897 2004-12-08 Martin Baulig <martin@ximian.com>
7899 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7900 instead of a CS3002 for properties and indexer.
7902 2004-12-08 Martin Baulig <martin@ximian.com>
7904 * decl.cs (MemberName.ToString): Make this work again.
7906 2004-12-08 Marek Safar <marek.safar@seznam.cz>
7908 * attribute.cs (Resolve): Add error 591 detection.
7910 * class.cs (FieldMember.Define): Add error 1547 detection.
7911 (Indexer.Define): Add error 620 detection.
7912 (Operator.Define): Add error 590 detection.
7914 * ecore.cs: Missing argument for error 79.
7916 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7919 2004-12-07 Marek Safar <marek.safar@seznam.cz>
7922 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7925 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7927 * cs-parser.jay : handle doc comments on implicit/explicit operators.
7928 Some operator comments were suppressed.
7929 * doc.cs : Implicit/explicit operator name in doc comments are like
7930 "op_Explicit(type)~returnType", so added suffix handling.
7932 2005-01-21 Alp Toker <alp@atoker.com>
7934 * cs-parser.jay: destructor_declaration's container is PartialContainer
7935 not Class when partial types are used, so use Kind prop instead of 'is'.
7937 2004-12-12 Martin Baulig <martin@ximian.com>
7939 * expression.cs (Unary.TryReduceNegative): Added support for
7940 SByteConstant and ByteConstant.
7941 (Unary.Reduce): Check error values from TryReduceNegative().
7943 2004-12-11 Martin Baulig <martin@ximian.com>
7945 * support.cs (ReflectionParameters.ParameterName): If we have a
7946 `gpd', call `ParameterName' on it.
7948 * parameter.cs (Parameter.GetParameterAttributes): New static method.
7950 * pending.cs (PendingImplementation.DefineProxy): Call
7951 DefineParameter() for all of the MethodBuilder's arguments.
7953 2004-12-09 Martin Baulig <martin@ximian.com>
7955 * doc.cs (DocUtil): Make this a static class.
7957 2004-12-09 Martin Baulig <martin@ximian.com>
7959 * expression.cs (Invocation.InferType): Moved the type inference
7960 implementation into TypeManager.
7962 * generics.cs (TypeManager): Moved the type inference
7963 implementation here.
7965 2004-12-09 Martin Baulig <martin@ximian.com>
7967 * typemanager.cs (TypeManager): Make this a partial class.
7970 (TypeManager): Move the generics part of `TypeManager' here.
7972 2004-12-08 Martin Baulig <martin@ximian.com>
7974 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7975 instead of a CS3002 for properties and indexer. Added CS3024
7976 check for generic interfaces.
7978 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
7979 instances are not CLS-compliant.
7981 2004-12-08 Martin Baulig <martin@ximian.com>
7984 (void_pointer_expression): New rule for `void*', `void**' etc.
7985 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
7987 2004-12-08 Martin Baulig <martin@ximian.com>
7989 * expression.cs (Invocation.InferType): Removed the hack for
7990 MethodCore.MayUnify().
7992 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
7995 * class.cs (MethodCore.MayUnify): Use
7996 TypeManager.MayBecomeEqualGenericTypes().
7998 2004-12-08 Martin Baulig <martin@ximian.com>
8000 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
8001 parameter, box it. Fixes #69233.
8003 2004-12-08 Martin Baulig <martin@ximian.com>
8005 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
8006 have the ctor constraint. Fixes #68326.
8008 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
8010 * cs-parser.jay : interface comment was not consumed because of
8011 extra opt_semicolon before doc handling.
8013 2004-12-03 Raja R Harinath <rharinath@novell.com>
8015 Fix test-327.cs, test-328.cs, and put in early infrastructure
8016 for eventually fixing #52697.
8017 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
8018 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
8020 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
8021 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
8022 (VerifyUsing, error246): Update.
8023 * rootcontext.cs (RootContext.NamespaceLookup): Just use
8024 'NamespaceEntry.LookupNamespaceOrType'.
8026 2004-12-07 Martin Baulig <martin@ximian.com>
8028 * driver.cs: Call it "BETA SOFTWARE" :-)
8030 2004-12-06 Raja R Harinath <rharinath@novell.com>
8032 Fix crash on cs0657-17.cs.
8033 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8034 Use RootContext.Tree.Types, not 'new RootTypes ()'.
8035 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
8036 the case where the NamespaceEntry gets overwritten.
8038 2004-12-06 Marek Safar <marek.safar@seznam.cz>
8040 Fixed #69195, #56821
8041 * ecore.cs (ResolveBoolean): Tiny refactoring.
8043 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
8044 of right expression resolving when left is false constant and
8045 operator is LogicalAnd OR true constant and operator is LogicalOr.
8047 * statement.cs (ResolveUnreachable): Always reports warning.
8049 2004-12-05 Miguel de Icaza <miguel@ximian.com>
8051 * class.cs: Distinguish between 1721 and 1722 (just a little help
8052 for the programmer).
8054 2004-12-03 Miguel de Icaza <miguel@ximian.com>
8056 * delegate.cs: Only allow this on new versions of the language.
8058 2004-12-02 Duncan Mak <duncan@ximian.com>
8060 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
8062 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
8063 here as a static method. Take an additional bool out parameter
8064 `must_do_cs1540_check' for signaling to InstanceResolve.
8065 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
8066 member field from PropertyExpr class and made it an argument of
8068 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
8069 check for MarshalByRefObject, and report CS0122 instead of CS1540.
8070 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
8071 and `remove_accessor' as well as InstanceResolve: report CS0122
8076 2004-12-07 Martin Baulig <martin@ximian.com>
8078 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
8079 and CS0692 where appropriate.
8081 2004-12-06 Martin Baulig <martin@ximian.com>
8083 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
8084 IsDuplicateImplementation() and improved it.
8086 * expression.cs (Invocation.InferTypeArguments): Added
8087 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
8088 and removed the "ref" modifier from `infered_types'.
8090 * decl.cs (MemberName.ToString): Removed the exception.
8092 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
8094 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
8095 comments are allowed.
8097 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8099 * delegate.cs: Add checks for subtypes in paramaters and return values
8100 in VerifyMethod () to add support for Covariance/Contravariance
8103 2004-12-02 Miguel de Icaza <miguel@ximian.com>
8105 * report.cs: Remove extra closing parenthesis.
8107 * convert.cs (Error_CannotImplicitConversion): If the name of the
8108 types are the same, provide some extra information.
8110 2004-12-02 Marek Safar <marek.safar@seznam.cz>
8113 * attribute.cs (Resolve): Improved implementation of params
8114 attribute arguments.
8116 * support.cs (ParameterData): Add HasParams to be faster.
8118 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
8120 all things are for /doc support:
8122 * doc.cs: new file that supports XML documentation generation.
8123 * mcs.exe.sources: added doc.cs.
8125 Handle /doc command line option.
8126 Report error 2006 instead of 5 for missing file name for /doc.
8127 Generate XML documentation when required, after type resolution.
8129 Added support for picking up documentation (/// and /** ... */),
8130 including a new XmlCommentState enumeration.
8132 Added lines to fill Documentation element for field, constant,
8133 property, indexer, method, constructor, destructor, operator, event
8134 and class, struct, interface, delegate, enum.
8135 Added lines to warn incorrect comment.
8137 Added Documentation field (passed only when /doc was specified).
8139 Added DocComment, DocCommentHeader, GenerateDocComment() and
8140 OnGenerateDocComment() and some supporting private members for
8141 /doc feature to MemberCore.
8143 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
8145 Added overriden DocCommentHeader.
8147 Added overriden DocCommentHeader and GenerateDocComment().
8149 2004-12-01 Miguel de Icaza <miguel@ximian.com>
8151 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
8152 unwrapping the enumeration values, chain to
8153 DoConstantNumericPromotions again, so we can promote things to the
8154 fundamental types (takes care of enums that are bytes, sbytes).
8158 2004-12-01 Raja R Harinath <rharinath@novell.com>
8160 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
8161 Fix long-standing bug in type-lookup. Use FindType instead of
8162 LookupType when ec.ResolvingTypeTree.
8163 (Attribute.ResolveType, Attribute.Resolve)
8164 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
8166 (Attributes.Search): Remove internal version. Update.
8167 (Attributes.SearchMulti): Update.
8168 (Attributes.GetClsCompliantAttribute): Remove.
8169 (Attributes.GetIndexerNameAttribute): Remove.
8170 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
8171 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
8172 * class.cs (Indexer.Define): Likewise.
8174 2004-12-01 Marek Safar <marek.safar@seznam.cz>
8177 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
8178 MarshallByReference members access.
8180 * expression.cs: Use CheckMarshallByRefAccess;
8181 Better error CS0197 message.
8183 * report.cs: Print whole related error message.
8185 2004-11-29 Marek Safar <marek.safar@seznam.cz>
8187 * class (GetClassBases): Better error 60 report.
8188 (EventProperty): Disabled warning 67 detection.
8190 2004-11-29 Marek Safar <marek.safar@seznam.cz>
8193 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
8195 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
8198 2004-11-29 Marek Safar <marek.safar@seznam.cz>
8201 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
8203 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
8205 2004-11-26 Miguel de Icaza <miguel@ximian.com>
8207 * attribute.cs (Attribute.Resolve): Refine error reporting and
8208 report a cs0117 if the identifier does not exist, to distinguish
8209 from 0617 which is a miss-use of the actual identifier.
8211 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
8212 between cs0070 and cs0079.
8214 * class.cs (MemberBase.DoDefine): When reporting a wrong
8215 accessibility level, we use MethodCore to compare instead of
8216 Method (this was a regression in some refactoring effort).
8218 So now we correctly report cs0056 again.
8220 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
8221 testing the target_type (which was known to be object_type) and
8222 not the source type (which is anonymous_method).
8224 Fixed reporting of error cs1660.
8226 * expression.cs (UserCast.Source): Expose the underlying cast.
8228 * statement.cs (Switch.SwitchGoverningType): Sort the list of
8229 allowed types to find a match to int32 first (most common).
8231 In addition, it ignores any ImplicitUserConversions that did an
8232 internal implicit conversion (as the switch statement allows only
8233 one integral conversion to exist).
8235 * class.cs (PartialContainer.Create): rename `name' to
8236 `member_name' for clarity. Then replace the string calls with a
8237 call to MemberName.GetPartialName, as now using
8238 MemberName.ToString is an error (this is due to the side effects
8239 it had, that were fixed in the past).
8241 This will restore the error reporting on a number of partial class
8242 errors that were missusing this (and getting an exception as a
8243 results, which is now just a plain textual warning, because
8244 yyparse debug output would crash otherwise).
8246 2004-11-26 Raja R Harinath <rharinath@novell.com>
8248 * Makefile (PROGRAM_INSTALL_DIR): Remove.
8250 2004-11-25 Ben Maurer <bmaurer@ximian.com>
8252 * rootcontext.cs (LookupType): Make sure to cache lookups that
8253 don't give us a negative result. This saves about 5% of corlib
8256 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8258 * report.cs (AbstractMessage.Print): messages are sent to stderr
8260 * class.cs (TypeContainer.GetClassBases): It is an error to have a
8261 non-interface in the list of interfaces (at this point, either
8262 parent was properly set, or a base class is being listed in the
8263 interfaces section).
8265 This flags error 1722, and resolves the crash from bug 69259.
8267 2004-11-25 Ben Maurer <bmaurer@ximian.com>
8269 * statement.cs (Using.EmitExpressionFinally): make this work right
8270 for valuetypes. Fixes 69926.
8272 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8274 * const.cs (Const.ChangeType): Cope with the "0 literal can be
8275 converted to an enum" here, before we try to change the underlying
8276 type. This code exists, but it is a different code path than the
8277 one used while encoding constants.
8279 (ImplicitReferenceConversionExists): In addition, resynchronized
8280 the code here, so it matches the same code in
8281 ImplicitReferenceConversionExists for the `from any class-type S
8282 to any interface-type T'.
8284 2004-11-25 Marek Safar <marek.safar@seznam.cz>
8286 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8288 2004-11-24 Miguel de Icaza <miguel@ximian.com>
8290 * cs-parser.jay: Use verbosity accordingly.
8292 2004-11-24 Marek Safar <marek.safar@seznam.cz>
8294 * expression.cs (Unary.ResolveOperator): Do not report warning;
8295 AddressOf reads from variable.
8297 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8299 2004-11-24 Marek Safar <marek.safar@seznam.cz>
8303 * attribute.cs (Attributable): Removed CheckTargets.
8304 (Attributes.Emit): Explicit attribute targets are tested here.
8306 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8307 not enabled for interfaces.
8309 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8310 (GetAssemblyName): Ouch next bug there.
8312 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8314 * expression.cs: Error 275 added.
8316 2004-11-23 Marek Safar <marek.safar@seznam.cz>
8318 Fix bug #69177 (Implemented decimal constant support)
8320 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8321 (BinaryFold): Add DecimalConstant.
8323 * const.cs (Define): Decimal constant
8325 (ChangeType): Add decimal type handling.
8326 (LookupConstantValue): Don't set value for decimal type but
8327 emit DecimalConstantAttribute. Needed for constant optimization.
8329 * constant.cs (ToDecimal): New method.
8330 (ConvertToDecimal): New method.
8331 (IntConstant): Implemented ConvertToDecimal.
8332 (DecimalConstant.Emit): Emit optimized version for decimals in
8335 * expression.cs (ResolveOperator): Changed order of constant
8336 reduction to work correctly with native types which have
8337 overloaded operators.
8338 (ResolveMemberAccess): Extract constant value from attribute
8341 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8343 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8344 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8345 (ChangeType): Decimal is special.
8346 (TypeToCoreType): Add decimal type.
8348 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8350 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8353 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8355 * class.cs (EventField.ApplyAttributeBuilder): Fix error
8358 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8360 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8362 * pending.cs (PendingImplementation): Grab only interfaces.
8364 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8366 * statement.cs (ForeachHelperMethods): Add location member and
8367 error 202 detection.
8369 2004-11-18 Marek Safar <marek.safar@seznam.cz>
8371 * expression.cs (DoResolveBase): Fixed wrong warning for out
8374 2004-12-04 Martin Baulig <martin@ximian.com>
8376 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
8377 to check whether the conversion is ok.
8379 * typemanager.cs (TypeManager.GetTypeArguments): Just return
8380 `Type.EmptyTypes' if we're not a generic TypeContainer.
8382 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8384 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8385 old bug: when converting from the null literal to a pointer,
8386 return an EmptyCast, not the NullLiteral.
8388 This fixes #69921, the recent null_type changes probably made this
8391 2004-12-03 Martin Baulig <martin@ximian.com>
8393 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8394 method as our child, call AnonymousMethod.Compatible() on it.
8396 2004-12-02 Miguel de Icaza <miguel@ximian.com>
8398 * class.cs (FieldBase): Use an unused bit field from the field to
8399 encode the `has_offset' property from the FieldMember. This saves
8400 a couple of Ks on bootstrap compilation.
8402 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8403 method as our child, return the AnonymousMethod resolved
8406 * expression.cs (New.DoResolve): Allow return values from
8407 NewDelegate to also include AnonymousMethods.
8411 2004-11-29 Raja R Harinath <rharinath@novell.com>
8413 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
8415 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
8416 System.Runtime.InteropServices._Exception, since it's a base
8417 interface of the core type System.Exception in the net_2_0 profile.
8419 2004-11-27 Martin Baulig <martin@ximian.com>
8421 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
8423 2004-11-26 Raja R Harinath <rharinath@novell.com>
8425 * Makefile: Convert to use executable.make.
8426 * gmcs.exe.sources: New.
8428 2004-11-25 Martin Baulig <martin@ximian.com>
8430 * expression.cs (Invocation.InferType): Added support for byref types.
8432 2004-11-25 Martin Baulig <martin@ximian.com>
8434 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
8435 in TypeManager.TypeToCoreType().
8437 2004-11-25 Martin Baulig <martin@ximian.com>
8439 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
8440 "Dispose" method from the `current_type'.
8441 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
8442 DoDefineMembers() instead of using the MethodBuilder; this is
8443 required for generic iterators.
8445 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
8447 2004-11-24 Martin Baulig <martin@ximian.com>
8449 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
8451 2004-11-20 Martin Baulig <martin@ximian.com>
8453 * expression.cs (Invocation.InferType): Correctly infer generic
8454 instances; see gen-103.cs.
8455 (Invocation.InferTypeArguments): If a generic method doesn't have
8456 any unbound type parameters, we don't need to infer anything.
8458 2004-11-19 Raja R Harinath <rharinath@novell.com>
8460 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
8462 2004-11-17 Raja R Harinath <rharinath@novell.com>
8464 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8465 (TypeHandle.GetMemberCache): New.
8466 (TypeHandle.TypeHandle): Update.
8467 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8468 (TypeManager.LookupParentInterfacesCache):
8469 Rename from LookupInterfaceCache. Optimize slightly.
8470 (TypeManager.MemberLookup_FindMembers): Update.
8471 * decl.cs (MemberCache.MemberCache): Set Container to null in the
8473 (AddCacheContents): Rename from AddHashtable.
8474 * class.cs (TypeContainer.parent_container): Remove.
8475 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8476 (TypeContainer.DoDefineMembers): Don't initialize it.
8477 Update to name changes.
8479 2004-11-17 Miguel de Icaza <miguel@ximian.com>
8481 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8482 that factors the code to check access modifiers on override.
8484 (PropertyBase): Use the code here.
8486 Patch from Lluis S'anchez, fixes bug #69361.
8488 2004-11-15 Miguel de Icaza <miguel@ximian.com>
8490 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8491 routine that is used to report the use of a captured variable
8492 whose address has been taken.
8494 There are two checks: one when variables are being captured and
8495 the other check is when the address of a variable is taken.
8497 (because an anonymous methods might be resolved before *or* after
8498 the address has been taken) and
8500 * expression.cs (Conditional.DoResolve): Remove the special
8501 casing that Martin added to trueExpr and falseExpr being both
8502 NullLiteral. We get the right behavior now just by introducing
8503 the null_type into the compiler.
8505 * convert.cs (ExplicitConversion): Change the code to use
8506 null_type instead of testing `expr is NullLiteral'.
8507 (ImplicitConversionStandard): use null_type too.
8508 (ImplicitReferenceConversionExists): use null_type too.
8509 (ImplicitReferenceConversion): use null_type too.
8511 * literal.cs: The type of `NullLiteral' is now null_type instead
8513 (Resolve): Set the type here.
8515 * typemanager.cs: Introduce null_type.
8517 2004-11-18 Martin Baulig <martin@ximian.com>
8520 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
8522 2004-11-18 Martin Baulig <martin@ximian.com>
8524 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
8526 2004-11-18 Martin Baulig <martin@ximian.com>
8528 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
8529 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
8530 call ResolveConstructedType() on it to resolve it without checking
8532 (Constraints.ResolveTypes): Check them here.
8533 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
8534 but don't check constraints.
8535 (ConstructedType.ResolveAsTypeTerminal): Override this and also
8536 check constraints here.
8537 (ConstructedType.ResolveConstructedType): New public method. This
8538 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
8539 resolve ourselves without checking constraints.
8541 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
8543 2004-11-18 Martin Baulig <martin@ximian.com>
8546 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
8548 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
8550 2004-11-18 Martin Baulig <martin@ximian.com>
8552 * ecore.cs (TypeExpr.ResolveType): Removed.
8553 (Expression.ResolveAsTypeTerminal): We always return a fully
8554 resolved `TypeExpr', so we can just access its `Type'.
8556 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
8558 2004-11-17 Martin Baulig <martin@ximian.com>
8560 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
8561 sure we don't return any unresolved TypeExpr's.
8562 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
8564 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
8566 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
8567 unresolved `ConstructedType's.
8569 2004-11-17 Martin Baulig <martin@ximian.com>
8571 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
8573 2004-11-17 Martin Baulig <martin@ximian.com>
8576 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
8578 * decl.cs (DeclSpace.ResolveType): Removed.
8579 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
8581 2004-11-17 Martin Baulig <martin@ximian.com>
8583 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8584 direction, like FindMembers() does. Fixes #69546, testcase is in
8587 2004-11-16 Martin Baulig <martin@ximian.com>
8589 This is based on a patch from Marek Safar, see bug #69082.
8590 Fixes bugs #63705 and #67130.
8592 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8593 method; create a MemberCache for an interface type and cache the
8596 * decl.cs (IMemberContainer.ParentContainer): Removed.
8597 (IMemberContainer.ParentCache): New property.
8598 (MemberCache.SetupCacheForInterface): Removed.
8599 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8600 to create a cache for an interface's "parent".
8602 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8605 2004-11-14 Ben Maurer <bmaurer@ximian.com>
8607 * statement.cs: Avoid adding bools to a hashtable.
8609 2004-11-15 Martin Baulig <martin@ximian.com>
8611 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
8613 2004-11-11 Martin Baulig <martin@ximian.com>
8615 * typemanager.cs (TypeManager.GetMethodName): New method.
8617 * class.cs (MethodData.Define): Include the generic arity in the
8618 name of an explicit interface; also add it to the method name.
8620 * pending.cs (PendingImplementation.InterfaceMethod): The method
8621 name now includes the generic arity.
8623 2004-11-07 Miguel de Icaza <miguel@ximian.com>
8625 * expression.cs (Invocation.OverloadResolve): Flag error if we are
8626 calling an unsafe method from a safe location.
8628 2004-11-06 Marek Safar <marek.safar@seznam.cz>
8631 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8633 2004-11-06 Miguel de Icaza <miguel@ximian.com>
8635 * namespace.cs (VerifyUsing): use GetPartialName instead of
8638 2004-11-05 Miguel de Icaza <miguel@ximian.com>
8640 * statement.cs (Return.Resolve): Fix regression in typo: if
8641 `in_exc', we have to request a NeedReturnLabel, this was a typo
8642 introduced in the anonymous method check-in. Fixes #69131.
8644 * Indexers were using the ShortName when defining themselves,
8645 causing a regression in the compiler bootstrap when applying the
8646 patch from 2004-11-02 (first part), now they use their full name
8647 and the bug is gone.
8649 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
8651 * driver.cs: Strip the path from the names of embedded resources. Fixes
8654 2004-11-04 Raja R Harinath <rharinath@novell.com>
8656 Fix error message regression: cs0104-2.cs.
8657 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8658 (AliasEntry.Resolve): Update.
8659 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
8661 (RootContext.LookupType): Update.
8663 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
8665 * cs-parser.jay: Add support for handling accessor modifiers
8666 * class: Add support port accessor modifiers and error checking,
8667 define PropertyMethod.Define as virtual (not abstract anymore)
8668 * ecore.cs: Add checking for proeprties access with access modifiers
8669 * iterators.cs: Modify Accessor constructor call based in the modified
8671 2004-11-02 Ben Maurer <bmaurer@ximian.com>
8673 * expression.cs (StringConcat): Handle being called twice,
8674 as when we have a concat in a field init with more than two
8677 2004-11-02 Miguel de Icaza <miguel@ximian.com>
8679 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8680 special case explicit implementations, we should always produce
8681 the .property or .event declaration.
8683 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8684 since it will not return correct data if people use this
8685 unresolved in the presence of using statements (see test-313).
8687 * class.cs (MethodData.Define): If we are an explicit interface
8688 implementation, set the method name to the full name of the
8689 interface plus the name of the method.
8691 Notice that using the method.MethodName.GetFullName() does not
8692 work, as it will only contain the name as declared on the source
8693 file (it can be a shorthand in the presence of using statements)
8694 and not the fully qualifed type name, for example:
8698 class D : ICloneable {
8699 object ICloneable.Clone () {
8703 Would produce a method called `ICloneable.Clone' instead of
8704 `System.ICloneable.Clone'.
8706 * namespace.cs (Alias.Resolve): Use GetPartialName.
8708 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8710 * cs-parser.jay: Add error 1055 report.
8712 2004-11-01 Miguel de Icaza <miguel@ximian.com>
8714 * assign.cs (Assign.DoResolve): Only do the transform of
8715 assignment into a New if the types are compatible, if not, fall
8716 through and let the implicit code deal with the errors and with
8717 the necessary conversions.
8719 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8721 * cs-parser.jay: Add error 1031 report.
8723 * cs-tokenizer.cs: Add location for error 1038.
8725 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8727 * cs-parser.jay: Add error 1016 report.
8729 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8731 * cs-parser.jay: Add errors 1575,1611 report.
8733 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8735 * cs-parser.jay: Add error 1001 report.
8737 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8740 * attribute.cs (GetMarshal): Add method argument for
8741 caller identification.
8743 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8744 agument for GetMarshal and RuntimeMissingSupport.
8746 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8748 * attribute.cs (ExtractSecurityPermissionSet): Removed
8749 TypeManager.code_access_permission_type.
8751 * typemanager.cs: Removed TypeManager.code_access_permission_type.
8753 2004-10-27 Miguel de Icaza <miguel@ximian.com>
8755 * expression.cs (LocalVariableReference.DoResolveLValue): Check
8756 for obsolete use of a variable here. Fixes regression on errors
8757 cs0619-25 and cs0619-26.
8759 2004-10-27 Marek Safar <marek.safar@seznam.cz>
8761 Fix #62358, implemented security attribute encoding.
8763 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8764 Tests permitted SecurityAction for assembly or other types.
8765 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8766 data from SecurityPermissionAttribute to PermisionSet class.
8768 * class.cs (ApplyAttributeBuilder): Added special handling
8769 for System.Security.Permissions.SecurityAttribute based types.
8771 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8772 special handling for System.Security.Permissions.SecurityAttribute
8775 * enum.cs (ApplyAttributeBuilder): Added special handling
8776 for System.Security.Permissions.SecurityAttribute based types.
8778 * parameter.cs (ApplyAttributeBuilder): Added special handling
8779 for System.Security.Permissions.SecurityAttribute based types.
8781 * rootcontext.cs: Next 2 core types.
8783 * typemanager.cs (TypeManager.security_permission_attr_type):
8784 Built in type for the SecurityPermission Attribute.
8785 (code_access_permission_type): Build in type.
8787 2004-10-17 Miguel de Icaza <miguel@ximian.com>
8789 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8790 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8791 all of this information into
8792 EmitContext.EmitCapturedVariableInstance.
8794 * codegen.cs (EmitCapturedVariableInstance): move here the
8795 funcionality of emitting an ldarg.0 in the presence of a
8796 remapping. This centralizes the instance emit code.
8798 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8799 then emit a load of this: it means that we have reached the
8800 topmost ScopeInfo: the one that contains the pointer to the
8801 instance of the class hosting the anonymous method.
8803 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8804 captures to the topmost CaptureContext.
8806 2004-10-12 Miguel de Icaza <miguel@ximian.com>
8808 * expression.cs (LocalVariableReference): Move the knowledge about
8809 the iterators into codegen's EmitCapturedVariableInstance.
8811 2004-10-11 Miguel de Icaza <miguel@ximian.com>
8813 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8814 all code paths return a value from an anonymous method (it is the
8815 same as the 161 error, but for anonymous methods).
8817 2004-10-08 Miguel de Icaza <miguel@ximian.com>
8819 The introduction of anonymous methods in the compiler changed
8820 various ways of doing things in the compiler. The most
8821 significant one is the hard split between the resolution phase
8822 and the emission phases of the compiler.
8824 For instance, routines that referenced local variables no
8825 longer can safely create temporary variables during the
8826 resolution phase: they must do so from the emission phase,
8827 since the variable might have been "captured", hence access to
8828 it can not be done with the local-variable operations from the runtime.
8832 (Block.Flags): New flag `IsTopLevel' to indicate that this block
8833 is a toplevel block.
8835 (ToplevelBlock): A new kind of Block, these are the blocks that
8836 are created by the parser for all toplevel method bodies. These
8837 include methods, accessors and anonymous methods.
8839 These contain some extra information not found in regular blocks:
8840 A pointer to an optional CaptureContext (for tracking captured
8841 local variables and parameters). A pointer to the parent
8844 (Return.Resolve): Catch missmatches when returning a value from an
8845 anonymous method (error 1662).
8846 Invoke NeedReturnLabel from the Resolve phase instead of the emit
8849 (Break.Resolve): ditto.
8851 (SwitchLabel): instead of defining the labels during the
8852 resolution phase, we now turned the public ILLabel and ILLabelCode
8853 labels into methods called GetILLabelCode() and GetILLabel() that
8854 only define the label during the Emit phase.
8856 (GotoCase): Track the SwitchLabel instead of the computed label
8857 (its contained therein). Emit the code by using
8858 SwitchLabel.GetILLabelCode ().
8860 (LocalInfo.Flags.Captured): A new flag has been introduce to track
8861 whether the Local has been captured or not.
8863 (LocalInfo.IsCaptured): New property, used to tell whether the
8864 local has been captured.
8866 * anonymous.cs: Vastly updated to contain the anonymous method
8869 The main classes here are: CaptureContext which tracks any
8870 captured information for a toplevel block and ScopeInfo used to
8871 track the activation frames for various local variables.
8873 Each toplevel block has an optional capture context associated
8874 with it. When a method contains an anonymous method both the
8875 toplevel method and the anonymous method will create a capture
8876 context. When variables or parameters are captured, they are
8877 recorded on the CaptureContext that owns them, for example:
8881 MyDelegate d = delegate {
8886 Here `a' will be recorded as captured on the toplevel
8887 CapturedContext, the inner captured context will not have anything
8888 (it will only have data if local variables or parameters from it
8889 are captured in a nested anonymous method.
8891 The ScopeInfo is used to track the activation frames for local
8892 variables, for example:
8894 for (int i = 0; i < 10; i++)
8895 for (int j = 0; j < 10; j++){
8896 MyDelegate d = delegate {
8901 At runtime this captures a single captured variable `i', but it
8902 captures 10 different versions of the variable `j'. The variable
8903 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8904 recorded on a child.
8906 The toplevel ScopeInfo will also track information like the `this'
8907 pointer if instance variables were referenced (this is necessary
8908 as the anonymous method lives inside a nested class in the host
8909 type of the method).
8911 (AnonymousMethod): Expanded to track the Toplevel, implement
8912 `AnonymousMethod.Compatible' to tell whether an anonymous method
8913 can be converted to a target delegate type.
8915 The routine now also produces the anonymous method content
8917 (AnonymousDelegate): A helper class that derives from
8918 DelegateCreation, this is used to generate the code necessary to
8919 produce the delegate for the anonymous method that was created.
8921 * assign.cs: API adjustments for new changes in
8922 Convert.ImplicitStandardConversionExists.
8924 * class.cs: Adjustments to cope with the fact that now toplevel
8925 blocks are of type `ToplevelBlock'.
8927 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8928 insteda of standard blocks.
8930 Flag errors if params arguments are passed to anonymous methods.
8932 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8933 `CurrentAnonymousMethod' which points to the current Anonymous
8934 Method. The variable points to the AnonymousMethod class that
8935 holds the code being compiled. It is set in the new EmitContext
8936 created for the anonymous method.
8938 (EmitContext.Phase): Introduce a variable and an enumeration to
8939 assist in enforcing some rules about when and where we are allowed
8940 to invoke certain methods (EmitContext.NeedsReturnLabel is the
8941 only one that enfonces this right now).
8943 (EmitContext.HaveCaptureInfo): new helper method that returns
8944 whether we have a CapturedContext initialized.
8946 (EmitContext.CaptureVariable): New method used to register that a
8947 LocalInfo must be flagged for capturing.
8949 (EmitContext.CapturedParameter): New method used to register that a
8950 parameters must be flagged for capturing.
8952 (EmitContext.CapturedField): New method used to register that a
8953 field must be flagged for capturing.
8955 (EmitContext.HaveCapturedVariables,
8956 EmitContext.HaveCapturedFields): Return whether there are captured
8957 variables or fields.
8959 (EmitContext.EmitMethodHostInstance): This is used to emit the
8960 instance for the anonymous method. The instance might be null
8961 (static methods), this (for anonymous methods that capture nothing
8962 and happen to live side-by-side with the current method body) or a
8963 more complicated expression if the method has a CaptureContext.
8965 (EmitContext.EmitTopBlock): Routine that drives the emission of
8966 code: it will first resolve the top block, then emit any metadata
8967 and then emit the code. The split is done so that we can extract
8968 any anonymous methods and flag any captured variables/parameters.
8970 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8971 during this phase, the ILGenerator should not be used as labels
8972 and local variables declared here might not be accessible to any
8973 code that is part of an anonymous method.
8975 Exceptions to this include the temporary variables that are
8976 created by some statements internally for holding temporary
8979 (EmitContext.EmitMeta): New routine, in charge of emitting all the
8982 (EmitContext.TemporaryReturn): This method is typically called
8983 from the Emit phase, and its the only place where we allow the
8984 ReturnLabel to be defined other than the EmitMeta. The reason is
8985 that otherwise we would have to duplicate a lot of logic in the
8986 Resolve phases of various methods that today is on the Emit
8989 (EmitContext.NeedReturnLabel): This no longer creates the label,
8990 as the ILGenerator is not valid during the resolve phase.
8992 (EmitContext.EmitThis): Extended the knowledge in this class to
8993 work in anonymous methods in addition to iterators.
8995 (EmitContext.EmitCapturedVariableInstance): This emits whatever
8996 code is necessary on the stack to access the instance to a local
8997 variable (the variable will be accessed as a field).
8999 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
9000 EmitContext.EmitAddressOfParameter): Routines to support
9001 parameters (not completed at this point).
9003 Removals: Removed RemapLocal and RemapLocalLValue. We probably
9004 will also remove the parameters.
9006 * convert.cs (Convert): Define a `ConstantEC' which points to a
9007 null. This is just to prefity some code that uses
9008 ImplicitStandardConversion code and do not have an EmitContext
9011 The idea is to flag explicitly that at that point in time, it is
9012 known that the conversion will not trigger the delegate checking
9013 code in implicit conversions (which requires a valid
9016 Everywhere: pass new EmitContext parameter since
9017 ImplicitStandardConversionExists now requires it to check for
9018 anonymous method conversions.
9020 (Convert.ImplicitStandardConversionExists): If the type of an
9021 expression is the anonymous_method_type, and the type is a
9022 delegate, we invoke the AnonymousMethod.Compatible method to check
9023 whether an implicit conversion is possible.
9025 (Convert.ImplicitConversionStandard): Only do implicit method
9026 group conversions if the language level is not ISO_1.
9028 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
9029 MethodInfo for the Invoke method. used by Delegate and
9032 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
9033 method conversions if the target type is a delegate.
9035 Removed extra debugging nops.
9037 (LocalVariableReference): Turn the `local_info' into a public
9040 Add `prepared' field, the same hack used for FieldExprs to cope
9041 with composed assignments, as Local variables do not necessarily
9042 operate purely on the stack as they used to: they can be captured
9045 Add `temp' for a temporary result, like fields.
9047 Refactor DoResolve and DoResolveLValue into DoResolveBase.
9049 It now copes with Local variables that are captured and emits the
9050 proper instance variable to load it from a field in the captured
9053 (ParameterReference.DoResolveBase): During the resolve phase,
9054 capture parameters if we are in an anonymous method.
9056 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
9057 anonymous method, use the EmitContext helper routines to emit the
9058 parameter reference.
9060 * iterators.cs: Set RemapToProxy to true/false during the
9063 * parameters.cs (GetParameterByName): New helper method.
9065 * typemanager.cs (anonymous_method_type) a new type that
9066 represents an anonyous method. This is always an internal type,
9067 used as a fencepost to test against the anonymous-methodness of an
9070 2004-10-20 Marek Safar <marek.safar@seznam.cz>
9072 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
9074 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
9076 2004-11-10 Martin Baulig <martin@ximian.com>
9078 * expression.cs (Invocation.BetterFunction): If two methods have
9079 equal parameter types, but only one of them is generic, the
9080 non-generic one wins.
9081 (New.DoResolve): Don't set `is_struct' to false if we're a generic
9082 instance; just use `Type.IsValueType' to determine whether
9083 something is a struct or not.
9084 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
9085 so we can be called multiple times.
9087 2004-11-10 Martin Baulig <martin@ximian.com>
9089 * generic.cs (TypeParameter.DefineConstraints): New public method.
9090 (TypeParameter.CheckAccessLevel): Override this and return true.
9091 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
9092 override ResolveType() anymore.
9093 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
9095 2004-11-10 Martin Baulig <martin@ximian.com>
9097 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
9098 call DeclSpace.ResolveNestedType() on it.
9100 2004-11-10 Martin Baulig <martin@ximian.com>
9102 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
9103 non-null, call ParameterModifier() on it.
9105 2004-11-10 Martin Baulig <martin@ximian.com>
9108 (Iterators): Added `current_type' and `this_type' fields.
9109 (Iterators.DefineIterator): Create a new EmitContext and store it
9110 in `ec'; compute `this_type'.
9112 2004-11-10 Martin Baulig <martin@ximian.com>
9115 (TypeManager.IsPrivateAccessible): New public method.
9116 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
9118 2004-11-10 Martin Baulig <martin@ximian.com>
9120 * class.cs (TypeContainer.DefineType): Call
9121 TypeBuilder.DefineGenericParameters() before resolving the type
9123 (MethodData.parent_method): New protected field.
9124 (MethodData..ctor): Added `MethodInfo parent_method' argument.
9125 (MethodData.Define): Compute `parent_method'.
9128 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
9129 (MemberCore.GetClsCompliantAttributeValue): Likewise.
9130 (DeclSpace.ec): New protected field; store the EmitContext here.
9131 (DeclSpace.EmitContext): New public property.
9132 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
9133 (DeclSpace.ResolveNestedType): New public method.
9134 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
9135 (DeclSpace.NestedAccessible): Added `Type tb' argument.
9136 (DeclSpace.FamilyAccessible): Likewise.
9137 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
9138 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
9141 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
9144 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
9145 (Enum.Emit): Don't create a new EmitContext.
9147 2004-10-18 Martin Baulig <martin@ximian.com>
9149 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
9150 `Type' directly, but call ResolveType() on it.
9151 (Catch.Resolve): Likewise.
9152 (Foreach.Resolve): Likewise.
9154 2004-10-18 Martin Baulig <martin@ximian.com>
9156 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
9157 `Type' directly, but call ResolveType() on it.
9158 (Probe.DoResolve): Likewise.
9159 (ArrayCreation.LookupType): Likewise.
9160 (TypeOf.DoResolve): Likewise.
9161 (SizeOf.DoResolve): Likewise.
9163 2004-10-18 Raja R Harinath <rharinath@novell.com>
9165 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
9168 2004-10-17 John Luke <john.luke@gmail.com>
9170 * class.cs (Operator.GetSignatureForError): use CSharpName
9172 * parameter.cs (Parameter.GetSignatureForError): Returns
9173 correct name even if was not defined.
9175 2004-10-13 Raja R Harinath <rharinath@novell.com>
9178 * class.cs (TypeContainer.EmitContext): New property.
9179 (DefineNestedTypes): Create an emitcontext for each part.
9180 (MethodCore.DoDefineParameters): Use container's emitcontext.
9181 Pass type array to InternalParameters.
9182 (MemberBase.DoDefine): Use container's emitcontext.
9183 (FieldMember.Define): Likewise.
9184 (Event.Define): Likewise.
9185 (SetMethod.GetParameterInfo): Change argument to EmitContext.
9186 Pass type array to InternalParameters.
9187 (SetIndexerMethod.GetParameterInfo): Likewise.
9188 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9189 * delegate.cs (Define): Pass emitcontext to
9190 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
9191 array to InternalParameters.
9192 * expression.cs (ParameterReference.DoResolveBase): Pass
9193 emitcontext to GetParameterInfo.
9194 (ComposedCast.DoResolveAsTypeStep): Remove check on
9195 ec.ResolvingTypeTree.
9196 * parameter.cs (Parameter.Resolve): Change argument to
9197 EmitContext. Use ResolveAsTypeTerminal.
9198 (Parameter.GetSignature): Change argument to EmitContext.
9199 (Parameters.ComputeSignature): Likewise.
9200 (Parameters.ComputeParameterTypes): Likewise.
9201 (Parameters.GetParameterInfo): Likewise.
9202 (Parameters.ComputeAndDefineParameterTypes): Likewise.
9203 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
9204 * support.cs (InternalParameters..ctor): Remove variant that takes
9206 * typemanager.cs (system_intptr_expr): New.
9207 (InitExpressionTypes): Initialize it.
9209 2004-10-12 Chris Toshok <toshok@ximian.com>
9211 * cs-parser.jay: fix location for try_statement and catch_clause.
9213 2004-10-18 Martin Baulig <martin@ximian.com>
9215 * class.cs (FieldMember.Define): Don't access the TypeExpr's
9216 `Type' directly, but call ResolveType() on it.
9217 (MemberBase.DoDefine): Likewise.
9219 * expression.cs (New.DoResolve): Don't access the TypeExpr's
9220 `Type' directly, but call ResolveType() on it.
9221 (ComposedCast.DoResolveAsTypeStep): Likewise.
9223 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9224 `Type' directly, but call ResolveType() on it.
9226 2004-10-17 John Luke <john.luke@gmail.com>
9228 * class.cs (Operator.GetSignatureForError): use CSharpName
9230 * parameter.cs (Parameter.GetSignatureForError): Returns
9231 correct name even if was not defined.
9233 2004-10-13 Raja R Harinath <rharinath@novell.com>
9236 * class.cs (TypeContainer.EmitContext): New property.
9237 (DefineNestedTypes): Create an emitcontext for each part.
9238 (MethodCore.DoDefineParameters): Use container's emitcontext.
9239 Pass type array to InternalParameters.
9240 (MemberBase.DoDefine): Use container's emitcontext.
9241 (FieldMember.Define): Likewise.
9242 (Event.Define): Likewise.
9243 (SetMethod.GetParameterInfo): Change argument to EmitContext.
9244 Pass type array to InternalParameters.
9245 (SetIndexerMethod.GetParameterInfo): Likewise.
9246 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9247 * delegate.cs (Define): Pass emitcontext to
9248 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
9249 array to InternalParameters.
9250 * expression.cs (ParameterReference.DoResolveBase): Pass
9251 emitcontext to GetParameterInfo.
9252 (ComposedCast.DoResolveAsTypeStep): Remove check on
9253 ec.ResolvingTypeTree.
9254 * parameter.cs (Parameter.Resolve): Change argument to
9255 EmitContext. Use ResolveAsTypeTerminal.
9256 (Parameter.GetSignature): Change argument to EmitContext.
9257 (Parameters.ComputeSignature): Likewise.
9258 (Parameters.ComputeParameterTypes): Likewise.
9259 (Parameters.GetParameterInfo): Likewise.
9260 (Parameters.ComputeAndDefineParameterTypes): Likewise.
9261 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
9262 * support.cs (InternalParameters..ctor): Remove variant that takes
9264 * typemanager.cs (system_intptr_expr): New.
9265 (InitExpressionTypes): Initialize it.
9267 2004-10-12 Chris Toshok <toshok@ximian.com>
9269 * cs-parser.jay: fix location for try_statement and catch_clause.
9271 2004-10-07 Raja R Harinath <rharinath@novell.com>
9273 More DeclSpace.ResolveType avoidance.
9274 * decl.cs (MemberCore.InUnsafe): New property.
9275 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
9276 with newly created EmitContext.
9277 (FieldMember.Define): Likewise.
9278 * delegate.cs (Delegate.Define): Likewise.
9279 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9280 only if normal name-lookup fails.
9281 (TypeExpr.DoResolve): Enable error-checking.
9282 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9283 (SizeOf.DoResolve): Likewise.
9284 (ComposedCast.DoResolveAsTypeStep): Likewise.
9285 (StackAlloc.DoResolve): Likewise.
9286 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9287 (Block.Unsafe): New property.
9288 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9289 (Unsafe): Set 'unsafe' flag of contained block.
9290 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9291 (Fixed.Resolve): Likewise.
9292 (Catch.Resolve): Likewise.
9293 (Using.ResolveLocalVariableDecls): Likewise.
9294 (Foreach.Resolve): Likewise.
9296 2004-10-05 John Luke <john.luke@gmail.com>
9298 * cs-parser.jay: add location to error CS0175
9300 2004-10-04 Miguel de Icaza <miguel@ximian.com>
9302 * ecore.cs (Expression.Constantity): Add support for turning null
9305 * const.cs (Const.Define): Allow constants to be reference types
9306 as long as the value is Null.
9308 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
9310 * namespace.cs (NamespaceEntry.Using): No matter which warning
9311 level is set, check if this namespace name has already been added.
9313 2004-10-03 Ben Maurer <bmaurer@ximian.com>
9315 * expression.cs: reftype [!=]= null should always use br[true,false].
9318 2004-10-03 Marek Safar <marek.safar@seznam.cz>
9321 * attribute.cs: Enum conversion moved to
9322 GetAttributeArgumentExpression to be applied to the all
9325 2004-10-01 Raja R Harinath <rharinath@novell.com>
9327 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9328 * class.c (TypeContainer.DefineType): Flag error if
9329 base types aren't accessible due to access permissions.
9330 * decl.cs (DeclSpace.ResolveType): Move logic to
9331 Expression.ResolveAsTypeTerminal.
9332 (DeclSpace.ResolveTypeExpr): Thin layer over
9333 Expression.ResolveAsTypeTerminal.
9334 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9335 Refactor code into NestedAccess. Use it.
9336 (DeclSpace.NestedAccess): New.
9337 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9338 argument to silence errors. Check access permissions.
9339 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9340 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9341 (Cast.DoResolve): Likewise.
9342 (New.DoResolve): Likewise.
9343 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9344 (TypeOf.DoResolve): Likewise.
9346 * expression.cs (Invocation.BetterConversion): Return the Type of
9347 the better conversion. Implement section 14.4.2.3 more faithfully.
9348 (Invocation.BetterFunction): Make boolean. Make correspondence to
9349 section 14.4.2.2 explicit.
9350 (Invocation.OverloadResolve): Update.
9351 (Invocation): Remove is_base field.
9352 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
9353 (Invocation.Emit): Likewise.
9355 2004-09-24 Marek Safar <marek.safar@seznam.cz>
9357 * cs-parser.jay: Reverted 642 warning fix.
9359 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9362 * decl.cs (FindMemberWithSameName): Indexer can have more than
9365 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9367 * expression.cs (LocalVariableReference.DoResolveLValue):
9368 Do not report warning 219 for out values.
9369 (EmptyExpression.Null): New member to avoid extra allocations.
9371 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9373 * cs-parser.jay: Fix wrong warning 642 report.
9375 * cs-tokenizer.cs (CheckNextToken): New helper;
9376 Inspect next character if is same as expected.
9378 2004-09-23 Martin Baulig <martin@ximian.com>
9380 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9381 (Convert.ImplicitReferenceConversionExists): Likewise.
9383 2004-11-09 Raja R Harinath <rharinath@novell.com>
9385 * Makefile (DISTFILES): Comment out a few missing files.
9387 2004-10-29 Raja R Harinath <rharinath@novell.com>
9389 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
9390 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
9391 (gmcs.exe): Invoke bootstrap-libs.
9392 (clean-local): Clean the net_2_0_bootstrap profile too.
9393 (PROGRAM_INSTALL_DIR): New.
9394 (install-local): Use it.
9396 2004-10-13 Martin Baulig <martin@ximian.com>
9398 * generic.cs (TypeManager.InflatedConstraints): New nested class.
9399 (TypeParameter.DefineType): If we're a method type parameter and
9400 that method is overriding something, "inflate" its constraints.
9402 2004-10-12 Martin Baulig <martin@ximian.com>
9404 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
9405 and have type arguments, create and resolve a ConstructedType.
9407 2004-10-12 Martin Baulig <martin@ximian.com>
9409 * decl.cs (MemberCache.FindMemberToOverride): Use
9410 TypeManager.IsEqual() to compare the parameters and Type.Equals()
9411 to compare the invocationType.
9413 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
9414 When comparing two type parameters, only do the signature-only
9415 comparision for method type parameters.
9417 2004-10-11 Martin Baulig <martin@ximian.com>
9419 * report.cs: Don't make --fatal abort on warnings, we have
9420 -warnaserror for that.
9422 2004-10-11 Martin Baulig <martin@ximian.com>
9425 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
9426 (TypeManager.IsEqual): Call ourself recursively instead of using
9429 2004-10-11 Martin Baulig <martin@ximian.com>
9431 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
9432 on our own type parameters, not on the ones we inherit from a containing
9435 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
9438 * generic.cs (TypeParameter.Define): We may only be called once.
9440 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
9441 instead of TypeManager.IsEqual().
9443 2004-09-28 Martin Baulig <martin@ximian.com>
9446 (GenericConstraints.EffectiveBaseClass): New public property.
9447 (TypeParameter.GenericConstraints): New public property.
9448 (ConstructedType.CheckConstraints): Improved.
9450 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
9451 (Convert.TypeParameterConversion): New private method; use this in
9452 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
9453 for all conversions related to type parameters.
9455 2004-09-24 Martin Baulig <martin@ximian.com>
9457 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
9458 type parameter conversions for type parameters which are known to
9461 2004-09-24 Martin Baulig <martin@ximian.com>
9463 * generic.cs (GenericConstraints): Added `IsReferenceType' and
9464 `IsValueType' properties.
9466 * support.cs (ReflectionConstraints): Use
9467 Type.GetGenericParameterConstraints() instead of the old hack.
9469 2004-09-24 Martin Baulig <martin@ximian.com>
9471 * generic.cs (GenericConstraints): Moved here and made it an
9474 * support.cs (GenericConstraints): Moved to generic.cs.
9476 2004-09-24 Martin Baulig <martin@ximian.com>
9479 (ReflectionConstraints): Un-nested this class and made it public.
9482 (TypeManager.GetTypeParameterConstraints): New public method.
9483 (TypeManager.HasConstructorConstraint): Use the attributes.
9485 2004-09-24 Martin Baulig <martin@ximian.com>
9487 * support.cs (GenericConstraints): Replaced `HasConstructor',
9488 `IsReferenceType' and `IsValueType' with `Attributes'.
9489 (ReflectionParameters.ReflectionConstraints): Removed the Create()
9490 method and made the .ctor public.
9492 * generic.cs (Constraints.Attributes): New public property.
9493 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
9494 `IsReferenceType' -> `HasReferenceTypeConstraint' and
9495 `IsValueType' -> `HasValueTypeConstraint'.
9497 2004-09-23 Martin Baulig <martin@ximian.com>
9499 * generic.cs (Constraints): Reflect latest runtime changes.
9501 2004-09-23 Martin Baulig <martin@ximian.com>
9503 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9504 (Convert.ImplicitReferenceConversionExists): Likewise.
9506 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9508 * class.cs (Operator.Define): Add error 448 and 559 report.
9510 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9512 * class.cs (MemberBase.IsTypePermitted): New protected
9513 method for checking error CS0610.
9515 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9517 * class.cs (TypeContainer.HasExplicitLayout): New property
9518 Returns whether container has StructLayout attribute set Explicit.
9519 (FieldMember): New abstract class for consts and fields.
9520 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9521 (Field): Reuse FieldMember.
9523 * const.cs (Const): Reuse FieldMember.
9525 * rootcontext.cs: EmitConstants call moved to class.
9527 2004-09-22 Martin Baulig <martin@ximian.com>
9529 Marek and me just fixed one of our oldest bugs: #28562 :-)
9531 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9533 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9534 we're an EnumConstant, just return that.
9535 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9536 an EnumConstant. In this case, we need to use GetValueAsEnumType()
9537 to get the value which'll actually be written into the attribute.
9538 However, we have to use GetValue() to access the attribute's value
9541 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9543 * constant.cs (Constant.IsNegative): New abstract property
9546 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9547 (StackAlloc.DoResolve): Reused IsNegative.
9549 2004-09-22 Martin Baulig <martin@ximian.com>
9551 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
9552 public method; like LookupTypeContainer, but also works for
9555 * report.cs (Report.SymbolRelatedToPreviousError): Use
9556 TypeManager.LookupGenericTypeContainer().
9558 2004-09-22 Martin Baulig <martin@ximian.com>
9560 Thanks to Peter Sestoft for this bug report.
9562 * expression.cs (Conditional): If both the `trueExpr' and the
9563 `falseExpr' is a NullLiteral, return a NullLiteral.
9565 2004-09-22 Martin Baulig <martin@ximian.com>
9567 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9568 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9569 for the "get_Current" call.
9571 2004-09-21 Martin Baulig <martin@ximian.com>
9573 * convert.cs (Convert.ImplicitReferenceConversion): When
9574 converting to an interface type, first check whether we're
9575 converting from a reference type.
9577 2004-09-14 Martin Baulig <martin@ximian.com>
9579 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9581 2004-09-14 Marek Safar <marek.safar@seznam.cz>
9584 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9585 called and is obsolete then this member suppress message
9586 when call is inside next [Obsolete] method or type.
9588 * expression.cs: Use TestObsoleteMethodUsage member.
9590 2004-09-14 Martin Baulig <martin@ximian.com>
9592 * genericparser.cs: Removed.
9594 2004-09-13 Marek Safar <marek.safar@seznam.cz>
9596 * class.cs (MethodCore.CheckBase): Fix bug #65757.
9598 2004-09-12 Marek Safar <marek.safar@seznam.cz>
9600 * attribute.cs (Attribute.Resolve): Add error 653 report.
9602 * class.cs (Class.ApplyAttributeBuilder): Add error 641
9604 (Method.ApplyAttributeBuilder): Add error 685 report.
9605 (Operator.Define): Add error 564 report.
9607 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9609 * expression.cs (Invocation.DoResolve): Add error
9612 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9615 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9617 * class.cs (ConstructorInitializer.Resolve):
9618 Wrong error number (515->516).
9620 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9622 * class.cs (Indexer.Define): Add error 631 report.
9624 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9626 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9628 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9630 * expression.cs (Probe.DoResolve): Add error CS0241 report.
9632 2004-09-10 Marek Safar <marek.safar@seznam.cz>
9634 * cs-parser.jay: Added error CS0241 report.
9636 2004-09-10 Raja R Harinath <rharinath@novell.com>
9638 * cs-parser.jay (fixed_statement): Introduce a scope for the
9639 declaration in the 'fixed' statement.
9641 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9643 * cs-parser.jay: Added CS0230 error report.
9645 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9647 * cs-parser.jay: Added errors CS0231 and CS0257 report.
9649 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9651 * expression.cs (Argument.Resolve): Added error CS0192 and
9654 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9656 C# 2.0 #pragma warning feature
9658 * cs-tokenizer.cs (PreProcessPragma): New method;
9659 Handles #pragma directive.
9661 * report.cs (WarningRegions): New class; Support
9662 class for #pragma warning directive. It tests whether
9663 warning is enabled for a given line.
9665 2004-09-08 Miguel de Icaza <miguel@ximian.com>
9667 * const.cs: Add more descriptive error report, tahnks to
9670 2004-09-08 Marek Safar <marek.safar@seznam.cz>
9672 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9674 2004-09-07 Miguel de Icaza <miguel@ximian.com>
9676 * expression.cs: Apply patch from Ben: Remove dead code from
9677 ArrayCreation, and remove the TurnintoConstant call in const.cs,
9678 as that code just threw an exception anwyays.
9680 * const.cs: Remove the call to the turnintoconstant, for details
9683 * literal.cs: The type of the null-literal is the null type; So
9684 we use a placeholder type (literal.cs:System.Null, defined here)
9687 * expression.cs (Conditional.DoResolve): Remove some old code that
9688 is no longer needed, conversions have been fixed.
9690 (ArrayCreationExpression.DoResolve): Return false if we fail to
9691 resolve the inner expression.
9693 2004-09-07 Raja R Harinath <rharinath@novell.com>
9696 * cs-parser.jay (delegate_declaration): Record a delegate
9697 declaration as a type declaration.
9698 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9700 2004-09-06 Miguel de Icaza <miguel@ximian.com>
9702 * parameter.cs: Do not crash if the type can not be resolved.
9704 * expression.cs: Report errors with unsafe pointers, fixes #64896
9706 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
9708 * expression.cs: Pointer arith always needs to do a conv.i
9709 if the operand is a long. fix 65320
9711 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9713 Fixed cs0619-37.cs, cs0619-38.cs
9715 * enum.cs (GetObsoleteAttribute): Removed.
9717 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9718 on Enum member is double staged. The first is tested member
9721 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9723 Fixed #56986, #63631, #65231
9725 * class.cs: (TypeContainer.AddToMemberContainer): New method,
9726 adds member to name container.
9727 (TypeContainer.AddToTypeContainer): New method, adds type to
9729 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9730 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9731 AddOperator): Simplified by reusing AddToMemberContainer.
9732 (TypeContainer.UserDefinedStaticConstructor): Changed to property
9734 (Method.CheckForDuplications): Fixed implementation to test all
9736 (MemberBase): Detection whether member is explicit interface
9737 implementation is now in constructor.
9738 (MemberBase.UpdateMemberName): Handles IndexerName.
9739 (Accessor): Changed to keep also location information.
9740 (AbstractPropertyEventMethod): Is derived from MemberCore.
9741 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9742 will be emited or not.
9743 (PropertyBase.AreAccessorsDuplicateImplementation):
9744 Tests whether accessors are not in collision with some method.
9745 (Operator): Is derived from MethodCore to simplify common
9748 * decl.cs (Flags.TestMethodDuplication): Test for duplication
9750 (DeclSpace.AddToContainer): Adds the member to defined_names
9751 table. It tests for duplications and enclosing name conflicts.
9753 * enum.cs (EnumMember): Clean up to reuse the base structures
9755 2004-09-03 Martin Baulig <martin@ximian.com>
9757 Merged latest changes into gmcs. Please keep this comment in
9758 here, it makes it easier for me to see what changed in MCS since
9759 the last time I merged.
9761 2004-09-03 Martin Baulig <martin@ximian.com>
9763 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9764 into TypeContainer, to make partial classes work again.
9766 2004-09-03 Martin Baulig <martin@ximian.com>
9768 * rootcontext.cs (RootContext.V2): Removed.
9770 2004-03-23 Martin Baulig <martin@ximian.com>
9772 * expression.cs (Invocation.OverloadResolve): Added `bool
9773 may_fail' argument and use it instead of the Location.IsNull() hack.
9775 2004-09-09 Martin Baulig <martin@ximian.com>
9777 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
9779 2004-09-09 Martin Baulig <martin@ximian.com>
9781 * generic.cs (TypeParameter.DefineType): Added support for
9782 explicit interface methods.
9784 2004-09-09 Martin Baulig <martin@ximian.com>
9786 * README.Changes: New document. Started to list important changes
9787 between MCS and GMCS here.
9789 2004-09-08 Martin Baulig <martin@ximian.com>
9792 (TypeContainer.CheckRecursiveDefinition): New protected method.
9793 (TypeContainer.DefineType): Move the CS0146 check into
9794 CheckRecursiveDefinition().
9796 2004-09-06 Martin Baulig <martin@ximian.com>
9798 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
9799 types for the constructor constraint.
9801 2004-09-03 Martin Baulig <martin@ximian.com>
9803 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9804 into TypeContainer, to make partial classes work again.
9806 2004-09-03 Martin Baulig <martin@ximian.com>
9808 * rootcontext.cs (RootContext.V2): Removed.
9810 2004-03-23 Martin Baulig <martin@ximian.com>
9812 * expression.cs (Invocation.OverloadResolve): Added `bool
9813 may_fail' argument and use it instead of the Location.IsNull() hack.
9815 2004-09-03 Martin Baulig <martin@ximian.com>
9817 Merged latest changes into gmcs. Please keep this comment in
9818 here, it makes it easier for me to see what changed in MCS since
9819 the last time I merged.
9821 2004-09-03 Raja R Harinath <rharinath@novell.com>
9824 * expression.cs (BetterConversion): Don't allow either conversion
9825 to be null. Remove redundant implicit conversion test when 'q ==
9826 null' -- when this function is invoked, we already know that the
9827 implicit conversion exists.
9828 (BetterFunction): Assume that 'best' is non-null. Remove
9829 redundant reimplementation of IsApplicable when 'best' is null.
9830 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9831 number of arguments.
9832 (IsAncestralType): Extract from OverloadResolve.
9833 (OverloadResolve): Make robust to the MethodGroupExpr being
9834 unsorted. Implement all the logic of Section 14.5.5.1, and
9835 support overloading of methods from multiple applicable types.
9836 Clean up logic somewhat. Don't pass null methods to BetterFunction.
9838 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9839 (RealError, Warning): Append type of report to related symbol.
9841 2004-09-03 Marek Safar <marek.safar@seznam.cz>
9843 * enum.cs: Fixed CLS-Compliance checks for enum members.
9844 Error tests cs3008-8.cs, cs3014-8.cs
9846 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9848 Fixed bug #62342, #63102
9849 * class.cs: ImplementIndexer uses member.IsExplicitImpl
9850 like ImplementMethod.
9852 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9854 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9857 2004-09-02 Martin Baulig <martin@ximian.com>
9859 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9860 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9863 2004-09-01 Marek Safar <marek.safar@seznam.cz>
9865 C# 2.0 Static classes implemented
9867 * class.cs (TypeContainer): instance_constructors,
9868 initialized_fields, initialized_static_fields,
9869 default_constructor, base_inteface_types are protected to be
9870 accessible from StaticClass.
9871 (TypeContainer.DefineDefaultConstructor): New virtual method
9872 for custom default constructor generating
9873 (StaticClass): New class to handle "Static classes" feature.
9875 * cs-parser.jay: Handle static keyword on class like instance
9878 * driver.cs: Added "/langversion" command line switch with two
9879 options (iso-1, default).
9881 2004-08-31 Marek Safar <marek.safar@seznam.cz>
9883 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9885 2004-08-31 Miguel de Icaza <miguel@ximian.com>
9887 * delegate.cs: Style.
9889 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
9891 * delegate.cs: Add seperate instance expr field for miguel.
9893 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9895 * PointerArithmetic (Resolve): make sure we are not doing
9896 pointer arith on void*. Also, make sure we are resolved
9897 by not setting eclass until resolve.
9899 All callers: Make sure that PointerArithmetic gets resolved.
9901 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9903 * ArrayCreation (LookupType): If the type does not resolve
9904 to an array, give an error.
9906 2004-08-27 Marek Safar <marek.safar@seznam.cz>
9908 * statement.cs (Try.Resolve): Fixed bug #64222
9910 2004-08-27 Martin Baulig <martin@ximian.com>
9913 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9916 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9918 * ecore.cs (Constantify): Get underlying type via
9919 System.Enum.GetUnderlyingType to avoid StackOverflow on the
9920 Windows in special cases.
9922 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9924 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9925 for obtaining also private methods.
9926 (GetRemoveMethod): Used GetRemoveMethod (true)
9927 for obtaining also private methods.
9929 2004-09-02 Martin Baulig <martin@ximian.com>
9931 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9932 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9935 2004-08-27 Martin Baulig <martin@ximian.com>
9938 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9941 2004-08-25 Martin Baulig <martin@ximian.com>
9943 * support.cs (ReflectionParameters..ctor): If this is a generic
9944 method, retrieve and store its type parameters.
9945 (InternalParameters..ctor): Added `TypeParameter[]' argument.
9946 (ReflectionParameters.GenericConstraints): The argument specifies
9947 the type parameter, not the method parameter.
9948 (InternalParameters.GenericConstraints): Likewise.
9950 * generic.cs (TypeParameter.DefineType): Correctly handle
9951 constraints wrt. generic methods in interfaces and their
9954 2004-08-24 Martin Baulig <martin@ximian.com>
9956 * generic.cs (TypeParameter.IsSubclassOf): New public method.
9957 (Constraints.IsSubclassOf): New internal method.
9959 * typemanager.cs (TypeManager.FindMembers): Added special support
9960 for GenericTypeParameterBuilder's.
9961 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
9964 2004-08-24 Martin Baulig <martin@ximian.com>
9967 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9968 this for accessibility checks.
9969 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9970 IsNestedFamilyAccessible.
9971 (TypeManager.IsSubclassOf): New method, do what the name actually
9974 2004-08-24 Martin Baulig <martin@ximian.com>
9976 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
9977 as a SimpleName, include the generic arity.
9979 2004-08-24 Martin Baulig <martin@ximian.com>
9981 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9982 MethodAttributes.HideBySig for operators.
9984 2004-08-23 Martin Baulig <martin@ximian.com>
9986 Back to the old error reporting system :-)
9988 * report.cs (Message): Removed.
9989 (Report.MessageData, ErrorData, WarningData): Removed.
9990 (Report.Error, Warning): Back to the old system.
9992 2004-08-23 Martin Baulig <martin@ximian.com>
9994 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9996 * class.cs (TypeContainer.ParentContainer): New public virtual
9997 method; replaces the explicit interface implementation.
9998 (ClassPart.ParentContainer): Override.
10000 2004-08-23 Martin Baulig <martin@ximian.com>
10002 * statement.cs (Switch): Added support for constant switches; see
10003 #59428 or test-285.cs.
10005 2004-08-22 Marek Safar <marek.safar@seznam.cz>
10008 * statement.cs (GetEnumeratorFilter): Removed useless
10009 logic because C# specs is strict. GetEnumerator must be
10012 2004-08-22 Martin Baulig <martin@ximian.com>
10014 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10015 a switch and may break, reset the barrier. Fixes #59867.
10017 2004-08-22 Marek Safar <marek.safar@seznam.cz>
10019 CLS-Compliance speed up (~5% for corlib)
10021 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
10022 New method. Tests container for CLS-Compliant names
10024 * class.cs (TypeContainer.VerifyClsName): New method.
10025 Checks whether container name is CLS Compliant.
10026 (Constructor): Implements IMethodData.
10028 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
10029 low-case table for CLS Compliance test.
10030 (MemberCache.VerifyClsParameterConflict): New method.
10031 Checks method parameters for CS3006 error.
10033 * enum.cs (EnumMember): Is derived from MemberCore.
10034 (Enum.VerifyClsName): Optimized for better performance.
10036 2004-08-06 Marek Safar <marek.safar@seznam.cz>
10038 * report.cs: Renamed Error_T to Error and changed all
10041 2004-08-06 Marek Safar <marek.safar@seznam.cz>
10043 * class.cs (TypeContainer.IndexerArrayList): New inner class
10044 container for indexers.
10045 (TypeContainer.DefaultIndexerName): New constant for default
10046 indexer name. Replaced all "Item" with this constant.
10047 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
10049 * typemanager.cs (TypeManager.default_member_ctor): Cache here
10050 DefaultMemberAttribute constructor.
10052 2004-08-05 Martin Baulig <martin@ximian.com>
10054 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
10057 2004-08-05 Marek Safar <marek.safar@seznam.cz>
10059 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
10060 multi platforms problem.
10062 * compiler.csproj: Included shared files.
10064 2004-08-04 Marek Safar <marek.safar@seznam.cz>
10066 Fix bug 60333, 55971 in the more general way
10067 * attribute.cs (Attribute.GetAttributeArgumentExpression):
10068 Added arg_type argument for constant conversion.
10069 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
10071 2004-08-04 Marek Safar <marek.safar@seznam.cz>
10074 * class.cs (TypeContainer ): New inner classes MethodArrayList,
10075 OperatorArrayList, MethodCoreArrayList for typecontainer
10076 containers. Changed class member types to these new types.
10077 (MethodArrayList.DefineMembers): Added test for CS0659.
10079 2004-08-04 Miguel de Icaza <miguel@ximian.com>
10081 * cfold.cs: Synchronize the folding with the code in expression.cs
10082 Binary.DoNumericPromotions for uint operands.
10084 * attribute.cs: Revert patch from Raja, it introduced a regression
10085 while building Blam-1.2.1 (hard to isolate a test case).
10087 2004-08-04 Marek Safar <marek.safar@seznam.cz>
10091 (TypeContainer.Define): Renamed to DefineContainerMembers because of
10093 (MethodCore.parent_method): New member. The method we're overriding
10094 if this is an override method.
10095 (MethodCore.CheckBase): Moved from Method class and made common.
10096 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
10098 (MethodCore.CheckForDuplications): New abstract method. For custom
10099 member duplication search in a container
10100 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
10101 method and its return type.
10102 (Event.conflict_symbol): New member. Symbol with same name in the
10106 (MemberCache.FindMemberWithSameName): New method. The method
10107 is looking for conflict with inherited symbols.
10109 2004-08-04 Martin Baulig <martin@ximian.com>
10111 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10113 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10115 2004-08-03 Marek Safar <marek.safar@seznam.cz>
10117 * report.cs (Message): New enum for better error, warning reference in
10119 (MessageData): New inner abstract class. It generally handles printing of
10120 error and warning messages.
10121 Removed unused Error, Warning, Message methods.
10123 2004-08-03 Marek Safar <marek.safar@seznam.cz>
10125 Fix for cs0592-8.cs test
10127 (Attributable.ValidAttributeTargets): Made public.
10128 (Attribute.ExplicitTarget): New member for explicit target value.
10129 (Attribute.CheckTargets): Now we translate explicit attribute
10130 target to Target here.
10132 2004-08-03 Ben Maurer <bmaurer@ximian.com>
10134 * ecore.cs (MethodGroupExpr): new IsBase property.
10136 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
10138 * delegate.cs (DelegateCreation): store a MethodGroupExpr
10139 rather than an instance expr.
10141 (DelegateCreation.Emit): Use the method group rather than
10142 the instance expression. Also, if you have base.Foo as the
10143 method for a delegate, make sure to emit ldftn, not ldftnvirt.
10145 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
10147 (NewDelegate.DoResolve): Only check for the existance of Invoke
10148 if the method is going to be needed. Use MethodGroupExpr.
10150 (NewDelegate.Emit): Remove, DelegateCreation implements this.
10152 * expression.cs: For pointer arith., make sure to use
10153 the size of the type, not the size of the pointer to
10156 2004-08-03 Marek Safar <marek.safar@seznam.cz>
10159 * class.cs (Class): Added error CS0502 test.
10161 2004-08-03 John Luke <jluke@cfl.rr.com>
10162 Raja R Harinath <rharinath@novell.com>
10165 * attribute.cs (Attribute.complained_before): New flag.
10166 (Attribute.ResolveType, Attribute.Resolve),
10167 (Attribute.DefinePInvokeMethod): Set it.
10168 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
10170 2004-08-03 Martin Baulig <martin@ximian.com>
10172 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10173 use a user-defined operator; we still need to do numeric
10174 promotions in case one argument is a builtin type and the other
10175 one has an implicit conversion to that type. Fixes #62322.
10177 2004-08-18 Martin Baulig <martin@ximian.com>
10179 * class.cs (Method.Define): Use the correct method name when
10180 creating the MethodBuilder for a generic method.
10182 2004-08-17 Martin Baulig <martin@ximian.com>
10184 * generic.cs (Constraints): Support type parameter constraints.
10186 2004-08-16 Martin Baulig <martin@ximian.com>
10188 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
10189 (Token.GENERIC_DIMENSION): New token; this is returned if we
10190 encounter an unbound generic type in a typeof() expression.
10192 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
10193 this token is only generated while parsing a typeof() expression.
10194 (typeof_expression): Removed the old unbound_type hack.
10196 * generic.cs (TypeArguments.IsUnbound): New public property.
10198 * decl.cs (MemberName): Added support for unbound types.
10200 2004-08-14 Martin Baulig <martin@ximian.com>
10203 (TypeManager.IsEqualGenericInstance): New static method.
10204 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
10205 just used to check accessibility, so follow the rules of 26.1.6.
10207 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
10208 ConstructedType instead of a TypeExpression if we have type arguments.
10210 * cs-parser.jay (typeof_expression): Support unbound generic types.
10212 * ecore.cs (UnboundTypeExpression): New public class.
10214 2004-08-12 Martin Baulig <martin@ximian.com>
10216 * typemanager.cs (TypeManager.IsNestedChildOf): Use
10217 TypeManager.IsEqual() rather than `=='.
10219 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
10220 generic instances as well.
10222 2004-08-12 Martin Baulig <martin@ximian.com>
10224 * expression.cs (Invocation.InferType): We can only infer method
10225 type parameters. Fixes #62647.
10227 2004-08-11 Martin Baulig <martin@ximian.com>
10229 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
10230 before resolving the base classes.
10232 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10234 * Makefile: install .mdb file too.
10236 2004-08-05 Martin Baulig <martin@ximian.com>
10238 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
10239 initializer, the current type is just the TypeBuilder, not the
10240 instantiated generic type.
10241 (FieldExpr.IsFieldInitializer): New public property.
10243 2004-08-04 Martin Baulig <martin@ximian.com>
10245 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10247 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10249 2004-08-03 Martin Baulig <martin@ximian.com>
10251 * class.cs (MethodData.Define): If we're an explicit
10252 implementation, remove the generic arity from the type name.
10254 2004-08-03 Martin Baulig <martin@ximian.com>
10256 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10257 use a user-defined operator; we still need to do numeric
10258 promotions in case one argument is a builtin type and the other
10259 one has an implicit conversion to that type. Fixes #62322.
10261 2004-08-02 Martin Baulig <martin@ximian.com>
10263 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
10264 `TypeExpr[]' array.
10265 (TypeContainer.GetClassBases): Return the unexpanded list of
10266 interfaces; we expand them later.
10267 (TypeContainer.DefineType): After creating the TypeBuilder, call
10268 TypeManager.ExpandInterfaces() to get an expanded and resolved
10269 list of interfaces.
10271 * ecore.cs (TypeExpr.GetInterfaces): Removed
10273 * generics.cs (Constraints.InterfaceConstraints): Remove.
10274 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
10275 register the interface constraints.
10278 (TypeManager.AddUserType): Removed the `ifaces' argument.
10279 (TypeManager.AddTypeParameter): Likewise.
10280 (TypeManager.AddUserInterface): Removed, was unused.
10281 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
10282 `TypeExpr[]' array for the interfaces.
10283 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
10284 has been defined, returns a list of the resolved interfaces types.
10285 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
10286 (TypeManager.GetExplicitInterfaces): Likewise.
10288 2004-08-02 Martin Baulig <martin@ximian.com>
10290 * expression.cs (Invocation.EmitCall): If we're invoking a method
10291 on a type parameter, use the new `Constrained' prefix opcode.
10293 2004-08-02 Martin Baulig <martin@ximian.com>
10295 * statement.cs (LocalInfo.Flags): Added `IsThis'.
10296 (LocalInfo.IsThis): New public property.
10297 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10299 2004-08-01 Martin Baulig <martin@ximian.com>
10301 * class.cs (TypeContainer.GetClassBases): Don't set the default
10302 here since we may get called from GetPartialBases().
10303 (TypeContainer.DefineType): If GetClassBases() didn't return a
10304 parent, use the default one.
10306 2004-07-30 Martin Baulig <martin@ximian.com>
10308 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10310 * class.cs (SourceMethod): New public class, derive from the
10311 symbol writer's ISourceMethod.
10312 (Method): Use the new symbol writer API.
10314 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10315 as argument and use the new symbol writer.
10318 (SourceFile): Implement the symbol writer's ISourceFile.
10319 (Location.SymbolDocument): Removed.
10320 (Location.SourceFile): New public property.
10322 * symbolwriter.cs: Use the new symbol writer API.
10324 2004-07-30 Raja R Harinath <rharinath@novell.com>
10326 * Makefile (install-local): Remove. Functionality moved to
10329 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
10331 * Makefile: Install mcs.exe.config file together with mcs.exe.
10332 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10333 correct runtime version.
10335 2004-07-25 Martin Baulig <martin@ximian.com>
10338 (TypeContainer.RegisterOrder): Removed, this was unused.
10339 (TypeContainer, interface_order): Removed.
10340 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10341 TypeContainer as argument since we can also be called with a
10342 `PartialContainer' for a partial class/struct/interface.
10343 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10344 of checking whether we're an `Interface' - we could be a
10345 `PartialContainer'.
10346 (PartialContainer.Register): Override; call
10347 AddClass()/AddStruct()/AddInterface() on our parent.
10349 * cs-parser.jay (interface_member_declaration): Add things to the
10350 `current_container', not the `current_class'.
10352 * rootcontext.cs (RegisterOrder): The overloaded version which
10353 takes an `Interface' was unused, removed.
10355 * typemanager.cs (TypeManager.LookupInterface): Return a
10356 `TypeContainer', not an `Interface'.
10357 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10358 contain a `PartialContainer' for an interface, so check it's
10359 `Kind' to figure out what it is.
10361 2004-07-25 Martin Baulig <martin@ximian.com>
10363 * class.cs (Class.DefaultTypeAttributes): New public constant.
10364 (Struct.DefaultTypeAttributes): Likewise.
10365 (Interface.DefaultTypeAttributes): Likewise.
10366 (PartialContainer.TypeAttr): Override this and add the
10367 DefaultTypeAttributes.
10369 2004-07-25 Martin Baulig <martin@ximian.com>
10371 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10372 we can just use the `Parent' field instead.
10374 2004-07-25 Martin Baulig <martin@ximian.com>
10376 * class.cs (TypeContainer.Emit): Renamed to EmitType().
10378 2004-07-25 Martin Baulig <martin@ximian.com>
10380 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10381 our parts before defining any methods.
10382 (TypeContainer.VerifyImplements): Make this virtual.
10383 (ClassPart.VerifyImplements): Override and call VerifyImplements()
10384 on our PartialContainer.
10386 2004-07-25 Martin Baulig <martin@ximian.com>
10388 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10390 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10391 argument, we can just use the `Parent' field instead.
10394 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
10395 (MemberBase.DoDefine): Likewise.
10397 2004-07-24 Martin Baulig <martin@ximian.com>
10399 * decl.cs (MemberCore.Parent): New public field.
10400 (DeclSpace.Parent): Moved to MemberCore.
10402 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10403 (MemberBase.ctor): Added TypeContainer argument, pass it to our
10405 (FieldBase, Field, Operator): Likewise.
10406 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10407 (EventField, Event): Likewise.
10409 2004-07-23 Martin Baulig <martin@ximian.com>
10411 * class.cs (PartialContainer): New public class.
10412 (ClassPart): New public class.
10413 (TypeContainer): Added support for partial classes.
10414 (TypeContainer.GetClassBases): Splitted some of the functionality
10415 out into GetNormalBases() and GetPartialBases().
10417 * cs-tokenizer.cs (Token.PARTIAL): New token.
10418 (Tokenizer.consume_identifier): Added some hacks to recognize
10419 `partial', but only if it's immediately followed by `class',
10420 `struct' or `interface'.
10422 * cs-parser.jay: Added support for partial clases.
10424 2004-07-23 Martin Baulig <martin@ximian.com>
10426 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10427 a `DeclSpace' and also made it readonly.
10428 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10429 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10430 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10432 * cs-parser.jay: Pass the `current_class', not the
10433 `current_container' (at the moment, this is still the same thing)
10434 to a new Method, Property, Event, Indexer or Constructor.
10436 2004-07-23 Martin Baulig <martin@ximian.com>
10438 * cs-parser.jay (CSharpParser): Added a new `current_class' field
10439 and removed the `current_interface' one.
10440 (struct_declaration, class_declaration, interface_declaration):
10441 Set `current_class' to the newly created class/struct/interface;
10442 set their `Bases' and call Register() before parsing their body.
10444 2004-07-23 Martin Baulig <martin@ximian.com>
10446 * class.cs (Kind): New public enum.
10447 (TypeContainer): Made this class abstract.
10448 (TypeContainer.Kind): New public readonly field.
10449 (TypeContainer.CheckDef): New public method; moved here from
10451 (TypeContainer.Register): New public abstract method.
10452 (TypeContainer.GetPendingImplementations): New public abstract
10454 (TypeContainer.GetClassBases): Removed the `is_class' and
10455 `is_iface' parameters.
10456 (TypeContainer.DefineNestedTypes): Formerly known as
10458 (ClassOrStruct): Made this class abstract.
10460 * tree.cs (RootTypes): New public type.
10462 2004-07-20 Martin Baulig <martin@ximian.com>
10464 * tree.cs (Tree.RecordNamespace): Removed.
10465 (Tree.Namespaces): Removed.
10467 * rootcontext.cs (RootContext.IsNamespace): Removed.
10469 * cs-parser.jay (namespace_declaration): Just create a new
10470 NamespaceEntry here.
10472 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
10474 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
10475 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
10476 entry to make sure it runs in the correct runtime version.
10478 2004-07-18 Martin Baulig <martin@ximian.com>
10480 * generic.cs (ConstructedType.CheckConstraints): Improved
10481 constraints checking.
10483 2004-07-18 Martin Baulig <martin@ximian.com>
10485 * expression.cs (Invocation.BetterMethod): Call
10486 TypeManager.TypeToCoreType() on all types and removed my previous
10487 hack; we're already doig the right thing here.
10489 2004-07-17 Martin Baulig <martin@ximian.com>
10491 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
10493 2004-07-16 Martin Baulig <martin@ximian.com>
10495 * iterators.cs: Added generics support.
10497 2004-07-16 Martin Baulig <martin@ximian.com>
10499 * iterators.cs: Rewrote this. We're now using one single Proxy
10500 class for both the IEnumerable and the IEnumerator interface and
10501 `Iterator' derives from Class so we can use the high-level API.
10503 * class.cs (TypeContainer.AddIterator): New method.
10504 (TypeContainer.DoDefineType): New protected virtual method, which
10505 is called from DefineType().
10506 (TypeContainer.DoDefineMembers): Call DefineType() and
10507 DefineMembers() on all our iterators.
10508 (TypeContainer.Emit): Call Emit() on all our iterators.
10509 (TypeContainer.CloseType): Call CloseType() on all our iterators.
10511 * codegen.cs (EmitContext.CurrentIterator): New public field.
10513 2004-07-15 Martin Baulig <martin@ximian.com>
10516 (TypeManager.not_supported_exception_type): New type.
10518 2004-07-14 Martin Baulig <martin@ximian.com>
10521 (TypeManager.generic_ienumerable_type): New type.
10522 (TypeManager.generic_ienumerator_type): New type.
10525 (RootContext.interfaces_first_stage): Added
10526 "System.Collections.Generic.IEnumerator`1" and
10527 "System.Collections.Generic.IEnumerable`1".
10529 2004-07-14 Martin Baulig <martin@ximian.com>
10531 * iterators.cs: Use real error numbers.
10533 2004-07-14 Martin Baulig <martin@ximian.com>
10535 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10536 requires this to be a System.Collection.IEnumerable and not a
10537 class implementing that interface.
10538 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
10540 2004-07-13 Marek Safar <marek.safar@seznam.cz>
10542 * class.cs: Fixed previous fix, it broke some error tests.
10544 2004-07-12 Martin Baulig <martin@ximian.com>
10546 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10549 2004-07-14 Martin Baulig <martin@ximian.com>
10551 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
10552 an exclamation mark (!) for the generic arity to reflect the
10553 latest spec changes; ie. use "System.Collections.Generic.IList`1".
10555 2004-07-13 Martin Baulig <martin@ximian.com>
10557 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
10558 specifiers being part of a type argument.
10560 2004-07-13 Martin Baulig <martin@ximian.com>
10562 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
10563 name for generic types.
10565 2004-07-13 Martin Baulig <martin@ximian.com>
10567 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
10570 2004-07-09 Miguel de Icaza <miguel@ximian.com>
10572 * assign.cs (LocalTemporary): Add new argument: is_address,If
10573 `is_address' is true, then the value that we store is the address
10574 to the real value, and not the value itself.
10576 * ecore.cs (PropertyExpr): use the new local temporary
10577 stuff to allow us to handle X.Y += z (where X is a struct)
10579 2004-07-08 Martin Baulig <martin@ximian.com>
10581 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10582 not always return, just like we're doing in Using.Resolve().
10584 2004-07-07 Miguel de Icaza <miguel@ximian.com>
10586 * cs-parser.jay (fixed_statement): flag this as Pinned.
10588 2004-07-06 Miguel de Icaza <miguel@ximian.com>
10590 * typemanager.cs (TypeManager): Removed MakePinned method, this
10591 mechanism is replaced with the .NET 2.x compatible mechanism of
10592 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10594 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
10595 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10596 `IsFixed' property which has a different meaning.
10598 2004-07-02 Raja R Harinath <rharinath@novell.com>
10600 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10601 visible from inside a nested class, not just the names of the
10602 immediately enclosing class.
10603 Fix for bug #60730.
10605 2004-06-24 Raja R Harinath <rharinath@novell.com>
10607 * expression.cs (BetterConversion): Remove buggy special-case
10608 handling of "implicit constant expression conversions". At this
10609 point, we already know that the conversion is possible -- we're
10610 only checking to see which is better.
10612 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10614 * cs-parser.jay: Added error CS0210 test.
10616 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10618 * cs-parser.jay: Added error CS0134 test.
10620 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10623 * cs-parser.jay: Added error CS0145 test.
10625 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10627 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10629 2004-06-23 Ben Maurer <bmaurer@ximian.com>
10631 * expression.cs (StackAlloc.Resolve): The argument may not
10632 be a constant; deal with this case.
10634 2004-06-23 Marek Safar <marek.safar@seznam.cz>
10636 * attribute.cs (IndexerName_GetIndexerName): Renamed to
10637 GetIndexerAttributeValue.
10638 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10640 * class.cs (Indexer.Define): Added error tests for CS0415,
10643 2004-06-23 Miguel de Icaza <miguel@ximian.com>
10645 * attribute.cs (Attribute.Resolve): Keep field code in sync with
10648 2004-06-23 Martin Baulig <martin@ximian.com>
10650 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10651 neither return nor throw, reset the barrier as well. Fixes #60457.
10653 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
10655 * class.cs : EventAttributes is now set to None by default.
10656 This fixes bug #60459.
10658 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10661 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10662 Don't throw exception but return null (it's sufficient now).
10664 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10666 * typemanager.cs (GetArgumentTypes): Faster implementation.
10668 2004-06-18 Martin Baulig <martin@ximian.com>
10670 * attribute.cs (Attribute.Resolve): Check whether we're an
10671 EmptyCast which a Constant child. Fixes #60333.
10673 2004-06-17 Ben Maurer <bmaurer@ximian.com>
10675 * statement.cs (EmitCollectionForeach): Account for the fact that
10676 not all valuetypes are in areas which we can take the address of.
10677 For these variables, we store to a temporary variable. Also, make
10678 sure that we dont emit a `callvirt' on a valuetype method.
10680 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10682 * expression.cs (StackAlloc.DoReSolve): Added test for
10683 negative parameter (CS0247).
10685 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10688 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10690 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10693 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10696 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10698 Fix bug #58254 & cs1555.cs, cs1556.cs
10699 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10701 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10703 * cs-parser.jay: Added error CS1669 test for indexers.
10705 2004-06-18 Martin Baulig <martin@ximian.com>
10707 * generics.cs (GenericMethod.ctor): Don't take an Attributes
10708 argument. Fixes #60441.
10710 2004-06-16 Ben Maurer <bmaurer@ximian.com>
10711 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
10712 The name needs to have the actual name of the method in order
10713 for other tests (such as the one in OverloadResolve for Invoke
10714 on a delegate) to work. As well, it does not really help
10715 error reporting because the method group had multiple methods.
10716 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
10717 Make profiling work.
10719 2004-06-13 Martin Baulig <martin@ximian.com>
10721 * cs-parser.jay: Don't allow generic attributes.
10723 2004-06-13 Martin Baulig <martin@ximian.com>
10725 * class.cs (MemberBase.DoDefineBase): New protected method.
10726 (MemberBase.DoDefine): Compute the `flags' in the new
10727 DoDefineBase() which must be called first.
10728 (Method.Define): Call DoDefineBase() first so we have the flags
10729 when defining the generic method.
10731 * cs-parser.jay (interface_method_declaration): Support generic methods.
10733 2004-06-13 Martin Baulig <martin@ximian.com>
10735 * decl.cs (TypeName): Removed.
10736 (MemberName): Removed TypeName and MemberNow; now we just have
10739 * cs-parser.jay: Don't distinguish between type arguments and type
10740 parameters in the grammar and simplified the rules a bit. The
10741 reduce/reduce conflicts are now gone (except the one we inherited
10744 2004-06-11 Martin Baulig <martin@ximian.com>
10746 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10747 call this twice: for params and varargs methods.
10749 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10752 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10754 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10756 * attribute.cs (Attribute.GetValidTargets): Made public.
10759 (AbstractPropertyEventMethod): New class for better code sharing.
10760 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10762 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10764 2004-06-09 Martin Baulig <martin@ximian.com>
10766 * cs-parser.jay: Removed a reduce/reduce conflict.
10768 2004-06-03 Martin Baulig <martin@ximian.com>
10770 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
10771 GetSimpleName() and return a SimpleName.
10773 * ecore.cs (SimpleName.Arguments): New public field.
10774 (SimpleName): Added overloaded ctor which takes an additional
10775 TypeArguments argument.
10776 (SimpleName.SimpleNameResolve): Added support for generic methods.
10777 (MethodGroupExpr.ResolveGeneric): New public method. The code was
10778 formerly in MemberAccess.DoResolve(), but we also need it in
10779 SimpleNameResolve().
10781 * expression.cs (MemberAccess.DoResolve): Use the new
10782 MethodGroupExpr.ResolveGeneric().
10784 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10786 * decl.cs: If possible, use lookuptypedirect here. We can only do
10787 this if there is no `.' after the namespace. Avoids using
10788 LookupType, which does lots of slow processing.
10789 (FindNestedType) New method, does what it says :-).
10790 * namespace.cs: use LookupTypeDirect.
10791 * rootcontext.cs: use membercache, if possible.
10792 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10794 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10797 According to the spec,
10799 In a member access of the form E.I, if E is a single identifier,
10800 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10801 field, property, localvariable, or parameter with the same type as
10802 the meaning of E as a type-name (§3.8), then both possible
10803 meanings of E are permitted.
10805 We did not check that E as a simple-name had the same type as E as
10808 This trivial check gives us 5-7% on bootstrap time.
10810 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10812 * expression.cs (Invocation.OverloadResolve): Avoid the
10813 use of hashtables and boxing here by allocating on demand.
10815 2004-05-30 Martin Baulig <martin@ximian.com>
10817 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10818 we're doing a silent lookup. Don't try to lookup nested types in
10819 TypeManager.object_type (thanks to Ben Maurer).
10821 2004-05-30 Martin Baulig <martin@ximian.com>
10823 Committing a patch from Ben Maurer.
10825 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10827 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10829 * convert.cs: add a trivial cache for overload operator resolution.
10831 2004-05-31 Marek Safar <marek.safar@seznam.cz>
10834 (AttributeTester.GetObsoleteAttribute): Returns instance of
10835 ObsoleteAttribute when type is obsolete.
10838 (TypeContainer.VerifyObsoleteAttribute): Override.
10839 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10840 (MethodCode.VerifyObsoleteAttribute): Override.
10841 (MemberBase.VerifyObsoleteAttribute): Override.
10844 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10845 and report proper error.
10848 (Delegate.VerifyObsoleteAttribute): Override.
10851 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10852 and report proper error.
10853 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10856 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10860 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10861 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10862 Added test for ObsoleteAttribute.
10865 (Catch): Derived from Statement.
10867 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10869 * decl.cs: If possible, use lookuptypedirect here. We can only do
10870 this if there is no `.' after the namespace. Avoids using
10871 LookupType, which does lots of slow processing.
10872 (FindNestedType) New method, does what it says :-).
10873 * namespace.cs: use LookupTypeDirect.
10874 * rootcontext.cs: use membercache, if possible.
10875 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10877 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10880 According to the spec,
10882 In a member access of the form E.I, if E is a single identifier,
10883 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10884 field, property, localvariable, or parameter with the same type as
10885 the meaning of E as a type-name (§3.8), then both possible
10886 meanings of E are permitted.
10888 We did not check that E as a simple-name had the same type as E as
10891 This trivial check gives us 5-7% on bootstrap time.
10893 2004-05-30 Marek Safar <marek.safar@seznam.cz>
10895 Fixed bug #59071 & cs0160.cs
10896 * statement.cs (Try.Resolve): Check here whether order of catch
10897 clauses matches their dependencies.
10899 2004-05-30 Marek Safar <marek.safar@seznam.cz>
10902 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
10905 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10907 * expression.cs (Invocation.OverloadResolve): Avoid the
10908 use of hashtables and boxing here by allocating on demand.
10910 2004-05-30 Martin Baulig <martin@ximian.com>
10912 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10913 we're doing a silent lookup. Don't try to lookup nested types in
10914 TypeManager.object_type (thanks to Ben Maurer).
10916 2004-05-30 Martin Baulig <martin@ximian.com>
10918 Committing a patch from Ben Maurer.
10920 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10922 2004-05-29 Martin Baulig <martin@ximian.com>
10924 * class.cs (IMethodData.ShouldIgnore): New method.
10926 * typemanager.cs (TypeManager.MethodFlags): Don't take a
10927 `Location' argument, we don't need it anywhere. Use
10928 `IMethodData.ShouldIgnore ()' instead of
10929 `MethodData.GetMethodFlags ()'.
10930 (TypeManager.AddMethod): Removed.
10931 (TypeManager.AddMethod2): Renamed to AddMethod.
10933 2004-05-29 Martin Baulig <martin@ximian.com>
10935 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10937 * convert.cs (Convert.ImplicitReferenceConversion): If we're
10938 converting from a class type S to an interface type and we already
10939 have an object on the stack, don't box it again. Fixes #52578.
10941 2004-05-29 Martin Baulig <martin@ximian.com>
10943 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10944 Added support for `params' parameters. Fixes #59267.
10946 2004-05-29 Martin Baulig <martin@ximian.com>
10948 * literal.cs (NullPointer): Provide a private .ctor which sets
10949 `type' to TypeManager.object_type. Fixes #59048.
10951 2004-05-29 Martin Baulig <martin@ximian.com>
10953 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10954 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
10956 * ecore.cs (EventExpr.instance_expr): Make the field private.
10958 2004-05-26 Marek Safar <marek.safar@seznam.cz>
10960 Fixed bug #50080 & cs0214-2.cs
10961 * expression.cs (Cast.DoResolve): Check unsafe context here.
10963 * statement.cs (Resolve.DoResolve): Likewise.
10965 2004-05-26 Martin Baulig <martin@ximian.com>
10967 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10969 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10970 (RootContext.LookupType): Pass down the `silent' flag.
10972 2004-05-25 Martin Baulig <martin@ximian.com>
10975 (MethodGroupExpr.IdenticalTypeName): New public property.
10976 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10977 expression actually refers to a type.
10979 2004-05-25 Martin Baulig <martin@ximian.com>
10981 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10982 for #56176 and made it actually work.
10984 2004-05-25 Martin Baulig <martin@ximian.com>
10986 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10987 (FieldExpr, PropertyExpr): Override and implement
10988 CacheTemporaries. Fixes #52279.
10990 2004-05-25 Miguel de Icaza <miguel@ximian.com>
10992 * location.cs: In the new compiler listing a file twice is a
10993 warning, not an error.
10995 2004-05-24 Martin Baulig <martin@ximian.com>
10997 * enum.cs (Enum.DefineType): For the `BaseType' to be a
10998 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
11000 2004-05-24 Martin Baulig <martin@ximian.com>
11002 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
11003 walking the `using' list. Fixes #53921.
11005 2004-05-24 Martin Baulig <martin@ximian.com>
11007 * const.cs (Const.LookupConstantValue): Added support for
11008 EmptyCast's; fixes #55251.
11010 2004-05-24 Martin Baulig <martin@ximian.com>
11012 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
11013 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
11014 which does the CS0135 check. The reason is that we first need to
11015 check whether the variable actually exists.
11017 2004-05-24 Martin Baulig <martin@ximian.com>
11019 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
11020 than RootContext.LookupType() to find the explicit interface
11021 type. Fixes #58584.
11023 2004-05-24 Raja R Harinath <rharinath@novell.com>
11025 * Makefile: Simplify. Use executable.make.
11026 * mcs.exe.sources: New file. List of sources of mcs.exe.
11028 2004-05-24 Anders Carlsson <andersca@gnome.org>
11032 Use the invariant culture when doing String.Compare for CLS case
11035 2004-05-23 Martin Baulig <martin@ximian.com>
11037 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
11038 don't have any dots. Fixes #52622, added cs0246-8.cs.
11040 * namespace.cs (NamespaceEntry.Lookup): Likewise.
11042 2004-05-23 Marek Safar <marek.safar@seznam.cz>
11044 * class.cs (MemberBase.Define): Reuse MemberType member for
11045 resolved type. Other methods can use it too.
11047 2004-05-23 Martin Baulig <martin@ximian.com>
11049 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
11050 the variable also exists in the current block (otherwise, we need
11051 to report a CS0103). Fixes #58670.
11053 2004-05-23 Martin Baulig <martin@ximian.com>
11055 * flowanalysis.cs (Reachability.Reachable): Compute this
11056 on-the-fly rather than storing it as a field.
11058 2004-05-23 Martin Baulig <martin@ximian.com>
11060 * flowanalysis.cs (Reachability.And): Manually compute the
11061 resulting `barrier' from the reachability.
11063 2004-05-23 Marek Safar <marek.safar@seznam.cz>
11066 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
11067 instance of ObsoleteAttribute when symbol is obsolete.
11070 (IMethodData): Extended interface for ObsoleteAttribute support.
11072 2004-05-22 Marek Safar <marek.safar@seznam.cz>
11074 * attribute.cs: Fix bug #55970
11076 2004-05-22 Marek Safar <marek.safar@seznam.cz>
11080 (GetObsoleteAttribute): New method. Creates the instance of
11082 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
11083 ObsoleteAttribute when member is obsolete.
11084 (AttributeTester.Report_ObsoleteMessage): Common method for
11085 Obsolete error/warning reporting.
11088 (TypeContainer.base_classs_type): New member for storing parent type.
11091 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
11092 for this MemberCore.
11094 2004-05-21 Marek Safar <marek.safar@seznam.cz>
11096 * attribute.cs, const.cs: Fix bug #58590
11098 2004-05-21 Martin Baulig <martin@ximian.com>
11100 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
11101 out parameters if the end of the method is unreachable. Fixes
11104 2004-05-21 Marek Safar <marek.safar@seznam.cz>
11106 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
11107 Hari was right, why extra method.
11109 2004-05-21 Marek Safar <marek.safar@seznam.cz>
11111 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
11113 2004-05-20 Martin Baulig <martin@ximian.com>
11115 * delegate.cs: Convert this file to Unix mode - like the original
11118 2004-05-20 Martin Baulig <martin@ximian.com>
11120 * attribute.cs: Convert this file to Unix mode - like the original
11123 2004-05-19 Marek Safar <marek.safar@seznam.cz>
11125 Fix bug #58688 (MCS does not report error when the same attribute
11128 * attribute.cs (Attribute.Emit): Distinction between null and default.
11130 2004-05-19 Raja R Harinath <rharinath@novell.com>
11132 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
11133 of a top-level attribute without an attribute target.
11134 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
11136 (Attribute.Conditional_GetConditionName),
11137 (Attribute.Obsolete_GetObsoleteMessage): Update.
11138 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
11139 part of ScanForIndexerName.
11140 (Attribute.CanIgnoreInvalidAttribute): New function.
11141 (Attribute.ScanForIndexerName): Move to ...
11142 (Attributes.ScanForIndexerName): ... here.
11143 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
11144 (Attributes.Search): New internal variant that can choose not to
11145 complain if types aren't resolved. The original signature now
11147 (Attributes.GetClsCompliantAttribute): Use internal variant, with
11148 complaints suppressed.
11149 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
11150 only if it not useful.
11151 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
11152 top-level for attributes that are shared between the assembly
11153 and a top-level class.
11154 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
11155 * class.cs: Update to reflect changes.
11156 (DefineIndexers): Fuse loops.
11157 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
11158 a couple more variants of attribute names.
11160 2004-05-18 Marek Safar <marek.safar@seznam.cz>
11162 Fix bug #52585 (Implemented explicit attribute declaration)
11165 (Attributable.ValidAttributeTargets): New abstract method. It gets
11166 list of valid attribute targets for explicit target declaration.
11167 (Attribute.Target): It holds target itself.
11168 (AttributeSection): Removed.
11169 (Attribute.CheckTargets): New method. It checks whether attribute
11170 target is valid for the current element.
11173 (EventProperty): New class. For events that are declared like
11174 property (with add and remove accessors).
11175 (EventField): New class. For events that are declared like field.
11178 * cs-parser.jay: Implemented explicit attribute target declaration.
11180 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
11181 Override ValidAttributeTargets.
11184 (ReturnParameter): Class for applying custom attributes on
11186 (ParameterAtribute): New class. Class for applying custom
11187 attributes on the parameter type.
11189 2004-05-17 Miguel de Icaza <miguel@ximian.com>
11191 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
11194 (Method): Allow UNSAFE here.
11196 * modifiers.cs: Support unsafe reporting.
11198 2004-05-17 Marek Safar <marek.safar@seznam.cz>
11200 * decl.cs: Fix bug #58478.
11202 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11204 * statement.cs: When checking for unreachable code on an EmptyStatement,
11205 set the location. Fixes bug #58488.
11207 2004-05-13 Miguel de Icaza <miguel@ximian.com>
11209 * driver.cs: Add -pkg handling.
11211 From Gonzalo: UseShelLExecute=false
11213 2004-05-12 Marek Safar <marek.safar@seznam.cz>
11216 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11218 (Attribute.IsClsCompliaceRequired): Moved to base for better
11220 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11221 when attribute is AttributeUsageAttribute.
11222 (Attribute.GetValidTargets): Simplified.
11223 (Attribute.GetAttributeUsage): New method returns AttributeUsage
11224 attribute for this type.
11225 (Attribute.ApplyAttributes): Method renamed to Emit and make
11227 (GlobalAttributeSection): New class for special handling of global
11228 attributes (assembly, module).
11229 (AttributeSection.Emit): New method.
11231 * class.cs: Implemented Attributable abstract methods.
11232 (MethodCore.LabelParameters): Moved to Parameter class.
11233 (Accessor): Is back simple class.
11234 (PropertyMethod): Implemented Attributable abstract class.
11235 (DelegateMethod): Implemented Attributable abstract class.
11236 (Event): New constructor for disctintion between normal Event
11237 and Event with accessors.
11239 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11241 * codegen.cs, const.cs, decl.cs, delegate.cs:
11242 (CommonAssemblyModulClass): Implemented Attributable abstract class
11245 * enum.cs: Implement IAttributeSupport interface.
11246 (EnumMember): New class for emum members. Implemented Attributable
11250 (ParameterBase): Is abstract.
11251 (ReturnParameter): New class for easier [return:] attribute handling.
11253 * typemanager.cs: Removed builder_to_attr.
11255 2004-05-11 Raja R Harinath <rharinath@novell.com>
11258 * attribute.cs (Attribute.GetPositionalValue): New function.
11259 * class.cs (TypeContainer.VerifyMembers): New function.
11260 (TypeContainer.Emit): Use it.
11261 (ClassOrStruct): New base class for Class and Struct.
11262 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
11263 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11265 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11266 then each non-static field should have a FieldOffset attribute.
11267 Otherwise, none of the fields should have a FieldOffset attribute.
11268 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
11269 and FieldOffset attributes.
11270 * typemanager.cs (TypeManager.struct_layout_attribute_type)
11271 (TypeManager.field_offset_attribute_type): New core types.
11272 (TypeManager.InitCoreTypes): Initialize them.
11274 2004-05-11 Michal Moskal <malekith@pld-linux.org>
11276 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11277 Return correct type.
11280 2004-05-09 Miguel de Icaza <miguel@ximian.com>
11282 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11283 be implicitly converted to ulong.
11285 * expression.cs: The logic for allowing operator &, | and ^ worked
11286 was wrong, it worked before because we did not report an error in
11287 an else branch. Fixes 57895.
11289 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11290 allow volatile fields to be reference types.
11292 2004-05-07 Miguel de Icaza <miguel@ximian.com>
11294 * driver.cs: Add support for /debug-
11296 2004-05-07 Raja R Harinath <rharinath@novell.com>
11298 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
11299 Add a 'complain' parameter to silence errors.
11300 (Attribute.Resolve): Update to changes. Put in sanity check to catch
11301 silently overlooked type-resolutions.
11302 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11303 to reflect changes.
11304 (Attributes.Search): New function.
11305 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11306 (Attributes.GetAttributeFullName): Remove hack.
11307 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
11308 Update to reflect changes.
11309 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11310 Use Attributes.Search instead of nested loops.
11312 2004-05-07 Marek Safar <marek.safar@seznam.cz>
11315 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11316 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11317 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11319 * report.cs: (Report.Warning): Renamed to Warning_T because of
11320 parameter collision.
11322 2004-05-05 Raja R Harinath <rharinath@novell.com>
11324 * expression.cs (MemberAccess.ResolveMemberAccess):
11325 Exit with non-zero status after Report.Error.
11326 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11328 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11330 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
11332 * support.cs: Don't hang when the file is empty.
11334 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
11336 * support.cs: In SeekableStreamReader, compute the preamble size of the
11337 underlying stream. Position changes should take into account that initial
11340 2004-05-03 Todd Berman <tberman@sevenl.net>
11342 * driver.cs: remove unused GetSysVersion function.
11344 2004-05-03 Todd Berman <tberman@sevenl.net>
11346 * driver.cs: Remove the hack from saturday, as well as the hack
11347 from jackson (LoadAssemblyFromGac), also adds the CWD to the
11348 link_paths to get that bit proper.
11350 2004-05-01 Todd Berman <tberman@sevenl.net>
11352 * driver.cs: Try a LoadFrom before a Load, this checks the current
11353 path. This is currently a bug in mono that is be fixed, however, this
11354 provides a workaround for now. This will be removed when the bug
11357 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
11359 * CryptoConvert.cs: Updated to latest version. Fix issue with
11360 incomplete key pairs (#57941).
11362 2004-05-01 Todd Berman <tberman@sevenl.net>
11364 * driver.cs: Remove '.' from path_chars, now System.* loads properly
11367 2004-04-30 Jackson Harper <jackson@ximian.com>
11369 * codegen.cs: Open keys readonly.
11371 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11373 * typemanager.cs: don't report cyclic struct layout when a struct
11374 contains 2 or more fields of the same type. Failed for Pango.AttrShape
11375 which has 2 Pango.Rectangle fields.
11377 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
11379 * expression.cs: Handle IntPtr comparisons with IL code
11380 rather than a method call.
11382 2004-04-29 Martin Baulig <martin@ximian.com>
11384 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
11385 the list of PropertyInfo's in class hierarchy and find the
11386 accessor. Fixes #56013.
11388 2004-04-29 Martin Baulig <martin@ximian.com>
11390 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11392 2004-04-29 Martin Baulig <martin@ximian.com>
11394 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11396 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11398 2004-04-29 Martin Baulig <martin@ximian.com>
11400 * class.cs (ConstructorInitializer.Resolve): Check whether the
11401 parent .ctor is accessible. Fixes #52146.
11403 2004-04-29 Martin Baulig <martin@ximian.com>
11405 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11407 * statement.cs (Using.EmitLocalVariableDecls): Use
11408 TypeManager.idisposable_type, not typeof (IDisposable).
11409 (Foreach.EmitCollectionForeach): Added support for valuetypes.
11411 2004-04-29 Martin Baulig <martin@ximian.com>
11413 * class.cs (Event.Define): Don't emit the field and don't set
11414 RTSpecialName and SpecialName for events on interfaces. Fixes
11417 2004-04-29 Raja R Harinath <rharinath@novell.com>
11419 Refactor Attribute.ApplyAttributes.
11420 * attribute.cs (Attributable): New base class for objects that can
11421 have Attributes applied on them.
11422 (Attribute): Make AttributeUsage fields public.
11423 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11424 (Attribute.IsInternalCall): New property.
11425 (Attribute.UsageAttr): Convert to a public read-only property.
11426 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11427 (Attribute.ResolveType, Attribute.Resolve)
11428 (Attribute.ScanForIndexerName): Update to reflect changes.
11429 (Attribute.CheckAttributeTarget): Re-format.
11430 (Attribute.ApplyAttributes): Refactor, to various
11431 Attributable.ApplyAttributeBuilder methods.
11432 * decl.cs (MemberCore): Make Attributable.
11433 * class.cs (Accessor): Make Attributable.
11434 (MethodData.ApplyAttributes): Use proper attribute types, not
11436 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11437 (TypeContainer.ApplyAttributeBuilder)
11438 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11439 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
11440 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11441 (Operator.ApplyAttributeBuilder): New factored-out methods.
11442 * const.cs (Const.ApplyAttributeBuilder): Likewise.
11443 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11444 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11445 * parameter.cs (ParameterBase): New Attributable base class
11446 that can also represent Return types.
11447 (Parameter): Update to the changes.
11449 2004-04-29 Jackson Harper <jackson@ximian.com>
11451 * driver.cs: Prefer the corlib system version when looking for
11452 assemblies in the GAC. This is still a hack, but its a better hack
11455 2004-04-29 Marek Safar <marek.safar@seznam.cz>
11457 * decl.cs, enum.cs: Improved error 3005 reporting.
11459 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11460 (related_symbols): New private member for list of symbols
11461 related to reported error/warning.
11463 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11465 2004-04-29 Martin Baulig <martin@ximian.com>
11467 * ecore.cs (Expression.Constantify): If we're an enum and
11468 TypeManager.TypeToCoreType() doesn't give us another type, use
11469 t.UnderlyingSystemType. Fixes #56178.
11471 2004-04-29 Martin Baulig <martin@ximian.com>
11473 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11474 interfaces and for each interface, only add members directly
11475 declared in that interface. Fixes #53255.
11477 2004-04-28 Martin Baulig <martin@ximian.com>
11479 * expression.cs (ConditionalLogicalOperator): Use a temporary
11480 variable for `left' to avoid that we evaluate it more than once;
11483 2004-04-28 Martin Baulig <martin@ximian.com>
11485 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11488 2004-04-28 Martin Baulig <martin@ximian.com>
11490 * statement.cs (LocalInfo.Resolve): Check whether the type is not
11493 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11494 whether the type is not void (CS1547).
11496 2004-04-28 Martin Baulig <martin@ximian.com>
11498 * expression.cs (Unary.DoResolveLValue): Override this and report
11499 CS0131 for anything but Operator.Indirection.
11501 2004-04-28 Martin Baulig <martin@ximian.com>
11503 Committing a patch from Ben Maurer; see bug #50820.
11505 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11508 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11511 2004-04-28 Martin Baulig <martin@ximian.com>
11513 Committing a patch from Ben Maurer; see bug #50820.
11515 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11518 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11521 2004-04-28 Martin Baulig <martin@ximian.com>
11523 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11524 (Block.AddLabel): Call DoLookupLabel() to only search in the
11527 2004-04-28 Martin Baulig <martin@ximian.com>
11529 * cfold.cs (ConstantFold.BinaryFold): Added special support for
11530 comparing StringConstants and NullLiterals in Equality and Inequality.
11532 2004-04-28 Jackson Harper <jackson@ximian.com>
11534 * driver.cs: Attempt to load referenced assemblies from the
11535 GAC. This is the quick and dirty version of this method that
11536 doesnt take into account versions and just takes the first
11537 canidate found. Will be good enough for now as we will not have more
11538 then one version installed into the GAC until I update this method.
11540 2004-04-28 Martin Baulig <martin@ximian.com>
11542 * typemanager.cs (TypeManager.CheckStructCycles): New public
11543 static method to check for cycles in the struct layout.
11545 * rootcontext.cs (RootContext.PopulateTypes): Call
11546 TypeManager.CheckStructCycles() for each TypeContainer.
11547 [Note: We only need to visit each type once.]
11549 2004-04-28 Martin Baulig <martin@ximian.com>
11551 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11553 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11554 success and added `out object value'. Use a `bool resolved' field
11555 to check whether we've already been called rather than
11556 `ConstantValue != null' since this breaks for NullLiterals.
11558 2004-04-28 Raja R Harinath <rharinath@novell.com>
11560 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11561 setting of this flag, since the 'set' method may be non-public.
11563 2004-04-28 Raja R Harinath <rharinath@novell.com>
11565 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11566 check on current_vector.Block.
11568 2004-04-27 Martin Baulig <martin@ximian.com>
11570 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11571 a field initializer. Fixes #56459.
11573 2004-04-27 Martin Baulig <martin@ximian.com>
11575 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11576 we're not attempting to use an indexer. Fixes #52154.
11578 2004-04-27 Martin Baulig <martin@ximian.com>
11580 * statement.cs (Return): Don't create a return label if we don't
11581 need it; reverts my change from January 20th. Thanks to Ben
11584 2004-04-27 Martin Baulig <martin@ximian.com>
11586 According to the spec, `goto' can only leave a nested scope, but
11589 * statement.cs (Block.LookupLabel): Only lookup in the current
11590 block, don't recurse into parent or child blocks.
11591 (Block.AddLabel): Check in parent and child blocks, report
11592 CS0140/CS0158 if we find a duplicate.
11593 (Block): Removed this indexer for label lookups.
11594 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11595 this already does the error reporting for us.
11598 (FlowBranching.UsageVector.Block): New public variable; may be null.
11599 (FlowBranching.CreateSibling): Added `Block' argument.
11600 (FlowBranching.LookupLabel): New public virtual method. Lookup a
11601 label for the target of a `goto' and check whether we're not
11602 leaving a `finally'.
11604 2004-04-27 Martin Baulig <martin@ximian.com>
11606 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11607 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11610 2004-04-27 Martin Baulig <martin@ximian.com>
11612 * statement.cs (Block.AddLabel): Also check for implicit blocks
11613 and added a CS0158 check.
11615 2004-04-27 Martin Baulig <martin@ximian.com>
11617 * flowanalysis.cs (FlowBranchingLoop): New class.
11618 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11619 UsageVector's instead of an ArrayList.
11620 (FlowBranching.Label): Likewise.
11621 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11622 (FlowBranching.AddBreakVector): New method.
11624 2004-04-27 Miguel de Icaza <miguel@ximian.com>
11626 * attribute.cs: Small regression fix: only convert the type if we
11627 the type is different, fixes System.Drawing build.
11629 2004-04-27 Martin Baulig <martin@ximian.com>
11631 * attribute.cs (Attribute.Resolve): If we have a constant value
11632 for a named field or property, implicity convert it to the correct
11635 2004-04-27 Raja R Harinath <rharinath@novell.com>
11637 * statement.cs (Block.Block): Implicit blocks share
11638 'child_variable_names' fields with parent blocks.
11639 (Block.AddChildVariableNames): Remove.
11640 (Block.AddVariable): Mark variable as "used by a child block" in
11641 every surrounding block.
11642 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11643 been used in a child block, complain about violation of "Invariant
11644 meaning in blocks" rule.
11645 * cs-parser.jay (declare_local_variables): Don't use
11646 AddChildVariableNames.
11647 (foreach_statement): Don't create an implicit block: 'foreach'
11648 introduces a scope.
11650 2004-04-23 Miguel de Icaza <miguel@ximian.com>
11652 * convert.cs (ImplicitNumericConversion): 0 is also positive when
11653 converting from 0L to ulong. Fixes 57522.
11655 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11657 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11658 derived class hides via 'new' keyword field from base class (test-242.cs).
11659 TODO: Handle this in the more general way.
11661 * class.cs (CheckBase): Ditto.
11663 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11665 * decl.cs (caching_flags): New member for storing cached values
11667 (MemberCore.Flags): New enum where bit flags for caching_flags
11669 (MemberCore.cls_compliance): Moved to caching_flags.
11670 (DeclSpace.Created): Moved to caching_flags.
11672 * class.cs: Use caching_flags instead of DeclSpace.Created
11674 2004-04-21 Miguel de Icaza <miguel@ximian.com>
11676 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11677 if we are only a derived class, not a nested class.
11679 * typemanager.cs: Same as above, but do this at the MemberLookup
11680 level (used by field and methods, properties are handled in
11681 PropertyExpr). Allow for the qualified access if we are a nested
11684 2004-04-21 Marek Safar <marek.safar@seznam.cz>
11686 * class.cs: Refactoring.
11687 (IMethodData): New inteface; Holds links to parent members
11688 to avoid member duplication (reduced memory allocation).
11689 (Method): Implemented IMethodData interface.
11690 (PropertyBase): New inner classes for get/set methods.
11691 (PropertyBase.PropertyMethod): Implemented IMethodData interface
11692 (Event): New inner classes for add/remove methods.
11693 (Event.DelegateMethod): Implemented IMethodData interface.
11695 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11696 EmitContext (related to class.cs refactoring).
11698 2004-04-21 Raja R Harinath <rharinath@novell.com>
11700 * delegate.cs (Delegate.VerifyApplicability): If the number of
11701 arguments are the same as the number of parameters, first try to
11702 verify applicability ignoring any 'params' modifier on the last
11706 2004-04-08 Martin Baulig <martin@ximian.com>
11708 Merged latest changes into gmcs. Please keep this comment in
11709 here, it makes it easier for me to see what changed in MCS since
11710 the last time I merged.
11712 2004-04-16 Raja R Harinath <rharinath@novell.com>
11714 * class.cs (TypeContainer.AddIndexer): Use
11715 'ExplicitInterfaceName' to determine if interface name was
11716 explicitly specified. 'InterfaceType' is not initialized at this time.
11717 (TypeContainer.DefineIndexers): Remove use of temporary list. The
11718 Indexers array is already in the required order. Initialize
11719 'IndexerName' only if there are normal indexers.
11720 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11721 (TypeContainer.Emit): Emit DefaultMember attribute only if
11722 IndexerName is initialized.
11725 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
11727 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11730 2004-04-15 Raja R Harinath <rharinath@novell.com>
11732 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11736 * attribute.cs (Attribute.Resolve): Check for duplicate named
11740 2004-04-15 Miguel de Icaza <miguel@ximian.com>
11742 * iterators.cs (MarkYield): track whether we are in an exception,
11743 and generate code accordingly. Use a temporary value to store the
11744 result for our state.
11746 I had ignored a bit the interaction of try/catch with iterators
11747 since their behavior was not entirely obvious, but now it is
11748 possible to verify that our behavior is the same as MS .NET 2.0
11752 2004-04-14 Miguel de Icaza <miguel@ximian.com>
11754 * iterators.cs: Avoid creating temporaries if there is no work to
11757 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11758 Enumerations, use TypeManager.EnumToUnderlying and call
11761 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11764 (This.Emit): Use EmitContext.EmitThis to emit our
11767 (This.EmitAssign): Ditto.
11769 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11770 codepaths, we will move all the functionality into
11773 (FieldExpr.EmitAssign): Ditto.
11775 This fixes several hidden bugs that I uncovered while doing a code
11776 review of this today.
11778 * codegen.cs (EmitThis): reworked so the semantics are more clear
11779 and also support value types "this" instances.
11781 * iterators.cs: Changed so that for iterators in value types, we
11782 do not pass the value type as a parameter.
11784 Initialization of the enumerator helpers is now done in the caller
11785 instead of passing the parameters to the constructors and having
11786 the constructor set the fields.
11788 The fields have now `assembly' visibility instead of private.
11790 2004-04-11 Miguel de Icaza <miguel@ximian.com>
11792 * expression.cs (Argument.Resolve): Check if fields passed as ref
11793 or out are contained in a MarshalByRefObject.
11795 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11796 another compiler type.
11798 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
11800 * class.cs (Indexer.Define): use the new name checking method.
11801 Also, return false on an error.
11802 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11803 (is_identifier_[start/part]_character): make static.
11805 2004-04-10 Miguel de Icaza <miguel@ximian.com>
11807 * expression.cs (Binary.ResolveOperator): Do no append strings
11808 twice: since we can be invoked more than once (array evaluation)
11809 on the same concatenation, take care of this here. Based on a fix
11810 from Ben (bug #56454)
11812 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11814 * codegen.cs: Fix another case where CS1548 must be reported (when
11815 delay-sign isn't specified and no private is available #56564). Fix
11816 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11817 error when MCS is used on the MS runtime and we need to delay-sign
11818 (which seems unsupported by AssemblyBuilder - see #56621).
11820 2004-04-08 Marek Safar <marek.safar@seznam.cz>
11822 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11823 (TypeManager.ComputeNamespaces): Faster implementation for
11826 * compiler.csproj: Updated AssemblyName to mcs.
11828 2004-05-11 Jackson Harper <jackson@ximian.com>
11830 * Makefile: Preserve MONO_PATH
11832 2004-05-11 Jackson Harper <jackson@ximian.com>
11834 * Makefile: Use mono and mcs to build gmcs
11836 2004-05-03 Miguel de Icaza <miguel@ximian.com>
11838 * codegen.cs: Add patch from Robert Shade
11839 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
11842 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
11844 * CryptoConvert.cs: Updated to latest version. Fix issue with
11845 incomplete key pairs (#57941).
11847 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11849 * codegen.cs: Fix another case where CS1548 must be reported (when
11850 delay-sign isn't specified and no private is available #56564). Fix
11851 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11852 error when MCS is used on the MS runtime and we need to delay-sign
11853 (which seems unsupported by AssemblyBuilder - see #56621).
11855 2004-04-29 Jackson Harper <jackson@ximian.com>
11857 * Makefile: Set MONO_PATH to use the bootstrap corlib
11858 * driver.cs: Check the GAC for referenced assemblies.
11860 2004-04-29 Martin Baulig <martin@ximian.com>
11862 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
11864 2004-04-07 Martin Baulig <martin@ximian.com>
11866 * expression.cs (Binary.ResolveOperator): Added special case for
11867 Equality/Inequality between a type parameter and a null literal.
11869 2004-04-07 Martin Baulig <martin@ximian.com>
11871 * convert.cs: Check null literal -> type parameter conversions.
11873 2004-04-07 Martin Baulig <martin@ximian.com>
11875 * generic.cs (ConstructedType.CheckConstraints): Enforce the
11876 `class' and `struct' constraints.
11878 2004-04-07 Martin Baulig <martin@ximian.com>
11880 * generic.cs (SpecialConstraint): New public enum.
11881 (Constraints.Resolve): Added support for the `class' and `struct'
11884 * cs-parser.jay (type_parameter_constraint): Added support for the
11885 `class' and `struct' constraints.
11887 2004-04-07 Martin Baulig <martin@ximian.com>
11889 * support.cs (GenericConstraints): Replaced `Types' by
11890 `ClassConstraint' and `InterfaceConstraints'; added
11891 `HasClassConstraint'.
11893 2004-04-07 Martin Baulig <martin@ximian.com>
11896 (Constraints.InterfaceConstraints): New public property.
11897 (Constraints.Types): Make this property public
11898 (TypeParameter): Implement IMemberContainer.
11899 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
11900 instead of a TypeBuilder/MethodBuilder; pass the interface
11901 constraints to TypeManager.AddTypeParameter().
11902 (TypeParameter.DefineType): Just take an EmitContext and no
11903 TypeBuilder/MethodBuilder. Use the new public API.
11905 * typemanager.cs (TypeManager.AddTypeParameter): Added
11906 `TypeExpr[]' argument; add the interfaces to the
11907 `builder_to_ifaces' hash.
11908 (TypeManager.LookupMemberContainer): For
11909 GenericTypeParameterBuilders, get the TypeParameter from the
11910 `builder_to_type_param'.
11911 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
11912 the TypeParameter and call FindMembers on it.
11914 2004-04-07 Martin Baulig <martin@ximian.com>
11917 (MethodCore.GenericMethod): Moved this field here from Method.
11918 (MethodCore.IsDuplicateImplementation): Take the number of type
11919 parameters into account if we're a generic method.
11921 * expression.cs (Invocation.InferTypeArguments): Don't return true
11922 if `arguments' is null; we still need to check whether we actually
11923 don't need to infer anything in this case.
11924 (MemberAccess): Merged the functionality from GenericMemberAccess
11927 * generic.cs (GenericMemberAccess): Removed.
11929 2004-04-05 Martin Baulig <martin@ximian.com>
11931 * decl.cs (MemberCore): For generic classes, interfaces and
11932 structs, `Name' now includes the number of type parameters
11933 ("Stack!1.Node!1").
11934 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
11935 encode the number of type arguments in the type name.
11937 * expression.cs (Expression.MemberLookup): Removed the
11938 `num_type_args' argument; we now encode the number of type
11939 arguments in the type name.
11941 * ecore.cs (SimpleName): Encode the number of type arguments in
11942 the type name itself.
11944 * generic.cs (ConstructedType): Likewise.
11946 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
11947 `MemberName'; we now include the number of type parameters in the
11950 * typemanager.cs (TypeManager.CheckGeneric): Removed.
11951 (TypeManager.MemberLookup): Removed the
11952 `num_type_args' argument; we now encode the number of type
11953 arguments in the type name.
11955 2004-04-03 Martin Baulig <martin@ximian.com>
11957 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
11958 (MemberCore.MemberName): Moved here from MemberBase.
11959 (DeclSpace.SetParameterInfo): Just take the constraints as an
11960 ArrayList; we already have the type parameters in our
11961 `MemberName'; also do the CS0080 reporting here.
11963 * cs-parser.jay (struct_declaration): Use `member_name' instead of
11964 `IDENTIFIER opt_type_parameter_list'; when constructing our
11965 `MemberName', it'll already include our type parameters.
11966 (class_declaration, interface_declaration): Likewise.
11967 (delegate_declaration): Likewise.
11968 (MakeName): Take a MemberName and return a MemberName.
11969 The following two changes are required to avoid shift/reduce conflicts:
11970 (member_name): Don't include a TypeName anymore; ie. this is now
11971 just 'IDENTIFIER opt_type_parameter_list'.
11972 (property_declaration, event_declaration): Use a
11973 `namespace_or_type_name' instead of a `member_name'.
11975 2004-04-03 Martin Baulig <martin@ximian.com>
11977 * decl.cs (MemberName): Renamed to `TypeName' and created a new
11978 `MemberName' class.
11979 (TypeName): Formerly known as MemberName.
11981 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
11982 instead of a `MemberName'.
11984 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
11985 (member_name): New rule; create a MemberName.
11987 2004-04-02 Martin Baulig <martin@ximian.com>
11989 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
11990 (CS0305 and CS0308).
11992 2004-04-02 Martin Baulig <martin@ximian.com>
11994 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
11995 support for nested types.
11997 2004-04-02 Martin Baulig <martin@ximian.com>
11999 * ecore.cs (IAlias): New public interface.
12000 (TypeExpr, TypeExpression): Implement IAlias.
12001 (TypeAliasExpression): New public class.
12003 * namespace.cs (Namespace): Implement IAlias.
12004 (Namespace.Lookup): Return an IAlias instead on an object.
12005 (Namespace.DefineName): Take an IAlias instead of an object.
12006 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
12008 (NamespaceEntry.UsingAlias): Take a Membername instead of an
12010 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
12012 (NamespaceEntry.Lookup): Likewise.
12014 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
12017 * decl.cs (DeclSpace): Implement IAlias.
12018 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
12020 * generic.cs (ConstructedType): Improved error checking.
12022 2004-04-02 Martin Baulig <martin@ximian.com>
12024 * convert.cs: Added type parameter conversions.
12027 (UnboxCast.Emit): Emit an `unbox.any' for type params.
12028 (ClassCast.Emit): If the source type is a type parameter, box it.
12029 If the target type is a type parameter, emit an `unbox.any'
12030 instead of a `classcast'.1
12032 2004-04-01 Martin Baulig <martin@ximian.com>
12034 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
12036 2004-04-01 Martin Baulig <martin@ximian.com>
12038 * generic.cs (ConstructedType.CheckConstraints): Use
12039 Convert.ImplicitStandardConversionExists(); user-defined implicit
12040 conversions are not allowed according to the spec.
12042 2004-03-30 Martin Baulig <martin@ximian.com>
12044 * expression.cs (New): Added support for type parameters.
12047 (TypeManager.activator_type): New public static field.
12048 (TypeManager.activator_create_instance): Likewise.
12050 2004-03-30 Martin Baulig <martin@ximian.com>
12052 * typemanager.cs (TypeManager.HasConstructorConstraint): New
12055 2004-03-30 Martin Baulig <martin@ximian.com>
12057 * generic.cs (ConstructedType.CheckConstraints): Actually follow
12058 the spec here: the argument type must be convertible to the
12061 2004-03-30 Martin Baulig <martin@ximian.com>
12064 (TypeParameter.Define, TypeParameter.DefineMethod): Call
12065 TypeManager.AddTypeParameter().
12066 (ConstructedType.CheckConstraints): Re-enable this and actually
12067 check whether we have a constructor constraint.
12070 (TypeManager.builder_to_type_param): New static field.
12071 (TypeManager.AddTypeParameter): New static method.
12072 (TypeManager.LookupTypeParameter): New public method.
12074 2004-03-30 Martin Baulig <martin@ximian.com>
12076 * generic.cs (TypeParameter.DefineType): Return a boolean and use
12077 the new API to actually define the constructor constraint.
12080 (TypeManager.new_constraint_attr_type): New static field.
12081 (TypeManager.InitCoreTypes): Initialize it.
12083 2004-03-30 Martin Baulig <martin@ximian.com>
12085 * generic.cs (Constraints): Completed error checking, use correct
12088 2004-03-29 Martin Baulig <martin@ximian.com>
12090 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
12092 * expression.cs (Invocation.InferTypeArguments): Added overloaded
12093 public version which takes a `ParameterData pd' instead of an
12096 2004-03-29 Martin Baulig <martin@ximian.com>
12098 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
12101 2004-03-29 Martin Baulig <martin@ximian.com>
12103 * expression.cs (Argument.ResolveMethodGroup): If we're a
12104 ConstructedType, call GetMemberAccess() on it.
12106 2004-03-29 Martin Baulig <martin@ximian.com>
12108 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
12109 (MethodCore.CheckGenericOverride): When overriding a generic
12110 method, check whether the constraints match.
12112 * support.cs (GenericConstraints): New public interface.
12113 (ParameterData.GenericConstraints): New public method.
12115 * parameter.cs (Parameter.Resolve): Check whether we're a generic
12116 method parameter and compute our constraints if appropriate.
12117 (Parameter.GenericConstraints): New public property.
12119 * generic.cs (Constraints): Implement GenericConstraints.
12121 2004-03-29 Martin Baulig <martin@ximian.com>
12123 * decl.cs (MemberCache.FindMemberToOverride): Use
12124 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
12126 2004-03-29 Martin Baulig <martin@ximian.com>
12128 * generic.cs (GenericMethod.Define): Resolve our type parameters.
12130 2004-03-29 Martin Baulig <martin@ximian.com>
12132 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
12133 not allowed on non-generic declarations").
12135 2004-03-29 Martin Baulig <martin@ximian.com>
12137 * expression.cs (Invocation.InferTypeArguments): Added overloaded
12138 public version of this method.
12140 * class.cs (MethodCore.IsDuplicateImplementation): Use
12141 Invocation.InferTypeArguments() to check this.
12143 2004-03-29 Martin Baulig <martin@ximian.com>
12145 * convert.cs: Use TypeManager.IsDelegateType() instead of
12146 comparing types correctly.
12148 2004-03-29 Martin Baulig <martin@ximian.com>
12150 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
12151 types directly to make it work for generic instances.
12153 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
12155 2004-03-29 Martin Baulig <martin@ximian.com>
12157 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
12158 support for arrays.
12160 2004-03-24 Martin Baulig <martin@ximian.com>
12162 * decl.cs (DeclSpace.FindType): Also use
12163 TypeManager.CheckGeneric() for types from the using clauses.
12165 2004-03-23 Martin Baulig <martin@ximian.com>
12167 * expression.cs (Invocation.OverloadResolve): Added `bool
12168 may_fail' argument and use it instead of the Location.IsNull() hack.
12170 2004-03-23 Martin Baulig <martin@ximian.com>
12172 * expression.cs (Invocation.InferType): Use correct type inference
12175 2004-03-23 Martin Baulig <martin@ximian.com>
12177 * ecore.cs (MethodGroupExpr.Name): Use
12178 TypeManager.CSharpSignature() instead of just the name.
12180 * expression.cs (Invocation.OverloadResolve): Provide better error
12182 (Invocation.DoResolve): OverloadResolve() never returns null
12183 without reporting an error, so removed the error -6 reporting here.
12185 2004-03-23 Martin Baulig <martin@ximian.com>
12187 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
12190 * cs-parser.jay (delegate_declaration): Support generic delegates.
12192 * delegate.cs: Support generic delegates.
12194 2004-03-22 Martin Baulig <martin@ximian.com>
12196 * expression.cs (Invocation.InferParamsTypeArguments): New static
12197 method; does type inference for params arguments.
12199 2004-03-21 Martin Baulig <martin@ximian.com>
12201 * typemanager.cs (TypeManager.IsGenericMethod): New public static
12202 method; checks whether a method is a generic method.
12204 * expression.cs (Invocation.InferTypeArguments): New static method;
12205 infer type arguments for generic method invocation.
12207 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
12208 property; we set this to true if we're resolving a generic method
12209 invocation and the user specified type arguments, ie. we're not
12210 doing type inference.
12212 2004-03-20 Martin Baulig <martin@ximian.com>
12214 * class.cs (MethodData.DeclaringType): New public property.
12215 (MethodData.Define): Set DeclaringType here.
12216 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
12217 instead of OperatorMethodBuilder.DeclaringType.
12219 2004-03-20 Martin Baulig <martin@ximian.com>
12221 * cs-tokenizer.cs (xtoken): Return a special
12222 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
12224 * cs-parser.jay (default_value_expression): Switch to the new
12227 2004-03-19 Martin Baulig <martin@ximian.com>
12229 * decl.cs (MemberName): New class. We use this to "construct"
12230 namespace_or_type_name's.
12232 * generics.cs (TypeArguments.GetDeclarations): New public method;
12233 returns the type arguments as a string[] and reports a CS0081 if
12234 one of them is not an identifier.
12236 * class.cs (MemberBase): The .ctor now takes the name as a
12237 MemberName instead of a string.
12238 (MemberBase.ExplicitInterfaceName): Changed type from string to
12240 (MemberBase.DoDefine): If we're an explicit implementation, the
12241 InterfaceType may be a generic instance.
12243 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
12244 (namespace_name): Call MemberName.GetName () to transform the
12245 MemberName into a string and ensure we don't have any type
12247 (type_name): Call MemberName.GetTypeExpression() to transfrom the
12248 MemberName into an expression.
12249 (method_header): Use namespace_or_type_name instead of member_name.
12251 2004-04-07 Miguel de Icaza <miguel@ximian.com>
12253 * rootcontext.cs: Add new types to the boot resolution.
12255 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12256 MulticastDelegate is not allowed.
12258 * typemanager.cs: Add new types to lookup: System.TypedReference
12261 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12262 check for TypedReference or ArgIterator, they are not allowed.
12264 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12265 makes us properly catch 1510 in some conditions (see bug 56016 for
12268 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
12270 * CryptoConvert.cs: update from corlib version
12273 2004-04-05 Miguel de Icaza <miguel@ximian.com>
12275 * class.cs (Indexer.Define): Check indexername declaration
12277 2004-04-05 Marek Safar <marek.safar@seznam.cz>
12279 * attribute.cs (IsClsCompliant): Fixed problem with handling
12280 all three states (compliant, not-compliant, undetected).
12282 2004-03-30 Marek Safar <marek.safar@seznam.cz>
12284 * attribute.cs (Attribute): Location is now public.
12285 (Resolve): Store resolved arguments (pos_values) in attribute class.
12286 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12287 (GetClsCompliantAttributeValue): New method that gets
12288 CLSCompliantAttribute value.
12289 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12290 if exists else null.
12291 (AttributeTester): New class for CLS-Compliant verification routines.
12293 * class.cs (Emit): Add CLS-Compliant verification.
12294 (Method.GetSignatureForError): Implemented.
12295 (Constructor.GetSignatureForError): Implemented
12296 (Constructor.HasCompliantArgs): Returns if constructor has
12297 CLS-Compliant arguments.
12298 (Constructor.Emit): Override.
12299 (Construcor.IsIdentifierClsCompliant): New method; For constructors
12300 is needed to test only parameters.
12301 (FieldBase.GetSignatureForError): Implemented.
12302 (TypeContainer): New member for storing base interfaces.
12303 (TypeContainer.FindMembers): Search in base interfaces too.
12305 * codegen.cs (GetClsComplianceAttribute): New method that gets
12306 assembly or module CLSCompliantAttribute value.
12307 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12309 (ModuleClass.Emit): Add error 3012 test.
12311 * const.cs (Emit): Override and call base for CLS-Compliant tests.
12313 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12314 state for all decl types.
12315 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12316 if CLS-Compliant tests are required.
12317 (IsClsCompliaceRequired): New method. Analyze whether code
12318 must be CLS-Compliant.
12319 (IsExposedFromAssembly): New method. Returns true when MemberCore
12320 is exposed from assembly.
12321 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12322 value or gets cached value.
12323 (HasClsCompliantAttribute): New method. Returns true if MemberCore
12324 is explicitly marked with CLSCompliantAttribute.
12325 (IsIdentifierClsCompliant): New abstract method. This method is
12326 used to testing error 3005.
12327 (IsIdentifierAndParamClsCompliant): New method. Common helper method
12328 for identifier and parameters CLS-Compliant testing.
12329 (VerifyClsCompliance): New method. The main virtual method for
12330 CLS-Compliant verifications.
12331 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12332 null. I don't know why is null (too many public members !).
12333 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12334 and get value of first CLSCompliantAttribute that found.
12336 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12337 (VerifyClsCompliance): Override and add extra tests.
12339 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12340 clscheck- disable CLS-Compliant verification event if assembly is has
12341 CLSCompliantAttribute(true).
12343 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12344 ApllyAttribute is now called in emit section as in the other cases.
12345 Possible future Emit integration.
12346 (IsIdentifierClsCompliant): New override.
12347 (VerifyClsCompliance): New override.
12348 (GetEnumeratorName): Returns full enum name.
12350 * parameter.cs (GetSignatureForError): Implemented.
12352 * report.cs (WarningData): New struct for Warning message information.
12353 (LocationOfPreviousError): New method.
12354 (Warning): New method. Reports warning based on the warning table.
12355 (Error_T): New method. Reports error based on the error table.
12357 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12358 verifications are done here.
12360 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12362 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12363 CLSCompliantAttribute.
12364 (all_imported_types): New member holds all imported types from other
12366 (LoadAllImportedTypes): New method fills static table with exported types
12367 from all referenced assemblies.
12368 (Modules): New property returns all assembly modules.
12370 2004-03-30 Miguel de Icaza <miguel@ximian.com>
12372 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12373 throwing a parser error.
12375 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12376 which removes the hardcoded get_/set_ prefixes for properties, as
12377 IL allows for the properties to be named something else.
12381 * expression.cs: Do not override operand before we know if it is
12382 non-null. Fix 56207
12384 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12386 * typemanager.cs: support for pinned variables.
12388 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12390 * decl.cs, typemanager.cs: Avoid using an arraylist
12391 as a buffer if there is only one result set.
12393 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12395 * expression.cs: Make sure you cant call a static method
12396 with an instance expression, bug #56174.
12398 2004-03-29 Miguel de Icaza <miguel@ximian.com>
12400 * class.cs (IsDuplicateImplementation): Improve error reporting to
12401 flag 663 (method only differs in parameter modifier).
12403 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12404 in preprocessor directives.
12406 * location.cs (LookupFile): Allow for the empty path.
12408 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
12409 better approach for some of that patch, but its failing with the
12410 CharSet enumeration. For now try/catch will do.
12412 * typemanager.cs: Do not crash if a struct does not have fields.
12415 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12417 * expression.cs: cs0213, cant fix a fixed expression.
12420 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12422 * cs-parser.jay: detect invalid embeded statements gracefully.
12425 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12427 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12430 the invocation type may not be a subclass of the tye of the item/
12431 The type of the item must be a subclass of the invocation item.
12436 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
12438 * attribute.cs: Added methods to get a string and a bool from an
12439 attribute. Required to information from AssemblyKeyFileAttribute,
12440 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12441 * codegen.cs: Modified AssemblyName creation to include support for
12442 strongnames. Catch additional exceptions to report them as CS1548.
12443 * compiler.csproj: Updated include CryptoConvert.cs.
12444 * compiler.csproj.user: Removed file - user specific configuration.
12445 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
12446 Mono.Security assembly. The original class is maintained and tested in
12447 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12448 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12449 like CSC 8.0 (C# v2) supports.
12450 * Makefile: Added CryptoConvert.cs to mcs sources.
12451 * rootcontext.cs: Added new options for strongnames.
12453 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
12455 * driver.cs: For --expect-error, report error code `2'
12456 if the program compiled with no errors, error code `1' if
12457 it compiled with an error other than the one expected.
12459 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
12461 * compiler.csproj: Updated for Visual Studio .NET 2003.
12462 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12463 * compiler.sln: Updated for Visual Studio .NET 2003.
12465 2004-03-24 Ravi Pratap M <ravi@ximian.com>
12467 * expression.cs: Fix bug #47234. We basically need to apply the
12468 rule that we prefer the conversion of null to a reference type
12469 when faced with a conversion to 'object' (csc behaviour).
12471 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12473 * statement.cs: Shorter form for foreach, eliminates
12474 a local variable. r=Martin.
12476 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12478 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12479 checks if we can use brtrue/brfalse to test for 0.
12480 * expression.cs: use the above in the test for using brtrue/brfalse.
12481 cleanup code a bit.
12483 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12485 * expression.cs: Rewrite string concat stuff. Benefits:
12487 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12488 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12489 rather than a concat chain.
12491 * typemanager.cs: Add lookups for more concat overloads.
12493 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12495 * expression.cs: Emit shorter il code for array init.
12512 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
12514 * statement.cs: Before, two switch blocks would be merged if the
12515 total size of the blocks (end_item - begin_item + 1) was less than
12516 two times the combined sizes of the blocks.
12518 Now, it will only merge if after the merge at least half of the
12523 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
12525 * class.cs : csc build fix for GetMethods(). See bug #52503.
12527 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
12529 * expression.cs: Make sure fp comparisons work with NaN.
12530 This fixes bug #54303. Mig approved this patch a long
12531 time ago, but we were not able to test b/c the runtime
12534 2004-03-19 Miguel de Icaza <miguel@ximian.com>
12536 * ecore.cs (TypExpr.GetHashCode): implement this overload.
12538 2004-03-19 Martin Baulig <martin@ximian.com>
12540 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
12541 two overloads may unify for some type parameter substitutions and
12542 report a CS0408 if appropriate.
12544 2004-03-19 Martin Baulig <martin@ximian.com>
12546 * class.cs (MemberCore.IsDuplicateImplementation): Report the
12547 error here and not in our caller.
12549 2004-03-19 Martin Baulig <martin@ximian.com>
12551 * interface.cs: Completely killed this file.
12552 (Interface): We're now a TypeContainer and live in class.cs.
12554 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12555 argument; we're now also called for interfaces.
12556 (TypeContainer.DefineMembers): Allow this method being called
12558 (TypeContainer.GetMethods): New public method; formerly known as
12559 Interface.GetMethod(). This is used by PendingImplementation.
12560 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12561 it's now private and non-static.
12562 (Interface): Moved this here; it's now implemented similar to
12564 (Method, Property, Event, Indexer): Added `bool is_interface'
12565 argument to their .ctor's.
12566 (MemberBase.IsInterface): New public field.
12568 * cs-parser.jay: Create normal Method, Property, Event, Indexer
12569 instances instead of InterfaceMethod, InterfaceProperty, etc.
12570 (opt_interface_base): Removed; we now use `opt_class_base' instead.
12571 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12573 2004-03-19 Martin Baulig <martin@ximian.com>
12575 * class.cs (MethodCore.IsDuplicateImplementation): New private
12576 method which does the CS0111 checking.
12577 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12578 Use IsDuplicateImplementation().
12580 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
12582 * decl.cs (FindMemberToOverride): New method to find the correct
12583 method or property to override in the base class.
12585 - Make Method/Property use the above method to find the
12586 version in the base class.
12587 - Remove the InheritableMemberSignatureCompare as it is now
12590 This patch makes large code bases much faster to compile, as it is
12591 O(n) rather than O(n^2) to do this validation.
12593 Also, it fixes bug 52458 which is that nested classes are not
12594 taken into account when finding the base class member.
12596 Reviewed/Approved by Martin.
12598 2004-03-17 Martin Baulig <martin@ximian.com>
12600 * expression.cs (MemberAccess.DoResolve): Take the parent's number
12601 of type arguments into account; use the `real_num_type_args'
12602 approach like in DoResolveAsTypeStep().
12604 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
12607 2004-03-17 Marek Safar <marek.safar@seznam.cz>
12609 * interface.cs: In all interface classes removed redundant
12610 member initialization.
12612 2004-03-16 Martin Baulig <martin@ximian.com>
12614 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12616 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12618 * decl.cs (DefineTypeAndParents): New helper method to define a
12619 type's containers before the type itself is defined; This is a
12620 bug exposed by the recent changes to Windows.Forms when an
12621 implemented interface was defined inside a class that had not been
12624 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12626 (Check): Loop correctly to report errors modifiers
12627 (UNSAFE was not in the loop, since it was the same as TOP).
12629 * interface.cs: Every interface member now takes a ModFlags,
12630 instead of a "is_new" bool, which we set on the base MemberCore.
12632 Every place where we called "UnsafeOk" in the interface, now we
12633 call the proper member (InterfaceMethod.UnsafeOK) instead to get
12634 the unsafe settings from the member declaration instead of the
12635 container interface.
12637 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
12639 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12640 `set_indexer_name' to the pending bits (one per type).
12642 We fixed a bug today that was picking the wrong method to
12643 override, since for properties the existing InterfaceMethod code
12644 basically ignored the method name. Now we make sure that the
12645 method name is one of the valid indexer names.
12647 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
12649 * support.cs (SeekableStreamReader): Keep track of stream byte
12650 positions and don't mix them with character offsets to the buffer.
12652 Patch from Gustavo Giráldez
12654 2004-03-15 Marek Safar <marek.safar@seznam.cz>
12656 * interface.cs (InterfaceSetGetBase): Removed double member
12657 initialization, base class does it as well.
12659 2004-03-13 Martin Baulig <martin@ximian.com>
12661 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12662 when compiling corlib.
12664 2004-03-13 Miguel de Icaza <miguel@ximian.com>
12666 * convert.cs (ExplicitConversion): We were reporting an error on
12667 certain conversions (object_type source to a value type, when the
12668 expression was `null') before we had a chance to pass it through
12669 the user defined conversions.
12671 * driver.cs: Replace / and \ in resource specifications to dots.
12674 * class.cs: Add check for duplicate operators. Fixes 52477
12676 2004-03-11 Miguel de Icaza <miguel@ximian.com>
12678 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12679 that are in the middle of the statements, not only at the end.
12682 * class.cs (TypeContainer.AddField): No longer set the
12683 `HaveStaticConstructor' flag, now we call it
12684 `UserDefineStaticConstructor' to diferentiate the slightly
12685 semantic difference.
12687 The situation is that we were not adding BeforeFieldInit (from
12688 Modifiers.TypeAttr) to classes that could have it.
12689 BeforeFieldInit should be set to classes that have no static
12694 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12696 And most importantly Zoltan's comment:
12698 http://bugzilla.ximian.com/show_bug.cgi?id=44229
12700 "I think beforefieldinit means 'it's ok to initialize the type sometime
12701 before its static fields are used', i.e. initialization does not need
12702 to be triggered by the first access to the type. Setting this flag
12703 helps the JIT to compile better code, since it can run the static
12704 constructor at JIT time, and does not need to generate code to call it
12705 (possibly lots of times) at runtime. Unfortunately, mcs does not set
12706 this flag for lots of classes like String.
12708 csc sets this flag if the type does not have an explicit static
12709 constructor. The reasoning seems to be that if there are only static
12710 initalizers for a type, and no static constructor, then the programmer
12711 does not care when this initialization happens, so beforefieldinit
12714 This bug prevents the AOT compiler from being usable, since it
12715 generates so many calls to mono_runtime_class_init that the AOT code
12716 is much slower than the JITted code. The JITted code is faster,
12717 because it does not generate these calls if the vtable is type is
12718 already initialized, which is true in the majority of cases. But the
12719 AOT compiler can't do this."
12721 2004-03-10 Miguel de Icaza <miguel@ximian.com>
12723 * class.cs (MethodData.Emit): Refactor the code so symbolic
12724 information is generated for destructors; For some reasons we
12725 were taking a code path that did not generate symbolic information
12728 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
12730 * class.cs: Create a Constructor.CheckBase method that
12731 takes care of all validation type code. The method
12732 contains some code that was moved from Define.
12734 It also includes new code that checks for duplicate ctors.
12735 This fixes bug #55148.
12737 2004-03-09 Joshua Tauberer <tauberer@for.net>
12739 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12740 a { ... }-style array creation invokes EmitStaticInitializers
12741 which is not good for reference-type arrays. String, decimal
12742 and now null constants (NullCast) are not counted toward
12743 static initializers.
12745 2004-03-05 Martin Baulig <martin@ximian.com>
12747 * location.cs (SourceFile.HasLineDirective): New public field;
12748 specifies whether the file contains or is referenced by a "#line"
12750 (Location.DefineSymbolDocuments): Ignore source files which
12751 either contain or are referenced by a "#line" directive.
12753 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
12755 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12756 direct access to our parent, so check the method inline there.
12758 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
12760 * expression.cs (Invocation.EmitCall): Miguel's last commit
12761 caused a regression. If you had:
12766 In Foo the implict this would be null.
12768 2004-02-27 Miguel de Icaza <miguel@ximian.com>
12770 * expression.cs (Invocation.EmitCall): If the method is not
12771 virtual, do not emit a CallVirt to it, use Call.
12773 * typemanager.cs (GetFullNameSignature): Improve the method to
12774 cope with ".ctor" and replace it with the type name.
12776 * class.cs (ConstructorInitializer.Resolve): Now the method takes
12777 as an argument the ConstructorBuilder where it is being defined,
12778 to catch the recursive constructor invocations.
12780 2004-03-16 Martin Baulig <martin@ximian.com>
12782 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
12783 ConstructedType, call ResolveType() on it to get the type rather
12784 than just using `expr.Type'.
12786 2004-03-16 Martin Baulig <martin@ximian.com>
12788 * generics.cs (ConstructedType.GetMemberAccess): Take the
12789 EmitContext instead on the TypeExpr and use
12790 ec.TypeContainer.CurrentType/ec.ContainerType.
12792 2004-03-16 Martin Baulig <martin@ximian.com>
12794 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
12795 parameters before aliases.
12797 2004-03-16 Martin Baulig <martin@ximian.com>
12799 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
12800 New oublic function; checks whether two generic instances may become
12801 equal under some instantiations (26.3.1).
12803 * class.cs (TypeContainer.Define): Call
12804 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
12807 2004-03-16 Martin Baulig <martin@ximian.com>
12809 * class.cs (TypeContainer.GetClassBases): Moved
12810 Error_TypeParameterAsBase() here and also check whether the base
12811 class is not an attribute.
12813 2004-03-16 Martin Baulig <martin@ximian.com>
12815 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12817 2004-03-16 Martin Baulig <martin@ximian.com>
12819 * class.cs (Error_TypeParameterAsBase): Use correct error number
12822 2004-03-16 Martin Baulig <martin@ximian.com>
12824 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
12827 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
12830 2004-03-15 Martin Baulig <martin@ximian.com>
12832 * typemanager.cs (TypeManager.GetFullName): New public method.
12833 (TypeManager.MemberLookup): Added `int_num_type_arguments'
12834 argument; only return members with the correct number of type
12836 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
12837 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
12838 whether the number of type arguments matches.
12840 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
12841 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
12843 * expression.cs (MemberAccess): Added public `NumTypeArguments'
12844 field; it's set by the protected .ctor when we're actually a
12845 GenericMemberAccess.
12846 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
12847 arguments and pass it to MemberLookupFinal ().
12849 * ecore.cs (Expression.MemberLookup): Added `int
12850 num_type_arguments' argument; only return members with the correct
12851 number of type arguments.
12852 (Expression.MemberLookupFailed): Check whether the MemberLookup
12853 failed because we did not have the correct number of type
12854 arguments; report CS0305 in this case.
12856 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
12857 `e.ResolveAsTypeTerminal()' already did so.
12859 2004-03-15 Martin Baulig <martin@ximian.com>
12861 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
12862 we're a ConstructedType; in this case, the caller must report an
12863 error (for instance CS0131).
12865 * generic.cs (TypeArguments): Added Location argument to the .ctor.
12866 (TypeArguments.Resolve): Actually report errors here.
12868 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12870 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12871 `set_indexer_name' to the pending bits (one per type).
12873 We fixed a bug today that was picking the wrong method to
12874 override, since for properties the existing InterfaceMethod code
12875 basically ignored the method name. Now we make sure that the
12876 method name is one of the valid indexer names.
12878 2004-03-15 Martin Baulig <martin@ximian.com>
12880 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
12881 for generic instances.
12883 2004-03-13 Martin Baulig <martin@ximian.com>
12885 * class.cs (TypeContainer.DefineType): Call
12886 TypeManager.AddUserType() immediately after creating the
12887 TypeBuilder; pass all type parameters when creating the
12890 * decl.cs (DeclSpace.FindNestedType): New public method.
12891 (DeclSpace.FindType): Added `int num_type_args' argument; only
12892 return types with the correct number of type parameters.
12893 (DeclSpace.CountTypeParams): New public property.
12895 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
12896 the number of type parameters; defaults to zero.
12898 * generic.cs (TypeArguments.Count): New public property.
12899 (ConstructedType.DoResolveAsTypeStep): First call
12900 ds.FindNestedType() to find out whether we're nested in the
12901 current generic type; in this case, we inherit all type parameters
12902 from the current class.
12904 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
12905 num_type_args' argument.
12906 (RootContext.LookupType): Added overloaded version which takes the
12907 number of type arguments; only return types with the correct
12908 number of type arguments.
12910 * typemanager.cs (TypeManager.CheckGeneric): New public function;
12911 checks whether `Type t' has `int num_type_args'.
12913 2004-03-13 Martin Baulig <martin@ximian.com>
12915 * generic.cs (GenericMethod.DefineType): New method; calls
12916 DefineType() on all the type parameters.
12918 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
12919 (MethodData.Define): If we're a generic method, call
12920 GenericMethod.DefineType() to define the type parameters.
12922 2004-03-10 Martin Baulig <martin@ximian.com>
12924 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
12925 instead of IsAssignableFrom.
12927 2004-03-10 Martin Baulig <martin@ximian.com>
12929 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
12931 * support.cs (ParameterData.HasArrayParameter): New property.
12932 (ReflectionParameters.ctor): Take a MethodBase instead of a
12933 ParameterInfo[]. If we have any type parameters, get the generic
12934 method definition and ask it whether we have variable arguments.
12936 2004-02-26 Miguel de Icaza <miguel@ximian.com>
12938 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12939 routines to check if a type is an enumerable/enumerator allow
12940 classes that implement the IEnumerable or IEnumerator interfaces.
12942 * class.cs (Property, Operator): Implement IIteratorContainer, and
12943 implement SetYields.
12945 (Property.Define): Do the block swapping for get_methods in the
12946 context of iterators. We need to check if Properties also
12947 include indexers or not.
12949 (Operator): Assign the Block before invoking the
12950 OperatorMethod.Define, so we can trigger the Iterator code
12953 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
12954 Property and Operator classes are not created when we parse the
12955 declarator but until we have the block completed, so we use a
12956 singleton SimpleIteratorContainer.Simple to flag whether the
12957 SetYields has been invoked.
12959 We propagate this setting then to the Property or the Operator to
12960 allow the `yield' to function.
12962 2004-02-25 Marek Safar <marek.safar@seznam.cz>
12964 * codegen.cs: Implemented attribute support for modules.
12965 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12966 Assembly/Module functionality.
12968 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12969 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12970 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12972 2004-02-16 Marek Safar <marek.safar@seznam.cz>
12974 * interface.cs (FindMembers): The operation is performed on all base
12975 interfaces and not only on the first. It is required for future CLS Compliance patch.
12977 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
12979 * statement.cs, codegen.cs:
12980 This patch deals with patterns such as:
12982 public class List : IEnumerable {
12984 public MyEnumerator GetEnumerator () {
12985 return new MyEnumerator(this);
12988 IEnumerator IEnumerable.GetEnumerator () {
12992 public struct MyEnumerator : IEnumerator {
12997 Before, there were a few things we did wrong:
12998 1) we would emit callvirt on a struct, which is illegal
12999 2) we emited ldarg when we needed to emit ldarga
13000 3) we would mistakenly call the interface methods on an enumerator
13001 type that derived from IEnumerator and was in another assembly. For example:
13003 public class MyEnumerator : IEnumerator
13005 Would have the interface methods called, even if there were public impls of the
13006 method. In a struct, this lead to invalid IL code.
13008 2004-02-11 Marek Safar <marek.safar@seznam.cz>
13010 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
13013 * delegate.cs (Define): Fixed crash when delegate type is undefined.
13015 2004-02-11 Miguel de Icaza <miguel@ximian.com>
13017 * cs-parser.jay: Fix small regression: we were not testing V2
13018 compiler features correctly.
13020 * interface.cs: If the emit context is null, then create one
13022 2004-02-09 Marek Safar <marek.safar@seznam.cz>
13024 * decl.cs (GetSignatureForError): New virtual method to get full name
13025 for error messages.
13027 * attribute.cs (IAttributeSupport): New interface for attribute setting.
13028 Now it is possible to rewrite ApplyAttributes method to be less if/else.
13030 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
13031 Duplicated members and code in these classes has been removed.
13032 Better encapsulation in these classes.
13034 2004-02-07 Miguel de Icaza <miguel@ximian.com>
13036 * assign.cs (Assign.DoResolve): When dealing with compound
13037 assignments, there is a new rule in ECMA C# 2.4 (might have been
13038 there before, but it is documented here) that states that in:
13042 If b is of type int, and the `op' is a shift-operator, then the
13043 above is evaluated as:
13047 * expression.cs (Binary.ResolveOperator): Instead of testing for
13048 int/uint/long/ulong, try to implicitly convert to any of those
13049 types and use that in pointer arithmetic.
13051 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
13052 method to print information for from the type, not from the
13053 null-method we were given.
13055 2004-02-01 Duncan Mak <duncan@ximian.com>
13057 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
13058 parsing for cmd, fixes bug #53694.
13060 2004-02-04 Marek Safar <marek.safar@seznam.cz>
13062 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
13063 in the member name duplication tests. Property and operator name duplication
13064 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
13066 2004-02-03 Marek Safar <marek.safar@seznam.cz>
13068 * interface.cs (PopulateMethod): Fixed crash when interface method
13069 returns not existing type (error test cs0246-3.cs).
13071 2004-02-02 Ravi Pratap M <ravi@ximian.com>
13073 * cs-parser.jay (interface_accessors): Re-write actions to also
13074 store attributes attached to get and set methods. Fix spelling
13077 (inteface_property_declaration): Modify accordingly.
13079 (InterfaceAccessorInfo): New helper class to store information to pass
13080 around between rules that use interface_accessors.
13082 * interface.cs (Emit): Apply attributes on the get and set
13083 accessors of properties and indexers too.
13085 * attribute.cs (ApplyAttributes): Modify accordingly to use the
13086 right MethodBuilder when applying attributes to the get and set accessors.
13088 2004-01-31 Miguel de Icaza <miguel@ximian.com>
13090 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
13092 2004-01-26 Miguel de Icaza <miguel@ximian.com>
13094 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
13096 2004-01-25 Miguel de Icaza <miguel@ximian.com>
13098 * cs-parser.jay: Remove YIELD token, instead use the new grammar
13099 changes that treat `yield' specially when present before `break'
13100 or `return' tokens.
13102 * cs-tokenizer.cs: yield is no longer a keyword.
13104 2004-01-23 Marek Safar <marek.safar@seznam.cz>
13106 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
13107 setting for default constructors.
13108 For default constructors are almost every time set wrong Modifier. The
13109 generated IL code has been alright. But inside mcs this values was
13110 wrong and this was reason why several of my CLS Compliance tests
13113 2004-02-27 Martin Baulig <martin@ximian.com>
13115 * generics.cs (ConstructedType.ResolveType): Make the nested type
13116 stuff actually work.
13118 2004-02-25 Martin Baulig <martin@ximian.com>
13120 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
13121 property; returns the type parameters just from the current type,
13122 ie. with the ones from outer classes.
13123 (DeclSpace.LookupGeneric): First search in the current class, then
13125 (DeclSpace.initialize_type_params): When hiding a type parameter
13126 from an outer class, put it into the `type_param_list' anyways.
13128 * expression.cs (MemberAccess.expr): Made this field protected.
13130 * class.cs (TypeContainer.Define): The `CurrentType' just contains
13131 the type parameters from the current class.
13133 * generic.cs (ConstructedType.ResolveType): Support nested generic
13134 types by taking the type parameters which we inherit from outer
13135 classes into account.
13136 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
13137 support for nested generic types.
13139 2004-02-23 Martin Baulig <martin@ximian.com>
13141 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
13142 field and check whether we're nested inside a generic type.
13143 (DeclSpace.ResolveType): If we're resolving to a generic type
13144 definition, create a ConstructedType and return its resolved type.
13145 (DeclSpace.initialize_type_params): New private method;
13146 initializes the `type_param_list' field from the type parameters
13147 from this and all enclosing classes.
13148 (DeclSpace.TypeParameters): Call initialize_type_params() unless
13149 we're already initialized.
13151 2004-02-23 Martin Baulig <martin@ximian.com>
13153 * class.cs (Method.Define): Create the generic method before
13154 calling DoDefine().
13155 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
13156 the TypeContainer one); we use this for generic methods.
13158 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
13159 parent's TypeBuilder.
13161 2004-02-18 Martin Baulig <martin@ximian.com>
13163 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
13164 to check for equality.
13166 2004-02-05 Martin Baulig <martin@ximian.com>
13168 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
13169 `ec.TypeContainer.CurrentType', use it instead of
13170 `ec.ContainerType' to check whether we're in the type's ctor.
13172 2004-01-29 Martin Baulig <martin@ximian.com>
13174 * expression.cs (Invocation.DoResolve): If we're a
13175 `ConstructedType', then we're actually a generic method, so
13176 rewrite the expr as a GenericMemberAccess.
13178 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
13179 here; manually parse it into a string.
13181 2004-01-28 Martin Baulig <martin@ximian.com>
13183 * typemanager.cs (TypeManager.IsEqual): New static method.
13184 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
13185 check for equality instead of using `=='.
13187 2004-01-26 Martin Baulig <martin@ximian.com>
13189 * decl.cs (DeclSpace.CurrentType): New public field.
13191 * expression.cs (This.ResolveBase): If we have an
13192 `ec.TypeContainer.CurrentType', use it instead of
13193 `ec.ContainerType'.
13195 * class.cs (TypeContainer.DefineType): If we're a generic type,
13196 create the `CurrentType' (unresolved).
13197 (TypeContainer.GenericType): New private field.
13198 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
13199 it and store it in `GenericType' before creating the MemberCache.
13200 (TypeContainer.GetMembers): If we have a `GenericType', call
13201 TypeManager.FindMembers() on it.
13203 * interface.cs (Interface.GenericType): New private field.
13204 (Interface.DefineType): If we're a generic type, create the
13205 `CurrentType' (unresolved).
13206 (Interface.DefineMembers): If we have a `CurrentType', resolve it
13207 and store it in `GenericType' before creating the MemberCache.
13208 (Interface.GetMembers): If we have a `GenericType', call
13209 TypeManager.FindMembers() on it.
13211 2004-01-22 Martin Baulig <martin@ximian.com>
13213 * cs-parser.jay (namespace_or_type_name): Return an Expression,
13214 not a QualifiedIdentifier. This is what `type_name_expression'
13215 was previously doing.
13216 (type_name_expression): Removed; the code is now in
13217 `namespace_or_type_name'.
13218 (qualified_identifier): Removed, use `namespace_or_type_name'
13220 (QualifiedIdentifier): Removed this class.
13222 2004-01-22 Martin Baulig <martin@ximian.com>
13224 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
13225 not a string as alias name.
13227 2004-01-21 Miguel de Icaza <miguel@ximian.com>
13229 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
13230 #52730 bug, and instead compute correctly the need to use a
13231 temporary variable when requesting an address based on the
13232 static/instace modified of the field and the constructor.
13234 2004-01-21 Martin Baulig <martin@ximian.com>
13236 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
13237 class and namespace before looking up aliases. Fixes #52517.
13239 2004-01-21 Martin Baulig <martin@ximian.com>
13241 * flowanalysis.cs (UsageVector.Merge): Allow variables being
13242 assinged in a 'try'; fixes exception4.cs.
13244 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13245 * class.cs : Implemented parameter-less constructor for TypeContainer
13247 * decl.cs: Attributes are now stored here. New property OptAttributes
13249 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
13251 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
13253 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13255 * typemanager.cs (CSharpSignature): Now reports also inner class name.
13256 (CSharpSignature): New method for indexer and property signature.
13258 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13260 * pending.cs (IsVirtualFilter): Faster implementation.
13262 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13264 * typemanager.cs: Avoid inclusion of same assembly more than once.
13266 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13268 * cs-parser.jay: Fixed problem where the last assembly attribute
13269 has been applied also to following declaration (class, struct, etc.)
13271 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13273 * class.cs: Added error CS0538, CS0539 reporting.
13274 Fixed crash on Microsoft runtime when field type is void.
13276 * cs-parser.jay: Added error CS0537 reporting.
13278 * pending.cs: Added error CS0535 reporting.
13279 Improved error report for errors CS0536, CS0534.
13281 2004-01-20 Miguel de Icaza <miguel@ximian.com>
13283 Merge a few bits from the Anonymous Method MCS tree.
13285 * statement.cs (ToplevelBlock): New class for toplevel methods,
13286 will hold anonymous methods, lifted variables.
13288 * cs-parser.jay: Create toplevel blocks for delegates and for
13289 regular blocks of code.
13291 2004-01-20 Martin Baulig <martin@ximian.com>
13293 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13294 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13295 and `NeedExplicitReturn'; added `IsLastStatement'.
13296 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13297 have a `ReturnLabel' or we're not unreachable.
13299 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13300 child's reachability; don't just override ours with it. Fixes
13301 #58058 (lluis's example).
13302 (FlowBranching): Added public InTryOrCatch(), InCatch(),
13303 InFinally(), InLoop(), InSwitch() and
13304 BreakCrossesTryCatchBoundary() methods.
13306 * statement.cs (Return): Do all error checking in Resolve().
13307 Unless we are the last statement in a top-level block, always
13308 create a return label and jump to it.
13309 (Break, Continue): Do all error checking in Resolve(); also make
13310 sure we aren't leaving a `finally'.
13311 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13312 statement in a top-level block.
13313 (Block.Flags): Added `IsDestructor'.
13314 (Block.IsDestructor): New public property.
13316 2004-01-20 Martin Baulig <martin@ximian.com>
13318 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13320 2004-01-20 Martin Baulig <martin@ximian.com>
13322 * statement.cs (Statement.ResolveUnreachable): New public method.
13323 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13324 (Block.Resolve): Resolve unreachable statements.
13326 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
13328 * expression.cs: We need to fix the case where we do
13329 not have a temp variable here.
13331 * assign.cs: Only expression compound assignments need
13332 temporary variables.
13334 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
13336 * flowanalysis.cs: Reduce memory allocation in a few ways:
13337 - A block with no variables should not allocate a bit
13339 - A method with no out parameters does not need any tracking
13340 for assignment of the parameters, so we need not allocate
13343 public readonly Type[] VariableTypes;
13344 public readonly string[] VariableNames;
13345 Are redundant. The data is already stored in the variable
13346 map, so we need not allocate another array for it.
13347 - We need to add alot of checks for if (params | locals) == null
13348 due to the first two changes.
13350 2004-01-18 Miguel de Icaza <miguel@ximian.com>
13352 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13353 implement IMemoryLocation, we store a copy on a local variable and
13354 take the address of it. Patch from Benjamin Jemlich
13356 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13357 to use a special "type_name_expression" rule which reduces the
13358 number of "QualifiedIdentifier" classes created, and instead
13359 directly creates MemberAccess expressions.
13361 2004-01-17 Miguel de Icaza <miguel@ximian.com>
13363 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13364 that fixes #52853. Null literal assignment to ValueType
13366 * class.cs (MethodData.Emit): Instead of checking the name of the
13367 method to determine if its a destructor, create a new derived
13368 class from Method called Destructor, and test for that.
13370 * cs-parser.jay: Create a Destructor object instead of a Method.
13372 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13376 2004-01-16 Miguel de Icaza <miguel@ximian.com>
13378 * expression.cs (Binary.ResolveOperator): Perform an implicit
13379 conversion from MethodGroups to their delegate types on the
13380 Addition operation.
13382 * delegate.cs: Introduce a new class DelegateCreation that is the
13383 base class for `NewDelegate' and `ImplicitDelegateCreation',
13384 factor some code in here.
13386 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13387 conversion from MethodGroups to compatible delegate types.
13389 * ecore.cs (Expression.Resolve): Do not flag error 654
13390 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13391 we allow conversions from MethodGroups to delegate types now.
13393 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13394 assignments in v2 either.
13396 2004-01-10 Miguel de Icaza <miguel@ximian.com>
13398 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13399 static read-only fields in ctors.
13401 Applied patch from Benjamin Jemlich
13403 * expression.cs (UnaryMutator): Avoid leaking local variables.
13405 2004-01-09 Miguel de Icaza <miguel@ximian.com>
13407 * cs-tokenizer.cs (IsCastToken): Allow the various native types
13408 here to return true, as they can be used like this:
13410 (XXX) int.MEMBER ()
13412 Fixed 49836 and all the other dups
13414 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
13416 * driver.cs: Implement /win32res and /win32icon.
13418 2004-01-08 Miguel de Icaza <miguel@ximian.com>
13420 * cs-parser.jay: Add a rule to improve error handling for the
13421 common mistake of placing modifiers after the type.
13423 2004-01-07 Miguel de Icaza <miguel@ximian.com>
13425 * cs-parser.jay (interface_event_declaration): Catch
13426 initialization of events on interfaces, and report cs0068
13428 * cs-parser.jay (interface_event_declaration): Catch
13429 initialization of events.
13431 * ecore.cs: Better report missing constructors.
13433 * expression.cs (Binary.ResolveOperator): My previous bug fix had
13434 the error reporting done in the wrong place. Fix.
13436 * expression.cs (Binary.ResolveOperator): Catch the
13437 operator + (E x, E y) error earlier, and later allow for implicit
13438 conversions in operator +/- (E e, U x) from U to the underlying
13441 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13442 52596, if the container class is abstract, the default constructor
13443 is protected otherwise its public (before, we were always public).
13445 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13448 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13449 Jemlich that fixes bug #52597, MCS was generating invalid code for
13450 idisposable structs. Thanks to Ben for following up with this
13453 2004-01-06 Miguel de Icaza <miguel@ximian.com>
13455 * driver.cs: Allow assemblies without code to be generated, fixes
13458 2004-01-07 Nick Drochak <ndrochak@gol.com>
13460 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13462 2004-01-05 Miguel de Icaza <miguel@ximian.com>
13464 * cs-parser.jay: Add rules to improve error reporting if fields or
13465 methods are declared at the namespace level (error 116)
13467 * Add rules to catch event add/remove
13469 2004-01-04 David Sheldon <dave-mono@earth.li>
13471 * expression.cs: Added matching ")" to error message for
13474 2004-01-03 Todd Berman <tberman@gentoo.org>
13476 * ecore.cs, attribute.cs:
13477 Applying fix from #52429.
13479 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13481 * ecore.cs, expression.cs, statement.cs:
13482 Total rewrite of how we handle branching. We
13483 now handle complex boolean expressions with fewer
13484 jumps. As well if (x == 0) no longer emits a ceq.
13486 if (x is Foo) is much faster now, because we generate
13489 Overall, we get a pretty big improvement on our benchmark
13490 tests. The code we generate is smaller and more readable.
13492 I did a full two-stage bootstrap. The patch was reviewed
13493 by Martin and Miguel.
13495 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13497 * cs-parser.jay: Make primary_expression not take a QI.
13498 we dont need this because the member_access rule covers
13499 us here. So we replace the rule with just IDENTIFIER.
13501 This has two good effects. First, we remove a s/r conflict.
13502 Second, we allocate many fewer QualifiedIdentifier objects.
13504 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13506 * attribute.cs: Handle MarshalAs attributes as pseudo, and
13507 set the correct information via SRE. This prevents
13508 hanging on the MS runtime. Fixes #29374.
13510 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13512 * convert.cs: correctly handle conversions to value types
13513 from Enum and ValueType as unboxing conversions.
13515 Fixes bug #52569. Patch by Benjamin Jemlich.
13517 2004-01-02 Ravi Pratap <ravi@ximian.com>
13519 * expression.cs (BetterConversion): Prefer int -> uint
13520 over int -> ulong (csc's behaviour). This fixed bug #52046.
13522 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
13524 * decl.cs (MemberCache.FindMembers): now returns a
13527 * typemanager.cs: In general, go with with ^^.
13528 (CopyNewMethods): take an IList.
13529 (RealMemberLookup): Only allocate an arraylist
13530 if we copy from two sets of methods.
13532 This change basically does two things:
13533 1) Fewer array lists allocated due to CopyNewMethods.
13534 2) the explicit cast in MemberList costed ALOT.
13536 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
13538 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13539 a hashtable to avoid needless string allocations when an identifier is
13540 used more than once (the common case).
13542 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
13544 * pending.cs: MS's TypeBuilder.GetInterfaces ()
13545 is broken, it will not return anything. So, we
13546 have to use the information we have in mcs to
13549 * typemanager.cs: Add a cache for GetInterfaces,
13550 since this will now be used more often (due to ^^)
13552 (GetExplicitInterfaces) New method that gets the
13553 declared, not effective, interfaces on a type
13554 builder (eg, if you have interface IFoo, interface
13555 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13558 This patch makes MCS able to bootstrap itself on
13561 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
13563 * expression.cs: Remove the Nop's that Miguel put
13566 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13568 * report.cs, codegen.cs: Give the real stack trace to
13569 the error when an exception is thrown.
13571 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13573 * decl.cs: only allocate hashtables for ifaces if
13576 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13578 * expression.cs: fix the error from cs0121-2.cs
13579 (a parent interface has two child interfaces that
13580 have a function with the same name and 0 params
13581 and the function is called through the parent).
13583 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
13585 * class.cs, rootcontext.cs, typmanager.cs: do not
13588 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
13590 * codegen.cs: remove stack for the ec flow branching.
13591 It is already a linked list, so no need.
13593 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
13595 * Makefile: Allow custom profiler here.
13597 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
13599 * typemanager.cs (LookupType):
13600 - Use a static char [], because split takes
13601 a param array for args, so it was allocating
13603 - Do not store true in a hashtable, it boxes.
13605 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
13607 * flowanalysis.cs: bytify common enums.
13609 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13611 * modifiers.cs: Add a new set of flags for the
13612 flags allowed on explicit interface impls.
13613 * cs-parser.jay: catch the use of modifiers in
13614 interfaces correctly.
13615 * class.cs: catch private void IFoo.Blah ().
13617 All related to bug #50572.
13619 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13621 * decl.cs: Rewrite the consistant accessability checking.
13622 Accessability is not linear, it must be implemented in
13623 a tableish way. Fixes #49704.
13625 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13627 * expression.cs: Handle negation in a checked context.
13628 We must use subtraction from zero. Fixes #38674.
13630 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
13632 * class.cs: Ignore static void main in DLLs.
13633 * rootcontext.cs: Handle the target type here,
13634 since we are have to access it from class.cs
13635 * driver.cs: account for the above.
13637 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
13639 * report.cs: Give line numbers and files if available.
13641 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
13643 * driver.cs: Implement /addmodule.
13645 * typemanager.cs: Change 'modules' field so it now contains Modules not
13648 2003-12-20 Martin Baulig <martin@ximian.com>
13650 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13651 (FieldBase.IsAssigned): Removed this field.
13652 (FieldBase.SetAssigned): New public method.
13653 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13655 2003-12-20 Martin Baulig <martin@ximian.com>
13657 * expression.cs (LocalVariableReference.DoResolve): Don't set
13658 `vi.Used' if we're called from DoResolveLValue().
13660 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13661 returns the usage vector it just merged into the current one -
13662 pass this one to UsageWarning().
13663 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13664 of the `EmitContext', don't call this recursively on our children.
13666 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
13668 * driver.cs: Implement /target:module.
13670 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
13672 * support.cs (CharArrayHashtable): New helper class.
13674 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
13675 char arrays, not strings, so we can avoid creating a string in
13676 consume_identifier if the identifier is a keyword.
13678 2003-12-16 Martin Baulig <martin@ximian.com>
13680 * statement.cs (LocalInfo.Assigned): Removed this property.
13681 (LocalInfo.Flags): Removed `Assigned'.
13682 (LocalInfo.IsAssigned): New public method; takes the EmitContext
13683 and uses flow analysis.
13684 (Block.UsageWarning): Made this method private.
13685 (Block.Resolve): Call UsageWarning() if appropriate.
13687 * expression.cs (LocalVariableReference.DoResolve): Always set
13688 LocalInfo.Used here.
13690 2003-12-13 Martin Baulig <martin@ximian.com>
13692 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13693 any value here; we're now using flow analysis to figure out
13694 whether a statement/block returns a value.
13696 2003-12-13 Martin Baulig <martin@ximian.com>
13698 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13700 (FlowBranching.MergeFinally): Don't call
13701 `branching.CheckOutParameters()' here, this is called in
13703 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13704 when adding the `finally' vector.
13706 2003-12-13 Martin Baulig <martin@ximian.com>
13709 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13710 actually work and also fix #48962.
13712 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
13714 * decl.cs: Do not check System.Object for nested types,
13715 since we know it does not have any. Big bang for buck:
13718 Run 1: 8.35 seconds
13719 Run 2: 8.32 seconds
13720 corlib: 17.99 seconds
13722 Run 1: 8.17 seconds
13723 Run 2: 8.17 seconds
13724 corlib: 17.39 seconds
13726 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
13728 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13729 time we are returning 0 members, so we save alot here.
13731 2003-12-11 Martin Baulig <martin@ximian.com>
13733 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13734 `MergeChild()', also just take the `FlowBranching' as argument;
13735 call Merge() on it and return the result.
13736 (FlowBranching.Merge): We don't need to do anything if we just
13739 2003-12-11 Martin Baulig <martin@ximian.com>
13741 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13742 them in an `ArrayList' to reduce memory usage. Thanks to Ben
13743 Maurer for this idea.
13745 2003-12-11 Martin Baulig <martin@ximian.com>
13747 * flowanalysis.cs (MergeResult): This class is now gone; we now
13748 use the `UsageVector' for this. The reason for this is that if a
13749 branching just has one sibling, we don't need to "merge" them at
13750 all - that's the next step to do.
13751 (FlowBranching.Merge): We now return a `UsageVector' instead of a
13754 2003-12-11 Martin Baulig <martin@ximian.com>
13756 Reworked flow analyis and made it more precise and bug-free. The
13757 most important change is that we're now using a special `Reachability'
13758 class instead of having "magic" meanings of `FlowReturns'. I'll
13759 do some more cleanups and optimizations and also add some more
13760 documentation this week.
13762 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13763 largely reworked this class.
13764 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13765 the new `Reachability' class instead of having "magic" values here.
13766 (FlowBranching): We're now using an instance of `Reachability'
13767 instead of having separate `Returns', `Breaks' etc. fields.
13769 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13770 based on flow analysis; ignore the return value of block.Emit ().
13772 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
13774 * driver.cs typemanager.cs: Find the mono extensions to corlib even
13775 if they are private.
13777 2003-12-09 Martin Baulig <martin@ximian.com>
13779 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13780 call them directly on the UsageVector.
13782 2003-12-09 Martin Baulig <martin@ximian.com>
13784 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13785 Changed return type from `FlowReturns' to `Reachability'.
13787 2003-12-09 Martin Baulig <martin@ximian.com>
13789 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13790 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13791 `Reachable' fields with a single `Reachability' one.
13793 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13795 * class.cs (FindMembers): Remove foreach's.
13800 Run 1: 8.74 seconds
13801 Run 2: 8.71 seconds
13804 Run 1: 8.64 seconds
13805 Run 2: 8.58 seconds
13808 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13813 This patch does a few things:
13814 1. EmptyStatement is now a singleton, so it is never reallocated.
13815 2. All blah is EmptyStatement constructs have been changed to
13816 blah == EmptyStatement.Value, which is much faster and valid
13817 now that EmptyStatement is a singleton.
13818 3. When resolving a block, rather than allocating a new array for
13819 the non-empty statements, empty statements are replaced with
13820 EmptyStatement.Value
13821 4. Some recursive functions have been made non-recursive.
13822 Mainly the performance impact is from (3), however (1) and (2) are needed for
13823 this to work. (4) does not make a big difference in normal situations, however
13824 it makes the profile look saner.
13829 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13830 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13831 Total memory allocated: 56397 KB
13834 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13835 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13836 Total memory allocated: 55666 KB
13838 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13840 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13841 than the hashtable in a hashtable version
13843 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13844 we always end up concating a string. This results in a huge perf
13845 loss, because many strings have to be tracked by the GC. In this
13846 patch, we first use a hashtable that works with two keys, so that
13847 the strings do not need to be concat'ed.
13851 Run 1: 8.74 seconds
13852 Run 2: 8.71 seconds
13855 Run 1: 8.65 seconds
13856 Run 2: 8.56 seconds
13858 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13860 * Makefile: Add a new target `do-time' that does a quick and simple
13861 profile, leaving easy to parse output.
13863 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
13865 * codegen.cs (Init): Create the dynamic assembly with
13866 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13868 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
13870 * support.cs: Make the PtrHashtable use only one
13871 instance of its comparer.
13873 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
13875 * typemanager.cs: Fix lookup of GetNamespaces.
13877 2003-11-29 Miguel de Icaza <miguel@ximian.com>
13879 * expression.cs: Removed redundant line.
13881 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13882 ArrayLists, use for loops with bounds.
13884 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13887 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13888 arraylists, use for loop with bounds.
13890 The above three changes give us a 0.071 second performance
13891 improvement out of 3.294 seconds down to 3.223. On my machine
13892 the above changes reduced the memory usage by 1,387 KB during
13893 compiler bootstrap.
13895 * cs-parser.jay (QualifiedIdentifier): New class used to represent
13896 QualifiedIdentifiers. Before we created a new string through
13897 concatenation, and mostly later on, the result would be
13898 manipulated by DecomposeQI through string manipulation.
13900 This reduced the compiler memory usage for bootstrapping from
13901 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13902 compile times in 0.05 seconds.
13904 2003-11-28 Dick Porter <dick@ximian.com>
13906 * support.cs: Do string compares with the Invariant culture.
13914 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13915 the comparison is done with the Invariant culture.
13917 2003-11-27 Miguel de Icaza <miguel@ximian.com>
13919 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13920 GetEnumerator method.
13922 (ProbeCollectionType): Iterate starting at the most specific type
13923 upwards looking for a GetEnumerator
13925 * expression.cs: Shift count can be up to 31 for int/uint and 63
13928 2003-11-26 Miguel de Icaza <miguel@ximian.com>
13930 * statement.cs (Block.LookupLabel): Also look for the label on the
13931 children blocks. Use a hash table to keep track of visited
13934 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13935 we actually did transform the other operand, otherwise fall back
13936 to the common codepath that casts to long.
13938 * cs-tokenizer.cs: Use the same code pattern as the int case.
13939 Maybe I should do the parsing myself, and avoid depending on the
13940 Parse routines to get this done.
13942 2003-11-25 Miguel de Icaza <miguel@ximian.com>
13944 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13945 which fixes bug 51347. This time test it.
13947 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13948 attributes for example can not tell the difference between these.
13949 The difference was only a syntax feature of the language.
13951 * attribute.cs: Apply attributes to delegates.
13953 * delegate.cs: Call the apply attributes method.
13955 2003-11-24 Miguel de Icaza <miguel@ximian.com>
13957 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13958 comparing 0 vs Byte.MinValue, not the value
13960 (ImplicitConversionRequired): When reporting a conversion error,
13961 use error 31 to print out the constant error instead of the
13964 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13965 which fixes bug 51347.
13967 2003-11-22 Miguel de Icaza <miguel@ximian.com>
13969 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
13970 which fixes the -warnaserror command line option.
13972 2003-11-21 Miguel de Icaza <miguel@ximian.com>
13974 * cfold.cs (DoNumericPromotions): During constant folding of
13975 additions on UIntConstant, special case intconstants with
13976 IntConstants like we do on the expression binary operator.
13978 2003-11-12 Miguel de Icaza <miguel@ximian.com>
13980 * convert.cs (ImplicitReferenceConversion): We were missing a case
13981 (System.Enum are not value types or class types, so we need to
13982 classify them separatedly).
13984 * driver.cs: We do not support error 2007.
13986 2003-11-12 Jackson Harper <jackson@ximian.com>
13988 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13989 system directory. Also use the full file name so users can
13990 libraries names mscorlib-o-tron.dll in a non system dir.
13992 2004-01-04 David Sheldon <dave-mono@earth.li>
13994 * expression.cs: Added matching ")" to error message for CS0077.
13996 2003-12-19 Martin Baulig <martin@ximian.com>
13998 * typemanager.cs (TypeManager.IsEqualGenericType): New public
13999 static method; see documentation in the method.
14000 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
14002 * convert.cs (Convert.ImplicitReferenceConversion,
14003 Convert.ImplicitReferenceConversionExists): Add support for
14004 generic type declarations; see gen-36.cs.
14006 2003-12-19 Martin Baulig <martin@ximian.com>
14008 * pending.cs (Pending.InterfaceMethod): Use
14009 `Type.IsAssignableFrom()' instead of `=='.
14011 2003-12-18 Martin Baulig <martin@ximian.com>
14013 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
14016 * convert.cs (Convert.ImplicitStandardConversionExists): Use
14017 `expr_type.Equals (target_type)' instead of `=='.
14019 2003-12-08 Martin Baulig <martin@ximian.com>
14021 * generics.cs (Constraints.Types): Removed.
14022 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
14024 (Constraints.ResolveTypes): New public method; resolves the
14025 TypeExpr's to Type's.
14026 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
14027 longer takes the constraints.
14028 (TypeParameter.DefineMethod): Likewise.
14029 (TypeParameter.DefineType): New public method. Calls
14030 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
14033 2003-12-08 Martin Baulig <martin@ximian.com>
14035 * convert.cs (Convert.ImplicitConversionStandard): Use
14036 `expr_type.Equals (target_type)' instead of `=='.
14038 2003-12-08 Martin Baulig <martin@ximian.com>
14040 * typemanager.cs (TypeManager.GetReferenceType): Call
14041 `Type.MakeByRefType ()'.
14043 2003-12-08 Martin Baulig <martin@ximian.com>
14045 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
14046 just has some special meaning in some situations. For instance,
14047 it is allowed to use `where' as the name of a variable etc.
14049 2003-12-04 Martin Baulig <martin@ximian.com>
14051 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
14052 `Type.MakeArrayType()' for array types.
14054 2003-11-18 Miguel de Icaza <miguel@ximian.com>
14056 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
14059 (SizeOf.DoResolve): assign the `type_queried' field. This gets
14062 2003-11-16 Martin Baulig <martin@ximian.com>
14064 * codegen.cs (EmitContext.IsGeneric): Removed.
14066 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
14067 ResolveGeneric() on the DeclSpace.
14069 2003-11-16 Martin Baulig <martin@ximian.com>
14071 * generic.cs (TypeArguments.Resolve):
14072 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
14073 `ResolveType()' on it to get the Type.
14075 2003-11-15 Martin Baulig <martin@ximian.com>
14077 * generic.cs (ConstructedType.GetInterfaces): Override this.
14079 2003-11-14 Martin Baulig <martin@ximian.com>
14081 * interface.cs (Interface.DefineType): Define all type parameters
14082 before adding the interfaces we inherit.
14084 2003-11-11 Martin Baulig <martin@ximian.com>
14086 * generic.cs (ConstructedType.ResolveType): Always call
14087 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
14089 2003-11-10 Martin Baulig <martin@ximian.com>
14091 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
14092 (TypeManager.InitCoreTypes): Initialize them here, but instead of
14093 calling `ResolveType()' on them, directly assign their `Type'.
14095 2003-11-08 Martin Baulig <martin@ximian.com>
14097 * generic.cs (ConstructedType): Override `IsClass' etc.
14099 2003-11-08 Martin Baulig <martin@ximian.com>
14101 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
14102 return value and the `out parent' parameter.
14103 (TypeContainer.DefineType): Moved the CS0644 check into
14104 GetClassBases(). Don't pass the interface types to the
14105 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
14106 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
14108 * ecore.cs (TypeExpr.IsAttribute): New property.
14109 (TypeExpr.GetInterfaces): New method.
14111 * interface.cs (Interface.GetInterfaceTypeByName): Return a
14112 TypeExpr instead of a Type.
14113 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
14114 (Interface.DefineType): Don't pass the interface types to the
14115 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
14116 them later and then call `TypeBulider.AddInterfaceImplementation()'.
14118 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
14119 instead of a `Type[]'.
14120 (TypeManager.RegisterBuilder): Likewise.
14121 (TypeManager.AddUserInterface): Likewise.
14122 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
14123 `Type[]' and also return a `TypeExpr[]'.
14124 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
14126 2003-11-08 Martin Baulig <martin@ximian.com>
14128 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
14131 2003-11-08 Martin Baulig <martin@ximian.com>
14133 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
14134 TypeManager.ResolveExpressionTypes().
14136 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
14137 instead of an Expression.
14138 (TypeExpr): This is now an abstract base class for `TypeExpression'.
14139 (TypeExpression): New public class; formerly known as `TypeExpr'.
14141 * expression.cs (ComposedCast): Derive from TypeExpr.
14143 * typemanager.cs (TypeManager.system_*_expr): These are now
14144 TypExpr's instead of Expression's.
14145 (TypeManager.ResolveExpressionTypes): New public static function;
14146 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
14149 2003-11-06 Miguel de Icaza <miguel@ximian.com>
14151 * expression.cs (New.DoResolve): Do not dereference value that
14152 might be a null return.
14154 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
14155 sure that the constant value has the right type. Fixes an
14156 unreported bug, similar to 50425.
14158 * const.cs (Const.LookupConstantValue): Call
14159 ImplicitStandardConversionExists before doing a conversion to
14160 avoid havng the TypeManager.ChangeType do conversions.
14162 Reduced the number of casts used
14164 (Const.ChangeType): New routine to enable reuse of the constant
14165 type changing code from statement.
14167 * typemanager.cs (ChangeType): Move common initialization to
14168 static global variables.
14172 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
14173 every value type to go through, even if it was void. Fix that.
14175 * cs-tokenizer.cs: Use is_identifier_start_character on the start
14176 character of the define, and the is_identifier_part_character for
14177 the rest of the string.
14179 2003-11-05 Miguel de Icaza <miguel@ximian.com>
14181 * expression.cs (UnaryMutator.EmitCode): When I updated
14182 LocalVariableReference.DoResolve, I overdid it, and dropped an
14183 optimization done on local variable references.
14185 2003-11-04 Miguel de Icaza <miguel@ximian.com>
14187 * ecore.cs: Convert the return from Ldlen into an int.
14189 2003-10-20 Miguel de Icaza <miguel@ximian.com>
14191 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
14192 the accessibility, this is a special case for toplevel non-public
14193 classes (internal for instance).
14195 2003-10-20 Nick Drochak <ndrochak@gol.com>
14197 * ecore.cs: Fix typo and build. Needed another right paren.
14199 2003-10-19 Miguel de Icaza <miguel@ximian.com>
14201 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
14202 `internal' case regular and protected, but not allowing protected
14203 to be evaluated later. Bug 49840
14205 2003-10-15 Miguel de Icaza <miguel@ximian.com>
14207 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
14208 to kb.Nlast, and not the kb.nFirst to isolate the switch
14211 Extract the underlying type, so enumerations of long/ulong are
14212 treated like long/ulong.
14214 2003-10-14 Miguel de Icaza <miguel@ximian.com>
14216 * expression.cs (New): Overload the meaning of RequestedType to
14217 track the possible creation of the NewDelegate type, since
14218 DoResolve is invoked more than once for new constructors on field
14221 See bugs: #48800 and #37014
14223 * cs-parser.jay (declare_local_constants): Take an arraylist
14224 instead of a single constant.
14226 (local_constant_declaration): It should take a
14227 constant_declarators, not a constant_declarator. Fixes 49487
14229 * convert.cs: Fix error report.
14231 2003-10-13 Jackson Harper <jackson@ximian.com>
14233 * typemanager.cs (TypeToCoreType): Add float and double this fixes
14236 2003-11-03 Martin Baulig <martin@ximian.com>
14238 * expression.cs (ArrayAccess.GetStoreOpcode): Added
14239 `out bool has_type_arg'; if set, we need to pass the type to
14241 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
14242 Stelem_Any/Ldelem_Any for generic parameters.
14244 2003-11-02 Martin Baulig <martin@ximian.com>
14246 * expression.cs (Invocation.EmitCall): Use
14247 `TypeManager.IsValueType()' to check whether it's a value type.
14248 Don't set `struct_call' when calling a method on a type parameter.
14250 2003-11-02 Martin Baulig <martin@ximian.com>
14252 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
14253 and removed the TypeBuilder argument.
14255 * typemanager.cs (TypeManager.IsValueType): Return
14256 `t.IsGenericParameter || t.IsValueType'.
14258 2003-10-25 Martin Baulig <martin@ximian.com>
14260 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
14261 call ConstructedType.Resolve() on it.
14263 * generic.cs (ConstructedType.Resolve): Set `type' on success.
14265 2003-10-25 Martin Baulig <martin@ximian.com>
14267 * class.cs (TypeContainer.GetClassBases): Changed
14268 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
14269 CS8214 reporting here.
14270 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
14271 instead of a `Type' for our parent. In case of a recursive
14272 declaration (see tests/gen-23.cs for an example), our parent is a
14273 ConstructedType and it doesn't have its type set. So, first
14274 create our own TypeBuilder, then call constructed.Resolve() to get
14275 the parent's type and finally TypeBuilder.SetParent() it.
14277 * ecore.cs (TypeExpr.Name): New public virtual property.
14280 (ConstructedType): We're now a TypeExpr and not just an Expression.
14281 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
14282 arguments here; this is done later.
14283 (ConstructedType.Resolve): New public method to resolve the type
14284 arguments and bind them.
14286 2003-10-21 Martin Baulig <martin@ximian.com>
14288 * convert.cs: Use `TypeManager.IsValueType' instead of
14289 'type.IsValueType' everywhere.
14291 * typemanager.cs (TypeManager.IsValueType): Return true for type
14292 parameters. The reason for this is that we need to box a type
14293 parameter when converting it to a reference type.
14295 * cs-parser.jay: Added support for default value expressions.
14297 * generics.cs (DefaultValueExpression): New public class.
14299 2003-10-17 Martin Baulig <martin@ximian.com>
14301 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
14302 TypeContainer so we can also use this for Interfaces.
14303 (TypeParameter.Resolve): Likewise.
14305 * interface.cs (Interface.DefineType): Added support for generic
14308 * cs-parser.jay: Added support for generic structs and interfaces.
14310 2003-10-17 Martin Baulig <martin@ximian.com>
14312 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
14313 call generic methods :-)
14315 2003-10-16 Martin Baulig <martin@ximian.com>
14317 * cs-parser.jay (namespace_or_type_name): Only create a
14318 GenericMemberAccess if we actually have type arguments.
14320 2003-10-13 Martin Baulig <martin@ximian.com>
14322 * class.cs (Method.Define): If we're a generic method, call
14323 TypeBuilder.DefineGenericMethod () before resolving
14325 (MethodData): Added .ctor which takes an additional MethodBuilder
14326 argument; this is used for generic methods.
14327 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
14328 we already have a MethodBuilder.
14330 2003-10-10 Martin Baulig <martin@ximian.com>
14332 * class.cs (Method): Added .ctor which takes a `GenericMethod'
14333 instead of a `DeclSpace'. This is used for generic methods.
14335 * cs-parser.jay (method_header): Added support for generic
14336 methods; create a `GenericMethod' instance and pass it to the
14337 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
14338 parameters and locals.
14340 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
14341 since we already have the location. Check whether we're a generic
14342 type declaration or a generic method and create the correct type
14345 * generic.cs (TypeParameter.DefineMethod): New public method.
14346 (GenericMethod): New public class; derives from DeclSpace and is
14347 used for generic methods.
14349 2003-10-09 Martin Baulig <martin@ximian.com>
14351 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14353 (MethodCore.DoDefineParameters): Removed the TypeContainer
14354 argument; use the DeclSpace which was passed to the .ctor instead.
14355 (MethodCore.CheckParameter): Take a DeclSpace instead of a
14356 TypeContainer; we only need a DeclSpace here.
14358 2003-10-09 Martin Baulig <martin@ximian.com>
14360 * class.cs (MethodData): Added additional `DeclSpace ds' argument
14362 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14363 EmitContext's .ctor.
14365 2003-10-09 Martin Baulig <martin@ximian.com>
14367 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14368 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14369 AsAccessible(), moved them as well.
14371 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14373 2003-10-07 Miguel de Icaza <miguel@ximian.com>
14375 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14376 generation for >=, as spotted by Paolo, bug 48679.
14377 Patch from David Waite.
14379 * cs-tokenizer.cs: Add handling for #pragma.
14381 * cs-parser.jay: Allow for both yield and yield return in the
14382 syntax. The anti-cobolization of C# fight will go on!
14384 * class.cs (TypeBuilder.DefineType): Catch error condition here
14385 (Parent.DefineType erroring out and returning null).
14387 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14388 coping with enumerations variables, we were mistakenly processing
14389 them as a regular value type instead of built-in types. Fixes the
14392 * typemanager.cs (IsBuiltinOrEnum): New method.
14394 2003-09-30 Miguel de Icaza <miguel@ximian.com>
14396 * cs-parser.jay: Upgrade: yield now needs the return clause.
14398 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14400 * cs-parser.jay : Renamed yyName to yyNames related to jay.
14402 2003-09-29 Martin Baulig <martin@ximian.com>
14404 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
14405 inflated generic methods.
14407 * generics.cs (ConstructedType): Distinguish between open and
14408 closed constructed types; correctly resolve the arguments.
14410 2003-09-22 Martin Baulig <martin@ximian.com>
14412 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
14413 all type arguments meet their constraints.
14415 2003-09-19 Martin Baulig <martin@ximian.com>
14417 * decl.cs (MemberCache.SetupCacheForInterface): Take a
14418 `MemberCache parent' argument. Normally, an interface doesn't
14419 have a parent type except System.Object, but we use this in gmcs
14420 for generic type parameters.
14422 2003-09-18 Martin Baulig <martin@ximian.com>
14424 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14425 on `type.IsInterface'; don't check whether the type has a parent
14426 to determine whether it's an interface.
14428 2003-09-17 Martin Baulig <martin@ximian.com>
14430 * generic.cs (ConstructedType.ToString): Always use `name' as the
14433 2003-09-15 Martin Baulig <martin@ximian.com>
14435 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
14437 * generic.cs (Constraints.Resolve): New public method; this is
14438 called to resolve the constraint types and to check whether all
14439 the constraints are correct.
14440 (Constraints.Types): New public property.
14441 (TypeParameter.Resolve): New public method; resolves all the
14442 type's constraints.
14444 * class.cs (TypeContainer.DefineType): Call
14445 TypeParameter.Resolve() before actually defining the type.
14447 2003-09-15 Martin Baulig <martin@ximian.com>
14449 * class.cs (TypeContainer.DefineType): Added an error flag to
14450 avoid reporting duplicate CS0146's ("class definition is
14453 * driver.cs (Driver.MainDriver): Abort if
14454 RootContext.ResolveTree() reported any errors.
14456 2003-09-07 Martin Baulig <martin@ximian.com>
14458 * report.cs (Error, Warning): Added overloaded versions which take
14459 a `params object[] args' and call String.Format().
14461 2003-09-07 Martin Baulig <martin@ximian.com>
14463 * decl.cs (DeclSpace..ctor): Don't call
14464 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14465 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
14466 (DeclSpace.RecordDecl): New method.
14468 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14470 2003-09-02 Ravi Pratap <ravi@ximian.com>
14472 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14473 value attributes to be applied to ParameterBuilders.
14475 * class.cs (MethodCore.LabelParameters): Make static and more
14476 generic so that it can be used from other places - like interface
14477 methods, for instance.
14479 * interface.cs (Interface.Emit): Call LabelParameters before
14480 emitting attributes on the InterfaceMethod.
14482 2003-09-07 Martin Baulig <martin@ximian.com>
14484 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
14485 if the number of type parameters doesn't match.
14487 2003-09-04 Martin Baulig <martin@ximian.com>
14489 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
14490 for arrays of generic type params (ie. `!0[]').
14492 2003-09-04 Martin Baulig <martin@ximian.com>
14494 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
14497 2003-09-04 Martin Baulig <martin@ximian.com>
14499 * decl.cs (DeclSpace.LookupGeneric): New method.
14500 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
14503 * generic.cs (TypeParameterExpr): Take a TypeParameter as
14504 argument, not just a string.
14505 (TypeParameter.Define): New public method; this is called to
14506 actually define the generic parameter; after this, you can use the
14507 new `Type' property to get the type.
14509 2003-09-04 Martin Baulig <martin@ximian.com>
14511 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
14512 is now an ArrayList; initialize the result of the `TypeParameters'
14514 (DeclSpace.GetGenericData): Removed.
14515 (DeclSpace.LookupGeneric): Temporarily removed; we need to
14516 implement this in a different way.
14517 (DeclSpace.GetTypeParameters): Removed; there's now a
14518 `TypeParameters' property.
14519 (DeclSpace.TypeParameters): New public property.
14521 * generic.cs (Constraints): Make this class public.
14522 (TypeParameter): New public class.
14524 2003-09-04 Martin Baulig <martin@ximian.com>
14526 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
14527 generic parameters.
14529 * class.cs (TypeContainer.DefineType): Call
14530 TypeBuilder.DefineGenericParameter () on all generic parameters if
14531 this is a generic type.
14533 2003-08-28 Martin Baulig <martin@ximian.com>
14535 * sample-stack.il: Compile this with ilasm: "ilasm /dll
14538 * sample-hello.cs: Compile this with gmcs: "gmcs
14539 /r:sample-stack.dll sample-hello.cs".
14541 2003-08-28 Martin Baulig <martin@ximian.com>
14543 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
14544 the parameters to the generic type.
14546 2003-08-28 Martin Baulig <martin@ximian.com>
14548 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
14550 2003-08-28 Martin Baulig <martin@ximian.com>
14552 * cs-parser.jay (opt_type_argument_list): Use
14553 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
14554 (primary_expression): Replace `qualified_identifier' with `type_name'.
14555 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
14557 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
14558 parser to check whether it is syntactically a type parameter list;
14559 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
14562 2003-08-26 Martin Baulig <martin@ximian.com>
14564 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14565 resolving aliases; fixes #47927.
14567 2003-08-26 Martin Baulig <martin@ximian.com>
14569 * statement.cs (Using.DoResolve): This is internally emitting a
14570 try/finally clause, so we need to set ec.NeedExplicitReturn if we
14571 do not always return. Fixes #47681.
14573 2003-08-26 Martin Baulig <martin@ximian.com>
14575 * decl.cs (MemberCore): Moved WarningNotHiding(),
14576 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14578 (AdditionResult): Make this nested in DeclSpace.
14579 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14580 argument; call NamespaceEntry.Define() unless we're nested in a
14583 * namespace.cs (Namespace.DefineName): New public function. This
14584 is called from DeclSpace's .ctor to add
14585 (Namespace.Lookup): Include DeclSpaces in the lookup.
14587 * class.cs (Operator): Derive from MemberBase, not MemberCore.
14589 * const.cs (Const): Derive from MemberBase, not MemberCore.
14591 2003-08-25 Martin Baulig <martin@ximian.com>
14593 * convert.cs (Convert.ExplicitReferenceConversion): When
14594 converting from an interface type to a class, unbox if the target
14595 type is a struct type. Fixes #47822.
14597 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14599 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14602 2003-08-22 Martin Baulig <martin@ximian.com>
14604 * class.cs (TypeManager.DefineType): When defining a nested type,
14605 call DefineType() on our parent; fixes #47801.
14607 2003-08-22 Martin Baulig <martin@ximian.com>
14609 * class.cs (MethodData.Define): While checking if a method is an
14610 interface implementation, improve the test a bit more to fix #47654.
14612 2003-08-22 Martin Baulig <martin@ximian.com>
14614 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14615 correctly; fixes #47722.
14617 2003-08-22 Martin Baulig <martin@ximian.com>
14619 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14620 LocalVariableReference, ensure it's not read-only. Fixes #47536.
14622 * statement.cs (Fixed.DoResolve): Make all variables read-only.
14624 2003-08-22 Martin Baulig <martin@ximian.com>
14626 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14627 can only be assigned in static constructors. Fixes #47161.
14629 2003-08-22 Martin Baulig <martin@ximian.com>
14631 Rewrote and improved the flow analysis code.
14633 * flowbranching.cs (FlowBranching): Make this class abstract.
14634 (FlowBranching.CreateBranching): New static function to create a
14635 new flow branching.
14636 (FlowBranchingBlock, FlowBranchingException): New classes.
14637 (FlowBranching.UsageVector.Type): New public readonly field.
14638 (FlowBranching.UsageVector.Breaks): Removed the setter.
14639 (FlowBranching.UsageVector.Returns): Removed the setter.
14640 (FlowBranching.UsageVector): Added Break(), Return(),
14641 NeverReachable() and Throw() methods to modify the reachability.
14642 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14643 done by FlowBranching.Merge().
14644 (FlowBranching.UsageVector.MergeChild): New method; merges the
14645 merge result into the current vector.
14646 (FlowBranching.Merge): New abstract method to merge a branching.
14648 2003-08-12 Martin Baulig <martin@ximian.com>
14650 * expression.cs (Indirection.CacheTemporaries): Create the
14651 LocalTemporary with the pointer type, not its element type.
14653 2003-08-10 Miguel de Icaza <miguel@ximian.com>
14655 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14656 token was a keyword or not.
14658 Add `error' options where an IDENTIFIER was expected; Provide
14659 CheckToken and CheckIdentifierToken convenience error reporting
14662 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14664 * decl.cs: Rename `NamespaceEntry Namespace' public field into
14665 NameSpaceEntry NameSpaceEntry.
14667 (LookupInterfaceOrClass): Avoid creating a full qualified name
14668 from namespace and name: avoid doing lookups when we know the
14669 namespace is non-existant. Use new Tree.LookupByNamespace which
14670 looks up DeclSpaces based on their namespace, name pair.
14672 * driver.cs: Provide a new `parser verbose' to display the
14673 exception thrown during parsing. This is turned off by default
14674 now, so the output of a failure from mcs is more graceful.
14676 * namespace.cs: Track all the namespaces defined in a hashtable
14679 (IsNamespace): New method
14681 2003-08-09 Miguel de Icaza <miguel@ximian.com>
14683 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
14684 we know that we need to concatenate (full typename can never be
14689 * statement.cs: Use a bitfield; Do not initialize to null things
14690 which are done by the constructor by default.
14692 * cs-parser.jay: bug fix, parameter was 4, not 3.
14694 * expression.cs: Just use the property;
14696 * statement.cs: No need for GetVariableInfo method.
14698 2003-08-08 Martin Baulig <martin@ximian.com>
14700 * flowanalysis.cs (FlowReturns): This is now nested in the
14701 `FlowBranching' class.
14702 (MyBitVector): Moved this here from statement.cs.
14703 (FlowBranching.SiblingType): New enum type.
14704 (FlowBranching.CreateSibling): Added `SiblingType' argument.
14706 2003-08-07 Martin Baulig <martin@ximian.com>
14708 * flowanalysis.cs (FlowBranchingType): This is now nested in the
14709 `FlowBranching' class and called `BranchingType'.
14711 2003-08-07 Martin Baulig <martin@ximian.com>
14713 * flowanalysis.cs: Moved all the control flow analysis code into
14716 2003-08-07 Martin Baulig <martin@ximian.com>
14718 * assign.cs (Assign.DoResolve): `target' must either be an
14719 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
14722 2003-08-07 Miguel de Icaza <miguel@ximian.com>
14724 * expression.cs (BinaryMethod): This kind of expression is created by the
14725 Binary class if it determines that the operator has to be handled
14728 (BinaryDelegate): This kind of expression is created if we are
14729 dealing with a + or - operator on delegates.
14731 (Binary): remove method, argumetns, and DelegateOperator: when
14732 dealing with methods,
14734 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14736 * statement.cs (Block): use bitfields for the three extra booleans
14737 we had in use. Remove unused topblock parameter.
14739 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14741 * assign.cs: Drop extra unneeded tests.
14743 2003-08-06 Miguel de Icaza <miguel@ximian.com>
14745 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14747 * statement.cs (Foreach): Use VariableStorage instead of
14750 * codegen.cs (VariableStorage): New class used by clients that
14751 require a variable stored: locals or fields for variables that
14752 need to live across yield.
14754 Maybe provide a convenience api for EmitThis+EmitLoad?
14756 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14759 2003-08-05 Miguel de Icaza <miguel@ximian.com>
14761 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14762 RemapParameterLValue): New methods that are used to turn a
14763 precomputed FieldInfo into an expression like this:
14767 The idea is to use this instead of making LocalVariableReference
14768 have more than one meaning.
14770 * cs-parser.jay: Add error production to BASE.
14772 * ecore.cs: Deal with TypeManager.GetField returning null, which
14773 is now a valid return value.
14775 (FieldExprNoAddress): New expression for Fields whose address can
14778 * expression.cs (LocalVariableReference): During the resolve
14779 phases, create new expressions if we are in a remapping context.
14780 Remove code that dealt with remapping here.
14782 (ParameterReference): same.
14784 (ProxyInstance): New expression, like the `This' expression, but
14785 it is born fully resolved. We know what we are doing, so remove
14786 the errors that are targeted to user-provided uses of `this'.
14788 * statement.cs (Foreach): our variable is now stored as an
14789 Expression; During resolution, follow the protocol, dont just
14790 assume it will return this.
14792 2003-08-06 Martin Baulig <martin@ximian.com>
14794 * support.cs (SeekableStreamReader.cs): New public class.
14796 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14797 SeekableStreamReader instead of the normal StreamReader.
14799 2003-08-04 Martin Baulig <martin@ximian.com>
14801 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14802 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14803 deambiguate casts and delegate invocations.
14804 (parenthesized_expression): Use the new tokens to ensure this is
14805 not a cast of method invocation.
14807 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14808 when reading a `)' and Deambiguate_CloseParens () was previously
14811 * expression.cs (ParenthesizedExpression): New class. This is
14812 just used for the CS0075 test.
14813 (Binary.DoResolve): Check for CS0075.
14815 2003-07-29 Ravi Pratap <ravi@ximian.com>
14817 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14818 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14819 reference comparison.
14821 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14822 examine the ReturnType for equality - this is necessary in the
14823 cases of implicit and explicit operators whose signature also
14824 includes the return type.
14826 2003-07-26 Miguel de Icaza <miguel@ximian.com>
14828 * namespace.cs: Cache the result of the namespace computation,
14829 instead of computing it every time.
14831 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14833 * decl.cs: Use a global arraylist that we reuse over invocations
14834 to avoid excesive memory consumption. Reduces memory usage on an
14835 mcs compile by one meg (45 average).
14837 * typemanager.cs (LookupTypeReflection): In .NET pointers are
14838 private, work around that.
14840 2003-07-23 Miguel de Icaza <miguel@ximian.com>
14842 * literal.cs (IntLiteral): Define Zero and One static literals.
14844 * cs-parser.jay (integer_literal): use static literals to reduce
14845 memory usage for the most used literals (0, 1 and -1). 211kb
14846 reduced in memory usage.
14848 Replace all calls to `new ArrayList' with `new
14849 ArrayList(4)' which is a good average number for most allocations,
14850 and also requires only 16 bytes of memory for its buffer by
14853 This reduced MCS memory usage in seven megabytes for the RSS after
14856 2003-07-28 Ravi Pratap <ravi@ximian.com>
14858 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14859 handle params methods the correct way by forming only one
14860 applicable set with params and normal methods in them. Earlier we
14861 were looking at params methods only if we found no normal methods
14862 which was not the correct thing to do.
14864 (Invocation.BetterFunction): Take separate arguments indicating
14865 when candidate and the best method are params methods in their
14868 This fixes bugs #43367 and #46199.
14870 * attribute.cs: Documentation updates.
14872 (CheckAttribute): Rename to CheckAttributeTarget.
14873 (GetValidPlaces): Rename to GetValidTargets.
14875 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14876 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14880 2003-07-28 Miguel de Icaza <miguel@ximian.com>
14882 * codegen.cs: Compute IsGeneric correctly.
14884 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
14887 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
14888 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
14889 regressions, and I was chasing more bugs than I required.
14891 * interface.cs: Use expressions for base type names (like classes
14892 and structs have been doing for a while now), and resolve that.
14893 This patch should probably go into head as well.
14895 This makes it one less user of FindType.
14897 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14899 This compiler can not self host currently. Need to fix that.
14901 * Makefile: compile to `gmcs.exe'
14903 * driver.cs: Turn on v2 by default on gmcs.
14905 * generic.cs (ConstructedType): Does no longer take a container
14906 type argument; That will be taken care of later.
14908 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
14909 Use SimpleName to resolve for now, so we can continue the work on
14910 the parser, until we get Type.GetType that understands generics.
14912 (ConstructedType.ToString): Implement
14914 (TypeArguments.Resolve): Resolve the child expressions as types.
14916 * cs-parser.jay: Rename interface_constraints to
14917 type_parameter_constraints
14919 (namespace_or_type_name): Only use constructed types for the basic
14920 construction, we will deal with identifier<...> later.
14922 (type/type_name): No longer call DecomposeQI, as
14923 namespace_or_type_name is always decoded now.
14925 2003-07-22 Ravi Pratap <ravi@ximian.com>
14927 * expression.cs (Invocation.OverloadResolve): Follow the spec more
14928 closely: we eliminate methods in base types when we have an
14929 applicable method in a top-level type.
14931 Please see section 14.5.5.1 for an exact description of what goes
14934 This fixes bug #45127 and a host of other related to corlib compilation.
14936 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14937 array is the method corresponding to the top-level type (this is
14938 because of the changes made to icall.c) so we change this
14941 (MethodGroupExpr.Name): This too.
14943 * typemanager.cs (GetElementType): New method which does the right
14944 thing when compiling corlib.
14946 * everywhere: Make use of the above in the relevant places.
14948 2003-07-22 Martin Baulig <martin@ximian.com>
14950 * cs-parser.jay (invocation_expression): Moved
14951 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14952 `cast_expression', but create a InvocationOrCast which later
14953 resolves to either an Invocation or a Cast.
14955 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14956 method; call this before EmitStatement() to make sure that this
14957 expression can be used as a statement.
14959 * expression.cs (InvocationOrCast): New class; resolves to either
14960 an Invocation or a Cast.
14962 * statement.cs (StatementExpression): Call ResolveStatement() on
14963 the ExpressionStatement before emitting it.
14965 2003-07-21 Martin Baulig <martin@ximian.com>
14967 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14968 `ref' and `out' attributes match; fixes #46220.
14969 (MemberAccess.ResolveMemberAccess): You can't reference a type
14970 through an expression; fixes #33180.
14971 (Indexers.GetIndexersForType): Don't return the indexers from
14972 interfaces the class implements; fixes #46502.
14974 2003-07-21 Martin Baulig <martin@ximian.com>
14976 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14977 CS0661 checks; fixes bug #30442.
14979 2003-07-21 Martin Baulig <martin@ximian.com>
14981 * decl.cs (AdditionResult): Added `Error'.
14983 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14985 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
14986 cs0031.cs actually work.
14988 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14990 * cs-parser.jay (namespace_name): do not use
14991 namespace_or_type_name, use qualified_identifier, because
14992 namespace_or_type_name will soon return a composed expression
14993 instead of a string.
14995 (namespace_or_type_name): Instead of returning a string, now this
14996 production returns an expression.
14998 * codegen.cs (EmitContext): Setup IsGeneric property based on
14999 whether our DeclSpace is generic, our the method is generic.
15001 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
15002 the method is generic.
15004 * cs-parser.jay (type_arguments, opt_type_argument_list,
15005 type_parameters, type_parameter_list, opt_type_parameter_list,
15006 type_parameter,, opt_type_parameter_constraints_clauses,
15007 type_parameter_constraints_clauses,
15008 type_parameter_constraint_clause, type_parameter_constraint,
15009 interface_constraints): Add new production
15011 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
15012 DeclSpace is generic or not.
15014 (DeclSpace.SetParameterInfo): New routine, used to set the
15015 parameter info for a type.
15017 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
15018 returns a GenericTypeExpr
15020 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
15021 generic, lookup the generic argument.
15023 * attribute.cs: Do not allow TypeParameterExpressions in
15026 * class.cs: Do not allow the Main method to be defined in a
15029 * expression.cs (SizeOf): Do not allow generic types to be used as
15030 arguments to sizeof.
15032 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
15033 it: whether a type is generic or not. Only works for types we are
15034 currently building for now.
15036 2003-07-20 Martin Baulig <martin@ximian.com>
15038 * namespace.cs: Fixed that bug which caused a crash when compiling
15039 the debugger's GUI.
15041 2003-07-20 Miguel de Icaza <miguel@ximian.com>
15043 * typemanager.cs (LookupTypeReflection): Never expose types which
15044 are NotPublic, NestedPrivate, NestedAssembly, or
15045 NestedFamANDAssem. We used to return these, and later do a check
15046 that would report a meaningful error, but the problem is that we
15047 would not get the real match, if there was a name override.
15049 2003-07-18 Miguel de Icaza <miguel@ximian.com>
15051 * namespace.cs (Namespace, Name): Do not compute the namespace
15052 name dynamically, compute it in the constructor. This reduced
15053 memory usage by 1697 KB.
15055 * driver.cs: Use --pause to pause at the end.
15057 2003-07-17 Peter Williams <peter@newton.cx>
15059 * Makefile: Change the name of the test target so that it doesn't
15060 conflict with the recursive test target.
15062 2003-07-17 Miguel de Icaza <miguel@ximian.com>
15064 * expression.cs (LocalVariableReference.Emit, EmitAssign,
15065 AddressOf): Do not use EmitThis, that was wrong, use the actual
15068 2003-07-15 Miguel de Icaza <miguel@ximian.com>
15070 * class.cs (MethodData.Define): While checking if a method is an
15071 interface implementation, improve the test: If we are not public
15072 (use new test here: use the computed MethodAttributes directly,
15073 instead of the parsed modifier flags) check if the `implementing'
15074 method comes from an interface or not.
15076 * pending.cs (VerifyPendingMethods): Slightly better error
15079 * makefile: add test target that does the mcs bootstrap.
15081 2003-07-16 Ravi Pratap <ravi@ximian.com>
15083 * interface.cs (Define): Do nothing here since there are no
15084 members to populate etc. Move the attribute emission out of here
15085 since this was just totally the wrong place to put it. Attribute
15086 application happens during the 'Emit' phase, not in the 'Define'
15089 (Emit): Add this method and move the attribute emission here
15091 * rootcontext.cs (EmitCode): Call the Emit method on interface
15094 2003-07-14 Ravi Pratap M <ravi@ximian.com>
15096 * expression.cs (OverloadResolve): Report error only if Location
15097 is not 'Null' which means that there was a probe going on.
15099 2003-07-14 Martin Baulig <martin@ximian.com>
15101 * expression.cs (ConditionalLogicalOperator): New public class to
15102 implement user defined conditional logical operators.
15103 This is section 14.11.2 in the spec and bug #40505.
15105 2003-07-14 Martin Baulig <martin@ximian.com>
15107 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
15109 2003-07-14 Martin Baulig <martin@ximian.com>
15111 * codegen.cs (EmitContext.InFixedInitializer): New public field.
15113 * ecore.cs (IVariable.VerifyFixed): New interface method.
15115 * expression.cs (Unary.ResolveOperator): When resolving the `&'
15116 operator, check whether the variable is actually fixed. Fixes bug
15117 #36055. Set a variable definitely assigned when taking its
15118 address as required by the spec.
15120 * statement.cs (LocalInfo.IsFixed): New field.
15121 (LocalInfo.MakePinned): Set `IsFixed' to true.
15123 2003-07-14 Ravi Pratap M <ravi@ximian.com>
15125 * attribute.cs (Attribute.Resolve): While doing a Member lookup
15126 for .ctors, ensure that we only ask for members declared in the
15127 attribute type (BindingFlags.DeclaredOnly).
15131 * expression.cs (Error_WrongNumArguments): Report error 1501
15132 correctly the way CSC does.
15134 2003-07-13 Martin Baulig <martin@ximian.com>
15136 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
15137 lookup on the fully qualified name, to make things like "X.X" work
15138 where "X.X" is a fully qualified type name, but we also have a
15139 namespace "X" in the using list. Fixes #41975.
15141 2003-07-13 Martin Baulig <martin@ximian.com>
15143 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
15144 function. If we're a CompoundAssign, we need to create an embedded
15145 CompoundAssign, not an embedded Assign.
15146 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
15149 2003-07-13 Martin Baulig <martin@ximian.com>
15151 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
15152 work to fix bug #46088.
15154 2003-07-13 Ravi Pratap <ravi@ximian.com>
15156 * class.cs (Operator.Emit): Do not emit attributes here - it is
15157 taken care of by the Method class that we delegate too. This takes
15158 care of bug #45876.
15160 2003-07-10 Martin Baulig <martin@ximian.com>
15162 * expression.cs (TypeOfVoid): New class.
15163 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
15165 2003-07-10 Martin Baulig <martin@ximian.com>
15167 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
15170 2003-07-10 Martin Baulig <martin@ximian.com>
15172 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
15173 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
15175 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
15177 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
15179 2003-07-10 Martin Baulig <martin@ximian.com>
15181 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
15182 of decimal. Fixes #42850.
15184 NOTE: I also fixed the created byte blob, but this doesn't work on
15185 the MS runtime and csc never produces any byte blobs for decimal
15188 2003-07-10 Martin Baulig <martin@ximian.com>
15190 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
15191 structs; fixes #32068.
15192 (Block.AddChildVariableNames): Fixed #44302.
15194 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15196 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
15198 2003-07-07 Miguel de Icaza <miguel@ximian.com>
15200 * attribute.cs: And this test is onger needed.
15202 2003-07-08 Martin Baulig <martin@ximian.com>
15204 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
15205 inaccessible types. Fixes #36313.
15207 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
15209 * namespace.cs (NamespaceEntry): Create implicit entries for all
15210 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
15211 implicit entries for N1.N2 and N1.
15213 2003-07-08 Martin Baulig <martin@ximian.com>
15215 Rewrote the handling of namespaces to fix a lot of the issues
15216 wrt. `using' aliases etc.
15218 * namespace.cs (Namespace): Splitted this class into a
15219 per-assembly `Namespace' and a per-file `NamespaceEntry'.
15221 * typemanager.cs (TypeManager.IsNamespace): Removed.
15222 (TypeManager.ComputeNamespaces): Only compute namespaces from
15223 loaded assemblies here, not the namespaces from the assembly we're
15224 currently compiling.
15226 2003-07-08 Martin Baulig <martin@ximian.com>
15228 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
15230 2003-07-07 Miguel de Icaza <miguel@ximian.com>
15232 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
15235 I thought about the memory savings here, but LookupTypeReflection
15236 is used under already very constrained scenarios. Compiling
15237 corlib or mcs only exposes one hit, so it would not really reduce
15238 any memory consumption.
15240 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15242 * typemanager.cs: fixes bug #45889 by only adding public types from
15243 other assemblies to the list of known types.
15245 2003-07-07 Miguel de Icaza <miguel@ximian.com>
15247 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
15248 on the type we resolved.
15250 2003-07-05 Martin Baulig <martin@ximian.com>
15252 * pending.cs (PendingImplementation.ParentImplements): Don't
15253 create the proxy if the parent is abstract.
15255 * class.cs (TypeContainer.DefineIndexers): Process explicit
15256 interface implementations first. Fixes #37714.
15258 2003-07-04 Miguel de Icaza <miguel@ximian.com>
15260 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
15261 defined recursively; but since we modify the input parameters
15262 (left is set to `this' temporarily), we reset this value if the
15263 left_is_explicit is false, which gives the original semantics to
15266 * literal.cs (NullPointer): new class used to represent a null
15267 literal in a pointer context.
15269 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
15270 type is a pointer, use a NullPointer object instead of a
15271 NullLiteral. Closes 43687
15273 (ExplicitConversion): Convert pointer values using
15274 the conv opcode to the proper type.
15276 * ecore.cs (New): change ValueTypeVariable property into a method,
15277 that returns whether the valuetype is suitable for being used.
15279 * expression.cs (Binary.DoNumericPromotions): Only return if we
15280 the int constant was a valid uint, and we can return both left and
15281 right as uints. If not, we continue processing, to trigger the
15282 type conversion. This fixes 39018.
15284 * statement.cs (Block.EmitMeta): During constant resolution, set
15285 the CurrentBlock property on the emitcontext, so that we resolve
15286 constants propertly.
15288 2003-07-02 Martin Baulig <martin@ximian.com>
15290 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
15291 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
15293 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
15294 than emitting it here.
15296 * statement.cs: Fixed some more flow analysis bugs.
15298 2003-07-02 Martin Baulig <martin@ximian.com>
15300 * class.cs (MethodData.Define): When implementing interface
15301 methods, set Final unless we're Virtual.
15303 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
15304 check work for interface methods.
15306 2003-07-01 Martin Baulig <martin@ximian.com>
15308 * ecore.cs (EmitContext.This): Replaced this property with a
15309 GetThis() method which takes a Location argument. This ensures
15310 that we get the correct error location for a CS0188.
15312 2003-07-01 Miguel de Icaza <miguel@ximian.com>
15314 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
15315 ImplicitStandardConversion.
15317 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
15319 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
15321 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
15324 2003-06-30 Miguel de Icaza <miguel@ximian.com>
15326 * class.cs (Constructor.Define): Turn off initlocals for unsafe
15329 (MethodData.Define): Turn off initlocals for unsafe methods.
15331 2003-06-29 Miguel de Icaza <miguel@ximian.com>
15333 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
15334 complete; Fixes #37521.
15336 * delegate.cs: Use Modifiers.TypeAttr to compute the
15337 TypeAttributes, instead of rolling our own. This makes the flags
15338 correct for the delegates.
15340 2003-06-28 Miguel de Icaza <miguel@ximian.com>
15342 * class.cs (Constructor.Define): Set the private flag for static
15343 constructors as well.
15345 * cs-parser.jay (statement_expression): Set the return value to
15346 null, to avoid a crash when we catch an error.
15348 2003-06-24 Miguel de Icaza <miguel@ximian.com>
15350 * cs-parser.jay: Applied patch from Jackson that adds support for
15351 extern and unsafe modifiers to destructor declarations.
15353 * expression.cs: Report error 21 if the user is trying to index a
15356 * driver.cs: Add an error message, suggested by the bug report.
15358 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
15359 if we do not have a ": this ()" constructor initializer. Fixes 45149
15361 2003-06-14 Miguel de Icaza <miguel@ximian.com>
15363 * namespace.cs: Add some information to reduce FAQs.
15365 2003-06-13 Miguel de Icaza <miguel@ximian.com>
15367 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
15368 underlying enumeration types. Fixes #43915.
15370 * expression.cs: Treat ushort/short as legal values to be used in
15371 bitwise operations.
15373 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15375 * delegate.cs: transfer custom attributes for paramenters from
15376 the delegate declaration to Invoke and BeginInvoke.
15378 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15380 * attribute.cs: handle custom marshalers and emit marshal info
15383 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
15385 * makefile.gnu: Added anonymous.cs to the compiler sources.
15387 2003-05-28 Miguel de Icaza <miguel@ximian.com>
15389 * iterators.cs: Change the name of the proxy class to include two
15392 * cs-parser.jay: Update grammar to include anonymous methods.
15394 * anonymous.cs: new file.
15396 2003-05-27 Miguel de Icaza <miguel@ximian.com>
15398 * class.cs (Field.Define): Add missing test for pointers and
15401 2003-05-27 Ravi Pratap <ravi@ximian.com>
15403 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15404 we use the stobj opcode.
15406 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15407 since it wasn't the correct fix.
15409 It still is puzzling that we are required to use stobj for IntPtr
15410 which seems to be a ValueType.
15412 2003-05-26 Miguel de Icaza <miguel@ximian.com>
15414 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15415 during regular simple name resolution. Now, the trick is that
15416 instead of returning for processing the simplename, we do a
15417 TypeManager.LookupType (ie, a rooted lookup as opposed to a
15418 contextual lookup type). If a match is found, return that, if
15419 not, return for further composition.
15421 This fixes long-standing 30485.
15423 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15424 using the address to initialize an object, do an Stobj instead of
15425 using the regular Stelem.
15427 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15428 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15429 Because if we are a BaseIndexerAccess that value will be true.
15432 * statement.cs (GotoCase.Resolve): Return after reporting an
15433 error, do not attempt to continue.
15435 * expression.cs (PointerArithmetic.Emit): If our operand is a
15436 long, convert our constants to match the operand before
15437 multiplying. Convert to I type before adding. Fixes 43670.
15439 2003-05-14 Ravi Pratap <ravi@ximian.com>
15441 * enum.cs (ImplicitConversionExists) : Rename to
15442 ImplicitEnumConversionExists to remove ambiguity.
15444 * ecore.cs (NullCast): New type of cast expression class which
15445 basically is very similar to EmptyCast with the difference being
15446 it still is a constant since it is used only to cast a null to
15448 (eg. (string) null)
15450 * convert.cs (ImplicitReferenceConversion): When casting a null
15451 literal, we return a NullCast.
15453 * literal.cs (NullLiteralTyped): Remove - I don't see why this
15454 should be around anymore.
15456 The renaming (reported was slightly wrong). Corrections:
15458 ConvertImplicitStandard -> ImplicitConversionStandard
15459 ConvertExplicitStandard -> ExplicitConversionStandard
15461 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15462 before passing them in !
15464 * convert.cs (ImplicitConversionStandard): When comparing for
15465 equal expr and target types, ensure that expr is not a
15468 In general, we must not be checking (expr_type ==
15469 target_type) in the top level conversion methods
15470 (ImplicitConversion, ExplicitConversion etc). This checking is
15471 done in the methods that they delegate to.
15473 2003-05-20 Miguel de Icaza <miguel@ximian.com>
15475 * convert.cs: Move Error_CannotConvertType,
15476 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15477 ImplicitNumericConversion, ImplicitConversionExists,
15478 ImplicitUserConversionExists, StandardConversionExists,
15479 FindMostEncompassedType, FindMostSpecificSource,
15480 FindMostSpecificTarget, ImplicitUserConversion,
15481 ExplicitUserConversion, GetConversionOperators,
15482 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15483 TryImplicitIntConversion, Error_CannotConvertImplicit,
15484 ConvertImplicitRequired, ConvertNumericExplicit,
15485 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15486 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15489 Perform the following renames:
15491 StandardConversionExists -> ImplicitStandardConversionExists
15492 ConvertImplicit -> ImplicitConversion
15493 ConvertImplicitStandard -> ImplicitStandardConversion
15494 TryImplicitIntConversion -> ImplicitIntConversion
15495 ConvertImplicitRequired -> ImplicitConversionRequired
15496 ConvertNumericExplicit -> ExplicitNumericConversion
15497 ConvertReferenceExplicit -> ExplicitReferenceConversion
15498 ConvertExplicit -> ExplicitConversion
15499 ConvertExplicitStandard -> ExplicitStandardConversion
15501 2003-05-19 Martin Baulig <martin@ximian.com>
15503 * statement.cs (TypeInfo.StructInfo): Made this type protected.
15504 (TypeInfo): Added support for structs having structs as fields.
15506 * ecore.cs (FieldExpr): Implement IVariable.
15507 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15508 VariableInfo for the field.
15510 2003-05-18 Martin Baulig <martin@ximian.com>
15512 * expression.cs (This.DoResolve): Report a CS0027 if we're
15513 emitting a field initializer.
15515 2003-05-18 Martin Baulig <martin@ximian.com>
15517 * expression.cs (This.ResolveBase): New public function.
15518 (This.DoResolve): Check for CS0188.
15520 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15523 * ecore.cs (MethodGroupExpr.DoResolve): Set the
15524 `instance_expression' to null if we don't have any non-static
15527 2003-05-18 Martin Baulig <martin@ximian.com>
15529 Reworked the way how local variables and parameters are handled by
15530 the flow analysis code.
15532 * statement.cs (TypeInfo, VariableMap): New public classes.
15533 (VariableInfo): New public class. This is now responsible for
15534 checking whether a variable has been assigned. It is used for
15535 parameters and local variables.
15536 (Block.EmitMeta): Take the InternalParameters as argument; compute
15537 the layout of the flow vectors here.
15538 (Block.LocalMap, Block.ParameterMap): New public properties.
15539 (FlowBranching): The .ctor doesn't get the InternalParameters
15540 anymore since Block.EmitMeta() now computes the layout of the flow
15542 (MyStructInfo): This class is now known as `StructInfo' and nested
15543 in `TypeInfo'; we don't access this directly anymore.
15545 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15546 property and removed IsAssigned(), IsFieldAssigned(),
15547 SetAssigned() and SetFieldAssigned(); we now call them on the
15548 VariableInfo so we don't need to duplicate this code everywhere.
15550 * expression.cs (ParameterReference): Added `Block block' argument
15552 (LocalVariableReference, ParameterReference, This): The new
15553 VariableInfo class is now responsible for all the definite
15556 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15557 IsParameterAssigned, SetParameterAssigned): Removed.
15559 2003-05-18 Martin Baulig <martin@ximian.com>
15561 * typemanager.cs (InitCoreTypes): Try calling
15562 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15563 the 3-args-version. Corlib now also needs our `void_type'.
15564 (GetMethod): Added overloaded version which takes an optional
15565 `bool report_errors' to allow lookups of optional methods.
15567 2003-05-12 Martin Baulig <martin@ximian.com>
15569 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15570 only used for locals and not for parameters.
15572 2003-05-12 Miguel de Icaza <miguel@ximian.com>
15574 * support.cs (InternalParameters.ParameterType): Return the
15575 ExternalType of the parameter.
15577 * parameter.cs (Parameter.ExternalType): drop the two arguments,
15580 2003-05-11 Miguel de Icaza <miguel@ximian.com>
15582 * class.cs (MethodData.Define): Do not set the `newslot' on
15583 interface members, if they are also flagged as "override".
15585 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15586 better code for ++i and i++. This only works for static fields
15587 and local variables.
15589 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15590 want to pull the DeclSpace out of the builder_to_declspace instead
15591 of the TypeBuilder (like in TypeContainer.FindMembers).
15593 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15594 instead of LookupTypeContainer. Fixes the crash on .NET for
15595 looking up interface members.
15597 * const.cs: Create our own emit context during the Definition
15598 stage, so that constants are evaluated in the proper context, when
15599 a recursive definition happens.
15601 2003-05-11 Martin Baulig <martin@ximian.com>
15603 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
15604 new block for a switch section.
15605 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15606 the adding/lookup in the switch block. Fixes #39828.
15608 2003-05-09 Miguel de Icaza <miguel@ximian.com>
15610 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15611 functionality: I needed to convert the data after I had performed
15612 the add/sub operation into the operands type size.
15614 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15615 pass the type for the box operation, otherwise the resulting
15616 object would have been of type object.
15618 (BoxedCast): Add constructor to specify the type to box as.
15620 2003-05-07 Miguel de Icaza <miguel@ximian.com>
15622 * iterators.cs: I was reusing the `count' variable inadvertently,
15623 take steps to not allow this to happen.
15625 2003-05-06 Miguel de Icaza <miguel@ximian.com>
15627 * attribute.cs (Attribute.Resolve): Params attributes are encoded
15628 by creating an array at the point where the params starts and
15629 putting all those arguments there, then adjusting the size of the
15632 2003-05-05 Miguel de Icaza <miguel@ximian.com>
15634 * expression.cs (New.AddressOf): Implement interface
15635 IMemoryLocation. This is used when the `new' operator is used in
15636 the context of an invocation to a method on a value type.
15638 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15641 * namespace.cs: Also check the using aliases here.
15643 * driver.cs: Move the test for using validity after the types have
15644 been entered, so we do a single pass that also includes the using
15647 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15648 in the regular case. CreateSiblingForFinally is doing extra
15651 * attribute.cs (GetAttributeArgumentExpression): Store the result
15652 on an out value, and use the return value to indicate failure
15653 instead of using null (which is a valid return for Constant.GetValue).
15655 * statement.cs: Perform the analysis flow for the increment
15656 portion after the statement, because this will be the real flow of
15657 execution. Fixes #42385
15659 * codegen.cs (EmitContext.EmitArgument,
15660 EmitContext.EmitStoreArgument): New helper functions when the
15661 RemapToProxy flag is set.
15663 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15666 Add support for remapping parameters.
15668 * iterators.cs: Propagate parameter values; Store parameter
15669 values in the proxy classes.
15671 2003-05-04 Miguel de Icaza <miguel@ximian.com>
15673 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
15674 need a proxy reference; I do not know what I was thinking
15676 * cs-parser.jay (constructor_initializer): catch another error,
15677 and display nice message.
15679 (field_declaration): catch void field declaration
15680 to flag a better error.
15682 * class.cs (MemberBase.CheckBase): Report an error instead of a
15683 warning if a new protected member is declared in a struct.
15684 (Field.Define): catch the error of readonly/volatile.
15686 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15688 (FieldExpr.AddressOf): ditto. Catch error where the address of a
15689 volatile variable is taken
15691 2003-05-02 Miguel de Icaza <miguel@ximian.com>
15693 * statement.cs (Fixed.Resolve): Report an error if we are not in
15696 2003-05-01 Miguel de Icaza <miguel@ximian.com>
15698 * typemanager.cs: reuse the code that handles type clashes for
15699 delegates and enumerations.
15701 * class.cs (Report28): Always report.
15703 * expression.cs (EncodeAsAttribute): Allow nulls here.
15705 2003-04-28 Miguel de Icaza <miguel@ximian.com>
15707 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15708 the functionality for testing whether an expression is valid for
15709 an attribute here. Also handle the case of arrays of elements
15712 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15713 encoding a linear array into an array of objects that are suitable
15714 to be passed to an CustomAttributeBuilder.
15716 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15718 * ecore.cs: (FieldExpr): Handle field remapping here.
15720 * iteratators.cs: Pass the instance variable (if the method is an
15721 instance method) to the constructors, so we can access the field
15722 variables on the class.
15724 TODO: Test this with structs. I think the THIS variable on
15725 structs might have to be a pointer, and not a refenrece
15727 2003-04-27 Miguel de Icaza <miguel@ximian.com>
15729 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15730 local variables to fields in a proxy class.
15732 * iterators.cs (PopulateProxy): Rename our internal fields to
15734 Create a <THIS> field if we are an instance method, so we can
15735 reference our parent container variables.
15736 (MapVariable): Called back from the EmitContext code to enter a
15737 new variable to field mapping into the proxy class (we just create
15741 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15742 for using the remapped locals to fields.
15744 I placed the code here, because that gives the same semantics to
15745 local variables, and only changes the Emit code.
15747 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15748 statements inside iterators.
15749 (VariableInfo): Add a FieldBuilder for the cases when we are
15750 remapping local variables to fields in a proxy class
15752 * ecore.cs (SimpleNameResolve): Avoid testing two times for
15753 current_block != null.
15755 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15756 not cope with strings, as it has been moved to the
15757 TableSwitchEmit. Fixed bug in switch generation.
15759 * expression.cs (New.DoResolve): Provide more context for the user
15760 when reporting an error.
15762 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15765 * expression.cs (MemberAccess.DoResolve): When we get a type back,
15766 check the permissions for it. Note than in a type-resolution
15767 context the check was already present in DeclSpace.ResolveType,
15768 but was missing from the MemberAccess.
15770 (ArrayCreation.CheckIndices): warn if the user has
15771 more nested levels of expressions, but there are no more
15772 dimensions specified. Avoids crash on bug 41906.
15774 2003-04-26 Miguel de Icaza <miguel@ximian.com>
15776 * statement.cs (Block): replace Implicit bool, for a generic
15778 New flag: `Unchecked'. This is used during the EmitMeta phase
15779 (which is out-of-line with the regular Resolve/Emit process for a
15780 statement, as this is done ahead of time, but still gets a chance
15781 to call constant resolve).
15783 (Block.Flags): new enum for adding a new flag.
15785 (Block.EmitMeta): track the state of unchecked.
15787 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15788 to enable constant resolution to work there as well.
15790 2003-04-22 Miguel de Icaza <miguel@ximian.com>
15792 * typemanager.cs (ienumerable_type): Also look up
15793 System.Collections.IEnumerable.
15795 2003-04-21 Miguel de Icaza <miguel@ximian.com>
15797 TODO: Test more than one conditional per method.
15799 * class.cs (Indexer.Define): Report the location where the user is
15800 referencing the unsupported feature.
15802 (MethodData): Overload the use of `conditionals' to
15803 minimize the creation of needless ArrayLists. This saves roughly
15804 212kb on my machine.
15806 (Method): Implement the new IIteratorContainer interface.
15807 (Method.SetYields): Implement the method by setting the ModFlags
15808 to contain METHOD_YIELDS.
15810 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15811 which just got set to null.
15813 * iterators.cs: New file.
15815 (Yield, YieldBreak): New statements.
15817 * statement.cs (Return.Resolve): Flag an error if we are used in
15818 an iterator method.
15820 * codegen.cs (InIterator): New flag set if the code is being
15821 compiled in an iterator method.
15823 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
15824 internal modifier, and we just use it to avoid adding extra
15825 fields, as this is seldom used.
15827 * cs-parser.jay: Add yield_statement (yield and yield break).
15829 * driver.cs: New flag -v2 to turn on version 2 features.
15831 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15832 hashtable when v2 is enabled.
15834 2003-04-20 Miguel de Icaza <miguel@ximian.com>
15836 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15837 there is already a namespace defined with this name.
15839 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15840 people upgraded their corlibs.
15842 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15843 always use fully qualified types, no need to use the compiler
15846 (TypeManager.IsNamespace): Use binarysearch.
15848 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15849 AddDelegate): I did not quite use the new IsValid API properly: I
15850 have to pass the short-name and the fullname. I was passing only
15851 the basename instead of the fullname sometimes.
15853 (TypeContainer.DefineType): call NamespaceClash.
15855 * interface.cs (Interface.DefineType): use NamespaceClash before
15858 * delegate.cs (Delegate.DefineType): use NamespaceClash before
15861 * enum.cs: (Enum.DefineType): use NamespaceClash before
15864 * typemanager.cs (: 3-line patch that gives us some tasty 11%
15865 speed increase. First, use the negative_hits cache when we get a
15866 negative. Second, add the type with its full original name
15867 instead of the new . and + encoded name (reflection uses + to
15868 separate type from a nested type). Use LookupTypeReflection
15869 directly which bypasses the type->name hashtable (that we already
15870 know does not contain the type.
15872 * decl.cs (DeclSpace.ResolveTypeExpr): track the
15873 location/container type.
15875 * driver.cs: When passing utf8, use directly the UTF8Encoding.
15877 2003-04-19 Miguel de Icaza <miguel@ximian.com>
15879 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15881 * delegate.cs (NewDelegate.Resolve): Test whether an instance
15882 method is being referenced in the method group from a static
15883 context, and report error 120 if so.
15885 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15888 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15889 is created, we create the A namespace).
15891 * cs-parser.jay: A namespace also introduces a DeclarationFound.
15894 2003-04-18 Miguel de Icaza <miguel@ximian.com>
15896 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15897 invocation to ModuleBuilder.GetType with the same values will
15898 return a new type instance, so we need to cache its return
15901 * expression.cs (Binary.ResolveOperator): Only allow the compare
15902 operators on enums if they are of the same type.
15904 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15905 types of ValueType on their own case. Before we were giving them
15906 the same treatment as objects.
15908 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15909 fullname. Short name is used to compare against container name.
15910 Fullname is used to check against defined namespace names.
15912 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15913 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15915 (Method.CheckBase): Call parent.
15916 (MemberBase.CheckBase): Check for protected members on sealed
15918 (PropertyBase.CheckBase): Call parent.
15919 (Field.Define): Call parent.
15921 * report.cs: Negative error codes are now mapped to 8000 - code,
15922 so that the display is render more nicely.
15924 * typemanager.cs: Do not use try/catch, instead report a regular
15927 (GetPointerType, GetReferenceType): These methods provide
15928 mechanisms to obtain the T* and T& from a T. We had the code
15929 previously scattered around the code base, and it also used
15930 TypeManager.LookupType that would go through plenty of caches.
15931 This one goes directly to the type source.
15933 In some places we did the Type.GetType followed by
15934 ModuleBuilder.GetType, but not in others, so this unifies the
15935 processing as well.
15937 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15938 statements now that we have namespace information.
15940 * typemanager.cs (IsNamespace): New method, returns whether the
15941 string presented is a namespace or not.
15943 (ComputeNamespaces): New public entry point, computes the list of
15944 available namespaces, using the GetNamespaces API call in Mono, or
15945 the slower version in MS.NET.
15947 Now before we start the semantic analysis phase, we have a
15948 complete list of namespaces including everything that the user has
15951 Deleted old code to cache namespaces in .nsc files.
15953 2003-04-17 Miguel de Icaza <miguel@ximian.com>
15955 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15956 class/struct location definition Location for the implicit
15957 constructor location.
15959 (Operator.Define): Use the location of the operator for the
15960 implicit Method definition.
15962 (Constructor.Emit): use the constructor location for the implicit
15963 base initializer constructor.
15965 * ecore.cs: Remove ITypeExpression. This interface is now gone,
15966 and the Expression class now contains two new methods:
15968 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
15969 isolate type lookup from the rest of the resolution process.
15971 Since we use Expressions to hold type definitions due to the way
15972 we parse the input we have historically overloaded Resolve to
15973 perform the Type lookups if a special flag is passed. Now this is
15974 eliminated and two methods take their place.
15976 The differences in the two methods between xStep and xTerminal is
15977 that xStep is involved in our current lookup system that uses
15978 SimpleNames to compose a name, while xTerminal is used just to
15979 catch the case where the simplename lookup failed.
15981 2003-04-16 Miguel de Icaza <miguel@ximian.com>
15983 * expression.cs (ResolveMemberAccess): Remove redundant code.
15984 TypeExpr expressions are always born fully resolved.
15986 * interface.cs (PopulateMethod): Do not lookup the types twice.
15987 We were doing it once during SemanticAnalysis and once during
15990 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15991 in local variable type definitions, were being returned as a
15992 SimpleName (we decomposed everything into a string), that is
15993 because primary_expression was being used instead of a type in the
15994 grammar (reduce/reduce conflicts).
15996 The part that was wrong is that we converted the expression into a
15997 string (an oversimplification in one hand, compounded with primary
15998 expressions doing string concatenation).
16004 Would return "A.B.C[]" as a SimpleName. This stopped things like
16005 using clauses from working on this particular context. And a type
16006 was being matched directly against "A.B.C[]".
16008 We now use the correct approach, and allow for ComposedCast to be
16009 part of the unary expression. So the "A.B.C []" become a composed
16010 cast of "A.B.C" (as a nested group of MemberAccess with a
16011 SimpleName at the end) plus the rank composition "[]".
16015 2003-04-10 Miguel de Icaza <miguel@ximian.com>
16017 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
16018 for the access level checking.
16020 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
16021 `TypeContainer container', because I kept getting confused when I
16022 was debugging this code.
16024 * expression.cs (Indexers): Instead of tracking getters/setters,
16025 we now track them in parallel. We create one arraylist less, but
16026 most importantly it is possible now for the LValue code to find a
16027 matching get for a set.
16029 (IndexerAccess.DoResolveLValue): Update the code.
16030 GetIndexersForType has been modified already to extract all the
16031 indexers from a type. The code assumed it did not.
16033 Also make the code set the correct return type for the indexer.
16034 This was fixed a long time ago for properties, but was missing for
16035 indexers. It used to be void_type.
16037 (Binary.Emit): Test first for doubles instead of
16038 floats, as they are more common.
16040 (Binary.EmitBranchable): Use the .un version of the branch opcodes
16041 when dealing with floats and the <=, >= operators. This fixes bug
16044 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
16045 to load the array value by emitting a load on the foreach variable
16046 type. This was incorrect.
16048 We now emit the code to load an element using the the array
16049 variable type, and then we emit the conversion operator.
16053 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
16055 * attribute.cs: Avoid allocation of ArrayLists in the common case.
16057 2003-04-09 Miguel de Icaza <miguel@ximian.com>
16059 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
16060 test for protection before we test for signatures.
16062 (MethodSignature.ToString): implement.
16064 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
16065 to the case where we reduced into a LongConstant.
16067 * decl.cs (CheckAccessLevel): If the type is an array, we can not
16068 depend on whether the information is acurrate, because the
16069 Microsoft runtime will always claim that the array type is public,
16070 regardless of the real state.
16072 If the type is a pointer, another problem happens: the type is
16073 reported as non-public in Microsoft.
16075 In both cases we have to call CheckAccessLevel recursively with
16076 the underlying type as the argument to be tested.
16078 2003-04-08 Miguel de Icaza <miguel@ximian.com>
16080 * assign.cs (Assign.Emit): If we are dealing with a compound
16081 assignment expression, we should use the code path that stores the
16082 intermediate result in a temporary value. This fixes #40903.
16084 *expression.cs (Indirection.ToString): Provide ToString method for
16087 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
16089 * class.cs: Null out fields holding references to Block objects so
16090 they can be garbage collected.
16092 * expression.cs (OverloadResolve): Remove unused local.
16094 2003-04-07 Martin Baulig <martin@ximian.com>
16096 * codegen.cs (EmitContext.CurrentFile): New public field.
16097 (EmitContext.Mark): Use the CurrentFile to check whether the
16098 location is in the correct file.
16099 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
16101 2003-04-07 Martin Baulig <martin@ximian.com>
16103 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
16105 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
16106 location. [FIXME: The location argument which gets passed to this
16107 method is sometimes wrong!]
16109 2003-04-07 Nick Drochak <ndrochak@gol.com>
16111 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
16113 2003-04-07 Miguel de Icaza <miguel@ximian.com>
16115 * expression.cs (Indirection.EmitAssign): We were using the
16116 temporary, but returning immediately instead of continuing the
16119 2003-04-06 Martin Baulig <martin@ximian.com>
16121 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
16122 if it's a nested child, but also deriving from the outer class.
16125 * typemanager.cs (IsNestedChildOf): Make this work if it's a
16126 nested child, but also deriving from the outer class. See
16128 (FilterWithClosure): We may access private members of the outer
16129 class if we're a nested child and deriving from the outer class.
16130 (RealMemberLookup): Only set `closure_private_ok' if the
16131 `original_bf' contained BindingFlags.NonPublic.
16133 2003-04-05 Martin Baulig <martin@ximian.com>
16135 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
16136 probe if its a type parameter, and if so, flag an error.
16138 * decl.cs: Move here the SetParameterInfo code from class.cs.
16139 Handle IsGeneric here.
16141 Handle a variety of errors in the parameter info definition.
16143 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
16144 type parameters here.
16146 * cs-parser.jay (class_declaration): report errors for parameters
16149 2003-01-21 Miguel de Icaza <miguel@ximian.com>
16151 * generic.cs: New file, contains support code for generics.
16153 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
16154 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
16156 Update parser for the above removals.
16158 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
16159 now taken care of in the parser.
16161 2003-04-02 Miguel de Icaza <miguel@ximian.com>
16163 * class.cs (Event.Define): Do not allow abstract events to have
16166 2003-04-01 Miguel de Icaza <miguel@ximian.com>
16168 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
16169 block in event declarations.
16171 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
16172 value type, get its address.
16174 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
16175 leaving a class on the stack instead of a boolean value (int
16176 0/1). Change the code so we compare against null, and then the
16177 result against zero.
16179 * class.cs (TypeContainer.GetClassBases): We were checking for the
16180 parent class being sealed too late.
16182 * expression.cs (Binary.Emit): For <= and >= when dealing with
16183 floating point values, use cgt.un and clt.un instead of cgt and
16186 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
16188 * statement.cs: Apply the same optimization as MS: skip the
16189 GetEnumerator returning an IEnumerator, and use the one returning a
16190 CharEnumerator instead. This allows us to avoid the try-finally block
16193 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
16195 * cs-parser.jay: Attributes cannot be applied to
16196 namespaces. Fixes #40473
16198 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16201 (Add*): check if the name is valid using the full name for constants,
16202 fields, properties and events.
16204 2003-03-28 Miguel de Icaza <miguel@ximian.com>
16206 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
16207 char constants to be part of the enumeration.
16209 * expression.cs (Conditional.DoResolve): Add support for operator
16210 true. Implements the missing functionality from 14.12
16212 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
16213 operator true/false as required by the spec.
16215 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
16216 implicit conversion to boolean.
16218 * statement.cs (Statement.ResolveBoolean): A boolean expression is
16219 also one where the type implements `operator true'.
16221 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
16222 get an expression that will invoke operator true based on an
16225 (GetConversionOperators): Removed the hack that called op_True
16228 (Expression.ResolveBoolean): Move this from Statement.
16230 2003-03-17 Miguel de Icaza <miguel@ximian.com>
16232 * ecore.cs (FieldExpr): do not allow initialization of initonly
16233 fields on derived classes
16235 2003-03-13 Martin Baulig <martin@ximian.com>
16237 * statement.cs (Block.Emit): Call ig.BeginScope() and
16238 ig.EndScope() when compiling with debugging info; call
16239 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
16241 2003-03-08 Miguel de Icaza <miguel@ximian.com>
16243 * expression.cs (Indexers): Do not construct immediately, allow
16244 for new members to be appended as we go. Fixes 38143
16246 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16248 * expression.cs: save/restore context when resolving an unchecked
16251 2003-03-05 Miguel de Icaza <miguel@ximian.com>
16253 * cfold.cs: Catch division by zero in modulus operator during
16256 2003-03-03 Miguel de Icaza <miguel@ximian.com>
16258 * interface.cs (Interface.DefineMembers): Avoid defining members
16261 2003-02-27 Miguel de Icaza <miguel@ximian.com>
16263 * driver.cs: handle the +/- options for -noconfig
16265 * statement.cs (Unckeched.Resolve): Also track the state of
16266 unchecked in the Resolve phase.
16268 2003-02-27 Martin Baulig <martin@ximian.com>
16270 * ecore.cs (Expression.MemberLookup): Don't create a
16271 MethodGroupExpr for something which is not a method. Fixes #38291.
16273 2003-02-25 Miguel de Icaza <miguel@ximian.com>
16275 * class.cs (MemberBase.CheckParameters): Also check that the type
16276 is unmanaged if it is a pointer.
16278 * expression.cs (SizeOf.Resolve): Add location information.
16280 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
16281 a managed type is declared.
16283 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
16284 parameter modifiers as well. Fixes bug 38606
16286 * class.cs: Very sad. Am backing out the speed up changes
16287 introduced by the ArrayList -> Array in the TypeContainer, as they
16288 were not actually that much faster, and introduced a bug (no error
16289 reports on duplicated methods).
16291 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
16292 source first, this will guarantee that we have a valid expression
16293 before calling in lower levels functions that will require a
16294 resolved object. Then use this original_source in the
16295 target.ResolveLValue instead of the original source that was
16298 Another change. Use target.Resolve instead of LValueResolve.
16299 Although we are resolving for LValues, we will let the Assign code
16300 take care of that (it will be called again from Resolve). This
16301 basically allows code like this:
16303 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
16304 class Y { void A (X x) { x [0] += o; }
16306 The problem was that the indexer was trying to resolve for
16307 set_Item (idx, object o) and never finding one. The real set_Item
16308 was set_Item (idx, X). By delaying the process we get the right
16313 2003-02-23 Martin Baulig <martin@ximian.com>
16315 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
16316 while calling DoEmit ().
16318 * codegen.cs (EmitContext.Mark): Don't mark locations in other
16319 source files; if you use the #line directive inside a method, the
16320 compiler stops emitting line numbers for the debugger until it
16321 reaches the end of the method or another #line directive which
16322 restores the original file.
16324 2003-02-23 Martin Baulig <martin@ximian.com>
16326 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
16328 2003-02-23 Martin Baulig <martin@ximian.com>
16330 * statement.cs (Block.AddChildVariableNames): We need to call this
16331 recursively, not just for our immediate children.
16333 2003-02-23 Martin Baulig <martin@ximian.com>
16335 * class.cs (Event.Define): Always make the field private, like csc does.
16337 * typemanager.cs (TypeManager.RealMemberLookup): Make events
16338 actually work, fixes bug #37521.
16340 2003-02-23 Miguel de Icaza <miguel@ximian.com>
16342 * delegate.cs: When creating the various temporary "Parameters"
16343 classes, make sure that we call the ComputeAndDefineParameterTypes
16344 on those new parameters (just like we do with the formal ones), to
16345 allow them to be resolved in the context of the DeclSpace.
16347 This fixes the bug that Dick observed in Bugzilla #38530.
16349 2003-02-22 Miguel de Icaza <miguel@ximian.com>
16351 * expression.cs (ResolveMemberAccess): When resolving a constant,
16352 do not attempt to pull a constant if the value was not able to
16353 generate a valid constant.
16355 * const.cs (LookupConstantValue): Do not report more errors than required.
16357 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16359 * expression.cs: fixes bug #38328.
16361 2003-02-18 Miguel de Icaza <miguel@ximian.com>
16363 * class.cs: Changed all the various members that can be part of a
16364 class from being an ArrayList to be an Array of the right type.
16365 During the DefineType type_list, interface_list, delegate_list and
16366 enum_list are turned into types, interfaces, delegates and enums
16369 And during the member population, indexer_list, event_list,
16370 constant_list, field_list, instance_constructor_list, method_list,
16371 operator_list and property_list are turned into their real arrays.
16373 Although we could probably perform this operation earlier, for
16374 good error reporting we need to keep the lists and remove the
16375 lists for longer than required.
16377 This optimization was triggered by Paolo profiling the compiler
16378 speed on the output of `gen-sample-program.pl' perl script.
16380 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
16381 not crash in methods like MemberLookupFailed that use this field.
16383 This problem arises when the compiler fails to resolve a type
16384 during interface type definition for example.
16386 2003-02-18 Miguel de Icaza <miguel@ximian.com>
16388 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
16389 inherit from System.Object, so we have to stop at null, not only
16390 when reaching System.Object.
16392 2003-02-17 Miguel de Icaza <miguel@ximian.com>
16394 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16395 DeclaredOnly because the parent indexer might have had a different
16396 name, but did not loop until the top of the hierarchy was reached.
16398 The problem this one fixes is 35492: when a class implemented an
16399 indexer from an interface, we were getting the interface method
16400 (which was abstract) and we were flagging an error (can not invoke
16403 This also keeps bug 33089 functioning, and test-148 functioning.
16405 * typemanager.cs (IsSpecialMethod): The correct way of figuring
16406 out if a method is special is to see if it is declared in a
16407 property or event, or whether it is one of the predefined operator
16408 names. This should fix correctly #36804.
16410 2003-02-15 Miguel de Icaza <miguel@ximian.com>
16412 The goal here is to remove the dependency on EmptyCast.Peel ().
16413 Killing it completely.
16415 The problem is that currently in a number of places where
16416 constants are expected, we have to "probe" for an EmptyCast, and
16417 Peel, which is not the correct thing to do, as this will be
16418 repetitive and will likely lead to errors.
16420 The idea is to remove any EmptyCasts that are used in casts that
16421 can be reduced to constants, so we only have to cope with
16424 This bug hunt was triggered by Bug 37363 and the desire to remove
16425 the duplicate pattern where we were "peeling" emptycasts to check
16426 whether they were constants. Now constants will always be
16429 * ecore.cs: Use an enumconstant here instead of wrapping with
16432 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16433 throwing me off. By handling this we can get rid of a few hacks.
16435 * statement.cs (Switch): Removed Peel() code.
16437 2003-02-14 Miguel de Icaza <miguel@ximian.com>
16439 * class.cs: Location information for error 508
16441 * expression.cs (New.DoResolve): Add a guard against double
16442 resolution of an expression.
16444 The New DoResolve might be called twice when initializing field
16445 expressions (see EmitFieldInitializers, the call to
16446 GetInitializerExpression will perform a resolve on the expression,
16447 and later the assign will trigger another resolution
16449 This leads to bugs (#37014)
16451 * delegate.cs: The signature for EndInvoke should contain any ref
16452 or out parameters as well. We were not doing this in the past.
16454 * class.cs (Field.Define): Do not overwrite the type definition
16455 inside the `volatile' group. Turns out that volatile enumerations
16456 were changing the type here to perform a validity test, which
16459 2003-02-12 Miguel de Icaza <miguel@ximian.com>
16461 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16462 and structs, we do not want to load the instance variable
16464 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16465 enum_type has to be handled like an object reference (implicit
16466 conversions exists from this to object), but the regular IsClass
16467 and IsValueType tests will never return true for this one.
16469 Also we use TypeManager.IsValueType instead of type.IsValueType,
16470 just for consistency with the rest of the code (this is only
16471 needed if we ever use the construct exposed by test-180.cs inside
16472 corlib, which we dont today).
16474 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
16476 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16479 2003-02-09 Martin Baulig <martin@ximian.com>
16481 * namespace.cs (Namespace..ctor): Added SourceFile argument.
16482 (Namespace.DefineNamespaces): New static public method; this is
16483 called when we're compiling with debugging to add all namespaces
16484 to the symbol file.
16486 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16487 pass it to the Namespace's .ctor.
16489 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16490 and MethodBase arguments; pass the namespace ID to the symwriter;
16491 pass the MethodBase instead of the token to the symwriter.
16492 (SymbolWriter.DefineNamespace): New method to add a namespace to
16495 2003-02-09 Martin Baulig <martin@ximian.com>
16497 * symbolwriter.cs: New file. This is a wrapper around
16498 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
16499 methods here in near future.
16501 2003-02-09 Martin Baulig <martin@ximian.com>
16503 * codegen.cs (EmitContext.Mark): Just pass the arguments to
16504 ILGenerator.MarkSequencePoint() which are actually used by the
16507 2003-02-09 Martin Baulig <martin@ximian.com>
16509 * location.cs (SourceFile): New public sealed class. This
16510 contains the name and an index which is used in the location's token.
16511 (Location): Reserve an appropriate number of bits in the token for
16512 the source file instead of walking over that list, this gives us a
16513 really huge performance improvement when compiling with debugging.
16515 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16516 `SourceFile' argument instead of a string.
16517 (Driver.ProcessFile): Add all the files via Location.AddFile(),
16518 but don't parse/tokenize here, we need to generate the list of all
16519 source files before we do that.
16520 (Driver.ProcessFiles): New static function. Parses/tokenizes all
16523 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16524 instead of a string.
16526 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16529 2003-02-09 Martin Baulig <martin@ximian.com>
16531 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16532 filename on `#line default'.
16534 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16536 * statement.cs: don't clear the pinned var when the fixed statement
16537 returns from the method (fixes bug#37752).
16539 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16541 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
16544 2003-02-07 Martin Baulig <martin@ximian.com>
16546 * driver.cs: Removed the `--debug-args' command line argument.
16548 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16549 automatically by the AsssemblyBuilder.
16550 (CodeGen.InitializeSymbolWriter): We don't need to call any
16551 initialization function on the symbol writer anymore. This method
16552 doesn't take any arguments.
16554 2003-02-03 Miguel de Icaza <miguel@ximian.com>
16556 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16557 from referenced assemblies as well.
16559 2003-02-02 Martin Baulig <martin@ximian.com>
16561 * class.cs (MethodData.Emit): Generate debugging info for external methods.
16563 2003-02-02 Martin Baulig <martin@ximian.com>
16565 * class.cs (Constructor.Emit): Open the symbol writer before
16566 emitting the constructor initializer.
16567 (ConstructorInitializer.Emit): Call ec.Mark() to allow
16568 single-stepping through constructor initializers.
16570 2003-01-30 Miguel de Icaza <miguel@ximian.com>
16572 * class.cs: Handle error 549: do not allow virtual methods in
16575 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16577 * decl.cs: Check access levels when resolving types
16579 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16581 * statement.cs: Add parameters and locals set in catch blocks that might
16582 return to set vector
16584 2003-01-29 Miguel de Icaza <miguel@ximian.com>
16586 * class.cs (Operator): Set the SpecialName flags for operators.
16588 * expression.cs (Invocation.DoResolve): Only block calls to
16589 accessors and operators on SpecialName methods.
16591 (Cast.TryReduce): Handle conversions from char constants.
16594 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16596 * statement.cs: small memory and time optimization in FlowBranching.
16598 2003-01-28 Pedro Mart <yoros@wanadoo.es>
16600 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16601 problem that the last fix but in the other sid (Set).
16603 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16604 access when there is no indexer in the hierarchy.
16606 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16608 * class.cs: Combine some if statements.
16610 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16612 * driver.cs: fixed bug #37187.
16614 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
16616 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16617 any indexer, it's needed to build a list with all the indexers in the
16618 hierarchy (AllGetters), else we have problems. Fixes #35653.
16620 2003-01-23 Miguel de Icaza <miguel@ximian.com>
16622 * class.cs (MethodData.Define): It is wrong for an interface
16623 implementation to be static in both cases: explicit and implicit.
16624 We were only handling this in one case.
16626 Improve the if situation there to not have negations.
16628 * class.cs (Field.Define): Turns out that we do not need to check
16629 the unsafe bit on field definition, only on usage. Remove the test.
16631 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16633 * driver.cs: use assembly.Location instead of Codebase (the latest
16634 patch made mcs fail when using MS assemblies).
16636 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
16638 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16639 get the path to *corlib.dll.
16641 2003-01-21 Nick Drochak <ndrochak@gol.com>
16645 * typemanager.cs: Remove compiler warnings
16647 2003-01-20 Duncan Mak <duncan@ximian.com>
16649 * AssemblyInfo.cs: Bump the version number to 0.19.
16651 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16653 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16655 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
16657 * class.cs (Constructor::Emit): Emit debugging info for constructors.
16659 2003-01-17 Miguel de Icaza <miguel@ximian.com>
16661 * cs-parser.jay: Small fix: we were not comparing the constructor
16662 name correctly. Thanks to Zoltan for the initial pointer.
16664 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16666 * cs-tokenizer.cs: Set file name when specified with #line
16668 2003-01-15 Miguel de Icaza <miguel@ximian.com>
16670 * cs-parser.jay: Only perform the constructor checks here if we
16671 are named like the class; This will help provider a better
16672 error. The constructor path is taken when a type definition is
16673 not found, but most likely the user forgot to add the type, so
16674 report that rather than the constructor error.
16676 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16678 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16681 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16683 * cs-parser.jay: Add cleanup call.
16685 2003-01-13 Duncan Mak <duncan@ximian.com>
16687 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16688 consistent with other methods.
16690 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16692 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16694 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16696 * attribute.cs: only set GuidAttr to true when we have a
16699 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16703 * typemanager.cs: fixes to allow mcs compile corlib with the new
16704 Type.IsSubclassOf fix.
16706 2003-01-08 Miguel de Icaza <miguel@ximian.com>
16708 * expression.cs (LocalVariableReference.DoResolve): Classify a
16709 constant as a value, not as a variable. Also, set the type for
16712 * cs-parser.jay (fixed_statement): take a type instead of a
16713 pointer_type, so we can produce a better error message later.
16715 * statement.cs (Fixed.Resolve): Flag types that are not pointers
16718 (For.DoEmit): Make inifinite loops have a
16719 non-conditional branch back.
16721 (Fixed.DoEmit): First populate the pinned variables, then emit the
16722 statement, then clear the variables. Before I was emitting the
16723 code once for each fixed piece.
16726 2003-01-08 Martin Baulig <martin@ximian.com>
16728 * statement.cs (FlowBranching.MergeChild): A break in a
16729 SWITCH_SECTION does not leave a loop. Fixes #36155.
16731 2003-01-08 Martin Baulig <martin@ximian.com>
16733 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16734 lives in the same number space than `param_map'. Fixes #36154.
16736 2003-01-07 Miguel de Icaza <miguel@ximian.com>
16738 * cs-parser.jay (constructor_declaration): Set the
16739 Constructor.ModFlags before probing for it. This makes the
16740 compiler report 514, 515 and 132 (the code was there, but got
16743 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16744 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16745 (GotoCase.Resolve): Set `Returns' to ALWAYS.
16747 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16749 * enum.cs: create the enum static fields using the enum type.
16751 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16753 * class.cs: don't try to create the ParamBuilder for the return
16754 type if it's not needed (and handle it breaking for the ms runtime
16757 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16759 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16761 2002-12-29 Miguel de Icaza <miguel@ximian.com>
16763 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16764 the command. This showed up while compiling the JANET source
16765 code, which used \r as its only newline separator.
16767 2002-12-28 Miguel de Icaza <miguel@ximian.com>
16769 * class.cs (Method.Define): If we are an operator (because it
16770 reuses our code), then set the SpecialName and HideBySig. #36128
16772 2002-12-22 Miguel de Icaza <miguel@ximian.com>
16774 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16775 exception, report error 120 `object reference required'.
16777 * driver.cs: Add --pause option, used during to measure the size
16778 of the process as it goes with --timestamp.
16780 * expression.cs (Invocation.DoResolve): Do not allow methods with
16781 SpecialName to be invoked.
16783 2002-12-21 Miguel de Icaza <miguel@ximian.com>
16785 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16786 number before adding it.
16788 2002-12-21 Ravi Pratap <ravi@ximian.com>
16790 * ecore.cs (StandardImplicitConversion): When in an unsafe
16791 context, we allow conversion between void * to any other pointer
16792 type. This fixes bug #35973.
16794 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16796 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16797 is not thrown when extensionless outputs are used
16799 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16801 * rootcontext.cs: fixed compilation of corlib.
16803 2002-12-19 Miguel de Icaza <miguel@ximian.com>
16805 * attribute.cs (Attributes.Contains): Add new method.
16807 * class.cs (MethodCore.LabelParameters): if the parameter is an
16808 `out' parameter, check that no attribute `[In]' has been passed.
16810 * enum.cs: Handle the `value__' name in an enumeration.
16812 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
16814 * decl.cs: Added special case to allow overrides on "protected
16817 2002-12-18 Ravi Pratap <ravi@ximian.com>
16819 * attribute.cs (Attributes.AddAttributeSection): Rename to this
16820 since it makes much more sense.
16822 (Attributes.ctor): Don't require a Location parameter.
16824 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16826 * attribute.cs (ApplyAttributes): Remove extra Location parameters
16827 since we already have that information per attribute.
16829 * everywhere : make appropriate changes.
16831 * class.cs (LabelParameters): Write the code which actually
16832 applies attributes to the return type. We can't do this on the MS
16833 .NET runtime so we flag a warning in the case an exception is
16836 2002-12-18 Miguel de Icaza <miguel@ximian.com>
16838 * const.cs: Handle implicit null conversions here too.
16840 2002-12-17 Ravi Pratap <ravi@ximian.com>
16842 * class.cs (MethodCore.LabelParameters): Remove the extra
16843 Type [] parameter since it is completely unnecessary. Instead
16844 pass in the method's attributes so that we can extract
16845 the "return" attribute.
16847 2002-12-17 Miguel de Icaza <miguel@ximian.com>
16849 * cs-parser.jay (parse): Use Report.Error to flag errors instead
16850 of ignoring it and letting the compile continue.
16852 * typemanager.cs (ChangeType): use an extra argument to return an
16853 error condition instead of throwing an exception.
16855 2002-12-15 Miguel de Icaza <miguel@ximian.com>
16857 * expression.cs (Unary.TryReduce): mimic the code for the regular
16858 code path. Perform an implicit cast in the cases where we can
16859 implicitly convert to one of the integral types, and then reduce
16860 based on that constant. This fixes bug #35483.
16862 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16864 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16866 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16868 * namespace.cs: fixed bug #35489.
16870 2002-12-12 Miguel de Icaza <miguel@ximian.com>
16872 * class.cs: Remove some dead code.
16874 * cs-parser.jay: Estimate the number of methods needed
16875 (RootContext.MethodCount);
16877 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16878 numbers instead of StringBuilders.
16880 * support.cs (PtrHashtable): Add constructor with initial size;
16881 We can now reduce reallocations of the method table.
16883 2002-12-10 Ravi Pratap <ravi@ximian.com>
16885 * attribute.cs (ApplyAttributes): Keep track of the emitted
16886 attributes on a per-target basis. This fixes bug #35413.
16888 2002-12-10 Miguel de Icaza <miguel@ximian.com>
16890 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16891 default to the Windows 1252 encoding.
16893 (UnixParseOption): Support version, thanks to Alp for the missing
16896 * AssemblyInfo.cs: Add nice assembly information.
16898 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16901 * cs-parser.jay: Allow a trailing comma before the close bracked
16902 in the attribute_section production.
16904 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16905 address of the instance was being taken, I will take this out,
16906 because we take the address of the object immediately here.
16908 2002-12-09 Ravi Pratap <ravi@ximian.com>
16910 * typemanager.cs (AreMultipleAllowed): Take care of the most
16911 obvious case where attribute type is not in the current assembly -
16914 2002-12-08 Miguel de Icaza <miguel@ximian.com>
16916 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16917 definitions, instead of doing that afterwards.
16919 Also we use a nice little hack, depending on the constructor, we
16920 know if we are a "composed" name or a simple name. Hence, we
16921 avoid the IndexOf test, and we avoid
16923 * codegen.cs: Add code to assist in a bug reporter to track down
16924 the source of a compiler crash.
16926 2002-12-07 Ravi Pratap <ravi@ximian.com>
16928 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16929 types have been emitted for a given element and flag an error
16930 if something which does not have AllowMultiple set is used more
16933 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16934 attribute types and their corresponding AllowMultiple properties
16936 (AreMultipleAllowed): Check the property for a given type.
16938 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16939 property in the case we have a TypeContainer.
16941 (Attributes.AddAttribute): Detect duplicates and just skip on
16942 adding them. This trivial fix catches a pretty gross error in our
16943 attribute emission - global attributes were being emitted twice!
16945 Bugzilla bug #33187 is now fixed.
16947 2002-12-06 Miguel de Icaza <miguel@ximian.com>
16949 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16950 instead of pp_and).
16952 * expression.cs (Binary.ResolveOperator): I can only use the
16953 Concat (string, string, string) and Concat (string, string,
16954 string, string) if the child is actually a concatenation of
16957 2002-12-04 Miguel de Icaza <miguel@ximian.com>
16959 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16960 context where we need a 2-character lookahead.
16962 * pending.cs (PendingImplementation): Rework so we can keep track
16963 of interface types all the time, and flag those which were
16964 implemented by parents as optional.
16966 2002-12-03 Miguel de Icaza <miguel@ximian.com>
16968 * expression.cs (Binary.ResolveOperator): Use
16969 String.Concat(string,string,string) or
16970 String.Concat(string,string,string,string) when possible.
16972 * typemanager: More helper methods.
16975 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16977 * pending.cs: remove the bogus return from GetMissingInterfaces()
16978 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16980 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16982 * namespace.cs: avoid duplicated 'using xxx' being added to
16983 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16984 when we get more than one 'using' statement for the same namespace.
16985 Report a CS0105 warning for it.
16987 2002-11-30 Miguel de Icaza <miguel@ximian.com>
16989 * cs-tokenizer.cs (consume_identifier): use read directly, instead
16990 of calling getChar/putback, uses internal knowledge of it.
16992 (xtoken): Reorder tokenizer so most common patterns are checked
16993 first. This reduces the compilation time in another 5% (from 8.11s
16994 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16996 The parsing time is 22% of the compilation in mcs, and from that
16997 64% is spent on the tokenization process.
16999 I tried using a binary search for keywords, but this is slower
17000 than the hashtable. Another option would be to do a couple of
17003 * Not use a StringBuilder, instead use an array of chars,
17004 with a set value. Notice that this way we could catch
17005 the 645 error without having to do it *afterwards*.
17007 * We could write a hand-parser to avoid the hashtable
17008 compares altogether.
17010 The identifier consumption process takes 37% of the tokenization
17011 time. Another 15% is spent on is_number. 56% of the time spent
17012 on is_number is spent on Int64.Parse:
17014 * We could probably choose based on the string length to
17015 use Int32.Parse or Int64.Parse and avoid all the 64-bit
17018 Another 3% is spend on wrapping `xtoken' in the `token' function.
17020 Handle 0xa0 as whitespace (#34752)
17022 2002-11-26 Miguel de Icaza <miguel@ximian.com>
17024 * typemanager.cs (IsCLRType): New routine to tell whether a type
17025 is one of the builtin types.
17027 Maybe it needs to use TypeCodes to be faster. Maybe we could use
17028 typecode in more places instead of doing pointer comparissions.
17029 We could leverage some knowledge about the way the typecodes are
17032 New code to cache namespaces in assemblies, it is currently not
17033 invoked, to be used soon.
17035 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
17037 * expression.cs (Binary.ResolveOperator): specially handle
17038 strings, and do not perform user-defined operator overloading for
17041 2002-11-24 Miguel de Icaza <miguel@ximian.com>
17043 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
17044 internalcall as it is a pretty simple operation; Avoid whenever
17045 possible to call Char.IsLetter.
17047 (consume_identifier): Cut by half the number of
17048 hashtable calls by merging the is_keyword and GetKeyword behavior.
17050 Do not short-circuit, because if we do, we
17051 report errors (ie, #if false && true would produce an invalid
17055 2002-11-24 Martin Baulig <martin@ximian.com>
17057 * expression.cs (Cast.TryReduce): If we're in checked syntax,
17058 check constant ranges and report a CS0221. Fixes #33186.
17060 2002-11-24 Martin Baulig <martin@ximian.com>
17062 * cs-parser.jay: Make this work for uninitialized variable
17063 declarations in the `for' initializer. Fixes #32416.
17065 2002-11-24 Martin Baulig <martin@ximian.com>
17067 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
17068 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
17070 2002-11-24 Martin Baulig <martin@ximian.com>
17072 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
17073 argument; if true, we also check for user-defined conversions.
17074 This is only needed if both arguments are of a user-defined type.
17075 Fixes #30443, added test-175.cs.
17076 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
17078 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
17080 2002-11-24 Martin Baulig <martin@ximian.com>
17082 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
17083 function to get the store opcode.
17084 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
17085 only emit the Ldelema if the store opcode is Stobj. You must run
17086 both test-34 and test-167 to test this. Fixes #34529.
17088 2002-11-23 Martin Baulig <martin@ximian.com>
17090 * ecore.cs (Expression.MemberLookup): Added additional
17091 `qualifier_type' argument which is used when we're being called
17092 from MemberAccess.DoResolve() and null if we're called from a
17094 (Expression.MemberLookupFailed): New method to report errors; this
17095 does the CS1540 check and reports the correct error message.
17097 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
17098 argument for the CS1540 check and redone the way how we're dealing
17099 with private members. See the comment in the source code for details.
17100 (FilterWithClosure): Reverted this back to revision 1.197; renamed
17101 `closure_start_type' to `closure_qualifier_type' and check whether
17102 it's not null. It was not this filter being broken, it was just
17103 being called with the wrong arguments.
17105 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
17106 and pass it the correct `qualifier_type'; this also does the error
17109 2002-11-22 Miguel de Icaza <miguel@ximian.com>
17111 * expression.cs (Invocation.EmitParams): If the we are dealing
17112 with a non-built-in value type, load its address as well.
17114 (ArrayCreation): Use a a pretty constant instead
17115 of the hardcoded value 2. Use 6 instead of 2 for the number of
17116 static initializers.
17118 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
17119 because they are not really value types, just glorified integers.
17121 * driver.cs: Do not append .exe, the CSC compiler does not do it.
17123 * ecore.cs: Remove redundant code for enumerations, make them use
17124 the same code path as everything else, fixes the casting issue
17125 with enumerations in Windows.Forms.
17127 * attribute.cs: Do only cast to string if it is a string, the
17128 validation happens later.
17130 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
17131 people upgrade their corlibs.
17133 * ecore.cs: Oops, enumerations were not following the entire code path
17135 2002-11-21 Miguel de Icaza <miguel@ximian.com>
17137 * typemanager.cs (FilterWithClosure): Commented out the test for
17138 1540 in typemanager.cs, as it has problems when accessing
17139 protected methods from a parent class (see test-174.cs).
17141 * attribute.cs (Attribute.ValidateGuid): new method.
17142 (Attribute.Resolve): Use above.
17144 2002-11-19 Miguel de Icaza <miguel@ximian.com>
17146 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
17148 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
17149 handling for enumerations, as we only needed the TypeContainer
17150 functionality to begin with (this is required for the fix below to
17151 work for enums that reference constants in a container class for
17154 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
17156 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
17157 a valid TypeBuilder to perform lookups on.o
17159 * class.cs (InheritableMemberSignatureCompare): Use true in the
17160 call to GetGetMethod and GetSetMethod, because we are comparing
17161 the signature, and we need to get the methods *even* if they are
17164 (PropertyBase.CheckBase): ditto.
17166 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
17167 GotoCase.Resolve): Use Peel on EmpytCasts.
17169 * ecore.cs (EmptyCast): drop child, add Peel method.
17171 2002-11-17 Martin Baulig <martin@ximian.com>
17173 * ecore.cs (EmptyCast.Child): New public property.
17175 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
17176 label resolved to an EmptyCast. Fixes #34162.
17177 (GotoCase.Resolve): Likewise.
17178 (Block.EmitMeta): Likewise.
17180 2002-11-17 Martin Baulig <martin@ximian.com>
17182 * expression.cs (Invocation.BetterConversion): Prefer int over
17183 uint; short over ushort; long over ulong for integer literals.
17184 Use ImplicitConversionExists instead of StandardConversionExists
17185 since we also need to check for user-defined implicit conversions.
17186 Fixes #34165. Added test-173.cs.
17188 2002-11-16 Martin Baulig <martin@ximian.com>
17190 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
17191 with the `true' and `false' literals. Fixes #33151.
17193 2002-11-16 Martin Baulig <martin@ximian.com>
17195 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
17196 October 22nd; don't do the cs1540 check for static members.
17198 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
17199 now using our own filter here and doing the cs1540 check again.
17201 2002-11-16 Martin Baulig <martin@ximian.com>
17203 * support.cs (InternalParameters): Don't crash if we don't have
17204 any fixed parameters. Fixes #33532.
17206 2002-11-16 Martin Baulig <martin@ximian.com>
17208 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
17209 when looking up static methods to make this work on Windows.
17212 2002-11-16 Martin Baulig <martin@ximian.com>
17214 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
17215 a setter rather than using PropertyInfo.CanWrite.
17217 2002-11-15 Nick Drochak <ndrochak@gol.com>
17219 * class.cs: Allow acces to block member by subclasses. Fixes build
17222 2002-11-14 Martin Baulig <martin@ximian.com>
17224 * class.cs (Constructor.Emit): Added the extern/block check.
17227 2002-11-14 Martin Baulig <martin@ximian.com>
17229 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
17230 iteration while looking for indexers, this is needed because the
17231 indexer may have a different name in our base classes. Fixed the
17232 error reporting (no indexers at all, not get accessor, no
17233 overloaded match). Fixes bug #33089.
17234 (IndexerAccess.DoResolveLValue): Likewise.
17236 2002-11-14 Martin Baulig <martin@ximian.com>
17238 * class.cs (PropertyBase.CheckBase): Make this work for multiple
17239 indexers. Fixes the first part of bug #33089.
17240 (MethodSignature.InheritableMemberSignatureCompare): Added support
17243 2002-11-13 Ravi Pratap <ravi@ximian.com>
17245 * attribute.cs (Attribute.Resolve): Catch the
17246 NullReferenceException and report it since it isn't supposed to
17249 2002-11-12 Miguel de Icaza <miguel@ximian.com>
17251 * expression.cs (Binary.EmitBranchable): Also handle the cases for
17252 LogicalOr and LogicalAnd that can benefit from recursively
17253 handling EmitBranchable. The code now should be nice for Paolo.
17255 2002-11-08 Miguel de Icaza <miguel@ximian.com>
17257 * typemanager.cs (LookupType): Added a negative-hit hashtable for
17258 the Type lookups, as we perform quite a number of lookups on
17259 non-Types. This can be removed once we can deterministically tell
17260 whether we have a type or a namespace in advance.
17262 But this might require special hacks from our corlib.
17266 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
17267 and double which avoids a conversion from an integer to a double.
17269 * expression.cs: tiny optimization, avoid calling IsConstant,
17270 because it effectively performs the lookup twice.
17272 2002-11-06 Miguel de Icaza <miguel@ximian.com>
17274 But a bogus return here to keep the semantics of the old code
17275 until the Mono runtime is fixed.
17277 * pending.cs (GetMissingInterfaces): New method used to remove all
17278 the interfaces that are already implemented by our parent
17279 classes from the list of pending methods.
17281 * interface.cs: Add checks for calls after ResolveTypeExpr.
17283 2002-11-05 Miguel de Icaza <miguel@ximian.com>
17285 * class.cs (Class.Emit): Report warning 67: event not used if the
17286 warning level is beyond 3.
17288 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
17289 being a NullLiteral.
17291 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
17294 * class.cs (TypeContainer.GetClassBases): Cover a missing code
17295 path that might fail if a type can not be resolved.
17297 * expression.cs (Binary.Emit): Emit unsigned versions of the
17300 * driver.cs: use error 5.
17302 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
17304 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
17306 2002-11-01 Miguel de Icaza <miguel@ximian.com>
17308 * cs-parser.jay (switch_section): A beautiful patch from Martin
17309 Baulig that fixed 33094.
17311 2002-10-31 Miguel de Icaza <miguel@ximian.com>
17313 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
17314 Check whether the base is abstract and report an error if so.
17316 * expression.cs (IndexerAccess.DoResolveLValue,
17317 IndexerAccess.DoResolve): ditto.
17319 (Invocation.DoResolve): ditto.
17321 (Invocation.FullMethodDesc): Improve the report string.
17323 * statement.cs (Block): Eliminate IsVariableDefined as it is
17324 basically just a wrapper for GetVariableInfo.
17326 * ecore.cs (SimpleName): Use new
17328 * support.cs (ReflectionParamter.ParameterType): We unwrap the
17329 type, as we return the actual parameter ref/unref state on a
17332 2002-10-30 Miguel de Icaza <miguel@ximian.com>
17334 * support.cs: Return proper flags REF/OUT fixing the previous
17337 * expression.cs: Reverted last patch, that was wrong. Is_ref is
17338 not used to mean `ref' but `ref or out' in ParameterReference
17340 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
17341 full type signature instead of calling TypeManger.CSharpName
17344 * support.cs (InternalParameters.ParameterDesc): Do not compare
17345 directly to the modflags, because REF/OUT will actually be bitsets
17348 * delegate.cs (VerifyMethod): Check also the modifiers.
17350 * cs-tokenizer.cs: Fix bug where floating point values with an
17351 exponent where a sign was missing was ignored.
17353 * driver.cs: Allow multiple assemblies to be specified in a single
17356 2002-10-28 Miguel de Icaza <miguel@ximian.com>
17358 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
17359 because identifiers after a parenthesis would end up in this kind
17360 of production, and we needed to desamiguate it for having casts
17363 (UserDefinedType *) xxx
17365 2002-10-24 Miguel de Icaza <miguel@ximian.com>
17367 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
17368 we should set on the Bindingflags.NonPublic, but not turn on
17369 private_ok. private_ok controls whether a Private member is
17370 returned (this is chekced on the filter routine), while the
17371 BindingFlags.NonPublic just controls whether private/protected
17372 will be allowed. This fixes the problem part of the problem of
17373 private properties being allowed to be used in derived classes.
17375 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
17376 so we can call the children DoResolveLValue method (this will
17377 properly signal errors on lvalue assignments to base properties)
17379 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
17380 getter are null, and we have a property info, we know that this
17381 happened because the lookup failed, so we report an error 122 for
17382 protection level violation.
17384 We also silently return if setter and getter are null in the
17385 resolve functions, this condition only happens if we have flagged
17386 the error before. This is the other half of the problem.
17388 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
17389 not have accessibility information, that is why we were returning
17390 true in the filter function in typemanager.cs.
17392 To properly report 122 (property is inaccessible because of its
17393 protection level) correctly, we report this error in ResolveAccess
17394 by failing if both the setter and the getter are lacking (ie, the
17397 DoResolve and DoLResolve have been modified to check for both
17398 setter/getter being null and returning silently, the reason being
17399 that I did not want to put the knowledge about this error in upper
17402 int old = Report.Errors;
17403 x = new PropertyExpr (...);
17404 if (old != Report.Errors)
17409 So the property expr is returned, but it is invalid, so the error
17410 will be flagged during the resolve process.
17412 * class.cs: Remove InheritablePropertySignatureCompare from the
17413 class, as we no longer depend on the property signature to compute
17414 whether it is possible to implement a method or not.
17416 The reason is that calling PropertyInfo.GetGetMethod will return
17417 null (in .NET, in Mono it works, and we should change this), in
17418 cases where the Get Method does not exist in that particular
17423 class X { public virtual int A { get { return 1; } } }
17425 class Z : Y { public override int A { get { return 2; } } }
17427 Would fail in Z because the parent (Y) would not have the property
17428 defined. So we avoid this completely now (because the alternative
17429 fix was ugly and slow), and we now depend exclusively on the
17432 (PropertyBase.CheckBase): Use a method-base mechanism to find our
17433 reference method, instead of using the property.
17435 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17436 routines are gone now.
17438 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17439 names, they were incorrectly named.
17441 * cs-tokenizer.cs: Return are more gentle token on failure.
17443 * pending.cs (PendingImplementation.InterfaceMethod): This routine
17444 had an out-of-sync index variable, which caused it to remove from
17445 the list of pending methods the wrong method sometimes.
17447 2002-10-22 Miguel de Icaza <miguel@ximian.com>
17449 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17450 CanWrite, because those refer to this particular instance of the
17451 property, and do not take into account the fact that we can
17452 override single members of a property.
17454 Constructor requires an EmitContext. The resolution process does
17455 not happen here, but we need to compute the accessors before,
17456 because the resolution does not always happen for properties.
17458 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17459 subclass, before we did not update this flag, but we did update
17462 (GetAccessors): Drop this routine, as it did not work in the
17463 presence of partially overwritten set/get methods.
17465 Notice that this broke the cs1540 detection, but that will require
17468 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17472 * driver.cs: issue a warning instead of an error if we don't support
17473 debugging for the platform. Also ignore a couple of errors that may
17474 arise when trying to write the symbols. Undo my previous patch.
17476 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17478 * driver.cs: ignore /debug switch except for Unix platforms.
17480 2002-10-23 Nick Drochak <ndrochak@gol.com>
17482 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17484 2002-10-21 Miguel de Icaza <miguel@ximian.com>
17486 * driver.cs: Do not make mcs-debug conditional, so we do not break
17487 builds that use it.
17489 * statement.cs (UsageVector.MergeChildren): I would like Martin to
17490 review this patch. But basically after all the children variables
17491 have been merged, the value of "Breaks" was not being set to
17492 new_breaks for Switch blocks. I think that it should be set after
17493 it has executed. Currently I set this to the value of new_breaks,
17494 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17495 conservative, but I do not understand this code very well.
17497 I did not break anything in the build, so that is good ;-)
17499 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17501 2002-10-20 Mark Crichton <crichton@gimp.org>
17503 * cfold.cs: Fixed compile blocker. Really fixed it this time.
17505 2002-10-20 Nick Drochak <ndrochak@gol.com>
17507 * cfold.cs: Fixed compile blocker.
17509 2002-10-20 Miguel de Icaza <miguel@ximian.com>
17511 * driver.cs: I was chekcing the key, not the file.
17513 2002-10-19 Ravi Pratap <ravi@ximian.com>
17515 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17516 message that we were generating - we just need to silently return
17519 2002-10-19 Miguel de Icaza <miguel@ximian.com>
17521 * class.cs (Event.Define): Change my previous commit, as this
17522 breaks the debugger. This is a temporary hack, as it seems like
17523 the compiler is generating events incorrectly to begin with.
17525 * expression.cs (Binary.ResolveOperator): Added support for
17526 "U operator - (E x, E y)"
17528 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17531 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17532 init-only variables, but this path did not take into account that
17533 there might be also instance readonly variables. Correct this
17536 This fixes bug 32253
17538 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17541 * driver.cs: Change the extension for modules to `netmodule'
17543 * cs-parser.jay: Improved slightly the location tracking for
17544 the debugger symbols.
17546 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17547 modifiers that were specified instead of the hardcoded value
17548 (FamAndAssem). This was basically ignoring the static modifier,
17549 and others. Fixes 32429.
17551 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17552 fixed a bug in the process (32476)
17554 * expression.cs (ArrayAccess.EmitAssign): Patch from
17555 hwang_rob@yahoo.ca that fixes bug 31834.3
17557 2002-10-18 Miguel de Icaza <miguel@ximian.com>
17559 * driver.cs: Make the module extension .netmodule.
17561 2002-10-16 Miguel de Icaza <miguel@ximian.com>
17563 * driver.cs: Report an error if the resource file is not found
17564 instead of crashing.
17566 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17567 false, like Emit does.
17569 2002-10-16 Nick Drochak <ndrochak@gol.com>
17571 * typemanager.cs: Remove unused private member. Also reported mcs
17572 bug to report this as a warning like csc.
17574 2002-10-15 Martin Baulig <martin@gnome.org>
17576 * statement.cs (Statement.Emit): Made this a virtual method; emits
17577 the line number info and calls DoEmit().
17578 (Statement.DoEmit): New protected abstract method, formerly knows
17579 as Statement.Emit().
17581 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17583 2002-10-11 Miguel de Icaza <miguel@ximian.com>
17585 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17586 have fixed a remaining problem: not every AddXXXX was adding a
17587 fully qualified name.
17589 Now everyone registers a fully qualified name in the DeclSpace as
17590 being defined instead of the partial name.
17592 Downsides: we are slower than we need to be due to the excess
17593 copies and the names being registered this way.
17595 The reason for this is that we currently depend (on the corlib
17596 bootstrap for instance) that types are fully qualified, because
17597 we dump all the types in the namespace, and we should really have
17598 types inserted into the proper namespace, so we can only store the
17599 basenames in the defined_names array.
17601 2002-10-10 Martin Baulig <martin@gnome.org>
17603 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17604 from bug #31834, see the bug report for a testcase which is
17607 2002-10-10 Martin Baulig <martin@gnome.org>
17609 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17610 flow analysis code for this.
17612 * statement.cs (Do, While, For): Tell the flow analysis code about
17614 (FlowBranching.UsageVector): Added support for infinite loops.
17615 (Block.Resolve): Moved the dead code elimination here and use flow
17618 2002-10-09 Miguel de Icaza <miguel@ximian.com>
17620 * class.cs (Field.Define): Catch cycles on struct type
17623 * typemanager.cs (IsUnmanagedtype): Do not recursively check
17624 fields if the fields are static. We only need to check instance
17627 * expression.cs (As.DoResolve): Test for reference type.
17629 * statement.cs (Using.ResolveExpression): Use
17630 ConvertImplicitRequired, not ConvertImplicit which reports an
17632 (Using.ResolveLocalVariableDecls): ditto.
17634 * expression.cs (Binary.ResolveOperator): Report errors in a few
17635 places where we had to.
17637 * typemanager.cs (IsUnmanagedtype): Finish implementation.
17639 2002-10-08 Miguel de Icaza <miguel@ximian.com>
17641 * expression.cs: Use StoreFromPtr instead of extracting the type
17642 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
17644 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17645 an enumeration value to a System.Enum, but System.Enum is not a
17646 value type, but an class type, so we need to box.
17648 (Expression.ConvertExplicit): One codepath could return
17649 errors but not flag them. Fix this. Fixes #31853
17651 * parameter.cs (Resolve): Do not allow void as a parameter type.
17653 2002-10-06 Martin Baulig <martin@gnome.org>
17655 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17656 if it's a class type and not a struct. Fixes #31815.
17658 2002-10-06 Martin Baulig <martin@gnome.org>
17660 * statement.cs: Reworked the flow analysis code a bit to make it
17661 usable for dead code elimination.
17663 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17665 * cs-parser.jay: allow empty source files. Fixes bug #31781.
17667 2002-10-04 Miguel de Icaza <miguel@ximian.com>
17669 * expression.cs (ComposedCast.DoResolveType): A quick workaround
17670 to fix the test 165, will investigate deeper.
17672 2002-10-04 Martin Baulig <martin@gnome.org>
17674 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17675 finally blocks actually work.
17676 (Try.Resolve): We don't need to create a sibling for `finally' if
17677 there is no finally block.
17679 2002-10-04 Martin Baulig <martin@gnome.org>
17681 * class.cs (Constructor.Define): The default accessibility for a
17682 non-default constructor is private, not public.
17684 2002-10-04 Miguel de Icaza <miguel@ximian.com>
17686 * class.cs (Constructor): Make AllowedModifiers public, add
17689 * cs-parser.jay: Perform the modifiers test here, as the
17690 constructor for the Constructor class usually receives a zero
17691 because of the way we create it (first we create, later we
17692 customize, and we were never checking the modifiers).
17694 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17695 is a version of LookupTypeReflection that includes the type-name
17696 cache. This can be used as a fast path for functions that know
17697 the fully qualified name and are only calling into *.GetType() to
17698 obtain a composed type.
17700 This is also used by TypeManager.LookupType during its type
17703 (LookupType): We now also track the real type name, as sometimes
17704 we can get a quey for the real type name from things like
17705 ComposedCast. This fixes bug 31422.
17707 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17708 complete type fullname, it does not have to go through the type
17709 resolution system to obtain the composed version of the type (for
17710 obtaining arrays or pointers).
17712 (Conditional.Emit): Use the EmitBoolExpression to
17713 generate nicer code, as requested by Paolo.
17715 (ArrayCreation.CheckIndices): Use the patch from
17716 hwang_rob@yahoo.ca to validate the array initializers.
17718 2002-10-03 Miguel de Icaza <miguel@ximian.com>
17720 * class.cs (ConstructorInitializer.Emit): simplify code by using
17721 Invocation.EmitCall, and at the same time, fix the bugs in calling
17722 parent constructors that took variable arguments.
17724 * ecore.cs (Expression.ConvertNumericExplicit,
17725 Expression.ImplicitNumericConversion): Remove the code that
17726 manually wrapped decimal (InternalTypeConstructor call is now gone
17729 * expression.cs (Cast.TryReduce): Also handle decimal types when
17730 trying to perform a constant fold on the type.
17732 * typemanager.cs (IsUnmanagedtype): Partially implemented.
17734 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17735 that only turned off an error report, and did nothing else.
17737 2002-10-02 Miguel de Icaza <miguel@ximian.com>
17739 * driver.cs: Handle and ignore /fullpaths
17741 2002-10-01 Miguel de Icaza <miguel@ximian.com>
17743 * expression.cs (Binary.ResolveOperator): Catch the case where
17744 DoNumericPromotions returns true,
17746 (Binary.DoNumericPromotions): Simplify the code, and the tests.
17748 2002-09-27 Miguel de Icaza <miguel@ximian.com>
17750 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17753 2002-09-26 Miguel de Icaza <miguel@ximian.com>
17755 * ecore.cs (ConvertNumericExplicit): It is not enough that the
17756 conversion exists, but it is also required that the conversion be
17757 performed. This manifested in "(Type64Enum) 2".
17759 * class.cs (TypeManager.AddMethod): The fix is not to change
17760 AddEnum, because that one was using a fully qualified name (every
17761 DeclSpace derivative does), but to change the AddMethod routine
17762 that was using an un-namespaced name. This now correctly reports
17763 the duplicated name.
17765 Revert patch until I can properly fix it. The issue
17766 is that we have a shared Type space across all namespaces
17767 currently, which is wrong.
17769 Options include making the Namespace a DeclSpace, and merge
17770 current_namespace/current_container in the parser.
17772 2002-09-25 Miguel de Icaza <miguel@ximian.com>
17774 * cs-parser.jay: Improve error reporting when we get a different
17775 kind of expression in local_variable_type and
17776 local_variable_pointer_type.
17778 Propagate this to avoid missleading errors being reported.
17780 * ecore.cs (ImplicitReferenceConversion): treat
17781 TypeManager.value_type as a target just like object_type. As
17786 Is valid, and needs to result in the int 1 being boxed before it
17787 is assigned to the value type v.
17789 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17790 to validate the enumeration name.
17792 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17793 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
17794 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17796 * ecore.cs (TryImplicitIntConversion): When doing an
17797 implicit-enumeration-conversion, check if the type is 64-bits and
17798 perform a conversion before passing to EnumConstant.
17800 2002-09-23 Miguel de Icaza <miguel@ximian.com>
17802 * decl.cs (Error_AmbiguousTypeReference); New routine used to
17803 report ambiguous type references. Unlike the MS version, we
17804 report what the ambiguity is. Innovation at work ;-)
17806 (DeclSpace.FindType): Require a location argument to
17807 display when we display an ambiguous error.
17809 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17811 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17813 * expression.cs (EmitDynamicInitializers): Apply patch from
17814 hwang_rob@yahoo.ca that fixes the order in which we emit our
17817 2002-09-21 Martin Baulig <martin@gnome.org>
17819 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17820 delegate takes no arguments.
17822 2002-09-20 Miguel de Icaza <miguel@ximian.com>
17824 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17827 * expression.cs: Extract the underlying type.
17829 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17831 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17833 2002-09-19 Miguel de Icaza <miguel@ximian.com>
17835 * class.cs (TypeContainer.DefineType): We can not use the nice
17836 PackingSize with the size set to 1 DefineType method, because it
17837 will not allow us to define the interfaces that the struct
17840 This completes the fixing of bug 27287
17842 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17843 means also structs. This fixes part of the problem.
17844 (Expresion.ImplicitReferenceConversionExists): ditto.
17846 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17847 error if there were no errors reported during the type lookup
17848 process, to avoid duplicates or redundant errors. Without this
17849 you would get an ambiguous errors plus a type not found. We have
17850 beaten the user enough with the first error.
17852 (DeclSparce.FindType): Emit a warning if we have an ambiguous
17855 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17856 during the resolution process, stop the lookup, this avoids
17857 repeated error reports (same error twice).
17859 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17861 * typemanager.cs (LookupType): Redo the type lookup code to match
17862 the needs of System.Reflection.
17864 The issue is that System.Reflection requires references to nested
17865 types to begin with a "+" sign instead of a dot. So toplevel
17866 types look like: "NameSpace.TopLevelClass", and nested ones look
17867 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17870 2002-09-19 Martin Baulig <martin@gnome.org>
17872 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17873 says that a method always returns or always throws an exception,
17874 don't report the CS0161.
17876 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17877 set `Returns = new_returns'.
17879 2002-09-19 Martin Baulig <martin@gnome.org>
17881 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17882 to an enum constant, check for a CS0176.
17884 2002-09-18 Miguel de Icaza <miguel@ximian.com>
17886 * class.cs (TypeContainer.CheckPairedOperators): Now we check
17887 for operators that must be in pairs and report errors.
17889 * ecore.cs (SimpleName.DoResolveType): During the initial type
17890 resolution process, when we define types recursively, we must
17891 check first for types in our current scope before we perform
17892 lookups in the enclosing scopes.
17894 * expression.cs (MakeByteBlob): Handle Decimal blobs.
17896 (Invocation.VerifyArgumentsCompat): Call
17897 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17898 I thought we were supposed to always call this, but there are a
17899 few places in the code where we dont do it.
17901 2002-09-17 Miguel de Icaza <miguel@ximian.com>
17903 * driver.cs: Add support in -linkres and -resource to specify the
17904 name of the identifier.
17906 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17908 * ecore.cs (StandardConversionExists): Sync with the conversion
17909 code: allow anything-* to void* conversions.
17911 (FindMostSpecificSource): Use an Expression argument
17912 instead of a Type, because we might be handed over a Literal which
17913 gets a few more implicit conversions that plain types do not. So
17914 this information was being lost.
17916 Also, we drop the temporary type-holder expression when not
17919 2002-09-17 Martin Baulig <martin@gnome.org>
17921 * class.cs (PropertyBase.CheckBase): Don't check the base class if
17922 this is an explicit interface implementation.
17924 2002-09-17 Martin Baulig <martin@gnome.org>
17926 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17927 different `IndexerName' attributes.
17929 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17930 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17931 virtual CommonResolve().
17933 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17935 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17936 and convert that to the UnderlyingType.
17938 * statement.cs (Foreach.Resolve): Indexers are just like variables
17939 or PropertyAccesses.
17941 * cs-tokenizer.cs (consume_string): Track line numbers and columns
17942 inside quoted strings, we were not doing this before.
17944 2002-09-16 Martin Baulig <martin@gnome.org>
17946 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17947 resolve it. This is needed for the definite assignment check of the
17948 instance expression, fixes bug #29846.
17949 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17951 2002-09-16 Nick Drochak <ndrochak@gol.com>
17953 * parameter.cs: Fix compile error. Cannot reference static member
17954 from an instance object. Is this an mcs bug?
17956 2002-09-14 Martin Baulig <martin@gnome.org>
17958 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17959 multiple times. Fixes bug #30295, added test-166.cs.
17961 2002-09-14 Martin Baulig <martin@gnome.org>
17963 * statement.cs (Block.Emit): Don't emit unreachable code.
17964 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17965 `break' statements.
17966 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17968 2002-09-14 Martin Baulig <martin@gnome.org>
17970 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17973 2002-09-14 Martin Baulig <martin@gnome.org>
17975 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17976 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17977 be false on the ms runtime.
17979 2002-09-13 Martin Baulig <martin@gnome.org>
17981 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17982 the CS0038 error message.
17984 2002-09-12 Miguel de Icaza <miguel@ximian.com>
17986 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17987 constant inside, return it.
17989 2002-09-12 Martin Baulig <martin@gnome.org>
17991 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17992 implicit conversion can be done between enum types.
17994 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17995 check whether an implicit conversion to the current enum's UnderlyingType
17996 exists and report an error if not.
17998 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17999 without debugging support.
18001 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
18002 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
18004 2002-09-12 Martin Baulig <martin@gnome.org>
18006 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
18008 * ecore.cs (IMemberExpr.DeclaringType): New property.
18009 (SimpleName.SimpleNameResolve): Check whether we're accessing a
18010 nonstatic member of an outer type (CS0038).
18012 2002-09-11 Miguel de Icaza <miguel@ximian.com>
18014 * driver.cs: Activate the using-error detector at warning level
18015 4 (at least for MS-compatible APIs).
18017 * namespace.cs (VerifyUsing): Small buglett fix.
18019 * pending.cs (PendingImplementation): pass the container pointer.
18021 * interface.cs (GetMethods): Allow for recursive definition. Long
18022 term, I would like to move every type to support recursive
18023 definitions, not the current ordering mechanism that we have right
18026 The situation is this: Attributes are handled before interfaces,
18027 so we can apply attributes to interfaces. But some attributes
18028 implement interfaces, we will now handle the simple cases
18029 (recursive definitions will just get an error).
18031 * parameter.cs: Only invalidate types at the end if we fail to
18034 2002-09-09 Martin Baulig <martin@gnome.org>
18036 * ecore.cs (PropertyExpr.Emit): Also check for
18037 TypeManager.system_int_array_get_length so this'll also work when
18038 compiling corlib. Fixes #30003.
18040 2002-09-09 Martin Baulig <martin@gnome.org>
18042 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
18043 and throw an exception if we can't get the type's size. Fixed #30040,
18046 2002-09-09 Martin Baulig <martin@gnome.org>
18048 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
18050 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
18051 context. Fixes bug #30027.
18053 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
18054 virtual functions. Fixes bug #30043, added test-164.cs.
18056 2002-09-08 Ravi Pratap <ravi@ximian.com>
18058 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
18060 2002-09-08 Nick Drochak <ndrochak@gol.com>
18062 * driver.cs: Use an object to get the windows codepage since it's not a
18065 2002-09-08 Miguel de Icaza <miguel@ximian.com>
18067 * statement.cs (For.Emit): for infinite loops (test == null)
18068 return whether there is a break inside, not always "true".
18070 * namespace.cs (UsingEntry): New struct to hold the name of the
18071 using definition, the location where it is defined, and whether it
18072 has been used in a successful type lookup.
18074 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
18079 2002-09-06 Ravi Pratap <ravi@ximian.com>
18081 * attribute.cs : Fix incorrect code which relied on catching
18082 a NullReferenceException to detect a null being passed in
18083 where an object was expected.
18085 2002-09-06 Miguel de Icaza <miguel@ximian.com>
18087 * statement.cs (Try): flag the catch variable as assigned
18089 * expression.cs (Cast): Simplified by using ResolveType instead of
18090 manually resolving.
18092 * statement.cs (Catch): Fix bug by using ResolveType.
18094 2002-09-06 Ravi Pratap <ravi@ximian.com>
18096 * expression.cs (BetterConversion): Special case for when we have
18097 a NullLiteral as the argument and we have to choose between string
18098 and object types - we choose string the way csc does.
18100 * attribute.cs (Attribute.Resolve): Catch the
18101 NullReferenceException and report error #182 since the Mono
18102 runtime no more has the bug and having this exception raised means
18103 we tried to select a constructor which takes an object and is
18106 2002-09-05 Ravi Pratap <ravi@ximian.com>
18108 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
18109 message (1502, 1503) when we can't locate a method after overload
18110 resolution. This is much more informative and closes the bug
18113 * interface.cs (PopulateMethod): Return if there are no argument
18114 types. Fixes a NullReferenceException bug.
18116 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
18117 expressions too. Previously we were checking only in one place for
18118 positional arguments leaving out named arguments.
18120 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
18121 type to the enum type is not allowed. Remove code corresponding to
18124 (ConvertNumericExplicit): Allow explicit conversions from
18125 the underlying type to enum type. This precisely follows the spec
18126 and closes a bug filed by Gonzalo.
18128 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18131 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
18133 2002-09-03 Miguel de Icaza <miguel@ximian.com>
18135 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
18136 it was important that we stored the right value after the
18137 reduction in `converted'.
18139 2002-09-04 Martin Baulig <martin@gnome.org>
18141 * location.cs (Location.SymbolDocument): Use full pathnames for the
18144 2002-08-30 Miguel de Icaza <miguel@ximian.com>
18146 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
18147 of the expression resolve mechanism, because that will catch the
18148 SimpleName error failures.
18150 (Conditional): If we can not resolve the
18151 expression, return, do not crash.
18153 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18156 (location): display token name instead of its number.
18158 2002-08-28 Martin Baulig <martin@gnome.org>
18160 * expression.cs (Binary.ResolveOperator): Don't silently return
18161 but return an error if an operator cannot be applied between two
18164 2002-08-28 Martin Baulig <martin@gnome.org>
18166 * class.cs (Constructor.Define): Set the permission attributes
18167 correctly instead of making all constructors public.
18169 2002-08-28 Martin Baulig <martin@gnome.org>
18171 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
18172 for private members before reporting a CS0103; if we find anything,
18175 2002-08-28 Martin Baulig <martin@gnome.org>
18177 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
18178 to check whether `closure_start_type == closure_invocation_type',
18179 we also need to check whether `m.DeclaringType == closure_invocation_type'
18180 before bypassing the permission checks. We might be accessing
18181 protected/private members from the base class.
18182 (TypeManager.RealMemberLookup): Only set private_ok if private
18183 members were requested via BindingFlags.NonPublic.
18185 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
18187 * expression.cs (MemberAccess.ResolveMemberAccess): Set
18188 MethodGroupExpr.IsExplicitImpl if appropriate.
18189 (Invocation.DoResolve): Don't report the CS0120 for explicit
18190 interface implementations.
18192 2002-08-27 Martin Baulig <martin@gnome.org>
18194 * expression.cs (Invocation.DoResolve): If this is a static
18195 method and we don't have an InstanceExpression, we must report
18198 2002-08-25 Martin Baulig <martin@gnome.org>
18200 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
18201 `==' between a valuetype and an object.
18203 2002-08-25 Miguel de Icaza <miguel@ximian.com>
18205 * ecore.cs (TypeExpr): Provide a ToString method.
18207 2002-08-24 Martin Baulig <martin@gnome.org>
18209 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
18210 now called proggie.dbg and it's a binary file.
18212 2002-08-23 Martin Baulig <martin@gnome.org>
18214 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
18216 2002-08-23 Martin Baulig <martin@gnome.org>
18218 * struct.cs (MyStructInfo.ctor): Make this work with empty
18219 structs; it's not allowed to use foreach() on null.
18221 2002-08-23 Martin Baulig <martin@gnome.org>
18223 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
18224 writer the full pathname of the generated assembly.
18226 2002-08-23 Martin Baulig <martin@gnome.org>
18228 * statements.cs (FlowBranching.UsageVector.MergeChildren):
18229 A `finally' block never returns or breaks; improved handling of
18232 2002-08-23 Martin Baulig <martin@gnome.org>
18234 * statement.cs (Throw.Resolve): Allow `throw null'.
18236 2002-08-23 Martin Baulig <martin@gnome.org>
18238 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
18239 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
18240 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
18241 MemberLookup would return a wrong event if this is an explicit
18242 interface implementation and the class has an event with the same
18245 2002-08-23 Martin Baulig <martin@gnome.org>
18247 * statement.cs (Block.AddChildVariableNames): New public method.
18248 (Block.AddChildVariableName): Likewise.
18249 (Block.IsVariableNameUsedInChildBlock): Likewise.
18250 (Block.AddVariable): Check whether a variable name has already
18251 been used in a child block.
18253 * cs-parser.jay (declare_local_variables): Mark all variable names
18254 from the current block as being used in a child block in the
18257 2002-08-23 Martin Baulig <martin@gnome.org>
18259 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
18260 find the symbol writer.
18262 * driver.cs: csc also allows the arguments to /define being
18263 separated by commas, not only by semicolons.
18265 2002-08-23 Martin Baulig <martin@gnome.org>
18267 * interface.cs (Interface.GetMembers): Added static check for events.
18269 2002-08-15 Martin Baulig <martin@gnome.org>
18271 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
18272 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
18274 * ecore.cs (Expression.MemberLookup): Added documentation and explained
18275 why the MethodData.EmitDestructor() change was necessary.
18277 2002-08-20 Martin Baulig <martin@gnome.org>
18279 * class.cs (TypeContainer.FindMembers): Added static check for events.
18281 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
18283 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
18284 use Type.GetEvents(), not Type.FindMembers().
18286 2002-08-20 Martin Baulig <martin@gnome.org>
18288 * decl.cs (MemberCache): Added a special method cache which will
18289 be used for method-only searched. This ensures that a method
18290 search will return a MethodInfo with the correct ReflectedType for
18293 2002-08-20 Martin Baulig <martin@gnome.org>
18295 * decl.cs (DeclSpace.FindMembers): Made this public.
18297 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18299 * delegate.cs: fixed build on windows.
18300 [FIXME: Filed as bug #29150: MCS must report these errors.]
18302 2002-08-19 Ravi Pratap <ravi@ximian.com>
18304 * ecore.cs (StandardConversionExists): Return a false
18305 if we are trying to convert the void type to anything else
18306 since that is not allowed.
18308 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
18309 we flag error 70 in the event an event is trying to be accessed
18310 directly from outside the declaring type.
18312 2002-08-20 Martin Baulig <martin@gnome.org>
18314 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
18315 MemberCache from typemanager.cs to decl.cs.
18317 2002-08-19 Martin Baulig <martin@gnome.org>
18319 * class.cs (TypeContainer): Implement IMemberContainer.
18320 (TypeContainer.DefineMembers): Create the MemberCache.
18321 (TypeContainer.FindMembers): Do better BindingFlags checking; only
18322 return public members if BindingFlags.Public was given, check
18323 whether members are static.
18325 2002-08-16 Martin Baulig <martin@gnome.org>
18327 * decl.cs (DeclSpace.Define): Splitted this in Define and
18328 DefineMembers. DefineMembers is called first and initializes the
18331 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
18332 DefineMembers() on all our DeclSpaces.
18334 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
18335 but call DefineMembers() on all nested interfaces. We call their
18336 Define() in our new Define() function.
18338 * interface.cs (Interface): Implement IMemberContainer.
18339 (Interface.Define): Moved all code except the attribute stuf to
18341 (Interface.DefineMembers): Initialize the member cache.
18343 * typemanager.cs (IMemberFinder): Removed this interface, we don't
18344 need this anymore since we can use MemberCache.FindMembers directly.
18346 2002-08-19 Martin Baulig <martin@gnome.org>
18348 * typemanager.cs (MemberCache): When creating the cache for an
18349 interface type, add all inherited members.
18350 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
18351 to `out bool used_cache' and documented it.
18352 (TypeManager.MemberLookup): If we already used the cache in the first
18353 iteration, we don't need to do the interfaces check.
18355 2002-08-19 Martin Baulig <martin@gnome.org>
18357 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
18358 here from IMemberFinder and don't implement this interface anymore.
18359 (DeclSpace.MemberCache): Moved here from IMemberFinder.
18361 * typemanager.cs (IMemberFinder): This interface is now only used by
18362 classes which actually support the member cache.
18363 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
18364 since we only put DeclSpaces into this Hashtable.
18365 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
18366 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
18368 2002-08-16 Martin Baulig <martin@gnome.org>
18370 * typemanager.cs (ICachingMemberFinder): Removed.
18371 (IMemberFinder.MemberCache): New property.
18372 (TypeManager.FindMembers): Merged this with RealFindMembers().
18373 This function will never be called from TypeManager.MemberLookup()
18374 so we can't use the cache here, just the IMemberFinder.
18375 (TypeManager.MemberLookup_FindMembers): Check whether the
18376 IMemberFinder has a MemberCache and call the cache's FindMembers
18378 (MemberCache): Rewrote larger parts of this yet another time and
18379 cleaned it up a bit.
18381 2002-08-15 Miguel de Icaza <miguel@ximian.com>
18383 * driver.cs (LoadArgs): Support quoting.
18385 (Usage): Show the CSC-like command line arguments.
18387 Improved a few error messages.
18389 2002-08-15 Martin Baulig <martin@gnome.org>
18391 * typemanager.cs (IMemberContainer.Type): New property.
18392 (IMemberContainer.IsInterface): New property.
18394 The following changes are conditional to BROKEN_RUNTIME, which is
18395 defined at the top of the file.
18397 * typemanager.cs (MemberCache.MemberCache): Don't add the base
18398 class'es members, but add all members from TypeHandle.ObjectType
18399 if we're an interface.
18400 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18401 is the current type.
18402 (MemberCache.CacheEntry.Container): Removed this field.
18403 (TypeHandle.GetMembers): Include inherited members.
18405 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18407 * typemanager.cs: fixed compilation and added a comment on a field that
18410 2002-08-15 Martin Baulig <martin@gnome.org>
18412 * class.cs (ConstructorInitializer.Resolve): In the
18413 Expression.MemberLookup call, use the queried_type as
18416 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18417 declared' attribute, it's always true.
18418 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18419 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18420 temporary wrapper for FindMembers which tells MemberLookup whether
18421 members from the base classes are included in the return value.
18422 This will go away soon.
18423 (TypeManager.MemberLookup): Use this temporary hack here; once the
18424 new MemberCache is completed, we don't need to do the DeclaredOnly
18425 looping here anymore since the MemberCache will take care of this.
18426 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18427 (MemberCache): When creating the MemberCache for a class, get
18428 members from the current class and all its base classes.
18429 (MemberCache.CacheEntry.Container): New field. This is a
18430 temporary hack until the Mono runtime is fixed to distinguish
18431 between ReflectedType and DeclaringType. It allows us to use MCS
18432 with both the MS runtime and the unfixed Mono runtime without
18433 problems and without accecting performance.
18434 (MemberCache.SearchMembers): The DeclaredOnly looping from
18435 TypeManager.MemberLookup is now done here.
18437 2002-08-14 Martin Baulig <martin@gnome.org>
18439 * statement.cs (MyStructInfo.MyStructInfo): Don't call
18440 Type.GetFields on dynamic types but get the fields from the
18441 corresponding TypeContainer.
18442 (MyStructInfo.GetStructInfo): Added check for enum types.
18444 * typemanager.cs (MemberList.IsSynchronized): Implemented.
18445 (MemberList.SyncRoot): Implemented.
18446 (TypeManager.FilterWithClosure): No need to check permissions if
18447 closure_start_type == closure_invocation_type, don't crash if
18448 closure_invocation_type is null.
18450 2002-08-13 Martin Baulig <martin@gnome.org>
18452 Rewrote TypeContainer.FindMembers to use a member cache. This
18453 gives us a speed increase of about 35% for the self-hosting MCS
18454 build and of about 15-20% for the class libs (both on GNU/Linux).
18456 * report.cs (Timer): New class to get enhanced profiling. This
18457 whole class is "TIMER" conditional since it remarkably slows down
18460 * class.cs (MemberList): New class. This is an IList wrapper
18461 which we're now using instead of passing MemberInfo[]'s around to
18462 avoid copying this array unnecessarily.
18463 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18464 (ICachingMemberFinder, IMemberContainer): New interface.
18465 (TypeManager.FilterWithClosure): If `criteria' is null, the name
18466 has already been checked, otherwise use it for the name comparision.
18467 (TypeManager.FindMembers): Renamed to RealMemberFinder and
18468 provided wrapper which tries to use ICachingMemberFinder.FindMembers
18469 if possible. Returns a MemberList, not a MemberInfo [].
18470 (TypeHandle): New class, implements IMemberContainer. We create
18471 one instance of this class per type, it contains a MemberCache
18472 which is used to do the member lookups.
18473 (MemberCache): New class. Each instance of this class contains
18474 all members of a type and a name-based hash table.
18475 (MemberCache.FindMembers): This is our new member lookup
18476 function. First, it looks up all members of the requested name in
18477 the hash table. Then, it walks this list and sorts out all
18478 applicable members and returns them.
18480 2002-08-13 Martin Baulig <martin@gnome.org>
18482 In addition to a nice code cleanup, this gives us a performance
18483 increase of about 1.4% on GNU/Linux - not much, but it's already
18484 half a second for the self-hosting MCS compilation.
18486 * typemanager.cs (IMemberFinder): New interface. It is used by
18487 TypeManager.FindMembers to call FindMembers on a TypeContainer,
18488 Enum, Delegate or Interface.
18489 (TypeManager.finder_to_member_finder): New PtrHashtable.
18490 (TypeManager.finder_to_container): Removed.
18491 (TypeManager.finder_to_delegate): Removed.
18492 (TypeManager.finder_to_interface): Removed.
18493 (TypeManager.finder_to_enum): Removed.
18495 * interface.cs (Interface): Implement IMemberFinder.
18497 * delegate.cs (Delegate): Implement IMemberFinder.
18499 * enum.cs (Enum): Implement IMemberFinder.
18501 * class.cs (TypeContainer): Implement IMemberFinder.
18503 2002-08-12 Martin Baulig <martin@gnome.org>
18505 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18507 2002-08-12 Martin Baulig <martin@gnome.org>
18509 * ecore.cs (ITypeExpression): New interface for expressions which
18511 (TypeExpression): Renamed to TypeLookupExpression.
18512 (Expression.DoResolve): If we're doing a types-only lookup, the
18513 expression must implement the ITypeExpression interface and we
18514 call DoResolveType() on it.
18515 (SimpleName): Implement the new ITypeExpression interface.
18516 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18517 hack, the situation that we're only looking up types can't happen
18518 anymore when this method is called. Moved the type lookup code to
18519 DoResolveType() and call it.
18520 (SimpleName.DoResolveType): This ITypeExpression interface method
18521 is now doing the types-only lookup.
18522 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18523 (ResolveFlags): Added MaskExprClass.
18525 * expression.cs (MemberAccess): Implement the ITypeExpression
18527 (MemberAccess.DoResolve): Added support for a types-only lookup
18528 when we're called via ITypeExpression.DoResolveType().
18529 (ComposedCast): Implement the ITypeExpression interface.
18531 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
18532 Expression.Resolve() with ResolveFlags.Type instead.
18534 2002-08-12 Martin Baulig <martin@gnome.org>
18536 * interface.cs (Interface.Define): Apply attributes.
18538 * attribute.cs (Attribute.ApplyAttributes): Added support for
18539 interface attributes.
18541 2002-08-11 Martin Baulig <martin@gnome.org>
18543 * statement.cs (Block.Emit): Only check the "this" variable if we
18544 do not always throw an exception.
18546 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18547 whether the property has a set accessor.
18549 2002-08-11 Martin Baulig <martin@gnome.org>
18551 Added control flow analysis support for structs.
18553 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18554 with control flow analysis turned off.
18555 (IVariable): New interface.
18556 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18557 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18558 (FieldExpr.DoResolve): Resolve the instance expression with flow
18559 analysis turned off and do the definite assignment check after the
18560 resolving when we know what the expression will resolve to.
18562 * expression.cs (LocalVariableReference, ParameterReference):
18563 Implement the new IVariable interface, only call the flow analysis
18564 code if ec.DoFlowAnalysis is true.
18565 (This): Added constructor which takes a Block argument. Implement
18566 the new IVariable interface.
18567 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18568 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18569 This does the definite assignment checks for struct members.
18571 * class.cs (Constructor.Emit): If this is a non-static `struct'
18572 constructor which doesn't have any initializer, call
18573 Block.AddThisVariable() to tell the flow analysis code that all
18574 struct elements must be initialized before control returns from
18577 * statement.cs (MyStructInfo): New public class.
18578 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18579 argument to this indexer. If non-zero, check an individual struct
18580 member, not the whole struct.
18581 (FlowBranching.CheckOutParameters): Check struct members.
18582 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18583 overloaded versions of these methods which take an additional
18584 `int field_idx' argument to check struct members.
18585 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18586 overloaded versions of these methods which take an additional
18587 `string field_name' argument to check struct member.s
18588 (VariableInfo): Implement the IVariable interface.
18589 (VariableInfo.StructInfo): New public property. Returns the
18590 MyStructInfo instance of the variable if it's a struct or null.
18591 (Block.AddThisVariable): New public method. This is called from
18592 Constructor.Emit() for non-static `struct' constructor which do
18593 not have any initializer. It creates a special variable for the
18594 "this" instance variable which will be checked by the flow
18595 analysis code to ensure that all of the struct's fields are
18596 initialized before control returns from the constructor.
18597 (UsageVector): Added support for struct members. If a
18598 variable/parameter is a struct with N members, we reserve a slot
18599 in the usage vector for each member. A struct is considered fully
18600 initialized if either the struct itself (slot 0) or all its
18601 members are initialized.
18603 2002-08-08 Martin Baulig <martin@gnome.org>
18605 * driver.cs (Driver.MainDriver): Only report an error CS5001
18606 if there were no compilation errors.
18608 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18609 `UnsafeContext' property to determine whether the parent is in
18610 unsafe context rather than checking the parent's ModFlags:
18611 classes nested in an unsafe class are unsafe as well.
18613 2002-08-08 Martin Baulig <martin@gnome.org>
18615 * statement.cs (UsageVector.MergeChildren): Distinguish between
18616 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18617 we return. Added test17() and test18() to test-154.cs.
18619 2002-08-08 Martin Baulig <martin@gnome.org>
18621 * typemanager.cs (TypeManager.FilterWithClosure): If we have
18622 Family access, make sure the invoking type isn't a subclass of the
18623 queried type (that'd be a CS1540).
18625 * ecore.cs (Expression.MemberLookup): Added overloaded version of
18626 this method which takes an additional `Type invocation_type'.
18628 * expression.cs (BaseAccess.DoResolve): Use the base type as
18629 invocation and query type.
18630 (MemberAccess.DoResolve): If the lookup failed and we're about to
18631 report a CS0122, try a lookup with the ec.ContainerType - if this
18632 succeeds, we must report a CS1540.
18634 2002-08-08 Martin Baulig <martin@gnome.org>
18636 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18637 (MethodGroupExpr): Implement the IMemberExpr interface.
18639 * expression (MemberAccess.ResolveMemberAccess): No need to have
18640 any special code for MethodGroupExprs anymore, they're now
18643 2002-08-08 Martin Baulig <martin@gnome.org>
18645 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18646 Family, FamANDAssem and FamORAssem permissions.
18647 (TypeManager.IsSubclassOrNestedChildOf): New public method.
18649 2002-08-08 Martin Baulig <martin@gnome.org>
18651 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18652 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18655 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18657 * driver.cs: implemented /resource option to embed managed resources.
18659 2002-08-07 Martin Baulig <martin@gnome.org>
18661 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18662 (FieldBase.HasFieldInitializer): New public property.
18663 (FieldBase.GetInitializerExpression): New public method. Resolves and
18664 returns the field initializer and makes sure it is only resolved once.
18665 (TypeContainer.EmitFieldInitializers): Call
18666 FieldBase.GetInitializerExpression to get the initializer, this ensures
18667 that it isn't resolved multiple times.
18669 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
18670 the resolving process (SimpleName/MemberLookup) that we're currently
18671 emitting a field initializer (which must not access any instance members,
18672 this is an error CS0236).
18674 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18675 argument, if the `IsFieldInitializer' flag is set, we must report and
18676 error CS0236 and not an error CS0120.
18678 2002-08-07 Martin Baulig <martin@gnome.org>
18680 * ecore.cs (IMemberExpr): New public interface.
18681 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18682 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18683 if the expression is an IMemberExpr.
18685 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18686 to be null, implicitly default to `this' if we're non-static in
18687 this case. Simplified the code a lot by using the new IMemberExpr
18688 interface. Also fixed bug #28176 here.
18690 2002-08-06 Martin Baulig <martin@gnome.org>
18692 * cs-parser.jay (SimpleLookup): Removed. We need to create
18693 ParameterReferences during semantic analysis so that we can do a
18694 type-only search when resolving Cast, TypeOf and SizeOf.
18695 (block): Pass the `current_local_parameters' to the Block's
18698 * class.cs (ConstructorInitializer): Added `Parameters parameters'
18699 argument to the constructor.
18700 (ConstructorInitializer.Resolve): Create a temporary implicit
18701 block with the parameters.
18703 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18704 references here if we aren't doing a type-only search.
18706 * statement.cs (Block): Added constructor which takes a
18707 `Parameters parameters' argument.
18708 (Block.Parameters): New public property.
18710 * support.cs (InternalParameters.Parameters): Renamed `parameters'
18711 to `Parameters' and made it public readonly.
18713 2002-08-06 Martin Baulig <martin@gnome.org>
18715 * ecore.cs (Expression.Warning): Made this public as well.
18717 * report.cs (Report.Debug): Print the contents of collections.
18719 2002-08-06 Martin Baulig <martin@gnome.org>
18721 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
18722 used to tell Resolve() which kinds of expressions it may return.
18723 (Expression.Resolve): Added overloaded version of this method which
18724 takes a `ResolveFlags flags' argument. This can be used to tell
18725 Resolve() which kinds of expressions it may return. Reports a
18727 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18728 ResolveFlags.SimpleName.
18729 (Expression.Error118): Added overloaded version of this method which
18730 takes a `ResolveFlags flags' argument. It uses the flags to determine
18731 which kinds of expressions are allowed.
18733 * expression.cs (Argument.ResolveMethodGroup): New public method.
18734 Resolves an argument, but allows a MethodGroup to be returned.
18735 This is used when invoking a delegate.
18737 * TODO: Updated a bit.
18739 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18741 Fixed compilation with csc.
18743 * ecore.cs: Expression.Error made public. Is this correct? Should
18744 Warning be made public too?
18746 * expression.cs: use ea.Location instead of ea.loc.
18747 [FIXME: Filed as bug #28607: MCS must report these errors.]
18749 2002-08-06 Martin Baulig <martin@gnome.org>
18751 * ecore.cs (Expression.loc): Moved the location here instead of
18752 duplicating it in all derived classes.
18753 (Expression.Location): New public property.
18754 (Expression.Error, Expression.Warning): Made them non-static and
18755 removed the location argument.
18756 (Expression.Warning): Added overloaded version which takes an
18757 `int level' argument.
18758 (Expression.Error118): Make this non-static and removed the
18759 expression and location arguments.
18760 (TypeExpr): Added location argument to the constructor.
18762 * expression.cs (StaticCallExpr): Added location argument to
18764 (Indirection, PointerArithmetic): Likewise.
18765 (CheckedExpr, UnCheckedExpr): Likewise.
18766 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18767 (StringPtr): Likewise.
18770 2002-08-05 Martin Baulig <martin@gnome.org>
18772 * expression.cs (BaseAccess.DoResolve): Actually report errors.
18774 * assign.cs (Assign.DoResolve): Check whether the source
18775 expression is a value or variable.
18777 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18778 while resolving the corresponding blocks.
18780 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18781 an error, don't silently return null.
18783 * statement.cs (Block.AddVariable): Do the error reporting here
18784 and distinguish between CS0128 and CS0136.
18785 (Block.DoResolve): Report all unused labels (warning CS0164).
18786 (LabeledStatement): Pass the location to the constructor.
18787 (LabeledStatement.HasBeenReferenced): New property.
18788 (LabeledStatement.Resolve): Set it to true here.
18790 * statement.cs (Return.Emit): Return success even after reporting
18791 a type mismatch error (CS0126 or CS0127), this is what csc does and
18792 it avoids confusing the users with any consecutive errors.
18794 2002-08-05 Martin Baulig <martin@gnome.org>
18796 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18798 * const.cs (Const.LookupConstantValue): Catch circular definitions.
18800 * expression.cs (MemberAccess.DoResolve): Silently return if an
18801 error has already been reported.
18803 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18804 error has already been reported.
18806 2002-08-05 Martin Baulig <martin@gnome.org>
18808 * statement.cs (UsageVector): Only initialize the `parameters'
18809 vector if we actually have any "out" parameters.
18811 2002-08-05 Martin Baulig <martin@gnome.org>
18813 * expression.cs (Binary.ResolveOperator): When combining delegates,
18814 they must have the same type.
18816 2002-08-05 Martin Baulig <martin@gnome.org>
18818 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18819 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18820 work with the ms runtime and we also don't need it: if we're a
18821 PropertyBuilder and not in the `indexer_arguments' hash, then we
18822 are a property and not an indexer.
18824 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18825 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18826 since the latter one doesn't work with the ms runtime.
18828 2002-08-03 Martin Baulig <martin@gnome.org>
18830 Fixed bugs #27998 and #22735.
18832 * class.cs (Method.IsOperator): New public field.
18833 (Method.CheckBase): Report CS0111 if there's already a method
18834 with the same parameters in the current class. Report CS0508 when
18835 attempting to change the return type of an inherited method.
18836 (MethodData.Emit): Report CS0179 if a method doesn't have a body
18837 and it's not marked abstract or extern.
18838 (PropertyBase): New abstract base class for Property and Indexer.
18839 (PropertyBase.CheckBase): Moved here from Property and made it work
18841 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18842 the same so we can reuse it there.
18843 (Property, Indexer): Derive from PropertyBase.
18844 (MethodSignature.inheritable_property_signature_filter): New delegate
18845 to find properties and indexers.
18847 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18848 argument and improved error reporting.
18850 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18851 EmptyReadOnlyParameters and made it a property.
18853 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18854 version of this method which takes a `PropertyInfo indexer'.
18855 (TypeManager.RegisterIndexer): New method.
18857 * class.cs: Added myself as author of this file :-)
18859 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18861 * class.cs: fixed compilation on windoze.
18863 2002-08-03 Martin Baulig <martin@gnome.org>
18865 * interface.cs (Interface.GetInterfaceBases): Check whether all
18866 base interfaces are at least as accessible than the current one.
18868 * class.cs (TypeContainer.GetClassBases): Check whether base types
18869 are at least as accessible than the current type.
18870 (TypeContainer.AsAccessible): Implemented and made non-static.
18871 (MemberBase.CheckParameters): Report errors if the accessibility
18874 * delegate.cs (Delegate.Delegate): The default visibility is
18875 internal for top-level types and private for nested types.
18876 (Delegate.Define): Report errors if the accessibility checks fail.
18878 * enum.cs (Enum.Enum): The default visibility is internal for
18879 top-level types and private for nested types.
18880 (Enum.DefineType): Compute the correct visibility.
18882 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18883 function which takes a `bool is_toplevel' instead of a TypeContainer.
18885 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18888 2002-08-02 Martin Baulig <martin@gnome.org>
18890 * expression.cs (LocalVariableReferenc): Added constructor which
18891 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18892 (LocalVariableReference.IsReadOnly): New property.
18893 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18894 variable is readonly, use our own readonly flag to do this; you can
18895 use the new constructor to get a writable reference to a read-only
18898 * cs-parser.jay (foreach_statement, using_statement): Get a writable
18899 reference to the local variable.
18901 2002-08-01 Miguel de Icaza <miguel@ximian.com>
18903 * rootcontext.cs (ResolveCore): Also include System.Exception
18905 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18906 we reach an EmptyStatement.
18908 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18911 * expression.cs (Binary.ResolveOperator): Check error result in
18914 use brtrue/brfalse directly and avoid compares to null.
18916 2002-08-02 Martin Baulig <martin@gnome.org>
18918 * class.cs (TypeContainer.Define): Define all nested interfaces here.
18919 Fixes bug #28407, added test-155.cs.
18921 2002-08-01 Martin Baulig <martin@gnome.org>
18923 * class.cs (Event.EmitDefaultMethod): Make this work with static
18924 events. Fixes #28311, added verify-3.cs.
18926 2002-08-01 Martin Baulig <martin@gnome.org>
18928 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18929 `is_disposable' fields.
18930 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18931 `hm.is_disposable' if we're using the collection pattern.
18932 (Foreach.EmitCollectionForeach): Use the correct type for the
18933 enumerator's local variable, only emit the try/finally block if
18934 necessary (fixes #27713).
18936 2002-08-01 Martin Baulig <martin@gnome.org>
18938 * ecore.cs (Expression.report118): Renamed to Error118 and made
18941 * statement.cs (Throw.Resolve): Check whether the expression is of
18942 the correct type (CS0118) and whether the type derives from
18943 System.Exception (CS0155).
18944 (Catch.Resolve): New method. Do the type lookup here and check
18945 whether it derives from System.Exception (CS0155).
18946 (Catch.CatchType, Catch.IsGeneral): New public properties.
18948 * typemanager.cs (TypeManager.exception_type): Added.
18950 2002-07-31 Miguel de Icaza <miguel@ximian.com>
18952 * driver.cs: Updated About function.
18954 2002-07-31 Martin Baulig <martin@gnome.org>
18956 Implemented Control Flow Analysis.
18958 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18959 (EmitContext.CurrentBranching): Added.
18960 (EmitContext.StartFlowBranching): Added.
18961 (EmitContext.EndFlowBranching): Added.
18962 (EmitContext.KillFlowBranching): Added.
18963 (EmitContext.IsVariableAssigned): Added.
18964 (EmitContext.SetVariableAssigned): Added.
18965 (EmitContext.IsParameterAssigned): Added.
18966 (EmitContext.SetParameterAssigned): Added.
18967 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18968 Added control flow analysis stuff here.
18970 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18971 resolve the expression as lvalue.
18972 (LocalVariableReference.DoResolve): Check whether the variable has
18973 already been assigned.
18974 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18975 the parameter as assigned here.
18976 (ParameterReference.DoResolve): Check whether the parameter has already
18978 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18979 expression as lvalue.
18981 * statement.cs (FlowBranching): New class for the flow analysis code.
18982 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18983 (LabeledStatement.IsDefined): New public property.
18984 (LabeledStatement.AddUsageVector): New public method to tell flow
18985 analyis that the label may be reached via a forward jump.
18986 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18988 (VariableInfo.Number): New public field. This is used by flow analysis
18989 to number all locals of a block.
18990 (Block.CountVariables): New public property. This is the number of
18991 local variables in this block (including the locals from all parent
18993 (Block.EmitMeta): Number all the variables.
18995 * statement.cs: Added flow analysis support to all classes.
18997 2002-07-31 Martin Baulig <martin@gnome.org>
18999 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
19000 To get debugging messages, compile mcs with /define:MCS_DEBUG and
19001 then use this argument.
19003 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
19005 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
19006 use this to specify /define options.
19008 2002-07-29 Martin Baulig <martin@gnome.org>
19010 * statement.cs (Fixed): Moved all code that does variable lookups
19011 and resolvings from Emit to Resolve.
19013 * statement.cs (For): Moved all code that does variable lookups
19014 and resolvings from Emit to Resolve.
19016 * statement.cs (Using): Moved all code that does variable lookups
19017 and resolvings from Emit to Resolve.
19019 2002-07-29 Martin Baulig <martin@gnome.org>
19021 * attribute.cs (Attribute.Resolve): Explicitly catch a
19022 System.NullReferenceException when creating the
19023 CustromAttributeBuilder and report a different warning message.
19025 2002-07-29 Martin Baulig <martin@gnome.org>
19027 * support.cs (ParameterData.ParameterName): Added method to
19028 get the name of a parameter.
19030 * typemanager.cs (TypeManager.IsValueType): New public method.
19032 2002-07-29 Martin Baulig <martin@gnome.org>
19034 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
19035 is a flag which specifies that it's either ref or out.
19036 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
19037 the out parameter to `out Parameter.Modifier mod', also set the
19038 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
19040 * support.cs (InternalParameters.ParameterModifier): Distinguish
19041 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
19042 Parameter.Modifier.ISBYREF flag if it's either ref or out.
19044 * expression.cs (Argument.GetParameterModifier): Distinguish
19045 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
19046 Parameter.Modifier.ISBYREF flag if it's either ref or out.
19048 2002-07-29 Martin Baulig <martin@gnome.org>
19050 * expression.cs (ParameterReference.ParameterReference): Added
19051 `Location loc' argument to the constructor.
19053 * cs-parser.jay: Pass location to ParameterReference.
19055 2002-07-28 Miguel de Icaza <miguel@ximian.com>
19057 * statement.cs (Try): Initialize the location.
19059 * cs-parser.jay: pass location to Try.
19061 * expression.cs (Unary.Reduce): Change the prototype to return
19062 whether a constant fold could be performed or not. The result is
19063 returned in an out parameters. In the case of Indirection and
19064 AddressOf, we want to perform the full tests.
19066 2002-07-26 Miguel de Icaza <miguel@ximian.com>
19068 * statement.cs (Statement.Emit): Flag dead code.
19070 2002-07-27 Andrew Birkett <andy@nobugs.org>
19072 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
19074 2002-07-27 Martin Baulig <martin@gnome.org>
19076 * class.cs (MethodData.Define): Put back call to
19077 TypeManager.AddMethod(), accidentally commented this out.
19079 * report.cs (Debug): New public method to print debugging information,
19080 this is `[Conditional ("DEBUG")]'.
19082 2002-07-26 Martin Baulig <martin@gnome.org>
19084 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
19085 (switch_statement): Push the current_block to the switch_stack and
19086 pop it again when we're done with the switch.
19087 (switch_section): The new block is a child of the current_block.
19088 Fixes bug #24007, added test-152.cs.
19090 2002-07-27 Martin Baulig <martin@gnome.org>
19092 * expression.cs (Invocation.EmitArguments): When calling a varargs
19093 function with only its fixed arguments, we need to pass an empty
19096 2002-07-27 Martin Baulig <martin@gnome.org>
19098 Mono 0.13 has been released.
19100 2002-07-25 Miguel de Icaza <miguel@ximian.com>
19102 * driver.cs: Rename --resource to --linkres, because that is what
19103 we do currently, we dont support --resource yet.
19105 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
19107 2002-07-25 Martin Baulig <martin@gnome.org>
19109 * class.cs (MethodData): New public class. This is a `method builder'
19110 class for a method or one accessor of a Property/Indexer/Event.
19111 (MethodData.GetMethodFlags): Moved here from MemberBase.
19112 (MethodData.ApplyAttributes): Likewise.
19113 (MethodData.ApplyObsoleteAttribute): Likewise.
19114 (MethodData.ApplyConditionalAttribute): Likewise.
19115 (MethodData.ApplyDllImportAttribute): Likewise.
19116 (MethodData.CheckAbstractAndExternal): Likewise.
19117 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
19118 (MethodData.Emit): Formerly known as Method.Emit().
19119 (MemberBase): Moved everything which was specific to a single
19120 accessor/method to MethodData.
19121 (Method): Create a new MethodData and call Define() and Emit() on it.
19122 (Property, Indexer, Event): Create a new MethodData objects for each
19123 accessor and call Define() and Emit() on them.
19125 2002-07-25 Martin Baulig <martin@gnome.org>
19127 Made MethodCore derive from MemberBase to reuse the code from there.
19128 MemberBase now also checks for attributes.
19130 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
19131 (MemberBase.GetMethodFlags): Moved here from class Method and marked
19133 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
19134 `CallingConventions cc' and `Attributes opt_attrs' arguments.
19135 (MemberBase.ApplyAttributes): New virtual method; applies the
19136 attributes to a method or accessor.
19137 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
19138 (MemberBase.ApplyConditionalAttribute): Likewise.
19139 (MemberBase.ApplyDllImportAttribute): Likewise.
19140 (MemberBase.CheckAbstractAndExternal): Likewise.
19141 (MethodCore.ParameterTypes): This is now a property instead of a
19142 method, it's initialized from DoDefineParameters().
19143 (MethodCore.ParameterInfo): Removed the set accessor.
19144 (MethodCore.DoDefineParameters): New protected virtual method to
19145 initialize ParameterTypes and ParameterInfo.
19146 (Method.GetReturnType): We can now simply return the MemberType.
19147 (Method.GetMethodFlags): Override the MemberBase version and add
19148 the conditional flags.
19149 (Method.CheckBase): Moved some code from Define() here, call
19150 DoDefineParameters() here.
19151 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
19152 here to avoid some larger code duplication.
19153 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
19154 ensure that abstract and external accessors don't declare a body.
19156 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
19157 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
19158 lookup in the attribute's parent classes, so we need to abort as soon
19159 as we found the first match.
19160 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
19161 the attribute has no arguments.
19163 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
19166 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19168 * cs-parser.jay: reverted previous patch.
19170 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19172 * cs-parser.jay: fixed bug #22119.
19174 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19176 * attribute.cs: fixed compilation. The error was:
19177 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
19178 be assigned to before control leaves the current method."
19179 [FIXME: Filed as bug #28186: MCS must report this error.]
19181 2002-07-25 Martin Baulig <martin@gnome.org>
19183 * attribute.cs (Attribute.Conditional_GetConditionName): New static
19184 method to pull the condition name ouf of a Conditional attribute.
19185 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
19186 the obsolete message and error flag out of an Obsolete attribute.
19188 * class.cs (Method.GetMethodFlags): New public method to get the
19189 TypeManager.MethodFlags for this method.
19190 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
19192 (Method.Define): Get and apply the Obsolete and Conditional attributes;
19193 if we're overriding a virtual function, set the new private variable
19194 `parent_method'; call the new TypeManager.AddMethod().
19196 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
19197 the MethodBuilder and the Method in a PtrHashtable.
19198 (TypeManager.builder_to_method): Added for this purpose.
19199 (TypeManager.MethodFlags): Added IsObsoleteError.
19200 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
19201 Obsolete and Conditional arguments in MethodBuilders. If we discover
19202 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
19203 the message from the attribute.
19205 2002-07-24 Martin Baulig <martin@gnome.org>
19207 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
19208 preprocessor directives, ensure that the argument to #define/#undef is
19209 exactly one identifier and that it's actually an identifier.
19211 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
19214 2002-07-24 Martin Baulig <martin@gnome.org>
19216 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
19217 initialize it to TypeManager.object_type in the constructor.
19218 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
19219 of the `hm.get_current' method if we're using the collection pattern.
19220 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
19221 for the explicit conversion to make it work when we're using the collection
19222 pattern and the `Current' property has a different return type than `object'.
19225 2002-07-24 Martin Baulig <martin@gnome.org>
19227 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
19228 does not match, but don't report any errors. This method is called in
19229 order for all methods in a MethodGroupExpr until a matching method is
19230 found, so we don't want to bail out if the first method doesn't match.
19231 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
19232 matches, report the 123. Fixes #28070.
19234 2002-07-24 Martin Baulig <martin@gnome.org>
19236 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
19237 TypeManager.TypeToCoreType() to the top of the method so the
19238 following equality checks will work. Fixes #28107.
19240 2002-07-24 Martin Baulig <martin@gnome.org>
19242 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
19243 operand is of type uint, and the other operand is of type sbyte,
19244 short or int, the operands are converted to type long." -
19245 Actually do what this comment already told us. Fixes bug #28106,
19248 2002-07-24 Martin Baulig <martin@gnome.org>
19250 * class.cs (MethodBase): New abstract class. This is now a base
19251 class for Property, Indexer and Event to avoid some code duplication
19252 in their Define() and DefineMethods() methods.
19253 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
19254 generic methods for Define() and DefineMethods().
19255 (FieldBase): Derive from MemberBase, not MemberCore.
19256 (Property): Derive from MemberBase, not MemberCore.
19257 (Property.DefineMethod): Moved all the code from this method to the
19258 new MethodBase.DefineAccessor(), just call it with appropriate
19260 (Property.Define): Call the new Property.DoDefine(), this does some
19261 sanity checks and we don't need to duplicate the code everywhere.
19262 (Event): Derive from MemberBase, not MemberCore.
19263 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
19264 accessors, this will also make them work with interface events.
19265 (Indexer): Derive from MemberBase, not MemberCore.
19266 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
19267 (Indexer.Define): Use the new MethodBase functions.
19269 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
19270 argument to the constructor.
19271 (Interface.FindMembers): Added support for interface events.
19272 (Interface.PopluateEvent): Implemented.
19274 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
19276 2002-07-22 Miguel de Icaza <miguel@ximian.com>
19278 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
19279 but this is required to check for a method name being the same as
19280 the containing class.
19284 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19286 * interface.cs: initialize variable.
19288 2002-07-23 Martin Baulig <martin@gnome.org>
19290 Implemented the IndexerName attribute in interfaces.
19292 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
19293 name if this is an explicit interface implementation.
19294 (Indexer.InterfaceIndexerName): New public variable. If we're
19295 implementing an interface indexer, this is the IndexerName in that
19296 interface. Otherwise, it's the IndexerName.
19297 (Indexer.DefineMethod): If we're implementing interface indexer,
19298 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
19299 and Pending.ImplementIndexer methods.
19300 (Indexer.Define): Also define the PropertyBuilder if we're
19301 implementing an interface indexer and this is neither an explicit
19302 interface implementation nor do the IndexerName match the one in
19305 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
19306 If a method is defined here, then we always need to create a proxy
19307 for it. This is used when implementing interface indexers.
19308 (Pending.IsInterfaceIndexer): New public method.
19309 (Pending.ImplementIndexer): New public method.
19310 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
19311 This is used when implementing interface indexers to define a proxy
19313 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
19314 define a proxy if necessary.
19316 * interface.cs (Interface.IndexerName): New public variable.
19317 (Interface.PopulateIndexer): Set the IndexerName.
19318 (Interface.DefineIndexers): New private method. Populate all the
19319 indexers and make sure their IndexerNames match.
19321 * typemanager.cs (IndexerPropertyName): Added support for interface
19324 2002-07-22 Martin Baulig <martin@gnome.org>
19326 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
19327 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
19328 ret if HasReturnLabel.
19329 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
19332 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
19333 and set the ec.LoopBeginTryCatchLevel.
19334 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
19335 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
19336 the current ec.TryCatchLevel, the branch goes out of an exception
19337 block. In this case, we need to use Leave and not Br.
19339 2002-07-22 Martin Baulig <martin@gnome.org>
19341 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
19342 block unless the block does not always return or it is contained in
19343 another try { ... } catch { ... } block. Fixes bug #26506.
19344 Added verify-1.cs to the test suite.
19346 2002-07-22 Martin Baulig <martin@gnome.org>
19348 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
19349 then we do not always return. Fixes bug #24985.
19351 2002-07-22 Martin Baulig <martin@gnome.org>
19353 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
19354 lookup on a per-class level; ie. walk up the class hierarchy until we
19355 found at least one applicable method, then choose the best among them.
19356 Fixes bug #24463 and test-29.cs.
19358 2002-07-22 Martin Baulig <martin@gnome.org>
19360 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
19361 return types of the methods. The return type is not part of the
19362 signature and we must not check it to make the `new' modifier work.
19363 Fixes bug #27999, also added test-147.cs.
19364 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
19366 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
19367 on the method's return type.
19369 2002-07-21 Martin Baulig <martin@gnome.org>
19371 * assign.cs: Make this work if the rightmost source is a constant and
19372 we need to do an implicit type conversion. Also adding a few more tests
19373 to test-38.cs which should have caught this.
19375 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
19376 target in the makefile for this. The makefile.gnu is primarily intended
19377 for end-users who don't want to debug the compiler.
19379 2002-07-21 Martin Baulig <martin@gnome.org>
19381 * assign.cs: Improved the Assign class so it can now handle embedded
19382 assignments (X = Y = Z = something). As a side-effect this'll now also
19383 consume less local variables. test-38.cs now passes with MCS, added
19384 a few new test cases to that test.
19386 2002-07-20 Martin Baulig <martin@gnome.org>
19388 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
19389 instructions. Fixes bug #27977, also added test-146.cs.
19391 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19393 * cs-tokenizer.cs: fixed getHex ().
19395 2002-07-19 Martin Baulig <martin@gnome.org>
19397 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19398 not Type.GetType() to lookup the array type. This is needed when
19399 we're constructing an array of a user-defined type.
19400 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19401 single-dimensional arrays, but also for single-dimensial arrays of
19404 2002-07-19 Martin Baulig <martin@gnome.org>
19406 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19407 this function is called, it's not allowed to share LocalBuilders
19408 among ILGenerators.
19410 2002-07-19 Martin Baulig <martin@gnome.org>
19412 * expression.cs (Argument.Resolve): Report an error 118 when trying
19413 to pass a type as argument.
19415 2002-07-18 Martin Baulig <martin@gnome.org>
19417 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19418 Conv_R_Un for the signed `long' type.
19420 2002-07-15 Miguel de Icaza <miguel@ximian.com>
19422 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19423 `expr' for the temporary result, as that will fail if we do
19424 multiple resolves on the same expression.
19426 2002-07-05 Miguel de Icaza <miguel@ximian.com>
19428 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19429 ec.TypeContainer for looking up aliases.
19431 * class.cs (TypeContainer): Remove LookupAlias from here.
19433 * decl.cs (DeclSpace); Move here.
19435 2002-07-01 Miguel de Icaza <miguel@ximian.com>
19437 * class.cs (FindMembers): Only call filter if the constructor
19438 bulider is not null.
19440 Also handle delegates in `NestedTypes' now. Now we will perform
19441 type lookups using the standard resolution process. This also
19444 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19445 This uses Expressions (the limited kind that can be parsed by the
19446 tree) instead of strings.
19448 * expression.cs (ComposedCast.ToString): Implement, used to flag
19449 errors since now we have to render expressions.
19451 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
19454 * ecore.cs (SimpleName.ToString): ditto.
19456 * cs-parser.jay: Instead of using strings to assemble types, use
19457 Expressions to assemble the type (using SimpleName, ComposedCast,
19458 MemberAccess). This should fix the type lookups in declarations,
19459 because we were using a different code path for this.
19461 * statement.cs (Block.Resolve): Continue processing statements
19462 even when there is an error.
19464 2002-07-17 Miguel de Icaza <miguel@ximian.com>
19466 * class.cs (Event.Define): Also remove the `remove' method from
19467 the list of pending items.
19469 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19470 generate more compact code.
19472 2002-07-17 Martin Baulig <martin@gnome.org>
19474 * const.cs (Const.LookupConstantValue): Add support for constant
19475 `unchecked' and `checked' expressions.
19476 Also adding test case test-140.cs for this.
19478 2002-07-17 Martin Baulig <martin@gnome.org>
19480 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19481 check whether mi.ReturnType implements the IEnumerator interface; the
19482 `==' and the IsAssignableFrom() will fail in this situation.
19484 2002-07-16 Ravi Pratap <ravi@ximian.com>
19486 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
19489 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19491 * expression.cs: fixed bug #27811.
19493 2002-07-14 Miguel de Icaza <miguel@ximian.com>
19495 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19496 Molaro: when we are a ref, the value already contains a pointer
19497 value, do not take the address of it.
19499 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19500 * removed mb-parser.jay and mb-tokenizer.cs
19502 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19504 * expression.cs: check against the building corlib void type.
19506 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19508 * ecore.cs: fix for valuetype static readonly fields: when
19509 initializing them, we need their address, not the address of a copy.
19511 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19513 * typemanager.cs: register also enum_type in corlib.
19515 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19517 * class.cs: allow calling this (but not base) initializers in structs.
19519 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19521 * ecore.cs: make sure we compare against the building base types
19524 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19526 * typemanager.cs: fix TypeToCoreType() to handle void and object
19527 (corlib gets no more typerefs after this change).
19529 2002-07-12 Miguel de Icaza <miguel@ximian.com>
19531 * expression.cs (ArrayCreation.EmitArrayArguments): use
19532 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19534 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19535 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
19536 array indexes, the runtime actually forbids them.
19538 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19539 for array arguments here.
19541 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19542 instead of the default for ValueTypes.
19544 (New.DoEmit): Use IsValueType instead of
19545 IsSubclassOf (value_type)
19546 (New.DoResolve): ditto.
19547 (Invocation.EmitCall): ditto.
19549 * assign.cs (Assign): ditto.
19551 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19552 Statements *are* currently doing part of their resolution during
19555 Expressions do always resolve during resolve, but statements are
19556 only required to propagate resolution to their children.
19558 2002-07-11 Miguel de Icaza <miguel@ximian.com>
19560 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19562 (LoadAssembly): Do not add the dll if it is already specified
19564 (MainDriver): Add the System directory to the link path at the end,
19565 after all the other -L arguments.
19567 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19568 wrong opcode for loading bytes and bools (ldelem.i1 instead of
19569 ldelem.u1) and using the opposite for sbytes.
19571 This fixes Digger, and we can finally run it.
19573 * driver.cs (UnixParseOption): Move the option parsing here.
19574 (CSCParseOption): Implement CSC-like parsing of options.
19576 We now support both modes of operation, the old Unix way, and the
19577 new CSC-like way. This should help those who wanted to make cross
19578 platform makefiles.
19580 The only thing broken is that /r:, /reference: and /lib: are not
19581 implemented, because I want to make those have the same semantics
19582 as the CSC compiler has, and kill once and for all the confussion
19583 around this. Will be doing this tomorrow.
19585 * statement.cs (Unsafe.Resolve): The state is checked during
19586 resolve, not emit, so we have to set the flags for IsUnsfe here.
19588 2002-07-10 Miguel de Icaza <miguel@ximian.com>
19590 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19591 not catch the Error_ObjectRefRequired in SimpleName (as it is
19592 possible to have a class/instance variable name that later gets
19593 deambiguated), we have to check this here.
19595 2002-07-10 Ravi Pratap <ravi@ximian.com>
19597 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19598 make static and put into Expression.
19600 (Event.Define): Register the private field of the event with the
19601 TypeManager so that GetFieldFromEvent can get at it.
19603 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19604 keep track of the private field associated with an event which
19607 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19610 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19612 2002-07-10 Miguel de Icaza <miguel@ximian.com>
19614 * expression.cs (Binary.EmitBranchable): this routine emits the
19615 Binary expression in a branchable context. This basically means:
19616 we need to branch somewhere, not just get the value on the stack.
19618 This works together with Statement.EmitBoolExpression.
19620 * statement.cs (Statement.EmitBoolExpression): Use
19623 2002-07-09 Miguel de Icaza <miguel@ximian.com>
19625 * statement.cs (For): Reduce the number of jumps in loops.
19627 (For): Implement loop inversion for the For statement.
19629 (Break): We can be breaking out of a Try/Catch controlled section
19630 (foreach might have an implicit try/catch clause), so we need to
19631 use Leave instead of Br.
19633 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19634 now). If the instace expression supports IMemoryLocation, we use
19635 the AddressOf method from the IMemoryLocation to extract the
19636 address instead of emitting the instance.
19638 This showed up with `This', as we were emitting the instance
19639 always (Emit) instead of the Address of This. Particularly
19640 interesting when This is a value type, as we dont want the Emit
19641 effect (which was to load the object).
19643 2002-07-08 Miguel de Icaza <miguel@ximian.com>
19645 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19647 * statement.cs (Checked): Set the CheckedState during the resolve
19648 process too, as the ConvCast operations track the checked state on
19649 the resolve process, and not emit.
19651 * cs-parser.jay (namespace_member_declaration): Flag that we have
19652 found a declaration when we do. This is used to flag error 1529
19654 * driver.cs: Report ok when we display the help only.
19656 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
19658 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19660 2002-07-04 Miguel de Icaza <miguel@ximian.com>
19662 * cs-tokenizer.cs (define): We also have to track locally the
19663 defines. AllDefines is just used for the Conditional Attribute,
19664 but we also need the local defines for the current source code.
19666 2002-07-03 Miguel de Icaza <miguel@ximian.com>
19668 * statement.cs (While, For, Do): These loops can exit through a
19669 Break statement, use this information to tell whether the
19670 statement is the last piece of code.
19672 (Break): Flag that we break.
19674 * codegen.cs (EmitContexts): New `Breaks' state variable.
19676 2002-07-03 Martin Baulig <martin@gnome.org>
19678 * class.cs (TypeContainer.MethodModifiersValid): Allow override
19679 modifiers in method declarations in structs. Otherwise, you won't
19680 be able to override things like Object.Equals().
19682 2002-07-02 Miguel de Icaza <miguel@ximian.com>
19684 * class.cs (Method, Property, Indexer): Do not allow the public
19685 modifier to be used in explicit interface implementations.
19687 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19688 override modifiers in method declarations in structs
19690 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
19692 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19693 integer or real overflow, report an error
19695 2002-07-02 Martin Baulig <martin@gnome.org>
19697 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19698 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19699 to tell the runtime about our newly created System.Object and
19700 System.ValueType types.
19702 2002-07-02 Miguel de Icaza <miguel@ximian.com>
19704 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19705 struct instead of Ldarg/Starg.
19707 2002-07-02 Martin Baulig <martin@gnome.org>
19709 * expression.cs (Indirection.Indirection): Call
19710 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19712 2002-07-02 Martin Baulig <martin@gnome.org>
19714 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19715 ValueType, call TypeManager.TypeToCoreType() on it.
19716 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19717 the OpCodes.Newarr argument.
19719 2002-07-02 Martin Baulig <martin@gnome.org>
19721 * expression.cs (Invocation.EmitCall): When compiling corlib,
19722 replace all calls to the system's System.Array type to calls to
19723 the newly created one.
19725 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19726 System.Array methods.
19727 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19728 from the system's System.Array type which must be replaced.
19730 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19732 * typemanager.cs: load unverifiable_code_ctor so we can build
19733 corlib using the correct type. Avoid using GetTypeCode() with
19735 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19736 TypeManager.object_type to allow building corlib.
19738 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19740 * ecore.cs: handle System.Enum separately in LoadFromPtr().
19742 2002-07-01 Martin Baulig <martin@gnome.org>
19744 * class.cs: Make the last change actually work, we need to check
19745 whether `ifaces != null' to avoid a crash.
19747 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19749 * class.cs: when we build structs without fields that implement
19750 interfaces, we need to add the interfaces separately, since there is
19751 no API to both set the size and add the interfaces at type creation
19754 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19756 * expression.cs: the dimension arguments to the array constructors
19757 need to be converted if they are a long.
19759 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19761 * class.cs: don't emit ldarg.0 if there is no parent constructor
19762 (fixes showstopper for corlib).
19764 2002-06-29 Martin Baulig <martin@gnome.org>
19766 MCS now compiles corlib on GNU/Linux :-)
19768 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19769 ie. check for MethodImplOptions.InternalCall.
19771 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19772 and TypeManager.attribute_type are null, so we must explicitly check
19773 whether parent is not null to find out whether it's an attribute type.
19774 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19775 and SetBuilder, not only if the property is neither abstract nor external.
19776 This is necessary to set the MethodImplOptions on the accessor methods.
19777 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19778 SetBuilder, see Property.Emit().
19780 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19781 populate "System.Object", "System.ValueType" and "System.Attribute" since
19782 they've already been populated from BootCorlib_PopulateCoreTypes().
19784 2002-06-29 Martin Baulig <martin@gnome.org>
19786 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19787 is the NullLiteral, we also need to make sure that target_type is not
19790 2002-06-29 Martin Baulig <martin@gnome.org>
19792 * rootcontext.cs (RootContext.ResolveCore): We must initialize
19793 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19794 before calling BootstrapCorlib_ResolveDelegate ().
19796 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19798 * statement.cs: fixed build-breaker. All tests passed ok.
19800 2002-06-27 Martin Baulig <martin@gnome.org>
19802 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19803 for System.Decimal when compiling corlib.
19805 2002-06-27 Martin Baulig <martin@gnome.org>
19807 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19808 switch blocks which contain nothing but a default clause.
19810 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
19812 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19814 2002-06-27 Martin Baulig <martin@gnome.org>
19816 * ecore.cs (PropertyExpr.PropertyExpr): Call
19817 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19819 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19820 is already a TypeBuilder.
19822 2002-06-27 Martin Baulig <martin@gnome.org>
19824 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19825 `target_type == TypeManager.array_type', not IsAssignableFrom() in
19826 the "from an array-type to System.Array" case. This makes it work
19827 when compiling corlib.
19829 2002-06-27 Martin Baulig <martin@gnome.org>
19831 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19832 non-static PropertyExpr, set its InstanceExpression. This makes
19833 the `ICollection.Count' property work in System/Array.cs.
19835 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
19837 * driver.cs: Made error handling more consistent. Errors now
19838 tracked by Report class, so many methods which used to return int
19839 now return void. Main() now prints success/failure and
19840 errors/warnings message.
19842 Renamed '--probe' compiler argument to '--expect-error'. Removed
19843 the magic number return values (123 and 124). Now, if the
19844 expected error occurs, the compiler exits with success (exit value
19845 0). If the compilation completes without seeing that particular
19846 error, the compiler exits with failure (exit value 1). The
19847 makefile in mcs/errors has been changed to handle the new behaviour.
19849 * report.cs: Made 'expected error' number a property and renamed
19850 it from 'Probe' to 'ExpectedError'.
19852 * genericparser.cs: Removed error handling support, since it is
19853 now all done by Report class.
19855 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19856 class, so parse() no longer returns an int.
19858 * namespace.cs: Use Report.Error instead of GenericParser.error
19860 2002-06-22 Miguel de Icaza <miguel@ximian.com>
19862 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19863 TypeContainer.AddOperator): At the front of the list put the
19864 explicit implementations, so they get resolved/defined first.
19866 2002-06-21 Miguel de Icaza <miguel@ximian.com>
19868 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19869 interface type is implemented by this TypeContainer. Used during
19870 explicit interface implementation.
19872 (Property.Define, Indexer.Define, Method.Define): Validate that
19873 the given interface in the explicit implementation is one of the
19874 base classes for the containing type.
19876 Also if we are explicitly implementing an interface, but there is
19877 no match in the pending implementation table, report an error.
19879 (Property.Define): Only define the property if we are
19880 not explicitly implementing a property from an interface. Use the
19881 correct name also for those properties (the same CSC uses,
19882 although that is really not needed).
19884 (Property.Emit): Do not emit attributes for explicitly implemented
19885 properties, as there is no TypeBuilder.
19887 (Indexer.Emit): ditto.
19889 Hiding then means that we do not really *implement* a pending
19890 implementation, which makes code fail.
19892 2002-06-22 Martin Baulig <martin@gnome.org>
19894 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19895 the return value of Object.GetType(). [FIXME: we need to do this whenever
19896 we get a type back from the reflection library].
19898 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19900 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19902 2002-06-20 Miguel de Icaza <miguel@ximian.com>
19904 * attribute.cs: Return null if we can not look up the type.
19906 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19907 the interface types found.
19909 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19910 interface types found.
19912 * typemanager.cs (GetInterfaces): Make this routine returns alll
19913 the interfaces and work around the lame differences between
19914 System.Type and System.Reflection.Emit.TypeBuilder in the results
19915 result for GetInterfaces.
19917 (ExpandInterfaces): Given an array of interface types, expand and
19918 eliminate repeated ocurrences of an interface. This expands in
19919 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19922 2002-06-21 Martin Baulig <martin@gnome.org>
19924 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19927 2002-06-21 Martin Baulig <martin@gnome.org>
19929 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
19930 and called with one of the core types, return the corresponding typebuilder for
19933 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19936 2002-06-21 Martin Baulig <martin@gnome.org>
19938 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19939 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19940 (Expression.ConvertReferenceExplicit): Likewise.
19942 * expression.cs (ElementAccess.DoResolve): Likewise.
19943 (ElementAccess.DoResolveLValue): Likewise.
19945 2002-06-10 Martin Baulig <martin@gnome.org>
19947 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19948 add the "value" parameter to the parameter list.
19950 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19953 2002-06-19 Miguel de Icaza <miguel@ximian.com>
19955 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19956 the argument to an int, uint, long or ulong, per the spec. Also
19957 catch negative constants in array creation.
19959 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19961 * class.cs: do not allow the same interface to appear twice in
19962 the definition list.
19964 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19966 * ecore.cs: don't use ldlen with System.Array.
19968 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19970 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19972 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19974 * modifiers.cs: produce correct field attributes for protected
19975 internal. Easy fix so miguel can work on ther harder stuff:-)
19977 2002-06-18 Miguel de Icaza <miguel@ximian.com>
19979 * pending.cs: New file. Move the code from class.cs here.
19980 Support clearning the pending flag for all methods (when not doing
19981 explicit interface implementation).
19983 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19985 * rootcontext.cs: added a couple more types needed to bootstrap.
19987 2002-06-17 Miguel de Icaza <miguel@ximian.com>
19989 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19990 constructor in the type, instead of any constructor in the type
19991 hierarchy. Thanks to Paolo for finding this bug (it showed up as
19992 a bug in the Mono runtime when applying the params attribute).
19994 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19995 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19997 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
19999 * expression.cs (Unary.ResolveOperator): Use TypeManager
20000 to resolve the type.
20002 2002-06-13 Ravi Pratap <ravi@ximian.com>
20004 * cs-parser.jay (enum_member_declaration): Pass in the attributes
20007 * enum.cs (AddEnumMember): Add support to store the attributes associated
20008 with each member too.
20010 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
20011 field builders too - this takes care of the enum member case.
20013 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
20015 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
20016 address-of operator on both value types and pointers.
20018 2002-06-10 Martin Baulig <martin@gnome.org>
20020 * interface.cs (Interface.PopulateIndexer): Add the indexer's
20021 PropertyBuilder to the `property_builders' list.
20023 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
20024 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
20025 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
20026 find any indexers which are inherited from an interface.
20028 2002-06-09 Martin Baulig <martin@gnome.org>
20030 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
20031 the same type as the constant if necessary. There's also a test-130.cs
20034 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
20036 * typemanager.cs (TypeManager.ChangeType): Previously known as
20037 Enum.ChangeEnumType().
20039 2002-06-09 Martin Baulig <martin@gnome.org>
20041 * expression.cs (Cast.TryReduce): Added support for consts.
20043 2002-06-08 Ravi Pratap <ravi@ximian.com>
20045 * class.cs (Accessor): Hold attributes information so we can pass
20048 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
20049 Modify to pass in attributes attached to the methods.
20051 (add_accessor_declaration, remove_accessor_declaration): Ditto.
20053 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
20054 to handle the Accessor kind :-)
20056 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
20058 2002-06-08 Martin Baulig <martin@gnome.org>
20060 * expression.cs (Unary.TryReduceNegative): Added support for
20063 2002-06-08 Martin Baulig <martin@gnome.org>
20065 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
20066 name can't be found in the `defined_names' - the caller will do a
20067 MemberLookup in this case and thus find methods in System.Enum
20068 such as Enum.IsDefined().
20070 2002-06-08 Martin Baulig <martin@gnome.org>
20072 * enum.cs (Enum.ChangeEnumType): This is a custom version of
20073 Convert.ChangeType() which works with TypeBuilder created types.
20074 (Enum.LookupEnumValue, Enum.Define): Use it here.
20076 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
20077 `TypeBuilder.BaseType != null' check.
20078 (TypeContainer.FindMembers): Only lookup parent members if we
20079 actually have a parent.
20080 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
20081 (ConstructorInitializer.Resolve): Likewise.
20083 * interface.cs (Interface.FindMembers): Added
20084 `TypeBuilder.BaseType != null' check.
20086 * rootcontext.cs (RootContext.ResolveCore): Added
20087 "System.Runtime.CompilerServices.IndexerNameAttribute" to
20088 classes_second_stage.
20090 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
20091 debug_type and trace_type when compiling with --nostdlib.
20093 2002-06-07 Martin Baulig <martin@gnome.org>
20095 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
20096 (AddField): Set it to true when adding a non-static field.
20097 (DefineType): Use `have_nonstatic_fields' to find out whether we
20098 have non-static fields, not `Fields != null'.
20100 2002-06-02 Miguel de Icaza <miguel@ximian.com>
20102 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
20103 dereferencing a null on the static-field code path)
20105 2002-05-30 Martin Baulig <martin@gnome.org>
20107 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
20108 to take command line arguments. Use reflection to call the new
20109 custom `Initialize' function on the symbol writer and pass it the
20110 command line arguments.
20112 * driver.cs (--debug-args): New command line argument to pass command
20113 line arguments to the symbol writer.
20115 2002-05-28 Miguel de Icaza <miguel@ximian.com>
20117 * assign.cs (DoResolve): Forgot to do the implicit conversion to
20118 the target type for indexers and properties. Thanks to Joe for
20121 2002-05-27 Miguel de Icaza <miguel@ximian.com>
20123 * typemanager.cs (MethodFlags): returns the method flags
20124 (Obsolete/ShouldIgnore) that control warning emission and whether
20125 the invocation should be made, or ignored.
20127 * expression.cs (Invocation.Emit): Remove previous hack, we should
20128 not do this on matching a base type, we should do this based on an attribute
20130 Only emit calls to System.Diagnostics.Debug and
20131 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
20132 on the command line.
20134 * rootcontext.cs: Global settings for tracing and debugging.
20136 * cs-tokenizer.cs (define): New utility function to track
20137 defines. Set the global settings for TRACE and DEBUG if found.
20139 2002-05-25 Ravi Pratap <ravi@ximian.com>
20141 * interface.cs (Populate*): Pass in the TypeContainer as well as
20142 the DeclSpace as parameters so that we can create EmitContexts and
20143 then use that to apply attributes etc.
20145 (PopulateMethod, PopulateEvent, PopulateProperty)
20146 (PopulateIndexer): Apply attributes everywhere.
20148 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
20151 (ApplyAttributes): Update accordingly.
20153 We now apply interface attributes for all members too.
20155 2002-05-26 Miguel de Icaza <miguel@ximian.com>
20157 * class.cs (Indexer.Define); Correctly check if we are explicit
20158 implementation (instead of checking the Name for a ".", we
20159 directly look up if the InterfaceType was specified).
20161 Delay the creation of the PropertyBuilder.
20163 Only create the PropertyBuilder if we are not an explicit
20164 interface implementation. This means that explicit interface
20165 implementation members do not participate in regular function
20166 lookups, and hence fixes another major ambiguity problem in
20167 overload resolution (that was the visible effect).
20169 (DefineMethod): Return whether we are doing an interface
20172 * typemanager.cs: Temporary hack until we get attributes in
20173 interfaces (Ravi is working on that) and we get IndexerName
20174 support in interfaces.
20176 * interface.cs: Register the indexers as properties.
20178 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
20179 warning, I have verified that this is a bug in the .NET runtime
20180 (JavaScript suffers of the same problem).
20182 * typemanager.cs (MemberLookup): When looking up members for
20183 interfaces, the parent of an interface is the implicit
20184 System.Object (so we succeed in searches of Object methods in an
20185 interface method invocation. Example: IEnumerable x; x.ToString
20188 2002-05-25 Miguel de Icaza <miguel@ximian.com>
20190 * class.cs (Event): Events should also register if they do
20191 implement the methods that an interface requires.
20193 * typemanager.cs (MemberLookup); use the new GetInterfaces
20196 (GetInterfaces): The code used to lookup interfaces for a type is
20197 used in more than one place, factor it here.
20199 * driver.cs: Track the errors at the bottom of the file, we kept
20202 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
20203 instance if the method we are calling is static!
20205 2002-05-24 Miguel de Icaza <miguel@ximian.com>
20207 * attribute.cs (ApplyAttributes): Make this function filter out
20208 the IndexerName attribute (as that attribute in reality is never
20209 applied) and return the string constant for the IndexerName
20212 * class.cs (TypeContainer.Emit): Validate that all the indexers
20213 have the same IndexerName attribute, and if so, set the
20214 DefaultName attribute on the class.
20216 * typemanager.cs: The return value might contain other stuff (not
20217 only methods). For instance, consider a method with an "Item"
20218 property and an Item method.
20220 * class.cs: If there is a problem with the parameter types,
20223 2002-05-24 Ravi Pratap <ravi@ximian.com>
20225 * ecore.cs (ImplicitConversionExists): Wrapper function which also
20226 looks at user defined conversion after making a call to
20227 StandardConversionExists - we need this for overload resolution.
20229 * expression.cs : Update accordingly the various method calls.
20231 This fixes 2 bugs filed against implicit user defined conversions
20233 2002-05-22 Miguel de Icaza <miguel@ximian.com>
20235 * statement.cs: Track the result of the assignment.
20237 2002-05-21 Miguel de Icaza <miguel@ximian.com>
20239 * expression.cs (MemberAccess): Improved error reporting for
20240 inaccessible members.
20242 2002-05-22 Martin Baulig <martin@gnome.org>
20244 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
20245 itself with debugging support.
20247 2002-05-22 Martin Baulig <martin@gnome.org>
20249 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
20250 Removed, this isn't needed anymore.
20252 2002-05-20 Martin Baulig <martin@gnome.org>
20254 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
20255 be underlying type for an enum.
20257 2002-05-20 Miguel de Icaza <miguel@ximian.com>
20259 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
20260 that splits out the loading of just the core types.
20262 * rootcontext.cs (ResolveCore): Split the struct resolution in
20263 two, so we can load the enumeration underlying types before any
20266 * expression.cs (Is): Bandaid until we fix properly Switch (see
20267 bug #24985 for details).
20269 * typemanager.cs (ImplementsInterface): The hashtable will contain
20270 a null if there are no interfaces implemented.
20272 2002-05-18 Miguel de Icaza <miguel@ximian.com>
20274 * cs-parser.jay (indexer_declarator): It is fine to have array
20277 2002-05-17 Miguel de Icaza <miguel@ximian.com>
20279 * typemanager.cs: (RegisterBuilder): New function used to register
20280 TypeBuilders that implement interfaces. Since
20281 TypeBuilder.GetInterfaces (as usual) does not work with lame
20283 (AddUserType): register interfaces.
20285 (ImplementsInterface): Use the builder_to_ifaces hash if we are
20286 dealing with TypeBuilder. Also, arrays are showing up as
20287 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
20288 methods can not be invoked on them!
20290 * ecore.cs (ExplicitReferenceConversionExists): Made public.
20291 (ImplicitReferenceConversionExists): Split out from
20292 StandardConversionExists.
20294 * expression.cs (As): We were only implementing one of the three
20295 cases for the as operator. We now implement them all.
20296 (Is): Implement the various other cases for Is as well.
20298 * typemanager.cs (CACHE): New define used to control if we want or
20299 not the FindMembers cache. Seems to have a negative impact on
20300 performance currently
20302 (MemberLookup): Nested types have full acess to
20303 enclosing type members
20305 Remove code that coped with instance/static returns for events, we
20306 now catch this in RealFindMembers.
20308 (RealFindMembers): only perform static lookup if the instance
20309 lookup did not return a type or an event.
20311 2002-05-17 Miguel de Icaza <miguel@ximian.com>
20313 * assign.cs (CompoundAssign): We pass more semantic information
20314 now to Compound Assignments than we did before: now we have all
20315 the information at hand, and now we resolve the target *before* we
20316 do the expression expansion, which allows the "CacheValue" method
20317 to have the effect we intended (before, a [x] += 1 would generate
20318 two differen ArrayAccess expressions from the ElementAccess,
20319 during the resolution process).
20321 (CompoundAssign.DoResolve): Resolve target and original_source here.
20323 2002-05-16 Miguel de Icaza <miguel@ximian.com>
20325 * expression.cs (ArrayAccess): dropped debugging information.
20327 * typemanager.cs: Small bug fix: I was always returning i_members,
20328 instead of one of i_members or s_members (depending on which had
20331 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
20332 method is invoked before any code generation takes place, and it
20333 is a mechanism to inform that the expression will be invoked more
20334 than once, and that the method should use temporary values to
20335 avoid having side effects
20337 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
20339 * ecore.cs (Expression.CacheTemporaries): Provide empty default
20342 * expression.cs (Indirection, ArrayAccess): Add support for
20343 CacheTemporaries in these two bad boys.
20345 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
20346 ldobj or ldind_ref.
20347 (StoreFromPtr): Handle stobj as well.
20349 * expression.cs (UnaryMutator): Share more code.
20351 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
20352 down: I was not tracking the Filter function as well, which
20353 was affecting the results of the cache.
20355 2002-05-15 Miguel de Icaza <miguel@ximian.com>
20357 * attribute.cs: Remove the hack to handle the CharSet property on
20360 2002-05-14 Miguel de Icaza <miguel@ximian.com>
20362 * attribute.cs (DoResolve): More uglyness, we now only try to
20363 resolve the attribute partially, to extract the CharSet
20364 information (only if we are a StructLayout attribute). Otherwise
20366 (GetExtraTypeInfo): Add some code to conditionally kill in the
20367 future this. I am more and more convinced that the .NET
20368 framework has special code to handle the attribute setting on
20371 * expression.cs (IsParamsMethodApplicable): Revert my previous
20372 foreach change here, it was wrong.
20374 2002-05-13 Miguel de Icaza <miguel@ximian.com>
20376 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
20377 (pp_expr): do not abort on unknown input, just return.
20378 (eval): abort if there are pending chars.
20380 * attribute.cs (Attribute.Resolve): Positional parameters are
20381 optional. Deal with that case.
20383 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
20384 the Ansi/Unicode/Auto information for the type.
20386 (TypeContainer.DefineType): instantiate the EmitContext here, as
20387 we will be using it during the type definition (to resolve
20388 attributes) and during the emit phase.
20390 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20391 to pull type information out of the attributes
20393 (Attribute.Resolve): track the constructor builder, and allow for
20394 multiple invocations (structs and classes will use this).
20396 * ecore.cs (MemberLookupFinal): new version with all the
20397 parameters customizable.
20399 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20400 constructors. Return if the result value is null (as the error
20401 would have been flagged already by MemberLookupFinal)
20403 Do not allow instances of abstract classes or interfaces to be
20406 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20407 We have to compare the assembly property here when dealing with
20408 FamANDAssem and Assembly access modifiers, because we might be
20409 creating an assembly from *modules* (that means that we are not
20410 getting TypeBuilders for types defined in other modules that are
20411 part of this assembly).
20413 (Method.Emit): If the method is marked abstract and has a body,
20416 (TypeContainer.DefineMembers): If both the defined member and the
20417 parent name match are methods, then do not emit any warnings: let
20418 the Method.Define routine take care of flagging warnings. But if
20419 there is a mismatch (method overrides something else, or method is
20420 overriwritten by something, then emit warning).
20422 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20423 set to null, this means `do not check for the return type on the
20426 (Method.Define): set the return type for the method signature to
20427 null, so that we get methods with the same name and parameters and
20428 different return types. This is used to flag warning 114 (you are
20429 hiding a method, and you probably want to use the new/override
20432 * typemanager.cs (MemberLookup): Implemented proper access
20433 control, closing a long standing set of bug reports. The problem
20434 was that the Framework only has two bits: Public and NonPublic,
20435 and NonPublic includes private and protected methods, but we need
20436 to enforce the FamANDAssem, FamOrAssem and Family.
20438 2002-05-11 Miguel de Icaza <miguel@ximian.com>
20440 * statement.cs (GotoCase): Return true: Ammounts to giving up
20441 knowledge on whether we return or not, and letting the other case
20442 be responsible for it.
20444 2002-05-10 Miguel de Icaza <miguel@ximian.com>
20446 * driver.cs: Do not load directories for each file processed, only
20447 do it if there is a pattern.
20449 * ecore.cs: Report readonly assigns here as well, as we might have
20450 been resolved only by MemberAccess.
20452 (SimpleName.SimpleNameResolve): Also be useful for LValue
20453 resolution. We need this to propagate assign to local readonly variables
20455 * typemanager.cs: Use a ptrhashtable for the criteria, because we
20456 do not want to reuse potential criteria memory.
20458 * class.cs (MyEventBuilder): Set reflected_type;
20460 * ecore.cs (Constantify): Added support for constifying bools.
20462 (RootContext.LookupType): Added a cache for values looked up in
20463 the declaration space.
20465 * typemanager.cs (FindMembers): Now is a front-end to
20466 RealFindMembers, and provides a two-level hashtable-based cache to
20469 15% performance improvement: from 22.5 to 19.2 seconds.
20471 * expression.cs (IsParamsMethodApplicable): use foreach.
20472 (Invocation.DoResolve): ditto.
20473 (New.DoResolve): ditto.
20474 (ArrayCreation.DoResolve): ditto.
20476 * ecore.cs (FindMostEncompassingType): use foreach.
20478 * delegate.cs (NewDelegate.DoResolve): Use foreach
20480 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20481 (RemoveMethods): use foreach.
20483 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20484 nested foreach statements instead of for, and also break out of
20485 the inner loop once a match is found.
20487 (Invocation.OverloadResolve): Use foreach, simplify the code.
20489 2002-05-08 Miguel de Icaza <miguel@ximian.com>
20491 * cfold.cs (BinaryFold): During an enumeration evaluation context,
20492 we actually unwrap the expression to allow for extra information
20495 * expression.cs: Use Shr_Un on unsigned operations.
20497 2002-05-08 Ravi Pratap <ravi@ximian.com>
20499 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
20500 applicable operators was not being considered correctly. This closes
20501 the bug Miguel reported.
20503 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20505 * attribute.cs: check that the type derives from System.Attribute
20506 and report the correct error in that case (moved the duplicate code to
20507 its own method, too).
20509 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20511 * attribute.cs: lookup attribute type name as the spec says: first the
20512 bare attribute name and then name + "Attribute" (nant compiles with
20513 mcs after this fix).
20515 2002-05-07 Miguel de Icaza <miguel@ximian.com>
20517 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
20518 Because of the way we parse things, we should try to see if a
20519 UIntConstant can fit in an integer.
20521 2002-05-07 Ravi Pratap <ravi@ximian.com>
20523 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20524 when we are in an explicit context.
20526 (ConvertReferenceExplicit): When converting from Iface type S to Class
20527 T make sure the rules are implemented as an OR.
20529 * parameter.cs (ParameterType): Make it a property for now although the
20530 purpose really isn't anything immediate.
20532 * expression.cs (Is*Applicable): Do better checking on the parameter type
20533 of a ref/out parameter. The ones from the system assemblies are already
20534 marked with the correct type so we don't need to do any correction.
20536 * ecore.cs (StandardConversionExists): Conversion from Interface types to
20537 the object type is standard too so include that.
20539 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20541 * ecore.cs (StandardConversionExists): Augment with missing code:
20542 deal with IntConstant, LongConstants and Enumerations.
20544 * assign.cs: Report the error, instead of failing silently
20546 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20547 typecontainer that they are declared, because the
20548 typecontainer/namespace will have the list of using clauses that
20549 need to be applied.
20551 Assembly Attributes were escaping the normal registration
20554 (EmitCode): Apply attributes within an EmitContext that represents
20555 the container they were declared on.
20557 * cs-parser.jay: Track bases for structs. How did I get this wrong?
20559 2002-05-06 Ravi Pratap <ravi@ximian.com>
20561 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20562 Revamp completely - make much cleaner as we now operate only
20565 (FindMostSpecificSource, FindMostSpecificTarget): New methods
20566 to implement the logic detailed in the spec more correctly.
20568 (UserDefinedConversion): Update accordingly.
20570 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20572 * statement.cs: Return flow analysis information up.
20574 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20577 (token): Do not consume an extra character before calling
20580 2002-05-06 Piers Haken <piersh@friskit.com>
20582 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20584 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20586 * class.cs (Constructor.Emit): Set the IsStatic flag in the
20587 EmitContext during the instance constructor initializer
20588 resolution, to stop access to instance variables.
20590 This is mandated by the spec, last paragraph of the `constructor
20591 initializers' section.
20593 2002-05-05 Miguel de Icaza <miguel@ximian.com>
20595 * cs-parser.jay, class.cs (Accessor): new class used to represent
20596 an accessor (get or set). In the past we used `null' to represent
20597 a missing accessor. But this is ambiguous because there was no
20598 way to tell in abstract indexers/properties if one of them was
20601 Now there is a way of addressing that.
20603 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20604 instead of FindMembers.
20606 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20607 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20609 * attribute.cs: Treat indexers and properties as the same in terms
20610 of applying attributes
20612 * ecore.cs (FindMostEncompassedType): Use statically initialized
20613 EmptyExpressions()s like we do elsewhere to avoid creating useless
20614 objects (and we take this out of the tight loop).
20616 (GetConversionOperators): Move the code to extract the actual
20617 operators to a separate routine to clean things up.
20619 2002-05-04 Miguel de Icaza <miguel@ximian.com>
20621 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20622 events are always registered FieldBuilders.
20624 * class.cs (FieldBase): New class shared by Fields
20626 * delegate.cs: If we are a toplevel delegate, use our full name.
20627 If we are a nested delegate, then only use our tail name.
20629 2002-05-02 Ravi Pratap <ravi@ximian.com>
20631 * expression.cs (IsApplicable): Ensure that we add the "&" to
20632 ref/out types before comparing it with the type of the argument.
20634 (IsParamsMethodApplicable): Ditto.
20636 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
20639 * delegate.cs : Handle the case when we have more than one applicable
20640 method. Flag an error only when we finish checking all.
20642 2002-05-02 Miguel de Icaza <miguel@ximian.com>
20644 * expression.cs: Add support for boolean static initializers.
20646 2002-05-01 Miguel de Icaza <miguel@ximian.com>
20648 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20650 * parameter.cs (ComputeParameterTypes,
20651 ComputeAndDefineParameterTypes): Better error handling: now we
20652 clear the `types' cache if we fail during any of the type lookups.
20653 We also return the status code correctly to our caller
20655 * delegate.cs: If we fail to define a delegate, abort the extra
20658 * expression.cs (Binary.ResolveOperator): for
20659 operator==(object,object) and operator !=(object, object) we also
20660 have to verify that there is an implicit conversion from one to
20663 (ArrayAccess.DoResolve): Array Access can operate on
20666 2002-04-30 Miguel de Icaza <miguel@ximian.com>
20668 * assign.cs (CompoundAssign): A new class used as a "flag" that
20669 the assignment actually is happening as part of a compound
20670 assignment operator.
20672 During compound assignment, a few new rules exist to enable things
20679 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20680 to the type of x) if y is implicitly convertible to the type of x,
20681 and the operator is a builtin operator and the return type of the
20682 operator is explicitly convertible to the type of x.
20684 * rootcontext.cs: Reset warning level to 2. 4 catches various
20685 "interesting" features in mcs, we must clean this up at some
20686 point, but currently am trying to kill other bugs ;-)
20688 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20689 in container classes as well.
20691 * expression.cs (Binary.ResolveOperator): Handle string case
20692 before anything else (as operator overloading does emit an error
20693 before doing anything else).
20695 This code could go away when we move to a table driven model, but
20696 i could not come up with a good plan last night.
20698 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
20700 * typemanager.cs (CSharpName): reimplementation using regex.
20701 * class.cs: added null check for fields in Emit
20702 * rootcontext.cs: set warninglevel to 4
20704 2002-04-29 Miguel de Icaza <miguel@ximian.com>
20706 * typemanager.cs (CSharpName): reimplemented with Lupus
20709 2002-04-28 Miguel de Icaza <miguel@ximian.com>
20711 * statement.cs (If): correclty implement Resolve, because we were
20712 not catching sem errors in there. The same process is needed
20714 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20717 (Statement.Warning_DeadCodeFound): Factorize code.
20718 (While): Report dead code here too.
20720 (Statement): Added Resolve virtual method to allow
20721 for resolution split from the emit code.
20723 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20725 * statement.cs (EmitBoolExpression): No longer try to resolve the
20727 (MakeBoolean): New utility function that resolve, implicitly
20728 converts to boolean and tags the expression.
20731 (If, Do): Implement dead code elimination.
20732 (While): Implement loop inversion
20734 (Do, While, For, If): Resolve the expression prior to calling our
20737 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
20740 - added method Report28 (warning: program has more than one entry point)
20741 - added method IsEntryPoint, implements paragraph 10.1 of the spec
20742 - modified method Method.Define, the part at the end of the method
20744 * rootcontext.cs: added static public Location EntryPointLocation;
20746 * ../errors/cs0028.cs : Add test case for the above warning.
20749 - modified method CSharpName to allow arrays of primitive type to
20750 be printed nicely (e.g. instead of System.Int32[][] it now prints
20752 - added method CSharpSignature: returns the signature of a method
20753 in string format to be used in reporting errors, warnings, etc.
20755 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20758 2002-04-26 Ravi Pratap <ravi@ximian.com>
20760 * delegate.cs (Define): Fix extremely silly bug where I was
20761 setting the type of the 'object' parameter of the BeginInvoke
20762 method to System.IAsyncResult instead of System.Object ;-)
20764 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20766 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20769 (Constructor.Emit): return if we fail to initialize the
20770 constructor. Another door closed!
20772 * expression.cs (New.DoResolve): Improve error message (from -6 to
20773 1501). Use DeclaredOnly lookup to find the exact constructor.
20775 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20776 loop. This is useful.
20778 * cs-parser.jay: Adjust the default parameters so that destructors
20779 have the proper signature.
20781 2002-04-26 Martin Baulig <martin@gnome.org>
20783 * driver.cs (LoadAssembly): If `assembly' contains any characters
20784 which are only valid in path names and not in assembly names
20785 (currently slash, backslash and point), use Assembly.LoadFrom ()
20786 instead of Assembly.Load () on the `assembly' (before iteration
20787 over the link_paths).
20789 2002-04-26 Martin Baulig <martin@gnome.org>
20791 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20793 2002-04-25 Miguel de Icaza <miguel@ximian.com>
20795 * class.cs (Property): use the new typemanager.MemberLookup
20797 (TypeContainer.MemberLookup): Implement using the
20798 TypeManager.MemberLookup now.
20800 * typemanager.cs: Make MemberLookup a function of the TypeManager,
20801 and return MemberInfos, so that these can be used without an
20802 EmitContext (what we had before).
20804 2002-04-24 Miguel de Icaza <miguel@ximian.com>
20806 * expression.cs: Fix the case where the argument to params if the
20807 type of the params. I omitted handling this before. Fixed
20809 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20811 * driver.cs: Call BootCorlib_PopulateCoreType
20813 * class.cs (Property.CheckBase): Check for properties only, not
20816 * interface.cs: Temporary hack: try/catch around the
20817 CustomAttributeBuilder, because I am getting an exception that I
20820 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20821 types whose definitions are required to be there (attributes are
20822 defined before standard types).
20824 Compute definitions as we boot the various types, as they are used
20825 immediately (value_type class will need object_type, but if we do
20826 not initialize object_type, we will pass a null, which will let
20827 the runtime pick the System.Object from the existing corlib, which
20828 is not what we want).
20830 2002-04-22 Patrik Torstensson <totte@labs2.com>
20832 * cs-tokenizer.cs: fixed a number of trim() issues.
20834 2002-04-22 Ravi Pratap <ravi@ximian.com>
20836 * expression.cs (Argument.Type): Ensure that we return the correct
20837 type when we have out or ref parameters [in which case we
20840 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20842 * class.cs (Property, Indexer): Allow extern modifier in there.
20844 * typemanager.cs (InitBaseTypes): Initializes object_type and
20845 value_type, since those will be used early on during the bootstrap
20846 process to compile corlib.
20848 (InitCoreTypes): Move code from here to InitBaseTypes.
20850 2002-04-21 Miguel de Icaza <miguel@ximian.com>
20852 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20853 single-dimension arrays as using the ldlen opcode.
20855 Daniel Lewis discovered this optimization.
20857 * typemanager.cs: Add signature for System.Array::get_Length
20859 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20861 * statement.cs: report the error when the foreach does not apply to an
20862 array nor a collection.
20864 2002-04-19 Miguel de Icaza <miguel@ximian.com>
20866 * expression.cs: Add implicit conversions to the operator ~.
20868 * constant.cs (DecimalConstant.Emit): Emit decimal value.
20870 * typemanager.cs: Locate the decimal constructor.
20872 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20874 * attribute.cs: use the new property of TypeOf.
20875 * expression.cs: added 'get' property around typearg.
20877 These changes fix a build breaker reported by NickD. Is this the
20878 correct way to fix? If not, please, revert my changes and make it
20881 2002-04-17 Miguel de Icaza <miguel@ximian.com>
20883 * attribute.cs: Add support for typeof in attribute invocations.
20884 I am not sure that this is right though.
20886 2002-04-14 Duncan Mak <duncan@ximian.com>
20888 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20889 Binary.Operator.Division case.
20891 2002-04-13 Ravi Pratap <ravi@ximian.com>
20893 * class.cs (DefineType): Ensure that we do a proper check on
20894 attribute types and also register it with the TypeManager.
20896 (TypeContainer.Targets): The default for attribute types is
20897 AttributeTargets.All.
20899 * attribute.cs (ApplyAttributes): Registering the attribute type
20900 is done elsewhere, not when we discover we have a Usage attribute.
20902 2002-04-12 Ravi Pratap <ravi@ximian.com>
20904 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20905 and get rid of is_delegate parameter.
20907 * everywhere : update.
20909 2002-04-12 Ravi Pratap <ravi@ximian.com>
20911 * cs-parser.jay (compilation_unit): Revamp completely to use
20912 some new ideas that I got from Rhys' grammar to solve the problems
20913 with assembly level attributes.
20915 (outer_declaration): New grammar production.
20917 (attribute_sections): Add.
20919 (opt_attributes): Base on attribute_sections
20921 (namespace_declaration): Allow opt_attributes to tackle the case
20922 when we have assembly level attributes - we are clever in this
20925 * attribute.cs (ApplyAttributes): Do not worry about assembly
20926 attributes in the non-global context.
20928 * rootcontext.cs (AddGlobalAttributes): Go back to using this
20929 instead of SetGlobalAttributes.
20931 * class.cs, rootcontext.cs : Ensure we define and generate
20932 attribute types before anything else.
20934 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20935 and flag the new error -20 for the case when the attribute type
20936 does not have valid targets specified. csc does not catch this.
20938 * ../errors/errors.txt : update for error # -20
20940 2002-04-11 Ravi Pratap <ravi@ximian.com>
20942 * support.cs (InternalParameters.ParameterModifier): Do some null
20943 checking and return sane values.
20945 * class.cs (Method.Define): If we are a PInvoke method, ensure
20946 that we are static and extern. Report error # 601
20948 * ../errors/cs0601.cs : Add test case for the above error.
20950 2002-04-07 Ravi Pratap <ravi@ximian.com>
20952 * rootcontext.cs (attribute_types): We need to keep type of
20953 all attribute types separately and emit code for them first.
20955 (RegisterAttribute) : Implement.
20957 * class.cs (DefineType): Check if the current Type is a custom
20958 attribute type and register it accordingly.
20960 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20961 adding the first attribute twice and rename to
20963 (SetGlobalAttributes): this.
20965 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20968 * attribute.cs (ApplyAttributes): Take an additional argument telling us
20969 if we are processing global arguments. Hmm, I am unsure of this.
20971 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20973 * expression.cs: added static array of strings to avoid calling
20974 Enum.ToString () for Operator in Binary. Significant recover of
20977 2002-04-10 Miguel de Icaza <miguel@ximian.com>
20979 * class.cs (FindMembers): Allow the Builders of the various
20980 members to be null. If they are skip them. This only happens
20981 during the PInvoke declaration.
20983 2002-04-09 Miguel de Icaza <miguel@ximian.com>
20985 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20986 failure, so we do not keep going afterwards.
20988 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20989 wanted to pass `false' as the `is_delegate' argument. If this is
20990 the case, why not use delegate_type == null to mean `is_delegate =
20991 false' and anything else as is_delegate = true.
20993 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
20995 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20996 code for the section, not the beginning of the tests.
20998 2002-04-08 Miguel de Icaza <miguel@ximian.com>
21000 * cfold.cs: Handle operator + (Enum x, Underlying x)
21002 * expression.cs (Binary): same. Warn about errors where we have
21003 Enum/Enum in operator + as well.
21005 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
21008 - added support for switch(bool)
21009 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
21010 - add TableSwitchEmit() to handle table-based switch statements
21012 2002-04-05 Ravi Pratap <ravi@ximian.com>
21014 * expression.cs (Invocation.OverloadResolve): Factor out code which
21015 does parameter compatibility checking with arguments so that we can
21016 re-use the code even from Delegate.VerifyApplicability
21018 (VerifyArgumentsCompat): Move above code here.
21020 * delegate.cs (VerifyApplicability): Get rid of duplicate code
21021 and instead make a call to the above method.
21023 2002-03-31 Ravi Pratap <ravi@ximian.com>
21025 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
21026 We use it to keep track of classes which are attribute types.
21028 2002-04-02 Miguel de Icaza <miguel@ximian.com>
21030 * delegate.cs (Delegate.Define): Correctly define the types in the
21031 presence of fixed and array parameters.
21033 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
21036 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
21037 include NonPublic after the first iteration.
21039 * class.cs (Indexer.CheckBase): Only check if both parents are
21042 * cs-parser.jay (accessor_body): If empty, set to null.
21044 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
21045 same code path here to resolve constants names that we did have in
21046 MemberAccess.DoResolve. There is too much code duplicated here.
21048 2002-04-01 Miguel de Icaza <miguel@ximian.com>
21050 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
21052 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
21055 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
21056 tokens, numbers and strings.
21058 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
21061 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
21062 asyncronous parameters and the regular parameters.
21064 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
21065 specify the target directory.
21067 * expression.cs: (This.DoResolve): Simplify
21068 (As.Emit): Optimize, do not generate IsInst if the expression is
21069 always of the given type.
21071 (Is.DoResolve): Bug fix, we were reporting both always/never for
21074 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
21075 creating too many unnecessary arrays.
21077 2002-03-31 Miguel de Icaza <miguel@ximian.com>
21079 * class.cs (EmitFieldInitializer): Use Assign expression to assign
21080 fields instead of rolling our own initializer. Takes care of all
21081 implicit conversions, and drops unnecessary static checks/argument.
21083 2002-03-31 Dick Porter <dick@ximian.com>
21085 * driver.cs: use the GetDirectories() return values properly, and
21086 use "/" as path separator.
21088 2002-03-30 Miguel de Icaza <miguel@ximian.com>
21090 * expression.cs (Unary): Optimize - - expr into expr.
21091 (Binary): Optimize a + (-b) into a -b.
21093 * codegen.cs (CodeGen): Made all methods static.
21095 2002-03-29 Miguel de Icaza <miguel@ximian.com>
21099 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
21100 TypeBuilder property.
21102 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
21105 * tree.cs: Removed the various RecordXXXX, and replaced with a
21106 single RecordDecl. Removed all the accessor methods, and just
21107 left a single access point Type
21109 * enum.cs: Rename DefineEnum to DefineType.
21111 * decl.cs: New abstract method `DefineType' used to unify the
21112 Defines for Enumerations, Interfaces, TypeContainers and
21115 (FindType): Moved LookupInterfaceOrClass here. Moved the
21116 LookupBaseClasses method that used to live in class.cs and
21117 interface.cs here, and renamed to FindType.
21119 * delegate.cs: Implement DefineType. Take advantage of the
21120 refactored pattern for locating the parent builder without taking
21121 the parent_builder argument (which we know does not work if we are
21122 nested, and triggering a toplevel definition).
21124 2002-03-28 Miguel de Icaza <miguel@ximian.com>
21126 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
21127 accessibility of a member has changed during override and report
21130 * class.cs (Method.Define, Property.Define): Only complain on
21131 overrides if the method is private, any other accessibility is
21132 fine (and since we just checked the permission is the same, we are
21135 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
21136 and elif are processed always. The other pre-processing
21137 directives are only processed if we are "taking" the path
21139 2002-03-29 Martin Baulig <martin@gnome.org>
21141 * class.cs (Method.Emit): Only emit symbolic debugging info if the
21142 current location is not Null.
21144 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
21145 a separate method so we can profile it.
21147 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
21148 `span.Seconds' are just seconds, but no minutes or hours.
21149 (MainDriver): Profile the CodeGen.SaveSymbols calls.
21151 2002-03-28 Miguel de Icaza <miguel@ximian.com>
21153 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
21154 Remove the gratuitous set of Final:
21156 // If an interface implementation, then we can set Final.
21157 if (((flags & MethodAttributes.Abstract) == 0) &&
21158 implementing.DeclaringType.IsInterface)
21159 flags |= MethodAttributes.Final;
21161 I do not know what I was smoking when I used that.
21164 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
21165 step into fixing the name resolution issues for delegates and
21166 unifying the toplevel name resolution.
21168 2002-03-28 Martin Baulig <martin@gnome.org>
21170 * class.cs (Method.Emit): If we have a symbol writer, call its
21171 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
21172 tell it about the current method.
21174 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
21175 writer that we're going to emit the first byte of IL code for a new
21176 statement (a new source line).
21177 (EmitContext.EmitTopBlock): If we have a symbol writer, call
21178 EmitContext.Mark() before emitting any code.
21180 * location.cs (SymbolDocument): Return null when we're Null.
21182 * statement.cs (Statement): Moved the `Location loc' variable here.
21183 (Statement.EmitBoolExpression): If we have a symbol writer, call
21184 ec.Mark() before emitting any code to tell it that we're at the
21185 beginning of a new statement.
21186 (StatementExpression): Added `Location' argument to the constructor.
21187 (Block): Added public readonly variable `StartLocation' and public
21188 variable `EndLocation'. The latter is to be set using SetEndLocation().
21189 (Block): Added constructor which takes a start and end location.
21190 (Block.SetEndLocation): New method. This sets the end location.
21191 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
21192 local variables we create.
21193 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
21194 each statement and do also mark the begin and end of the block.
21196 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
21197 tell it the current lexer.Location, use Location.Null for the end of the
21199 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
21200 current block, set its end location using SetEndLocation().
21201 (statement_expression): StatementExpression constructor now takes the
21202 lexer.Location as additional argument.
21203 (for_statement, declare_local_variables): Likewise.
21204 (declare_local_variables): When creating a new implicit block, use the
21205 new Block constructor and pass it the lexer.Location.
21207 2002-03-28 Miguel de Icaza <miguel@ximian.com>
21209 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
21210 members also on the parent interfaces recursively.
21212 2002-03-27 Miguel de Icaza <miguel@ximian.com>
21214 * report.cs: Use new formats, since Gonzalo finished the missing
21217 * expression.cs (Binary.ResolveOperator): added missing operator|
21218 operator& and operator^ for bool/bool.
21220 * cs-parser.jay: CheckDef now takes a Location argument that is
21221 used to report errors more precisly (instead of reporting the end
21222 of a definition, we try to track something which is a lot closer
21223 to the source of the problem).
21225 * cs-tokenizer.cs: Track global token use, so we can properly flag
21226 the use of #define/#undef after the first token has been seen.
21228 Also, rename the reportXXXX to Error_DescriptiveName
21230 * decl.cs (DeclSpace.IsTopLevel): Move property here from
21231 TypeContainer, so that Enum and Interface can use this too.
21233 * class.cs (TypeContainer.LookupInterfaceOrClass,
21234 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
21235 `builder' argument. Typically this was used to pass the parent
21236 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
21239 The problem is that a nested class could trigger the definition of
21240 a toplevel class, and the builder would be obviously wrong in that
21243 So we drop this argument, and we compute dynamically the
21244 TypeBuilder/ModuleBuilder (the correct information was available
21245 to us anyways from DeclSpace.Parent)
21247 * interface.cs (Interface.DefineInterface): Drop builder
21248 parameter cleanup like class.cs
21250 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
21253 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
21256 (Try.Emit): Propagate the returns value from the statement.
21258 (Return.Emit): Even if we are leavning
21260 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
21262 * modifiers.cs: Fix the computation of MethodAttributes flags.
21264 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
21266 * driver.cs: allow compilation of files that start with '/'.
21267 Add a default case when checking the argument of --target.
21269 2002-03-25 Miguel de Icaza <miguel@ximian.com>
21271 * interface.cs: Implement the same search algorithm for types in
21272 the interface code.
21274 * delegate.cs: Do not allow multiple definition.
21276 * Recovered ChangeLog that got accidentally amputated
21278 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
21280 * rootcontext.cs: Load manually enum to allow core classes to
21281 contain enumerations.
21283 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
21284 Update to new static methods in TypeManager.
21286 * typemanager.cs (GetMethod, GetConstructor): Use our
21287 implementation of FindMembers to find the members, since during
21288 corlib compilation, the types are TypeBuilders and GetMethod and
21289 GetConstructor do not work.
21291 Make all methods in TypeManager static.
21293 (InitCodeHelpers): Split the functionality from
21294 the InitCodeTypes function.
21296 * driver.cs: Call InitCodeHelpers after we have populated the
21299 * cs-parser.jay (delegate_declaration): we did not used to compute
21300 the delegate name correctly for void delegates.
21302 2002-03-24 Miguel de Icaza <miguel@ximian.com>
21304 * rootcontext.cs (RootContext): Init the interface_resolve_order
21305 and type_container_resolve_order always.
21307 (ResolveCore, BootstrapCorlib_ResolveClass,
21308 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
21309 compiler when compiling with --nostdlib
21311 * class.cs (TypeContainer.DefineType): Check that our parent is
21312 not null. This test is most important when we are bootstraping
21315 * codegen.cs: Split out the symbol writing code.
21317 2002-03-25 Martin Baulig <martin@gnome.org>
21319 * driver.cs (-g): Made -g an alias for --debug.
21321 2002-03-24 Martin Baulig <martin@gnome.org>
21323 * codegen.cs (SymbolWriter): New public variable. Returns the
21324 current symbol writer.
21325 (CodeGen): Added `bool want_debugging_support' argument to the
21326 constructor. If true, tell the ModuleBuild that we want debugging
21327 support and ask it for the ISymbolWriter.
21328 (Save): If we have a symbol writer, call it's Close() method after
21329 saving the assembly.
21331 * driver.c (--debug): New command line argument to create a
21332 debugger information file.
21334 * location.cs (SymbolDocument): New public property. Returns an
21335 ISymbolDocumentWriter object for the current source file or null
21336 if we don't have a symbol writer.
21338 2002-03-21 Miguel de Icaza <miguel@ximian.com>
21340 * driver.cs (LoadAssembly): Correctly return when all the paths
21341 have been tried and not before.
21343 * statement.cs (Switch.Emit): return the actual coverage for this
21344 statement (returns/not-returns)
21346 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
21347 switch of the statement if we are the last switch section. That
21348 kills two problems: try/catch problems (we used to emit an empty
21349 nop at the end) and switch statements where all branches would
21352 2002-03-19 Miguel de Icaza <miguel@ximian.com>
21354 * driver.cs: Add default assemblies (the equivalent to the
21355 Microsoft CSC.RSP file)
21357 * cs-tokenizer.cs: When updating `cols and setting it to zero,
21358 also update tokens_seen and set it to false.
21360 * driver.cs: Implement --recurse for Mike.
21362 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
21363 correctly splitting out the paths.
21365 2002-03-18 Miguel de Icaza <miguel@ximian.com>
21367 * interface.cs (Interface.PopulateProperty): Instead of using
21368 `parent' as the declaration space for the set parameters, use
21371 * support.cs (InternalParameters): InternalParameters constructor
21372 takes a DeclSpace instead of a TypeContainer.
21374 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
21375 types are being initialized, load the address of it before calling
21378 (New): Provide a mechanism to disable the generation of local
21379 value type temporaries when the caller will be providing us with
21380 an address to store it.
21382 (ArrayCreation.EmitDynamicInitializers): Use it.
21384 2002-03-17 Miguel de Icaza <miguel@ximian.com>
21386 * expression.cs (Invocation.EmitArguments): Only probe for array
21387 property if there is more than one argument. Sorry about that.
21389 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
21390 empty param arrays.
21392 * class.cs (Method.LabelParameters): Fix incorrect code path that
21393 prevented the `ParamArrayAttribute' from being applied to the
21396 2002-03-16 Miguel de Icaza <miguel@ximian.com>
21398 * support.cs (ReflectionParameters): Correctly compute whether the
21399 last argument is a params array. Fixes the problem with
21402 * typemanager.cs: Make the assemblies array always be non-null
21403 (empty, but non-null)
21405 * tree.cs (RecordDecl): New function that abstracts the recording
21406 of names. This reports error 101, and provides a pointer to the
21407 previous declaration. Fixes a crash in the compiler.
21409 * cs-parser.jay (constructor_declaration): Update to new grammar,
21410 and provide a constructor_body that can be empty.
21412 2002-03-15 Miguel de Icaza <miguel@ximian.com>
21414 * driver.cs: Add support for --resources.
21416 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21417 Make all types for the various array helper methods be integer.
21419 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21420 CheckState to ConvCast.
21422 (ConvCast): Now it takes a `checked' state argument, to avoid
21423 depending on the emit context for the conversion, and just using
21424 the resolve time setting.
21426 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21427 instead of Invocation.EmitArguments. We do not emit the original
21428 arguments, instead we emit those which have been converted to
21429 unsigned int expressions.
21431 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21433 * codegen.cs: ditto.
21435 * expression.cs (LocalVariableReference): Drop the use of the
21436 Store function that depended on the variable index.
21438 * statement.cs (VariableInfo): Drop the `Idx' property from this
21439 class, as this is not taking into account the indexes for
21440 temporaries tat we generate during the execution, getting the
21443 * class.cs: First emit class initializers, then call the parent
21446 * expression.cs (Binary): Fix opcode emision.
21447 (UnaryMutator.EmitCode): Support checked code generation
21449 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21450 matches for events for both the Static and Instance scans,
21451 pointing to the same element. Fix that.
21453 2002-03-14 Miguel de Icaza <miguel@ximian.com>
21455 * rootcontext.cs (ResolveTree): Always set the
21456 interface_resolve_order, because nested interfaces will be calling
21459 * class.cs (GetInterfaceOrClass): Track the same resolution
21460 process used by TypeManager.LookupType. This fixes the nested
21461 type lookups in class declarations (separate path from
21464 (TypeContainer.DefineType): Also define nested interfaces.
21465 (TypeContainer.RegisterOrder): New public function used to
21466 register the order in which child interfaces need to be closed.
21468 Nested interfaces need to be closed after their parents have been
21471 * interface.cs (InterfaceAttr): Put all the logic for computing
21472 the interface attribute here.
21474 (DefineInterface): Register our interface order with the
21475 RootContext or with the TypeContainer depending on the case.
21477 2002-03-12 Miguel de Icaza <miguel@ximian.com>
21479 * cs-parser.jay: rework foreach statement to work with the new
21480 changes to the policy on SimpleNames.
21482 * report.cs: support Stacktrace on warnings as well.
21484 * makefile: drop --unsafe and /unsafe from the compile.
21486 2002-03-13 Ravi Pratap <ravi@ximian.com>
21488 * ecore.cs (StandardConversionExists): Modify to take an Expression
21489 as the first parameter. Ensure we do null -> reference type conversion
21492 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21493 temporary Expression objects.
21495 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21497 * interface.cs: workaround bug in method overloading resolution
21498 (there is already a bugzilla bug for it).
21500 2002-03-12 Miguel de Icaza <miguel@ximian.com>
21502 We could also solve this problem by having a separate path for
21503 performing type lookups, instead of DoResolve, we could have a
21504 ResolveType entry point, and only participating pieces of the
21505 production (simplename, deref, array) would implement this.
21507 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21508 signal SimpleName to only resolve type names and not attempt to
21509 resolve anything else.
21511 * expression.cs (Cast): Set the flag.
21513 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21515 * class.cs: Only report 108 if there is no `new' modifier.
21517 * cs-parser.jay: rework foreach statement to work with the new
21518 changes to the policy on SimpleNames.
21520 * report.cs: support Stacktrace on warnings as well.
21522 * makefile: drop --unsafe and /unsafe from the compile.
21524 2002-03-11 Miguel de Icaza <miguel@ximian.com>
21526 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21527 lookups here, instead of doing that at parse time. This means
21528 that our grammar will not introduce `LocalVariableReferences' as
21529 expressions at this point. That solves the problem of code like
21533 static void Main ()
21537 This is only half the fix. The full fix requires parameters to
21538 also be handled in this way.
21540 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21541 makes the use more obvious of the DeclSpace. The
21542 ec.TypeContainer.TypeBuilder is now only used to pull the
21543 TypeBuilder for it.
21545 My theory is that I can get rid of the TypeBuilder completely from
21546 the EmitContext, and have typecasts where it is used (from
21547 DeclSpace to where it matters).
21549 The only pending problem is that the code that implements Aliases
21550 is on TypeContainer, and probably should go in DeclSpace.
21552 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21553 lookups here, instead of doing that at parse time. This means
21554 that our grammar will not introduce `LocalVariableReferences' as
21555 expressions at this point. That solves the problem of code like
21559 static void Main ()
21563 This is only half the fix. The full fix requires parameters to
21564 also be handled in this way.
21566 * class.cs (Property.DefineMethod): When implementing an interface
21567 method, set newslot, when implementing an abstract method, do not
21568 set the flag (before we tried never setting it, or always setting
21569 it, which is the difference).
21570 (Indexer.DefineMethod): same.
21571 (Method.DefineMethod): same.
21573 * ecore.cs: Only set the status used flag if we get back a Field.
21575 * attribute.cs: Temporary hack, so Paolo can keep working.
21577 2002-03-08 Ravi Pratap <ravi@ximian.com>
21579 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21580 the unmanaged type in the case we have a MarshalAs attribute.
21582 (Resolve): Handle the case when we are parsing the special MarshalAs
21583 attribute [we need to store the unmanaged type to use later]
21585 * typemanager.cs (marshal_as_attr_type): Built in type for the
21586 MarshalAs Attribute.
21588 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
21589 on parameters and accordingly set the marshalling info.
21591 2002-03-09 Miguel de Icaza <miguel@ximian.com>
21593 * class.cs: Optimizing slightly by removing redundant code after
21594 we switched to the `NoTypes' return value.
21595 (Property.DefineMethod): use NoTypes here too.
21597 This fixes the bug I introduced in my last batch of changes.
21599 2002-03-05 Ravi Pratap <ravi@ximian.com>
21601 * tree.cs (RecordEnum): Add. We now keep track of enums too.
21603 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21604 Enums since those are types too.
21606 * cs-parser.jay (enum_declaration): Record enums as we parse them.
21608 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
21609 thanks to a call during the lookup process.
21611 2002-03-07 Miguel de Icaza <miguel@ximian.com>
21613 * statement.cs (Foreach): Lots of work to accomodate a particular
21614 kind of foreach statement that I had not kept in mind. It is
21615 possible to have foreachs on classes that provide a GetEnumerator
21616 method that return objects that implement the "pattern" for using
21617 a foreach, there is no need to support GetEnumerator
21620 This is needed to compile nant.
21622 * decl.cs: Only report 114 if the member is not `Finalize' and if
21623 the warning level is at least 2.
21625 * class.cs: Moved the compare function from Method to
21628 (MethodSignature.InheritableMemberSignatureCompare): Add new
21629 filter function that is used to extract inheritable methods from a
21632 (Method.Define): Use the new `inheritable_method_signature_filter'
21635 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21638 2002-03-06 Miguel de Icaza <miguel@ximian.com>
21640 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21642 * cs-parser.jay: Add opt_semicolon to the interface declaration.
21644 * expression.cs: Pass location information to
21645 ConvertImplicitStandard.
21647 * class.cs: Added debugging code to track return values from
21650 2002-03-05 Miguel de Icaza <miguel@ximian.com>
21652 * expression.cs (Is.DoResolve): If either side of the `is' is an
21653 interface, do not flag the warning.
21655 * ecore.cs (ImplicitReferenceConversion): We need a separate test
21658 * report.cs: Allow for --fatal to be used with --probe.
21660 * typemanager.cs (NoTypes): Move the definition for the empty Type
21663 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21665 (TypeContainer.DefineProxy): New function used to proxy to parent
21666 implementations when implementing interfaces.
21667 (TypeContainer.ParentImplements): used to lookup if our parent
21668 implements a public function that is required by an interface.
21669 (TypeContainer.VerifyPendingMethods): Hook this up.
21671 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21672 `modules' and `assemblies' arraylists into arrays. We only grow
21673 these are the very early start up of the program, so this improves
21674 the speedof LookupType (nicely measured).
21676 * expression.cs (MakeByteBlob): Replaced unsafe code with
21677 BitConverter, as suggested by Paolo.
21679 * cfold.cs (ConstantFold.Binary): Special case: perform constant
21680 folding of string concatenation, but if either side is a string,
21681 and the other is not, then return null, and let the runtime use
21682 the concatenation on the string plus the object (using
21683 `Object.ToString').
21685 2002-03-04 Miguel de Icaza <miguel@ximian.com>
21687 Constant Folding has been implemented now.
21689 * expression.cs (Unary.Reduce): Do not throw an exception, catch
21690 the error instead on types that are not supported in one's
21693 * constant.cs (Constant and all children): New set of functions to
21694 perform implict and explicit conversions.
21696 * ecore.cs (EnumConstant): Implement the new functions to perform
21697 conversion by proxying to the child expression.
21699 * codegen.cs: (ConstantCheckState): Constant evaluation has its
21700 own separate setting that can not be turned off from the command
21701 line using --unchecked or --checked and is only controlled using
21702 the checked/unchecked statements and expressions. This setting is
21703 used by the constant folder to flag errors.
21705 * expression.cs (CheckedExpr, UncheckedExpr): Set the
21706 ConstantCheckState as well.
21708 During Resolve, they also have to flag the state, because the
21709 constant folder runs completely in the Resolve phase.
21711 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21714 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21716 * cfold.cs: New file, this file contains the constant folder.
21718 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21719 argument to track whether we are using the resulting address to
21720 load or store a value and provide better error messages.
21722 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21723 new AddressOf arguments.
21725 * statement.cs (Foreach.EmitCollectionForeach): Update
21727 * expression.cs (Argument.Emit): Call AddressOf with proper
21728 arguments to track usage.
21730 (New.DoEmit): Call AddressOf with new arguments.
21732 (Unary.Emit): Adjust AddressOf call.
21734 2002-03-01 Ravi Pratap <ravi@ximian.com>
21736 * cs-parser.jay (member_access): Change the case for pre-defined types
21737 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
21740 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21743 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21744 essentially like methods and apply attributes like MethodImplOptions to them too.
21746 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21749 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21750 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21753 * Update code everywhere accordingly.
21755 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21757 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21759 2002-02-28 Ravi Pratap <ravi@ximian.com>
21761 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21762 try performing lookups against those instead of jumping straight into using
21763 the 'using' clauses.
21765 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21767 (LookupType): Perform lookups in implicit parents too.
21769 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21770 sequence as RootContext.LookupType.
21772 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
21773 the various cases of namespace lookups into this method.
21775 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21777 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21778 in positional arguments)
21780 * class.cs (Operator): Update the AllowedModifiers to contain
21783 * cs-parser.jay: Update operator declaration to allow for the
21784 operator body to be empty.
21786 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21789 2002-02-27 Miguel de Icaza <miguel@ximian.com>
21791 * class.cs (Method.Emit): Label parameters.
21793 * driver.cs: Return 1 or 0 as the program exit code.
21795 2002-02-26 Miguel de Icaza <miguel@ximian.com>
21797 * expression.cs: Special case the `null' object when trying to
21798 auto-compute the type, as anything can be explicitly converted to
21801 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21802 spotting this Paolo.
21804 (Expression.ImplicitNumericConversion): Perform comparissions of
21805 the type using the underlying type in the case of an enumeration
21806 rather than using the enumeration type for the compare.
21808 Cope with the underlying == type case, which is not possible to
21811 (Expression.ConvertNumericExplicit): Perform comparissions of
21812 the type using the underlying type in the case of an enumeration
21813 rather than using the enumeration type for the compare.
21815 * driver.cs: If the user does not supply an extension, assume .exe
21817 * cs-parser.jay (if_statement): Rewrote so that we can track the
21818 location for the if statement.
21820 * expression.cs (Binary.ConstantFold): Only concat strings when
21821 the operation is "+", not everything ;-)
21823 * statement.cs (Statement.EmitBoolExpression): Take a location
21825 (If, While, Do): Track location.
21827 * expression.cs (Binary.ResolveOperator): In the object + string
21828 case, I was missing a call to ConvertImplicit
21830 2002-02-25 Ravi Pratap <ravi@ximian.com>
21832 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21833 Location arguments. Ensure we use RootContext.LookupType to do our work
21834 and not try to do a direct Type.GetType and ModuleBuilder.GetType
21836 * interface.cs (PopulateMethod): Handle the type of the parameter being
21839 * expression.cs (Invocation.BetterFunction): Handle the case when we
21840 have a params method with no fixed arguments and a call is made with no
21843 2002-02-25 Miguel de Icaza <miguel@ximian.com>
21845 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21846 the verbatim-string-literal
21848 * support.cs (InternalParameters.ParameterModifier): handle null
21850 (InternalParameters.ParameterType): ditto.
21852 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21853 duplicating the name of the variable parameter.
21854 (GetParameterByName): Fix bug where we were not looking up array
21855 paramters if they were the only present (thanks Paolo!).
21856 (GetParameterInfo): We only have an empty set of types if both
21857 fixed and array are set to null.
21858 (GetParameterInfo-idx): Handle FixedParameter == null
21860 * cs-parser.jay: Handle the case where there is no catch
21861 statements (missing null test).
21863 2002-02-22 Miguel de Icaza <miguel@ximian.com>
21865 * driver.cs (MainDriver): Be conservative on our command line
21868 Catch DirectoryNotFoundException when calling GetFiles.
21870 (SplitPathAndPattern): Used to split the input specification into
21871 a path and a pattern that we can feed to Directory.GetFiles.
21873 2002-02-21 Miguel de Icaza <miguel@ximian.com>
21875 * statement.cs (Fixed): Implement the last case of the Fixed
21876 statement (string handling).
21878 * expression.cs (StringPtr): New class used to return a char * to
21879 a string; Used by the Fixed statement.
21881 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
21883 * expression.cs (Binary.ResolveOperator): Remove redundant
21884 MemberLookup pn parent type.
21885 Optimize union call, we do not need a union if the types are the same.
21886 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21889 Specialize the use of MemberLookup everywhere, instead of using
21890 the default settings.
21892 (StackAlloc): Implement stackalloc keyword.
21894 * cs-parser.jay: Add rule to parse stackalloc.
21896 * driver.cs: Handle /h, /help, /?
21898 * expression.cs (MakeByteBlob): Removed the hacks we had in place
21899 before we supported unsafe code.
21901 * makefile: add --unsafe to the self compilation of mcs.
21903 2002-02-20 Miguel de Icaza <miguel@ximian.com>
21905 * expression.cs (PointerArithmetic): New class that is used to
21906 perform pointer arithmetic.
21907 (Binary.Resolve): Handle pointer arithmetic
21908 Handle pointer comparission.
21909 (ArrayPtr): Utility expression class that is used to take the
21910 address of an array.
21912 (ElementAccess): Implement array access for pointers
21914 * statement.cs (Fixed): Implement fixed statement for arrays, we
21915 are missing one more case before we are done.
21917 * expression.cs (Indirection): Implement EmitAssign and set the
21918 ExprClass to Variable. This allows pointer dereferences to be
21919 treated as variables, and to have values assigned to them.
21921 * ecore.cs (Expression.StoreFromPtr): New utility function to
21922 store values dereferencing.
21924 2002-02-20 Ravi Pratap <ravi@ximian.com>
21926 * expression.cs (Binary.ResolveOperator): Ensure that we are
21927 not trying to operate on a void type - this fixes the reported
21930 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21931 the parent implementation is sealed.
21933 * ../errors/cs0239.cs : Add.
21935 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21937 * typemanager.cs (unverifiable_code_type): Corresponds to
21938 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21939 which have unsafe code in them.
21941 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
21944 2002-02-19 Miguel de Icaza <miguel@ximian.com>
21946 * cs-tokenizer.cs: Add support for @"litreal strings"
21948 Make tokenizer accept pre-processor directives
21949 on any column (remove the old C-like limitation).
21951 * rootcontext.cs (EmitCode): Emit any global attributes.
21952 (AddGlobalAttributes): Used to keep track of assembly attributes.
21954 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21956 * cs-parser.jay: Add support for global attributes.
21958 2002-02-17 Miguel de Icaza <miguel@ximian.com>
21960 * expression.cs (Indirection): New helper class. Unary will
21961 create Indirection classes to be able to implement the
21962 IMemoryLocation interface on it.
21964 2002-02-16 Miguel de Icaza <miguel@ximian.com>
21966 * cs-parser.jay (fixed_statement): reference the right statement.
21968 * statement.cs (Fixed.Emit): Finish implementing the fixed
21969 statement for the &x case.
21971 2002-02-14 Miguel de Icaza <miguel@ximian.com>
21973 * class.cs (Property.Define, Method.Define): Remove newslot when
21976 * modifiers.cs: My use of NewSlot when `Abstract' was set was
21977 wrong. NewSlot should only be used if the `new' keyword is present.
21979 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21980 locating our system dir. Sorry about this.
21982 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21984 * driver.cs (GetSystemDir): Compute correctly the location of our
21985 system assemblies. I was using the compiler directory instead of
21986 the library directory.
21988 2002-02-13 Ravi Pratap <ravi@ximian.com>
21990 * expression.cs (BetterFunction): Put back in what Miguel commented out
21991 since it is the correct fix. The problem is elsewhere ;-)
21993 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21994 parameters of the parms method are themselves compatible or not !
21996 (StandardConversionExists): Fix very dangerous bug where we were forgetting
21997 to check that a class implements an interface before saying that an implicit
21998 conversion was allowed. Use ImplementsInterface to do the checking.
22000 2002-02-13 Miguel de Icaza <miguel@ximian.com>
22002 * class.cs (Method.Define): Track whether we are an explicit
22003 implementation or not. And only call DefineMethodOverride if we
22004 are an explicit implementation.
22006 (Property.DefineMethod): Ditto.
22008 2002-02-11 Ravi Pratap <ravi@ximian.com>
22010 * expression.cs (BetterFunction): Catch hideous bug which was
22011 preventing us from detecting ambiguous calls due to implicit casts i.e
22014 2002-01-29 Miguel de Icaza <miguel@ximian.com>
22016 * support.cs (Pair): Remove un-needed method. I figured why I was
22017 getting the error in cs-parser.jay, the variable in a foreach loop
22018 is readonly, and the compiler does not really treat this as a variable.
22020 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
22021 instead of EQUALS in grammar.
22023 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
22025 * expression.cs (Unary.DoResolve): Check whether the argument is
22028 2002-01-28 Miguel de Icaza <miguel@ximian.com>
22030 * support.cs: Api for Pair to set a value. Despite the fact that
22031 the variables are public the MS C# compiler refuses to compile
22032 code that accesses the field if the variable is part of a foreach
22035 * statement.cs (Fixed): Begin implementation of the fixed
22038 (Block.AddVariable): Return the VariableInfo on success and null
22039 on failure instead of true/false.
22041 * cs-parser.jay (foreach): Catch errors on variables already
22042 defined (we were ignoring this value before) and properly unwind
22043 the block hierarchy
22045 (fixed_statement): grammar for the fixed statement.
22047 2002-01-25 Miguel de Icaza <miguel@ximian.com>
22049 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
22050 pointer types to be incretemented.
22052 (SizeOf): Implement.
22054 * cs-parser.jay (pointer_member_access): Implement
22055 expr->IDENTIFIER production.
22057 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
22058 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
22061 (Unary): Implement indirection.
22063 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
22064 use in non-unsafe context).
22066 (SimpleName.DoResolve): Check for pointers in field access on safe
22069 (Expression.LoadFromPtr): Factor the load-indirect code in this
22070 function. This was duplicated in UnboxCast and ParameterReference
22072 2002-01-24 Miguel de Icaza <miguel@ximian.com>
22074 * expression.cs (ComposedCast): report an error if a pointer cast
22075 is used in a safe region.
22077 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
22078 pointer type casts in unsafe context.
22080 * codegen.cs (EmitContext): Set up IsUnsafe.
22082 * cs-parser.jay (non_expression_type): Add productions for pointer
22085 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
22086 code. We should not use force into static mode if the method is
22087 not virtual. Fixes bug in MIS
22089 * statement.cs (Do.Emit, While.Emit, For.Emit,
22090 Statement.EmitBoolExpression): Add support to Do and While to
22091 propagate infinite loop as `I do return' semantics.
22093 Improve the For case to also test for boolean constants.
22095 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
22096 to the list of attributes we can add.
22098 Remove `EmitContext' argument.
22100 * class.cs (Method.Define): Apply parameter attributes.
22101 (Constructor.Define): Apply parameter attributes.
22102 (MethodCore.LabelParameters): Move here the core of labeling
22105 * support.cs (ReflectionParameters.ParameterModifier,
22106 InternalParameters.ParameterModifier): Use IsByRef on the type and
22107 only return the OUT bit for these parameters instead of in/out/ref
22110 This is because I miss-understood things. The ParameterInfo.IsIn
22111 and IsOut represent whether the parameter has the [In] and [Out]
22114 2002-01-22 Miguel de Icaza <miguel@ximian.com>
22116 * ecore.cs (FieldExpr.Emit): Release temporaries.
22118 * assign.cs (LocalTemporary.Release): new function.
22120 * codegen.cs (EmitContext.GetTemporaryStorage,
22121 EmitContext.FreeTemporaryStorage): Rework the way we deal with
22122 temporary storage. Now we can "put back" localbuilders when we
22125 2002-01-21 Miguel de Icaza <miguel@ximian.com>
22127 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
22128 need to make a copy of the variable to generate verifiable code.
22130 2002-01-19 Miguel de Icaza <miguel@ximian.com>
22132 * driver.cs: Compute dynamically the system directory.
22134 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
22135 Slower, but more generally useful. Used by the abstract
22136 registering implementation.
22138 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
22139 the rules for the special rule on Type/instances. First check if
22140 we have the same name, and if so, try that special static path
22141 rather than the instance path.
22143 2002-01-18 Miguel de Icaza <miguel@ximian.com>
22145 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
22148 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
22149 Enum, ValueType, Delegate or Array for non-corlib compiles.
22151 * cs-tokenizer.cs: Catch long identifiers (645)
22153 * typemanager.cs (IndexerPropetyName): Ravi never tested this
22156 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
22157 fix, we were returning too early, so we were not registering
22158 pending methods from abstract classes.
22160 Do not register pending methods if the class is abstract.
22162 * expression.cs (Conditional.DoResolve): Report circular implicit
22163 conversions when we neecd to compute it for conditional
22166 (Is.DoResolve): If the expression is always of the provided type,
22167 flag warning 183. If the expression can not ever be of the
22168 provided type flag warning 184.
22170 * class.cs: Catch 169 as well.
22172 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
22175 2002-01-18 Nick Drochak <ndrochak@gol.com>
22177 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
22179 2002-01-17 Miguel de Icaza <miguel@ximian.com>
22181 * interface.cs: (PopulateMethod): Check for pointers being defined
22182 only if the unsafe context is active.
22183 (PopulateProperty): ditto.
22184 (PopulateIndexer): ditto.
22186 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
22187 specified. If pointers are present, make sure that they are
22188 present in an unsafe context.
22189 (Constructor, Constructor.Define): ditto.
22190 (Field, Field.Define): ditto.
22191 (Property, Property.Define): ditto.
22192 (Event, Event.Define): ditto.
22194 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
22195 hashtable if there are classes or structs defined.
22197 * expression.cs (LocalVariableReference.DoResolve): Simplify this
22198 code, as the constant resolution moved.
22200 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
22201 the metadata, so we can flag error 133.
22203 * decl.cs (MemberCore.UnsafeOK): New function to test that a
22204 pointer is being declared in an unsafe context.
22206 2002-01-16 Miguel de Icaza <miguel@ximian.com>
22208 * modifiers.cs (Modifiers.Check): Require a Location argument.
22209 Report error 227 for Unsafe use.
22211 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
22213 * statement.cs (For.Emit): If the test is null, then report that
22214 we do `return', as we wont reach anything afterwards.
22216 (Switch.SwitchGoverningType): Track the expression that matched
22219 * driver.cs: Allow negative numbers as an error code to flag.
22221 * cs-parser.jay: Handle 1551.
22223 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
22225 2002-01-15 Miguel de Icaza <miguel@ximian.com>
22227 * cs-parser.jay: Report 1518 (type declaration can only contain
22228 class, struct, interface, enum or delegate)
22230 (switch_label): Report 1523 (keywords `case' or `default' must
22233 (opt_switch_sections): Report 1522 (empty switch)
22235 * driver.cs: Report 1515 (response file specified multiple times)
22236 Report 1516 (Source file specified multiple times).
22238 * expression.cs (Argument.Resolve): Signal 1510
22240 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
22241 access not allowed in static code)
22243 2002-01-11 Ravi Pratap <ravi@ximian.com>
22245 * typemanager.cs (IsPointerType): Utility method which we are going
22248 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
22249 the object type, so we take care of that.
22251 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
22253 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
22254 added to non-params parameters :-)
22256 * typemanager.cs (CSharpName): Include 'void' type too.
22258 (void_ptr_type): Include in the set of core types.
22260 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
22263 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
22266 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
22267 completely forgotten about it.
22269 2002-01-10 Ravi Pratap <ravi@ximian.com>
22271 * cs-parser.jay (pointer_type): Add. This begins our implementation
22272 of parsing rules for unsafe code.
22274 (unsafe_statement): Implement.
22276 (embedded_statement): Modify to include the above.
22278 * statement.cs (Unsafe): Implement new class for unsafe blocks.
22280 * codegen.cs (EmitContext.InUnsafe): Add. This determines
22281 if the current context is an unsafe one.
22283 * cs-parser.jay (local_variable_pointer_type): Since local variable types
22284 are handled differently, we need separate rules for them.
22286 (local_variable_declaration): Update to use local_variable_pointer_type
22287 to allow variable declarations of unmanaged pointer types.
22289 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
22290 in unsafe contexts.
22292 * ../errors/cs0214.cs : Add.
22294 2002-01-16 Nick Drochak <ndrochak@gol.com>
22296 * makefile: remove 'response' file when cleaning.
22298 2002-01-15 Miguel de Icaza <miguel@ximian.com>
22300 * cs-parser.jay: Report 1524.
22302 2002-01-14 Miguel de Icaza <miguel@ximian.com>
22304 * typemanager.cs (RegisterMethod): drop checking if we have
22305 registered this from here
22307 2002-01-12 Miguel de Icaza <miguel@ximian.com>
22309 * class.cs (Method.EmitDestructor): Implement calling our base
22312 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
22313 value of InFinally.
22315 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
22316 this routine and will wrap the call in a try/catch block. Deal
22319 2002-01-11 Miguel de Icaza <miguel@ximian.com>
22321 * ecore.cs (Expression.MemberLookup): instead of taking a
22322 parameter `same_type' that was used to tell whether we could
22323 access private members we compute our containing type from the
22326 (FieldExpr): Added partial support for volatile fields. This does
22327 not work for volatile fields exposed from assemblies, as I can not
22328 figure out how to extract the modreq from it.
22330 Updated all the source files to use this.
22332 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
22333 because it is referenced by MemberLookup very often.
22335 2002-01-09 Ravi Pratap <ravi@ximian.com>
22337 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
22338 TypeBuilder.GetCustomAttributes to retrieve what we need.
22340 Get rid of redundant default_member_attr_type as this is the same as
22341 default_member_type which already exists.
22343 * interface.cs, attribute.cs : Update accordingly.
22345 2002-01-08 Miguel de Icaza <miguel@ximian.com>
22347 * typemanager.cs: Enable IndexerPropertyName again. It does not
22348 work for TYpeBuilders though. Ravi, can you please fix this?
22350 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
22352 * expression.cs (Argument.Emit): Handle the case of ref objects
22353 being passed to ref functions;
22355 (ParameterReference.EmitLoad): Loads the content of the pointer
22356 without dereferencing.
22358 2002-01-07 Miguel de Icaza <miguel@ximian.com>
22360 * cs-tokenizer.cs: Implemented the pre-processing expressions.
22362 2002-01-08 Ravi Pratap <ravi@ximian.com>
22364 * class.cs (Indexer.DefineMethod): Incorporate the interface
22365 type in the name of the method if we are doing explicit interface
22368 * expression.cs (ConversionExists): Remove as it is completely obsolete.
22370 (BetterConversion): Fix extremely trivial bug where we were referring to
22371 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
22374 * ../errors/bug16.cs : Add although we have fixed it.
22376 2002-01-07 Miguel de Icaza <miguel@ximian.com>
22378 * expression.cs (BaseIndexer): Begin implementation.
22380 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
22382 * cs-parser.jay (indexer_declarator): Use qualified_identifier
22383 production directly to remove a shift/reduce, and implement
22384 explicit interface implementation.
22386 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
22387 after a floating point suffix.
22389 * expression.cs (DoNumericPromotions): Improved the conversion for
22390 uint/uint. If we have a constant, we avoid doing a typecast to a
22393 * class.cs (Indexer): Implement explicit interface implementation
22396 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22398 * class.cs: make the default instance constructor public and hidebysig.
22400 2001-01-03 Ravi Pratap <ravi@ximian.com>
22402 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22403 so we can call it from elsewhere.
22405 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22406 we emit it internally if the class has a defined indexer; otherwise the user
22407 emits it by decorating the class definition with the DefaultMemberAttribute.
22409 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22410 attribute is not used on a type which defines an indexer.
22412 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22413 character when we skip whitespace.
22415 * ../errors/cs0646.cs : Add.
22417 2002-01-03 Miguel de Icaza <miguel@ximian.com>
22419 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22422 * makefile: Add practical target `mcs3.exe' which builds the third
22423 generation compiler.
22425 * expression.cs (New): Fix structures constructor calling.
22427 * class.cs (Property, Method, Indexer): Emit Final flag on the
22428 method if we are an interface implementation and we are not
22431 * ecore.cs (PropertyExpr): New public field `IsBase', tells
22432 whether this property is referencing a `base' method.
22434 * expression.cs (Invocation.EmitCall): take an extra argument:
22435 is_base, this is used to determine whether the `call' or
22436 `callvirt' opcode should be used.
22439 * delegate.cs: update EmitCall.
22441 * class.cs (Method.Define): Set NewSlot for the cases where we are
22442 not implementing an interface method.
22444 (Property.Define): ditto.
22446 2002-01-02 Miguel de Icaza <miguel@ximian.com>
22448 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22449 'r'. Allows mcs to parse itself fully.
22451 2002-01-02 Ravi Pratap <ravi@ximian.com>
22453 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22454 of the number of initializers that require the InitializeArray method.
22456 (CheckIndices): Store the Expression in all cases - not the plain value. Also
22457 update the above field where necessary.
22459 (MakeByteBlob): Update accordingly.
22461 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
22464 (EmitDynamicInitializers): Update in accordance with the new optimization.
22466 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22467 same OpCode applies.
22469 * cs-parser.jay : Fix some glaring errors I introduced.
22471 2002-01-01 Ravi Pratap <ravi@ximian.com>
22473 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22474 so that we can check for name clashes there too.
22476 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22477 for interface indexers.
22479 * interfaces.cs (Define): Emit the default member attribute.
22481 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22482 variable was being referred to while setting the value ;-)
22484 2002-01-01 Miguel de Icaza <miguel@ximian.com>
22486 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22487 byte-by-byte information when we know the data is zero.
22489 Make the block always a multiple of 4, because
22490 DefineInitializedData has a bug.
22492 * assign.cs: Fix, we should assign from the temporary, not from
22495 * expression.cs (MakeByteBlob): Fix my incorrect code.
22497 2001-12-31 Miguel de Icaza <miguel@ximian.com>
22499 * typemanager.cs (EnumToUnderlying): This function is used to get
22500 the underlying type from an enumeration, because it does not
22503 * constant.cs: Use the I4_S form for values between -128 and 127.
22505 * statement.cs (Block.LookupLabel): Looks up a label.
22506 (Block): Drop support for labeled blocks.
22508 (LabeledStatement): New kind of statement that represents a label
22511 (Goto): Finally implement this bad boy.
22513 * cs-parser.jay: Update to reflect new mechanism to implement
22516 2001-12-30 Miguel de Icaza <miguel@ximian.com>
22518 * codegen.cs (EmitContext.This): a codegen property that keeps the
22519 a single instance of this instead of creating many different this
22522 * delegate.cs (Delegate.DoResolve): Update to use the property;
22524 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22526 * expression.cs (BaseAccess.DoResolve): Ditto.
22528 2001-12-29 Ravi Pratap <ravi@ximian.com>
22530 * typemanager.cs (methodimpl_attr_type): Add to hold the type
22531 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22533 (InitCoreTypes): Update accordingly.
22535 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22536 so we can quickly store the state.
22538 (ApplyAttributes): Set the correct implementation flags
22539 for InternalCall methods.
22541 2001-12-29 Miguel de Icaza <miguel@ximian.com>
22543 * expression.cs (EmitCall): if a method is not virtual, then do
22544 not use callvirt on it.
22546 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22547 user defined stuff) requires the use of stobj, which takes an
22548 address on the stack instead of an array and an index. So emit
22549 the Ldelema operation for it.
22551 (EmitStoreOpcode): Use stobj for valuetypes.
22553 (UnaryMutator.EmitCode): Use the right 1 value depending on
22554 whether we are dealing with int64/uint64, float or doubles.
22556 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22557 constructors that I implemented last night.
22559 (Constructor.IsDefault): Fix to work properly for static
22562 * cs-parser.jay (CheckDef): report method signature errors.
22563 Update error number 103 to be 132.
22565 * decl.cs: New AdditionResult enumeration value: MethodExists.
22566 Although we do this check for methods later on in the semantic
22567 analysis, catching repeated default constructors is so easy that
22568 we catch these here.
22570 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22573 (ParameterReference.EmitAssign, Emit): handle
22576 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22577 (ArrayAccess.EmitStoreOpcode): ditto.
22579 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22581 * expression.cs (MakeByteBlob): Complete all the missing types
22582 (uint, short, ushort, byte, sbyte)
22584 * class.cs: Only init instance field initializers on instance
22587 Rename `constructors' to instance_constructors.
22589 (TypeContainer.AddConstructor): Only add constructors to the list
22590 if it is not static.
22592 Make sure that we handle default_static_constructor independently
22593 everywhere where we handle instance_constructors
22595 2001-12-28 Miguel de Icaza <miguel@ximian.com>
22597 * class.cs: Do not lookup or create a base initializer for a
22598 static constructor.
22600 (ConstructorInitializer.Resolve): use the proper type to lookup
22603 * cs-parser.jay: Report error 1585 (modifiers between type and name).
22605 * enum.cs, interface.cs: Remove CloseType, this is taken care by
22608 * decl.cs: CloseType is now an virtual method, the default
22609 implementation just closes this type.
22611 2001-12-28 Ravi Pratap <ravi@ximian.com>
22613 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22614 to PreserveSig by default. Also emit HideBySig on such methods.
22616 Basically, set the defaults to standard values.
22618 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22619 argument, if candidate is better, it can't be worse than the best !
22621 (Invocation): Re-write bits to differentiate between methods being
22622 applicable in their expanded form and their normal form - for params
22625 Get rid of use_standard everywhere as only standard conversions are allowed
22626 in overload resolution.
22628 More spec conformance.
22630 2001-12-27 Miguel de Icaza <miguel@ximian.com>
22632 * driver.cs: Add --timestamp, to see where the compiler spends
22635 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22636 `this' in static code.
22638 (SimpleName.DoResolve): Implement in terms of a helper function
22639 that allows static-references to be passed upstream to
22642 (Expression.ResolveWithSimpleName): Resolve specially simple
22643 names when called by MemberAccess to implement the special
22646 (Expression.ImplicitReferenceConversion): Handle conversions from
22647 Null to reference types before others, as Null's type is
22650 * expression.cs (Invocation.EmitCall): Handle the special case of
22651 calling methods declared on a reference type from a ValueType
22652 (Base classes System.Object and System.Enum)
22654 (MemberAccess.Resolve): Only perform lookups on Enumerations if
22655 the left hand side is a TypeExpr, not on every enumeration.
22657 (Binary.Resolve): If types are reference types, then do a cast to
22658 object on operators != and == of both arguments.
22660 * typemanager.cs (FindMembers): Extract instance and static
22661 members if requested.
22663 * interface.cs (PopulateProperty): Use void_type instead of null
22664 as the return type for the setter method.
22666 (PopulateIndexer): ditto.
22668 2001-12-27 Ravi Pratap <ravi@ximian.com>
22670 * support.cs (ReflectionParameters): Fix minor bug where we
22671 were examining the wrong parameter for the ParamArray attribute.
22673 Cope with requests for the type of the parameter at position
22674 greater than the params parameter's. We now return the element
22675 type of the params array as that makes more sense.
22677 * expression.cs (Invocation.IsParamsMethodApplicable): Update
22678 accordingly as we no longer have to extract the element type
22681 (Invocation.OverloadResolve): Update.
22683 2001-12-27 Miguel de Icaza <miguel@ximian.com>
22685 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22686 against IEnumerator, test whether the return value is a descendant
22687 of the IEnumerator interface.
22689 * class.cs (Indexer.Define): Use an auxiliary method to implement
22690 the other bits of the method definition. Begin support for
22691 explicit interface implementation.
22693 (Property.DefineMethod): Use TypeManager.void_type instead of null
22694 for an empty return value.
22696 2001-12-26 Miguel de Icaza <miguel@ximian.com>
22698 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22699 dealing with a FieldExpr which is composed of a FieldBuilder, in
22700 the code path we did extract the constant, but we should have
22701 obtained the underlying value to be able to cast it (otherwise we
22702 end up in an infinite loop, this is what Ravi was running into).
22704 (ArrayCreation.UpdateIndices): Arrays might be empty.
22706 (MemberAccess.ResolveMemberAccess): Add support for section
22707 14.5.4.1 that deals with the special case of E.I when E is a type
22708 and something else, that I can be a reference to a static member.
22710 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22711 handle a particular array type to create byte blobs, it is just
22712 something we dont generate byteblobs for.
22714 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22717 * location.cs (Push): remove the key from the hashtable that we
22718 are about to add. This happens for empty files.
22720 * driver.cs: Dispose files after we have parsed them.
22722 (tokenize): new function that only runs the tokenizer on its
22723 input, for speed testing.
22725 2001-12-26 Ravi Pratap <ravi@ximian.com>
22727 * class.cs (Event.Define): Define the private field only if there
22728 are no accessors defined.
22730 * expression.cs (ResolveMemberAccess): If there is no associated
22731 field with the event, that means we have an event defined with its
22732 own accessors and we should flag error cs0070 since transforming
22733 ourselves into a field is not valid in that case.
22735 * ecore.cs (SimpleName.DoResolve): Same as above.
22737 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22738 and charset to sane values.
22740 2001-12-25 Ravi Pratap <ravi@ximian.com>
22742 * assign.cs (DoResolve): Perform check on events only if they
22743 are being accessed outside the declaring type.
22745 * cs-parser.jay (event_declarations): Update rules to correctly
22746 set the type of the implicit parameter etc.
22748 (add_accessor, remove_accessor): Set current local parameters.
22750 * expression.cs (Binary): For delegate addition and subtraction,
22751 cast the return value from the method into the appropriate delegate
22754 2001-12-24 Ravi Pratap <ravi@ximian.com>
22756 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22757 of these as the workaround is unnecessary.
22759 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22760 delegate data - none of that is needed at all.
22762 Re-write bits to extract the instance expression and the delegate method
22765 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
22768 * attribute.cs (ApplyAttributes): New method to take care of common tasks
22769 of attaching attributes instead of duplicating code everywhere.
22771 * everywhere : Update code to do attribute emission using the above method.
22773 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22775 * expression.cs (IsParamsMethodApplicable): if there are not
22776 parameters, return immediately.
22778 * ecore.cs: The 0 literal can be implicity converted to an enum
22781 (SimpleName.DoResolve): First lookup the type, then lookup the
22784 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22785 want to get its address. If the InstanceExpression is not
22786 addressable, store the result in a temporary variable, then get
22789 * codegen.cs: Only display 219 errors on warning level or above.
22791 * expression.cs (ArrayAccess): Make it implement the
22792 IMemoryLocation interface.
22794 (Binary.DoResolve): handle the operator == (object a, object b)
22795 and operator != (object a, object b) without incurring into a
22796 BoxedCast (because 5 != o should never be performed).
22798 Handle binary enumerator operators.
22800 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22801 value type, otherwise use Ldelem_ref.
22803 Use precomputed names;
22805 (AddressOf): Implement address of
22807 * cs-parser.jay (labeled_statement): Fix recursive block
22808 addition by reworking the production.
22810 * expression.cs (New.DoEmit): New has a special case:
22812 If we are dealing with a ValueType, we have a few
22813 situations to deal with:
22815 * The target of New is a ValueType variable, that is
22816 easy, we just pass this as the variable reference
22818 * The target of New is being passed as an argument,
22819 to a boxing operation or a function that takes a
22822 In this case, we need to create a temporary variable
22823 that is the argument of New.
22826 2001-12-23 Ravi Pratap <ravi@ximian.com>
22828 * rootcontext.cs (LookupType): Check that current_type is not null before
22829 going about looking at nested types.
22831 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22832 not implement the IAssignMethod interface any more.
22834 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22835 where we tranform them into FieldExprs if they are being resolved from within
22836 the declaring type.
22838 * ecore.cs (SimpleName.DoResolve): Do the same here.
22840 * assign.cs (DoResolve, Emit): Clean up code considerably.
22842 * ../errors/bug10.cs : Add.
22844 * ../errors/cs0070.cs : Add.
22846 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22848 * assign.cs : Get rid of EventIsLocal everywhere.
22850 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22852 * ecore.cs (ConvertIntLiteral): finished the implementation.
22854 * statement.cs (SwitchLabel): Convert the value we are using as a
22855 key before looking up the table.
22857 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22859 * codegen.cs (EmitTopBlock): Require a Location argument now.
22861 * cs-parser.jay (constructor_declarator): We need to setup
22862 current_local_parameters before we parse the
22863 opt_constructor_initializer, to allow the variables to be bound
22864 to the constructor arguments.
22866 * rootcontext.cs (LookupType): First lookup nested classes in our
22867 class and our parents before we go looking outside our class.
22869 * expression.cs (ConstantFold): Extract/debox the values at the
22872 * rootcontext.cs (EmitCode): Resolve the constants first before we
22873 resolve the types. This is not really needed, but it helps debugging.
22875 * statement.cs: report location.
22877 * cs-parser.jay: pass location to throw statement.
22879 * driver.cs: Small bug fix.
22881 * report.cs: Updated format to be 4-zero filled digits.
22883 2001-12-22 Ravi Pratap <ravi@ximian.com>
22885 * expression.cs (CheckIndices): Fix minor bug where the wrong
22886 variable was being referred to ;-)
22888 (DoEmit): Do not call EmitStaticInitializers when the
22889 underlying type is System.Object.
22891 2001-12-21 Ravi Pratap <ravi@ximian.com>
22893 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22894 and do the usual workaround for SRE.
22896 * class.cs (MyEventBuilder.EventType): New member to get at the type
22897 of the event, quickly.
22899 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22901 * assign.cs (Assign.DoResolve): Handle the case when the target
22902 is an EventExpr and perform the necessary checks.
22904 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22907 (SimpleName.MemberStaticCheck): Include check for EventExpr.
22909 (EventExpr): Set the type in the constructor itself since we
22910 are meant to be born fully resolved.
22912 (EventExpr.Define): Revert code I wrote earlier.
22914 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22915 instance expression is null. The instance expression is a This in that case
22916 or a null, depending on whether it is a static method or not.
22918 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22919 refers to more than one method.
22921 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22922 and accordingly flag errors.
22924 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22926 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22928 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22930 * location.cs (ToString): Provide useful rutine.
22932 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22934 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22935 objects, return the actual integral boxed.
22937 * statement.cs (SwitchLabel): define an ILLabel for each
22940 (Switch.CheckSwitch): If the value is a Literal, extract
22941 the underlying literal.
22943 Also in the unused hashtable we had, add the SwitchLabel so we can
22944 quickly look this value up.
22946 * constant.cs: Implement a bunch of new constants. Rewrite
22947 Literal based on this. Made changes everywhere to adapt to this.
22949 * expression.cs (Expression.MakeByteBlob): Optimize routine by
22950 dereferencing array only once, and also copes with enumrations.
22952 bytes are two bytes wide, not one.
22954 (Cast): Perform constant conversions.
22956 * ecore.cs (TryImplicitIntConversion): Return literals instead of
22957 wrappers to the literals here.
22959 * expression.cs (DoNumericPromotions): long literals can converted
22960 to ulong implicity (this is taken care of elsewhere, but I was
22961 missing this spot).
22963 * ecore.cs (Expression.Literalize): Make the return type Literal,
22964 to improve type checking.
22966 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22968 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22970 * literal.cs: Revert code from ravi that checked the bounds. The
22971 bounds are sane by the definition of the type itself.
22973 * typemanager.cs: Fix implementation of ImplementsInterface. We
22974 need to actually look up in our parent hierarchy for interfaces
22977 * const.cs: Use the underlying type for enumerations
22979 * delegate.cs: Compute the basename for the delegate creation,
22980 that should fix the delegate test case, and restore the correct
22981 Type Lookup semantics in rootcontext
22983 * rootcontext.cs: Revert Ravi's last patch. The correct way of
22984 referencing a nested type with the Reflection API is using the "+"
22987 * cs-parser.jay: Do not require EOF token at the end.
22989 2001-12-20 Ravi Pratap <ravi@ximian.com>
22991 * rootcontext.cs (LookupType): Concatenate type names with
22992 a '.' instead of a '+' The test suite passes again.
22994 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22995 field of the enumeration.
22997 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22998 the case when the member is an EventExpr.
23000 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
23001 static has an associated instance expression.
23003 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
23005 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
23007 * class.cs (Event.Define): Register event and perform appropriate checks
23010 We define the Add and Remove methods even if the use provides none because
23011 in that case, we provide default implementations ourselves.
23013 Define a private field of the type of the event. This is done by the CSC compiler
23014 and we should be doing it too ;-)
23016 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
23017 More methods we use in code we generate.
23019 (multicast_delegate_type, delegate_type): Two separate types since the distinction
23022 (InitCoreTypes): Update accordingly for the above.
23024 * class.cs (Event.Emit): Generate code for default accessors that we provide
23026 (EmitDefaultMethod): Do the job in the above.
23028 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
23031 2001-12-20 Miguel de Icaza <miguel@ximian.com>
23033 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
23034 builders even if we were missing one.
23036 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
23037 pass the Basename as our class name instead of the Name. The
23038 basename will be correctly composed for us.
23040 * parameter.cs (Paramters): Now takes a Location argument.
23042 * decl.cs (DeclSpace.LookupType): Removed convenience function and
23043 make all the code call directly LookupType in RootContext and take
23044 this chance to pass the Location information everywhere.
23046 * Everywhere: pass Location information.
23048 2001-12-19 Miguel de Icaza <miguel@ximian.com>
23050 * class.cs (Constructor.Define): Updated way of detecting the
23051 length of the parameters.
23053 (TypeContainer.DefineType): Use basename as the type name for
23056 (TypeContainer.Define): Do not recursively define types here, as
23057 definition is taken care in order by the RootContext.
23059 * tree.cs: Keep track of namespaces in a per-file basis.
23061 * parameter.cs (Parameter.ComputeSignature): Update to use
23064 (Parameters.GetSignature): ditto.
23066 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
23067 instead of a TypeContainer.
23069 (Interface.SemanticAnalysis): Use `this' instead of our parent to
23070 resolve names. Because we need to be resolve in our context, not
23073 * driver.cs: Implement response files.
23075 * class.cs (TypeContainer.DefineType): If we are defined, do not
23076 redefine ourselves.
23078 (Event.Emit): Emit the code for add/remove handlers.
23079 (Event.Define): Save the MethodBuilders for add/remove.
23081 * typemanager.cs: Use pair here too.
23083 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
23084 DictionaryEntry requires the first argument to be non-null.
23086 (enum_declaration): Compute full name for registering the
23089 (delegate_declaration): Instead of using
23090 formal_parameter_list, use opt_formal_parameter_list as the list
23093 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
23094 (EventParsing): New property that controls whether `add' and
23095 `remove' are returned as tokens or identifiers (for events);
23097 2001-12-19 Ravi Pratap <ravi@ximian.com>
23099 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
23100 use MyEventBuilder only and let it wrap the real builder for us.
23102 (MyEventBuilder): Revamp constructor etc.
23104 Implement all operations that we perform on EventBuilder in precisely the same
23107 (FindMembers): Update to use the EventBuilder member.
23109 (Event.Emit): Update accordingly.
23111 2001-12-18 Ravi Pratap <ravi@ximian.com>
23113 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
23114 by calling the appropriate methods.
23116 (GetCustomAttributes): Make stubs as they cannot possibly do anything
23119 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
23121 2001-12-17 Ravi Pratap <ravi@ximian.com>
23123 * delegate.cs (Delegate.Populate): Check that the return type
23124 and various parameters types are indeed accessible.
23126 * class.cs (Constructor.Define): Same here.
23128 (Field.Define): Ditto.
23130 (Event.Define): Ditto.
23132 (Operator.Define): Check that the underlying Method defined itself
23133 correctly - so it's MethodBuilder should not be null.
23135 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
23136 expression happens to be null.
23138 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
23139 members but as of now we don't seem to be able to do anything really useful with it.
23141 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
23142 not the EventBuilder.
23144 2001-12-18 Miguel de Icaza <miguel@ximian.com>
23146 * cs-tokenizer.cs: Add support for defines.
23147 Add support for #if, #elif, #else, #endif
23149 (eval_var): evaluates a variable.
23150 (eval): stubbed for evaluating functions.
23152 * cs-parser.jay: Pass the defines information
23154 * driver.cs: Add --define command line option.
23156 * decl.cs: Move MemberCore here.
23158 Make it the base class for DeclSpace. This allows us to catch and
23159 report 108 and 109 for everything now.
23161 * class.cs (TypeContainer.Define): Extract all the members
23162 before populating and emit the warning 108 (new keyword required
23163 to override) instead of having each member implement this.
23165 (MemberCore.Define): New abstract method, we will be using this in
23166 the warning reporting engine in Populate.
23168 (Operator.Define): Adjust to new MemberCore protocol.
23170 * const.cs (Const): This does not derive from Expression, it is a
23171 temporary object we use to create fields, it is a MemberCore.
23173 * class.cs (Method.Define): Allow the entry point to be in a
23176 * driver.cs: Rewrite the argument handler to clean it up a bit.
23178 * rootcontext.cs: Made it just an auxiliary namespace feature by
23179 making everything static.
23181 * driver.cs: Adapt code to use RootContext type name instead of
23184 * delegate.cs: Remove RootContext argument.
23186 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
23189 * class.cs (Event.Define): The lookup can fail.
23191 * cs-tokenizer.cs: Begin implementation of pre-procesor.
23193 * expression.cs: Resolve the this instance before invoking the code.
23195 2001-12-17 Miguel de Icaza <miguel@ximian.com>
23197 * cs-parser.jay: Add a production in element_access that allows
23198 the thing to become a "type" reference. This way we can parse
23199 things like "(string [])" as a type.
23201 Note that this still does not handle the more complex rules of
23205 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
23207 * ecore.cs: (CopyNewMethods): new utility function used to
23208 assemble the list of methods from running FindMembers.
23210 (MemberLookup): Rework FindMembers so that
23212 2001-12-16 Miguel de Icaza <miguel@ximian.com>
23214 * class.cs (TypeContainer): Remove Delegates who fail to be
23217 * delegate.cs (Populate): Verify that we dont get null return
23218 values. TODO: Check for AsAccessible.
23220 * cs-parser.jay: Use basename to emit error 574 (destructor should
23221 have the same name as container class), not the full name.
23223 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
23224 possible representation.
23226 Also implements integer type suffixes U and L.
23228 2001-12-15 Miguel de Icaza <miguel@ximian.com>
23230 * expression.cs (ArrayCreation.DoResolve): We need to do the
23231 argument resolution *always*.
23233 * decl.cs: Make this hold the namespace. Hold the root context as
23235 (LookupType): Move here.
23237 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
23239 * location.cs (Row, Name): Fixed the code, it was always returning
23240 references to the first file.
23242 * interface.cs: Register properties defined through interfaces.
23244 * driver.cs: Add support for globbing on the command line
23246 * class.cs (Field): Make it derive from MemberCore as well.
23249 2001-12-15 Ravi Pratap <ravi@ximian.com>
23251 * class.cs (Event::Define): Check that the type of the event is a delegate
23252 type else flag error #66.
23254 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
23257 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
23258 values of EntryPoint, CharSet etc etc.
23260 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
23262 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
23263 be null and we should ignore this. I am not sure if this is really clean. Apparently,
23264 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
23265 which needs this to do its work.
23267 * ../errors/cs0066.cs : Add.
23269 2001-12-14 Miguel de Icaza <miguel@ximian.com>
23271 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
23274 * class.cs: (MethodSignature.MethodSignature): Removed hack that
23275 clears out the parameters field.
23276 (MemberSignatureCompare): Cleanup
23278 (MemberCore): New base class used to share code between MethodCore
23281 (RegisterRequiredImplementations) BindingFlags.Public requires
23282 either BindingFlags.Instace or Static. Use instance here.
23284 (Property): Refactored code to cope better with the full spec.
23286 * parameter.cs (GetParameterInfo): Return an empty array instead
23289 * class.cs (Property): Abstract or extern properties have no bodies.
23291 * parameter.cs (GetParameterInfo): return a zero-sized array.
23293 * class.cs (TypeContainer.MethodModifiersValid): Move all the
23294 method modifier validation to the typecontainer so we can reuse
23295 this on properties.
23297 (MethodCore.ParameterTypes): return an empty sized array of types.
23299 (Property.Define): Test property modifier validity.
23301 Add tests for sealed/override too.
23303 (Method.Emit): abstract or extern methods have no bodies.
23305 2001-12-14 Ravi Pratap <ravi@ximian.com>
23307 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
23310 (Method::Define, ::Emit): Modify accordingly.
23312 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
23314 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
23316 * makefile: Pass in /unsafe.
23318 2001-12-13 Miguel de Icaza <miguel@ximian.com>
23320 * class.cs (MakeKey): Kill routine.
23322 * class.cs (TypeContainer.Define): Correctly define explicit
23323 method implementations (they require the full interface name plus
23326 * typemanager.cs: Deply the PtrHashtable here and stop using the
23327 lame keys. Things work so much better.
23329 This of course broke everyone who depended on `RegisterMethod' to
23330 do the `test for existance' test. This has to be done elsewhere.
23332 * support.cs (PtrHashtable): A hashtable that avoid comparing with
23333 the object stupid Equals method (because, that like fails all over
23334 the place). We still do not use it.
23336 * class.cs (TypeContainer.SetRequiredInterface,
23337 TypeContainer.RequireMethods): Killed these two routines and moved
23338 all the functionality to RegisterRequiredImplementations.
23340 (TypeContainer.RegisterRequiredImplementations): This routine now
23341 registers all the implementations required in an array for the
23342 interfaces and abstract methods. We use an array of structures
23343 which can be computed ahead of time to reduce memory usage and we
23344 also assume that lookups are cheap as most classes will not
23345 implement too many interfaces.
23347 We also avoid creating too many MethodSignatures.
23349 (TypeContainer.IsInterfaceMethod): Update and optionally does not
23350 clear the "pending" bit if we find that there are problems with
23353 (TypeContainer.VerifyPendingMethods): Update to report errors of
23354 methods that look like implementations but are not.
23356 (TypeContainer.Define): Add support for explicit interface method
23359 2001-12-12 Miguel de Icaza <miguel@ximian.com>
23361 * typemanager.cs: Keep track of the parameters here instead of
23362 being a feature of the TypeContainer.
23364 * class.cs: Drop the registration of parameters here, as
23365 InterfaceMethods are also interface declarations.
23367 * delegate.cs: Register methods with the TypeManager not only with
23368 the TypeContainer. This code was buggy.
23370 * interface.cs: Full registation here.
23372 2001-12-11 Miguel de Icaza <miguel@ximian.com>
23374 * expression.cs: Remove reducer for binary expressions, it can not
23377 * const.cs: Put here the code that used to go into constant.cs
23379 * constant.cs: Put here the code for constants, this is a new base
23380 class for Literals.
23382 * literal.cs: Make Literal derive from Constant.
23384 2001-12-09 Miguel de Icaza <miguel@ximian.com>
23386 * statement.cs (Return.Emit): Report error 157 if the user
23387 attempts to return from a finally block.
23389 (Return.Emit): Instead of emitting a return, jump to the end of
23392 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23393 LocalBuilder to store the result of the function. ReturnLabel is
23394 the target where we jump.
23397 2001-12-09 Radek Doulik <rodo@ximian.com>
23399 * cs-parser.jay: remember alias in current namespace
23401 * ecore.cs (SimpleName::DoResolve): use aliases for types or
23404 * class.cs (LookupAlias): lookup alias in my_namespace
23406 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23408 (LookupAlias): lookup alias in this and if needed in parent
23411 2001-12-08 Miguel de Icaza <miguel@ximian.com>
23415 * rootcontext.cs: (ModuleBuilder) Made static, first step into
23416 making things static. I need this to avoid passing the
23417 TypeContainer when calling ParameterType.
23419 * support.cs (InternalParameters.ParameterType): Remove ugly hack
23420 that did string manipulation to compute the type and then call
23421 GetType. Use Parameter.ParameterType instead.
23423 * cs-tokenizer.cs: Consume the suffix for floating values.
23425 * expression.cs (ParameterReference): figure out whether this is a
23426 reference parameter or not. Kill an extra variable by computing
23427 the arg_idx during emission.
23429 * parameter.cs (Parameters.GetParameterInfo): New overloaded
23430 function that returns whether a parameter is an out/ref value or not.
23432 (Parameter.ParameterType): The type of the parameter (base,
23433 without ref/out applied).
23435 (Parameter.Resolve): Perform resolution here.
23436 (Parameter.ExternalType): The full type (with ref/out applied).
23438 * statement.cs (Using.Emit, Using.EmitExpression): Implement
23439 support for expressions on the using statement.
23441 2001-12-07 Miguel de Icaza <miguel@ximian.com>
23443 * statement.cs (Using.EmitLocalVariableDecls): Split the
23444 localvariable handling of the using statement.
23446 (Block.EmitMeta): Keep track of variable count across blocks. We
23447 were reusing slots on separate branches of blocks.
23449 (Try.Emit): Emit the general code block, we were not emitting it.
23451 Check the type of the declaration to be an IDisposable or
23452 something that can be implicity converted to it.
23454 Emit conversions if required.
23456 * ecore.cs (EmptyExpression): New utility class.
23457 (Expression.ImplicitConversionExists): New utility function.
23459 2001-12-06 Miguel de Icaza <miguel@ximian.com>
23461 * statement.cs (Using): Implement.
23463 * expression.cs (LocalVariableReference): Support read only variables.
23465 * statement.cs: Remove the explicit emit for the Leave opcode.
23466 (VariableInfo): Add a readonly field.
23468 2001-12-05 Miguel de Icaza <miguel@ximian.com>
23470 * ecore.cs (ConvCast): new class used to encapsulate the various
23471 explicit integer conversions that works in both checked and
23472 unchecked contexts.
23474 (Expression.ConvertNumericExplicit): Use new ConvCast class to
23475 properly generate the overflow opcodes.
23477 2001-12-04 Miguel de Icaza <miguel@ximian.com>
23479 * statement.cs: The correct type for the EmptyExpression is the
23480 element_type, not the variable type. Ravi pointed this out.
23482 2001-12-04 Ravi Pratap <ravi@ximian.com>
23484 * class.cs (Method::Define): Handle PInvoke methods specially
23485 by using DefinePInvokeMethod instead of the usual one.
23487 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23488 above to do the task of extracting information and defining the method.
23490 2001-12-04 Ravi Pratap <ravi@ximian.com>
23492 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23493 of the condition for string type.
23495 (Emit): Move that here.
23497 (ArrayCreation::CheckIndices): Keep string literals in their expression
23500 (EmitDynamicInitializers): Handle strings appropriately.
23502 2001-12-04 Miguel de Icaza <miguel@ximian.com>
23504 * codegen.cs (EmitContext): Replace multiple variables with a
23505 single pointer to the current Switch statement.
23507 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23510 2001-12-03 Miguel de Icaza <miguel@ximian.com>
23514 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23517 (Foreach.Emit): Foreach on arrays was not setting
23518 up the loop variables (for break/continue).
23520 (GotoCase): Semi-implented.
23522 2001-12-03 Ravi Pratap <ravi@ximian.com>
23524 * attribute.cs (CheckAttribute): Handle system attributes by using
23525 Attribute.GetAttributes to examine information we need.
23527 (GetValidPlaces): Same here.
23529 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23531 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23533 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23535 (Method::Define): Set appropriate flags if we have a DllImport attribute.
23537 (Method::Emit): Handle the case when we are a PInvoke method.
23539 2001-12-03 Miguel de Icaza <miguel@ximian.com>
23541 * expression.cs: Use ResolveWithSimpleName on compound names.
23543 2001-12-02 Ravi Pratap <ravi@ximian.com>
23545 * constant.cs (EmitConstant): Make sure we resolve the associated expression
23546 before trying to reduce it.
23548 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23550 * constant.cs (LookupConstantValue): Implement.
23552 (EmitConstant): Use the above in emitting the constant.
23554 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23555 that are user-defined by doing a LookupConstantValue on them.
23557 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23560 2001-11-29 Miguel de Icaza <miguel@ximian.com>
23562 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23564 (BaseAccess.DoResolve): Implement.
23566 (MemberAccess.DoResolve): Split this routine into a
23567 ResolveMemberAccess routine that can be used independently
23569 2001-11-28 Miguel de Icaza <miguel@ximian.com>
23571 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23572 As that share bits of the implementation. Is returns a boolean,
23573 while As returns the Type that is being probed.
23575 2001-12-01 Ravi Pratap <ravi@ximian.com>
23577 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23578 instead of a Literal - much easier.
23580 (EnumInTransit): Remove - utterly useless :-)
23582 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23584 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23586 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23587 chain when we have no associated expression.
23589 2001-11-30 Ravi Pratap <ravi@ximian.com>
23591 * constant.cs (Define): Use Location while reporting the errror.
23593 Also emit a warning when 'new' is used and there is no inherited
23596 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
23599 (LookupEnumValue): Implement to lookup an enum member's value and define it
23602 (Populate): Re-write accordingly to use the above routine.
23604 2001-11-27 Miguel de Icaza <miguel@ximian.com>
23606 * expression.cs (This): Fix prototype for DoResolveLValue to
23607 override the base class DoResolveLValue.
23609 * cs-parser.cs: Report errors cs574 and cs575 (destructor
23612 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23613 (we need to load the address of the field here). This fixes
23616 (FieldExpr.DoResolveLValue): Call the DoResolve
23617 function to initialize the Instance expression.
23619 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23620 correctly the GetEnumerator operation on a value type.
23622 * cs-parser.jay: Add more simple parsing error catches.
23624 * statement.cs (Switch): Add support for string switches.
23625 Handle null specially.
23627 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
23629 2001-11-28 Ravi Pratap <ravi@ximian.com>
23631 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23633 (declare_local_constant): New helper function.
23635 * statement.cs (AddConstant): Keep a separate record of constants
23637 (IsConstant): Implement to determine if a variable is a constant.
23639 (GetConstantExpression): Implement.
23641 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23643 * statement.cs (IsVariableDefined): Re-write.
23645 2001-11-27 Ravi Pratap <ravi@ximian.com>
23647 * class.cs (TypeContainer::FindMembers): Look for constants
23648 in the case when we are looking for MemberTypes.Field
23650 * expression.cs (MemberAccess::DoResolve): Check that in the
23651 case we are a FieldExpr and a Literal, we are not being accessed
23652 by an instance reference.
23654 * cs-parser.jay (local_constant_declaration): Implement.
23656 (declaration_statement): Implement for constant declarations.
23658 2001-11-26 Miguel de Icaza <miguel@ximian.com>
23660 * statement.cs (Switch): Catch double defaults.
23662 (Switch): More work on the switch() statement
23663 implementation. It works for integral values now, need to finish
23667 2001-11-24 Miguel de Icaza <miguel@ximian.com>
23669 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23670 integer literals into other integer literals. To be used by
23673 2001-11-24 Ravi Pratap <ravi@ximian.com>
23675 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23678 (EmitDynamicInitializers): Cope with the above since we extract data
23679 directly from ArrayData now.
23681 (ExpectInitializers): Keep track of whether initializers are mandatory
23684 (Bounds): Make it a hashtable to prevent the same dimension being
23685 recorded for every element in that dimension.
23687 (EmitDynamicInitializers): Fix bug which prevented the Set array method
23690 Also fix bug which was causing the indices to be emitted in the reverse
23693 2001-11-24 Miguel de Icaza <miguel@ximian.com>
23695 * expression.cs (ArrayCreation): Implement the bits that Ravi left
23696 unfinished. They do not work, because the underlying code is
23699 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23701 * cs-parser.jay: Remove bogus fixme.
23703 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23704 on Switch statement.
23706 2001-11-23 Ravi Pratap <ravi@ximian.com>
23708 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23711 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23712 parameter. Apparently, any expression is allowed.
23714 (ValidateInitializers): Update accordingly.
23716 (CheckIndices): Fix some tricky bugs thanks to recursion.
23718 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
23719 I was being completely brain-dead.
23721 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23722 and re-write acordingly.
23724 (DelegateInvocation): Re-write accordingly.
23726 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23728 (MakeByteBlob): Handle types more correctly.
23730 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23731 initialization from expressions but it is incomplete because I am a complete
23734 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23736 * statement.cs (If.Emit): Fix a bug that generated incorrect code
23737 on If. Basically, we have to return `true' (ie, we do return to
23738 our caller) only if both branches of the if return.
23740 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23741 short-circuit operators, handle them as short circuit operators.
23743 (Cast.DoResolve): Resolve type.
23744 (Cast.Cast): Take an expression as the target type.
23746 * cs-parser.jay (cast_expression): Remove old hack that only
23747 allowed a limited set of types to be handled. Now we take a
23748 unary_expression and we resolve to a type during semantic
23751 Use the grammar productions from Rhys to handle casts (this is
23752 not complete like Rhys syntax yet, we fail to handle that corner
23753 case that C# has regarding (-x), but we will get there.
23755 2001-11-22 Ravi Pratap <ravi@ximian.com>
23757 * class.cs (EmitFieldInitializer): Take care of the case when we have a
23758 field which is an array type.
23760 * cs-parser.jay (declare_local_variables): Support array initialization too.
23762 * typemanager.cs (MakeKey): Implement.
23764 (everywhere): Use the above appropriately.
23766 * cs-parser.jay (for_statement): Update for array initialization while
23767 declaring variables.
23769 * ecore.cs : The error message was correct, it's the variable's names that
23770 were misleading ;-) Make the code more readable.
23772 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23773 the correct type etc.
23775 (ConvertExplicit): Handle Enum types by examining the underlying type.
23777 2001-11-21 Ravi Pratap <ravi@ximian.com>
23779 * parameter.cs (GetCallingConvention): Always return
23780 CallingConventions.Standard for now.
23782 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23784 * expression.cs (Binary.ResolveOperator): Update the values of `l'
23785 and `r' after calling DoNumericPromotions.
23787 * ecore.cs: Fix error message (the types were in the wrong order).
23789 * statement.cs (Foreach.ProbeCollectionType): Need to pass
23790 BindingFlags.Instance as well
23792 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23793 implicit int literal conversion in an empty cast so that we
23794 propagate the right type upstream.
23796 (UnboxCast): new class used to unbox value types.
23797 (Expression.ConvertExplicit): Add explicit type conversions done
23800 (Expression.ImplicitNumericConversion): Oops, forgot to test for
23801 the target type before applying the implicit LongLiterals to ULong
23804 2001-11-21 Miguel de Icaza <miguel@ximian.com>
23806 * cs-parser.jay (for_statement): Reworked the way For works: now
23807 we declare manually any variables that are introduced in
23808 for_initializer to solve the problem of having out-of-band code
23809 emition (that is what got for broken).
23811 (declaration_statement): Perform the actual variable declaration
23812 that used to be done in local_variable_declaration here.
23814 (local_variable_declaration): Do not declare anything, just pass
23815 the information on a DictionaryEntry
23817 2001-11-20 Ravi Pratap <ravi@ximian.com>
23819 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23820 re-write of the logic to now make it recursive.
23822 (UpdateIndices): Re-write accordingly.
23824 Store element data in a separate ArrayData list in the above methods.
23826 (MakeByteBlob): Implement to dump the array data into a byte array.
23828 2001-11-19 Ravi Pratap <ravi@ximian.com>
23830 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23833 * constant.cs (Define): Implement.
23835 (EmitConstant): Re-write fully.
23837 Pass in location info.
23839 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23842 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23843 DictionaryEntry since we need location info too.
23845 (constant_declaration): Update accordingly.
23847 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23848 code into another method : UpdateIndices.
23850 2001-11-18 Ravi Pratap <ravi@ximian.com>
23852 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23853 some type checking etc.
23855 2001-11-17 Ravi Pratap <ravi@ximian.com>
23857 * expression.cs (ArrayCreation::ValidateInitializers): Implement
23858 bits to provide dimension info if the user skips doing that.
23860 Update second constructor to store the rank correctly.
23862 2001-11-16 Ravi Pratap <ravi@ximian.com>
23864 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23865 and try to implement.
23867 * ../errors/cs0150.cs : Add.
23869 * ../errors/cs0178.cs : Add.
23871 2001-11-16 Miguel de Icaza <miguel@ximian.com>
23873 * statement.cs: Implement foreach on multi-dimensional arrays.
23875 * parameter.cs (Parameters.GetParameterByName): Also lookup the
23876 name of the params argument.
23878 * expression.cs: Use EmitStoreOpcode to get the right opcode while
23879 initializing the array.
23881 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23882 we can use this elsewhere.
23884 * statement.cs: Finish implementation of foreach for single
23887 * cs-parser.jay: Use an out-of-band stack to pass information
23888 around, I wonder why I need this.
23890 foreach_block: Make the new foreach_block the current_block.
23892 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23893 function used to return a static Parameters structure. Used for
23894 empty parameters, as those are created very frequently.
23896 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23898 2001-11-15 Ravi Pratap <ravi@ximian.com>
23900 * interface.cs : Default modifier is private, not public. The
23901 make verify test passes again.
23903 2001-11-15 Ravi Pratap <ravi@ximian.com>
23905 * support.cs (ReflectionParameters): Fix logic to determine
23906 whether the last parameter is a params one. Test 9 passes again.
23908 * delegate.cs (Populate): Register the builders we define with
23909 RegisterParameterForBuilder. Test 19 passes again.
23911 * cs-parser.jay (property_declaration): Reference $6 instead
23912 of $$ to get at the location.
23914 (indexer_declaration): Similar stuff.
23916 (attribute): Ditto.
23918 * class.cs (Property): Register parameters for the Get and Set methods
23919 if they exist. Test 23 passes again.
23921 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23922 call to EmitArguments as we are sure there aren't any params arguments.
23923 Test 32 passes again.
23925 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23926 IndexOutOfRangeException.
23928 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23929 Test 33 now passes again.
23931 2001-11-15 Miguel de Icaza <miguel@ximian.com>
23933 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23934 broke a bunch of things. Will have to come up with a better way
23935 of tracking locations.
23937 * statement.cs: Implemented foreach for single dimension arrays.
23939 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23941 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23942 an error. This removes the lookup from the critical path.
23944 * cs-parser.jay: Removed use of temporary_loc, which is completely
23947 2001-11-14 Miguel de Icaza <miguel@ximian.com>
23949 * support.cs (ReflectionParameters.ParameterModifier): Report
23950 whether the argument is a PARAMS argument or not.
23952 * class.cs: Set the attribute `ParamArrayAttribute' on the
23953 parameter argument.
23955 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23956 and cons_param_array_attribute (ConstructorInfo for
23957 ParamArrayAttribute).,
23959 * codegen.cs: Emit the return using the `Return' statement, that
23960 way we can report the error correctly for missing return values.
23962 * class.cs (Method.Emit): Clean up.
23964 * expression.cs (Argument.Resolve): Take another argument: the
23965 location where this argument is used. Notice that this is not
23966 part of the "Argument" class as to reduce the size of the
23967 structure (we know the approximate location anyways).
23969 Test if the argument is a variable-reference, if not, then
23970 complain with a 206.
23972 (Argument.Emit): Emit addresses of variables.
23974 (Argument.FullDesc): Simplify.
23976 (Invocation.DoResolve): Update for Argument.Resolve.
23978 (ElementAccess.DoResolve): ditto.
23980 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23981 method should be virtual, as this method is always virtual.
23983 (NewDelegate.DoResolve): Update for Argument.Resolve.
23985 * class.cs (ConstructorInitializer.DoResolve): ditto.
23987 * attribute.cs (Attribute.Resolve): ditto.
23989 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23991 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23993 * expression.cs (ParameterReference): Drop IStackStorage and implement
23994 IAssignMethod instead.
23996 (LocalVariableReference): ditto.
23998 * ecore.cs (FieldExpr): Drop IStackStorage and implement
23999 IAssignMethod instead.
24001 2001-11-13 Miguel de Icaza <miguel@ximian.com>
24003 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
24004 enumerations that are used in heavily used structures derive from
24005 byte in a laughable and pathetic attempt to reduce memory usage.
24006 This is the kind of pre-optimzations that you should not do at
24007 home without adult supervision.
24009 * expression.cs (UnaryMutator): New class, used to handle ++ and
24010 -- separatedly from the other unary operators. Cleans up the
24011 code, and kills the ExpressionStatement dependency in Unary.
24013 (Unary): Removed `method' and `Arguments' from this class, making
24014 it smaller, and moving it all to SimpleCall, so I can reuse this
24015 code in other locations and avoid creating a lot of transient data
24016 strucutres when not required.
24018 * cs-parser.jay: Adjust for new changes.
24020 2001-11-11 Miguel de Icaza <miguel@ximian.com>
24022 * enum.cs (Enum.Populate): If there is a failure during
24025 * cs-parser.jay (opt_enum_base): we used to catch type errors
24026 here, but this is really incorrect. The type error should be
24027 catched during semantic analysis.
24029 2001-12-11 Ravi Pratap <ravi@ximian.com>
24031 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
24032 current_local_parameters as expected since I, in my stupidity, had forgotten
24035 * attribute.cs (GetValidPlaces): Fix stupid bug.
24037 * class.cs (Method::Emit): Perform check on applicability of attributes.
24039 (Constructor::Emit): Ditto.
24041 (Field::Emit): Ditto.
24043 (Field.Location): Store location information.
24045 (Property, Event, Indexer, Operator): Ditto.
24047 * cs-parser.jay (field_declaration): Pass in location for each field.
24049 * ../errors/cs0592.cs : Add.
24051 2001-11-12 Ravi Pratap <ravi@ximian.com>
24053 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
24055 (InitCoreTypes): Update accordingly.
24057 (RegisterAttrType, LookupAttr): Implement.
24059 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
24060 info about the same.
24062 (Resolve): Update to populate the above as necessary.
24064 (Error592): Helper.
24066 (GetValidPlaces): Helper to the above.
24068 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
24070 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
24072 2001-11-12 Ravi Pratap <ravi@ximian.com>
24074 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
24076 * ../errors/cs0617.cs : Add.
24078 2001-11-11 Ravi Pratap <ravi@ximian.com>
24080 * enum.cs (Emit): Rename to Populate to be more consistent with what
24081 we expect it to do and when exactly it is called.
24083 * class.cs, rootcontext.cs : Update accordingly.
24085 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
24086 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
24088 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
24090 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
24091 of a fieldinfo using the above, when dealing with a FieldBuilder.
24093 2001-11-10 Ravi Pratap <ravi@ximian.com>
24095 * ../errors/cs0031.cs : Add.
24097 * ../errors/cs1008.cs : Add.
24099 * ../errrors/cs0543.cs : Add.
24101 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
24104 (FindMembers): Implement.
24106 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
24107 enums and delegates too.
24109 (enum_types): Rename to builder_to_enum.
24111 (delegate_types): Rename to builder_to_delegate.
24113 * delegate.cs (FindMembers): Implement.
24115 2001-11-09 Ravi Pratap <ravi@ximian.com>
24117 * typemanager.cs (IsEnumType): Implement.
24119 * enum.cs (Emit): Re-write parts to account for the underlying type
24120 better and perform checking etc.
24122 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
24123 of the underlying type.
24125 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
24128 * enum.cs (error31): Helper to report error #31.
24130 * cs-parser.jay (enum_declaration): Store location of each member too.
24132 * enum.cs (member_to_location): New hashtable.
24134 (AddEnumMember): Update location hashtable.
24136 (Emit): Use the location of each member while reporting errors.
24138 2001-11-09 Miguel de Icaza <miguel@ximian.com>
24140 * cs-parser.jay: A for_initializer if is a
24141 local_variable_declaration really ammount to have an implicit
24142 block with the variable declaration and no initializer for for.
24144 * statement.cs (For.Emit): Cope with null initializers.
24146 This fixes the infinite loop on for initializers.
24148 2001-11-08 Miguel de Icaza <miguel@ximian.com>
24150 * enum.cs: More cleanup.
24152 * ecore.cs: Remove dead code.
24154 * class.cs (Property.Emit): More simplification.
24155 (Event.Emit): ditto.
24157 Reworked to have less levels of indentation.
24159 2001-11-08 Ravi Pratap <ravi@ximian.com>
24161 * class.cs (Property): Emit attributes.
24171 * enum.cs (Emit): Ditto.
24173 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
24176 * class.cs (Field, Event, etc.): Move attribute generation into the
24177 Emit method everywhere.
24179 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
24180 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
24181 as we had no way of defining nested enums !
24183 * rootcontext.cs : Adjust code accordingly.
24185 * typemanager.cs (AddEnumType): To keep track of enum types separately.
24187 2001-11-07 Ravi Pratap <ravi@ximian.com>
24189 * expression.cs (EvalConstantExpression): Move into ecore.cs
24191 * enum.cs (Enum): Rename some members and make them public and readonly
24192 according to our convention.
24194 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
24197 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
24199 (Enum::Emit): Write a simple version for now which doesn't try to compute
24200 expressions. I shall modify this to be more robust in just a while.
24202 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
24204 (TypeContainer::CloseType): Create the Enum types too.
24206 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
24208 * expression.cs (EvalConstantExpression): Get rid of completely.
24210 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
24211 user-defined values and other cases.
24213 (IsValidEnumLiteral): Helper function.
24215 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
24216 out there in the case we had a literal FieldExpr.
24218 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
24220 (Literalize): Revamp a bit to take two arguments.
24222 (EnumLiteral): New class which derives from Literal to wrap enum literals.
24224 2001-11-06 Ravi Pratap <ravi@ximian.com>
24226 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
24228 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
24230 (Resolve): Use the above to ensure we have proper initializers.
24232 2001-11-05 Ravi Pratap <ravi@ximian.com>
24234 * expression.cs (Expression::EvalConstantExpression): New method to
24235 evaluate constant expressions.
24237 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
24239 2001-11-07 Miguel de Icaza <miguel@ximian.com>
24241 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
24244 (Binary.ResolveOperator): Handle operator != (object a, object b)
24245 and operator == (object a, object b);
24247 (Binary.DoNumericPromotions): Indicate whether the numeric
24248 promotion was possible.
24250 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
24253 Made the ArrayAccess implement interface IAssignMethod instead of
24254 IStackStore as the order in which arguments are passed reflects
24257 * assign.cs: Instead of using expr.ExprClass to select the way of
24258 assinging, probe for the IStackStore/IAssignMethod interfaces.
24260 * typemanager.cs: Load InitializeArray definition.
24262 * rootcontext.cs (RootContext.MakeStaticData): Used to define
24263 static data that can be used to initialize arrays.
24265 2001-11-05 Miguel de Icaza <miguel@ximian.com>
24267 * expression.cs: Handle operator== and operator!= for booleans.
24269 (Conditioal.Reduce): Implement reducer for the ?: operator.
24271 (Conditional.Resolve): Implement dead code elimination.
24273 (Binary.Resolve): Catch string literals and return a new
24274 concatenated string.
24276 (Unary.Reduce): Implement reduction of unary expressions.
24278 * ecore.cs: Split out the expression core handling here.
24280 (Expression.Reduce): New method used to perform constant folding
24281 and CSE. This is needed to support constant-expressions.
24283 * statement.cs (Statement.EmitBoolExpression): Pass true and false
24284 targets, and optimize for !x.
24286 2001-11-04 Ravi Pratap <ravi@ximian.com>
24288 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
24289 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
24290 set custom atttributes.
24292 * literal.cs (Literal::GetValue): New abstract method to return the actual
24293 value of the literal, cast as an object.
24295 (*Literal): Implement GetValue method.
24297 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
24298 expressions to the arraylist but objects of type Argument.
24300 * class.cs (TypeContainer::Emit): Emit our attributes too.
24302 (Method::Emit, Constructor::Emit): Ditto.
24304 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
24305 to be ignoring earlier.
24307 2001-11-03 Ravi Pratap <ravi@ximian.com>
24309 * attribute.cs (AttributeSection::Define): Implement to do the business
24310 of constructing a CustomAttributeBuilder.
24312 (Attribute): New trivial class. Increases readability of code.
24314 * cs-parser.jay : Update accordingly.
24316 (positional_argument_list, named_argument_list, named_argument): New rules
24318 (attribute_arguments): Use the above so that we are more correct.
24320 2001-11-02 Ravi Pratap <ravi@ximian.com>
24322 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
24323 to perform all checks for a method with a params parameter.
24325 (Invocation::OverloadResolve): Update to use the above method and therefore
24326 cope correctly with params method invocations.
24328 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
24331 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
24332 constructors in our parent too because we can't afford to miss out on
24335 * attribute.cs (AttributeSection): New name for the class Attribute
24337 Other trivial changes to improve readability.
24339 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
24340 use the new class names.
24342 2001-11-01 Ravi Pratap <ravi@ximian.com>
24344 * class.cs (Method::Define): Complete definition for params types too
24346 (Indexer::Define): Ditto.
24348 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
24349 Cope everywhere with a request for info about the array parameter.
24351 2001-11-01 Ravi Pratap <ravi@ximian.com>
24353 * tree.cs (RecordNamespace): Fix up to check for the correct key.
24355 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
24356 local_variable_type to extract the string corresponding to the type.
24358 (local_variable_type): Fixup the action to use the new helper method.
24360 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
24363 * expression.cs : Clean out code which uses the above.
24365 2001-10-31 Ravi Pratap <ravi@ximian.com>
24367 * typemanager.cs (RegisterMethod): Check if we already have an existing key
24368 and bale out if necessary by returning a false.
24370 (RegisterProperty): Ditto.
24372 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
24373 and print out appropriate error messages.
24375 * interface.cs (everywhere): Ditto.
24377 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
24378 location to constructor.
24380 * class.cs (Property, Event, Indexer): Update accordingly.
24382 * ../errors/cs111.cs : Added.
24384 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
24385 of a method, as laid down by the spec.
24387 (Invocation::OverloadResolve): Use the above method.
24389 2001-10-31 Ravi Pratap <ravi@ximian.com>
24391 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24392 now take a TypeContainer and a Parameters object.
24394 (ParameterData): Modify return type of ParameterModifier method to be
24395 Parameter.Modifier and not a string.
24397 (ReflectionParameters, InternalParameters): Update accordingly.
24399 * expression.cs (Argument::GetParameterModifier): Same here.
24401 * support.cs (InternalParameters::ParameterType): Find a better way of determining
24402 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24403 symbol in it at all so maybe this is only for now.
24405 2001-10-30 Ravi Pratap <ravi@ximian.com>
24407 * support.cs (InternalParameters): Constructor now takes an extra argument
24408 which is the actual Parameters class.
24410 (ParameterDesc): Update to provide info on ref/out modifiers.
24412 * class.cs (everywhere): Update call to InternalParameters to pass in
24413 the second argument too.
24415 * support.cs (ParameterData): Add ParameterModifier, which is a method
24416 to return the modifier info [ref/out etc]
24418 (InternalParameters, ReflectionParameters): Implement the above.
24420 * expression.cs (Argument::ParameterModifier): Similar function to return
24421 info about the argument's modifiers.
24423 (Invocation::OverloadResolve): Update to take into account matching modifiers
24426 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24427 a new SetFormalParameters object which we pass to InternalParameters.
24429 2001-10-30 Ravi Pratap <ravi@ximian.com>
24431 * expression.cs (NewArray): Merge into the ArrayCreation class.
24433 2001-10-29 Ravi Pratap <ravi@ximian.com>
24435 * expression.cs (NewArray): Merge classes NewBuiltinArray and
24436 NewUserdefinedArray into one as there wasn't much of a use in having
24439 * expression.cs (Argument): Change field's name to ArgType from Type.
24441 (Type): New readonly property which returns the proper type, taking into
24442 account ref/out modifiers.
24444 (everywhere): Adjust code accordingly for the above.
24446 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24447 whether we are emitting for a ref or out parameter.
24449 * expression.cs (Argument::Emit): Use the above field to set the state.
24451 (LocalVariableReference::Emit): Update to honour the flag and emit the
24454 * parameter.cs (Attributes): Set the correct flags for ref parameters.
24456 * expression.cs (Argument::FullDesc): New function to provide a full desc.
24458 * support.cs (ParameterData): Add method ParameterDesc to the interface.
24460 (ReflectionParameters, InternalParameters): Implement the above method.
24462 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24465 (Invocation::FullMethodDesc): Ditto.
24467 2001-10-29 Miguel de Icaza <miguel@ximian.com>
24469 * cs-parser.jay: Add extra production for the second form of array
24472 * expression.cs (ArrayCreation): Update to reflect the above
24475 * Small changes to prepare for Array initialization.
24477 2001-10-28 Miguel de Icaza <miguel@ximian.com>
24479 * typemanager.cs (ImplementsInterface): interface might be null;
24480 Deal with this problem;
24482 Also, we do store negative hits on the cache (null values), so use
24483 this instead of calling t.GetInterfaces on the type everytime.
24485 2001-10-28 Ravi Pratap <ravi@ximian.com>
24487 * typemanager.cs (IsBuiltinType): New method to help determine the same.
24489 * expression.cs (New::DoResolve): Get rid of array creation code and instead
24490 split functionality out into different classes.
24492 (New::FormArrayType): Move into NewBuiltinArray.
24494 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24497 (NewBuiltinArray): New class to handle creation of built-in arrays.
24499 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24500 account creation of one-dimensional arrays.
24502 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24504 (NewUserdefinedArray::DoResolve): Implement.
24506 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24508 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24509 we maintain inside the TypeManager. This is necessary to perform lookups on the
24512 (LookupType): Update to perform GetType on the module builders too.
24514 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24516 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24518 2001-10-23 Ravi Pratap <ravi@ximian.com>
24520 * expression.cs (New::DoResolve): Implement guts of array creation.
24522 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24524 2001-10-27 Miguel de Icaza <miguel@ximian.com>
24526 * expression.cs: Fix bug I introduced lsat night that broke
24529 (Expression.Resolve): Report a 246 error (can not resolve name)
24530 if we find a SimpleName in the stream.
24532 (Expression.ResolveLValue): Ditto.
24534 (Expression.ResolveWithSimpleName): This function is a variant of
24535 ResolveName, this one allows SimpleNames to be returned without a
24536 warning. The only consumer of SimpleNames is MemberAccess
24538 2001-10-26 Miguel de Icaza <miguel@ximian.com>
24540 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24541 might arrive here. I have my doubts that this is correct.
24543 * statement.cs (Lock): Implement lock statement.
24545 * cs-parser.jay: Small fixes to support `lock' and `using'
24547 * cs-tokenizer.cs: Remove extra space
24549 * driver.cs: New flag --checked, allows to turn on integer math
24552 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24553 Threading.Monitor.Exit
24555 2001-10-23 Miguel de Icaza <miguel@ximian.com>
24557 * expression.cs (IndexerAccess::DoResolveLValue): Set the
24558 Expression Class to be IndexerAccess.
24560 Notice that Indexer::DoResolve sets the eclass to Value.
24562 2001-10-22 Miguel de Icaza <miguel@ximian.com>
24564 * class.cs (TypeContainer::Emit): Emit code for indexers.
24566 * assign.cs (IAssignMethod): New interface implemented by Indexers
24567 and Properties for handling assignment.
24569 (Assign::Emit): Simplify and reuse code.
24571 * expression.cs (IndexerAccess, PropertyExpr): Implement
24572 IAssignMethod, clean up old code.
24574 2001-10-22 Ravi Pratap <ravi@ximian.com>
24576 * typemanager.cs (ImplementsInterface): New method to determine if a type
24577 implements a given interface. Provides a nice cache too.
24579 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24582 (ConvertReferenceExplicit): Ditto.
24584 * delegate.cs (Delegate::Populate): Update to define the parameters on the
24585 various methods, with correct names etc.
24587 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
24588 Operator.UnaryNegation.
24590 * cs-parser.jay (operator_declarator): Be a little clever in the case where
24591 we have a unary plus or minus operator.
24593 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
24596 * everywhere : update accordingly.
24598 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24601 * class.cs (Method::Define): For the case where we are implementing a method
24602 inherited from an interface, we need to set the MethodAttributes.Final flag too.
24603 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24605 2001-10-21 Ravi Pratap <ravi@ximian.com>
24607 * interface.cs (FindMembers): Implement to work around S.R.E
24610 * typemanager.cs (IsInterfaceType): Implement.
24612 (FindMembers): Update to handle interface types too.
24614 * expression.cs (ImplicitReferenceConversion): Re-write bits which
24615 use IsAssignableFrom as that is not correct - it doesn't work.
24617 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24618 and accordingly override EmitStatement.
24620 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24621 using the correct logic :-)
24623 2001-10-19 Ravi Pratap <ravi@ximian.com>
24625 * ../errors/cs-11.cs : Add to demonstrate error -11
24627 2001-10-17 Miguel de Icaza <miguel@ximian.com>
24629 * assign.cs (Assign::Resolve): Resolve right hand side first, and
24630 then pass this as a hint to ResolveLValue.
24632 * expression.cs (FieldExpr): Add Location information
24634 (FieldExpr::LValueResolve): Report assignment to readonly
24637 (Expression::ExprClassFromMemberInfo): Pass location information.
24639 (Expression::ResolveLValue): Add new method that resolves an
24642 (Expression::DoResolveLValue): Default invocation calls
24645 (Indexers): New class used to keep track of indexers in a given
24648 (IStackStore): Renamed from LValue, as it did not really describe
24649 what this did. Also ResolveLValue is gone from this interface and
24650 now is part of Expression.
24652 (ElementAccess): Depending on the element access type
24654 * typemanager.cs: Add `indexer_name_type' as a Core type
24655 (System.Runtime.CompilerServices.IndexerNameAttribute)
24657 * statement.cs (Goto): Take a location.
24659 2001-10-18 Ravi Pratap <ravi@ximian.com>
24661 * delegate.cs (Delegate::VerifyDelegate): New method to verify
24662 if two delegates are compatible.
24664 (NewDelegate::DoResolve): Update to take care of the case when
24665 we instantiate a delegate from another delegate.
24667 * typemanager.cs (FindMembers): Don't even try to look up members
24668 of Delegate types for now.
24670 2001-10-18 Ravi Pratap <ravi@ximian.com>
24672 * delegate.cs (NewDelegate): New class to take care of delegate
24675 * expression.cs (New): Split the delegate related code out into
24676 the NewDelegate class.
24678 * delegate.cs (DelegateInvocation): New class to handle delegate
24681 * expression.cs (Invocation): Split out delegate related code into
24682 the DelegateInvocation class.
24684 2001-10-17 Ravi Pratap <ravi@ximian.com>
24686 * expression.cs (New::DoResolve): Implement delegate creation fully
24687 and according to the spec.
24689 (New::DoEmit): Update to handle delegates differently.
24691 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24692 because of which we were printing out arguments in reverse order !
24694 * delegate.cs (VerifyMethod): Implement to check if the given method
24695 matches the delegate.
24697 (FullDelegateDesc): Implement.
24699 (VerifyApplicability): Implement.
24701 * expression.cs (Invocation::DoResolve): Update to accordingly handle
24702 delegate invocations too.
24704 (Invocation::Emit): Ditto.
24706 * ../errors/cs1593.cs : Added.
24708 * ../errors/cs1594.cs : Added.
24710 * delegate.cs (InstanceExpression, TargetMethod): New properties.
24712 2001-10-16 Ravi Pratap <ravi@ximian.com>
24714 * typemanager.cs (intptr_type): Core type for System.IntPtr
24716 (InitCoreTypes): Update for the same.
24718 (iasyncresult_type, asynccallback_type): Ditto.
24720 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24723 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24726 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24727 the builders for the 4 members of a delegate type :-)
24729 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24732 * expression.cs (New::DoResolve): Implement guts for delegate creation.
24734 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24736 2001-10-15 Miguel de Icaza <miguel@ximian.com>
24738 * statement.cs (Break::Emit): Implement.
24739 (Continue::Emit): Implement.
24741 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
24742 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
24743 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
24744 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
24747 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24748 properties that track the label for the current loop (begin of the
24749 loop and end of the loop).
24751 2001-10-15 Ravi Pratap <ravi@ximian.com>
24753 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24754 use of emitting anything at all.
24756 * class.cs, rootcontext.cs : Get rid of calls to the same.
24758 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24760 (Populate): Define the constructor correctly and set the implementation
24763 * typemanager.cs (delegate_types): New hashtable to hold delegates that
24766 (AddDelegateType): Implement.
24768 (IsDelegateType): Implement helper method.
24770 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24772 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24773 and accordingly handle it.
24775 * delegate.cs (Populate): Take TypeContainer argument.
24776 Implement bits to define the Invoke method. However, I still haven't figured out
24777 how to take care of the native int bit :-(
24779 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
24780 Qualify the name of the delegate, not its return type !
24782 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24785 (StandardConversionExists): Checking for array types turns out to be recursive.
24787 (ConvertReferenceExplicit): Implement array conversion.
24789 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24791 2001-10-12 Ravi Pratap <ravi@ximian.com>
24793 * cs-parser.jay (delegate_declaration): Store the fully qualified
24794 name as it is a type declaration.
24796 * delegate.cs (ReturnType, Name): Rename members to these. Make them
24799 (DefineDelegate): Renamed from Define. Does the same thing essentially,
24800 as TypeContainer::DefineType.
24802 (Populate): Method in which all the definition of the various methods (Invoke)
24805 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24808 (CloseDelegate): Finally creates the delegate.
24810 * class.cs (TypeContainer::DefineType): Update to define delegates.
24811 (Populate, Emit and CloseType): Do the same thing here too.
24813 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24814 delegates in all these operations.
24816 2001-10-14 Miguel de Icaza <miguel@ximian.com>
24818 * expression.cs: LocalTemporary: a new expression used to
24819 reference a temporary that has been created.
24821 * assign.cs: Handle PropertyAccess back here, so that we can
24822 provide the proper semantic access to properties.
24824 * expression.cs (Expression::ConvertReferenceExplicit): Implement
24825 a few more explicit conversions.
24827 * modifiers.cs: `NEW' modifier maps to HideBySig.
24829 * expression.cs (PropertyExpr): Make this into an
24830 ExpressionStatement, and support the EmitStatement code path.
24832 Perform get/set error checking, clean up the interface.
24834 * assign.cs: recognize PropertyExprs as targets, and if so, turn
24835 them into toplevel access objects.
24837 2001-10-12 Miguel de Icaza <miguel@ximian.com>
24839 * expression.cs: PropertyExpr::PropertyExpr: use work around the
24842 * typemanager.cs: Keep track here of our PropertyBuilders again to
24843 work around lameness in SRE.
24845 2001-10-11 Miguel de Icaza <miguel@ximian.com>
24847 * expression.cs (LValue::LValueResolve): New method in the
24848 interface, used to perform a second resolution pass for LValues.
24850 (This::DoResolve): Catch the use of this in static methods.
24852 (This::LValueResolve): Implement.
24854 (This::Store): Remove warning, assigning to `this' in structures
24857 (Invocation::Emit): Deal with invocation of
24858 methods on value types. We need to pass the address to structure
24859 methods rather than the object itself. (The equivalent code to
24860 emit "this" for structures leaves the entire structure on the
24861 stack instead of a pointer to it).
24863 (ParameterReference::DoResolve): Compute the real index for the
24864 argument based on whether the method takes or not a `this' pointer
24865 (ie, the method is static).
24867 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24868 value types returned from functions when we need to invoke a
24869 method on the sturcture.
24872 2001-10-11 Ravi Pratap <ravi@ximian.com>
24874 * class.cs (TypeContainer::DefineType): Method to actually do the business of
24875 defining the type in the Modulebuilder or Typebuilder. This is to take
24876 care of nested types which need to be defined on the TypeBuilder using
24877 DefineNestedMethod.
24879 (TypeContainer::GetClassBases): Implement. Essentially the code from the
24880 methods in RootContext, only ported to be part of TypeContainer.
24882 (TypeContainer::GetInterfaceOrClass): Ditto.
24884 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24886 * interface.cs (Interface::DefineInterface): New method. Does exactly
24887 what RootContext.CreateInterface did earlier, only it takes care of nested types
24890 (Interface::GetInterfaces): Move from RootContext here and port.
24892 (Interface::GetInterfaceByName): Same here.
24894 * rootcontext.cs (ResolveTree): Re-write.
24896 (PopulateTypes): Re-write.
24898 * class.cs (TypeContainer::Populate): Populate nested types too.
24899 (TypeContainer::Emit): Emit nested members too.
24901 * typemanager.cs (AddUserType): Do not make use of the FullName property,
24902 instead just use the name argument passed in as it is already fully
24905 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24906 to TypeContainer mapping to see if a type is user-defined.
24908 * class.cs (TypeContainer::CloseType): Implement.
24910 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24911 the default constructor.
24913 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24916 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24918 * interface.cs (CloseType): Create the type here.
24920 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24923 Remove all the methods which are now in TypeContainer.
24925 2001-10-10 Ravi Pratap <ravi@ximian.com>
24927 * delegate.cs (Define): Re-write bits to define the delegate
24930 2001-10-10 Miguel de Icaza <miguel@ximian.com>
24932 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24934 * expression.cs (ImplicitReferenceConversion): handle null as well
24935 as a source to convert to any reference type.
24937 * statement.cs (Return): Perform any implicit conversions to
24938 expected return type.
24940 Validate use of return statement.
24942 * codegen.cs (EmitContext): Pass the expected return type here.
24944 * class.cs (Method, Constructor, Property): Pass expected return
24945 type to EmitContext.
24947 2001-10-09 Miguel de Icaza <miguel@ximian.com>
24949 * expression.cs: Make DoResolve take an EmitContext instead of a
24952 Replaced `l' and `location' for `loc', for consistency.
24954 (Error, Warning): Remove unneeded Tc argument.
24956 * assign.cs, literal.cs, constant.cs: Update to new calling
24959 * codegen.cs: EmitContext now contains a flag indicating whether
24960 code is being generated in a static method or not.
24962 * cs-parser.jay: DecomposeQI, new function that replaces the old
24963 QualifiedIdentifier. Now we always decompose the assembled
24964 strings from qualified_identifier productions into a group of
24967 2001-10-08 Miguel de Icaza <miguel@ximian.com>
24969 * rootcontext.cs: Deal with field-less struct types correctly now
24970 by passing the size option to Define Type.
24972 * class.cs: Removed hack that created one static field.
24974 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24976 * statement.cs: Moved most of the code generation here.
24978 2001-10-09 Ravi Pratap <ravi@ximian.com>
24980 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24983 (ElementAccess): Remove useless bits for now - keep checks as the spec
24986 2001-10-08 Ravi Pratap <ravi@ximian.com>
24988 * expression.cs (ElementAccess::DoResolve): Remove my crap code
24989 and start performing checks according to the spec.
24991 2001-10-07 Ravi Pratap <ravi@ximian.com>
24993 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24994 rank_specifiers instead.
24996 (rank_specifiers): Change the order in which the rank specifiers are stored
24998 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
25000 * expression.cs (ElementAccess): Implement the LValue interface too.
25002 2001-10-06 Ravi Pratap <ravi@ximian.com>
25004 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
25005 except that user defined conversions are not included.
25007 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
25008 perform the conversion of the return type, if necessary.
25010 (New::DoResolve): Check whether we are creating an array or an object
25011 and accordingly do the needful.
25013 (New::Emit): Same here.
25015 (New::DoResolve): Implement guts of array creation.
25017 (New::FormLookupType): Helper function.
25019 2001-10-07 Miguel de Icaza <miguel@ximian.com>
25021 * codegen.cs: Removed most of the code generation here, and move the
25022 corresponding code generation bits to the statement classes.
25024 Added support for try/catch/finalize and throw.
25026 * cs-parser.jay: Added support for try/catch/finalize.
25028 * class.cs: Catch static methods having the flags override,
25029 virtual or abstract.
25031 * expression.cs (UserCast): This user cast was not really doing
25032 what it was supposed to do. Which is to be born in fully resolved
25033 state. Parts of the resolution were being performed at Emit time!
25037 2001-10-05 Miguel de Icaza <miguel@ximian.com>
25039 * expression.cs: Implicity convert the result from UserCast.
25041 2001-10-05 Ravi Pratap <ravi@ximian.com>
25043 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
25044 prevented it from working correctly.
25046 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
25047 merely ConvertImplicit.
25049 2001-10-05 Miguel de Icaza <miguel@ximian.com>
25051 * typemanager.cs: Make the LookupTypeContainer function static,
25052 and not per-instance.
25054 * class.cs: Make static FindMembers (the one that takes a Type
25057 * codegen.cs: Add EmitForeach here.
25059 * cs-parser.jay: Make foreach a toplevel object instead of the
25060 inline expansion, as we need to perform semantic analysis on it.
25062 2001-10-05 Ravi Pratap <ravi@ximian.com>
25064 * expression.cs (Expression::ImplicitUserConversion): Rename to
25065 UserDefinedConversion.
25067 (Expression::UserDefinedConversion): Take an extra argument specifying
25068 whether we look for explicit user conversions too.
25070 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
25072 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
25074 (ExplicitUserConversion): Make it a call to UserDefinedConversion
25075 with the appropriate arguments.
25077 * cs-parser.jay (cast_expression): Record location too.
25079 * expression.cs (Cast): Record location info.
25081 (Expression::ConvertExplicit): Take location argument.
25083 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
25084 to determine if we are doing explicit conversions.
25086 (UserCast::Emit): Update accordingly.
25088 (Expression::ConvertExplicit): Report an error if everything fails.
25090 * ../errors/cs0030.cs : Add.
25092 2001-10-04 Miguel de Icaza <miguel@ximian.com>
25094 * modifiers.cs: If the ABSTRACT keyword is present, also set the
25095 virtual and newslot bits.
25097 * class.cs (TypeContainer::RegisterRequiredImplementations):
25098 Record methods we need.
25100 (TypeContainer::MakeKey): Helper function to make keys for
25101 MethodBases, since the Methodbase key is useless.
25103 (TypeContainer::Populate): Call RegisterRequiredImplementations
25104 before defining the methods.
25106 Create a mapping for method_builders_to_methods ahead of time
25107 instead of inside a tight loop.
25109 (::RequireMethods): Accept an object as the data to set into the
25110 hashtable so we can report interface vs abstract method mismatch.
25112 2001-10-03 Miguel de Icaza <miguel@ximian.com>
25114 * report.cs: Make all of it static.
25116 * rootcontext.cs: Drop object_type and value_type computations, as
25117 we have those in the TypeManager anyways.
25119 Drop report instance variable too, now it is a global.
25121 * driver.cs: Use try/catch on command line handling.
25123 Add --probe option to debug the error reporting system with a test
25126 * report.cs: Add support for exiting program when a probe
25127 condition is reached.
25129 2001-10-03 Ravi Pratap <ravi@ximian.com>
25131 * expression.cs (Binary::DoNumericPromotions): Fix the case when
25132 we do a forcible conversion regardless of type, to check if
25133 ForceConversion returns a null.
25135 (Binary::error19): Use location to report error.
25137 (Unary::error23): Use location here too.
25139 * ../errors/cs0019.cs : Check in.
25141 * ../errors/cs0023.cs : Check in.
25143 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
25144 case of a non-null MethodInfo object with a length of 0 !
25146 (Binary::ResolveOperator): Flag error if overload resolution fails to find
25147 an applicable member - according to the spec :-)
25148 Also fix logic to find members in base types.
25150 (Unary::ResolveOperator): Same here.
25152 (Unary::report23): Change name to error23 and make first argument a TypeContainer
25153 as I was getting thoroughly confused between this and error19 :-)
25155 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
25156 (::FindMostEncompassedType): Implement.
25157 (::FindMostEncompassingType): Implement.
25158 (::StandardConversionExists): Implement.
25160 (UserImplicitCast): Re-vamp. We now need info about most specific
25161 source and target types so that we can do the necessary conversions.
25163 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
25164 mathematical union with no duplicates.
25166 2001-10-03 Miguel de Icaza <miguel@ximian.com>
25168 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
25169 in order from base classes to child classes, so that we can in
25170 child classes look up in our parent for method names and
25171 attributes (required for handling abstract, virtual, new, override
25172 constructs: we need to instrospect our base class, and if we dont
25173 populate the classes in order, the introspection might be
25174 incorrect. For example, a method could query its parent before
25175 the parent has any methods and would determine that the parent has
25176 no abstract methods (while it could have had them)).
25178 (RootContext::CreateType): Record the order in which we define the
25181 2001-10-02 Miguel de Icaza <miguel@ximian.com>
25183 * class.cs (TypeContainer::Populate): Also method definitions can
25184 fail now, keep track of this.
25186 (TypeContainer::FindMembers): Implement support for
25187 DeclaredOnly/noDeclaredOnly flag.
25189 (Constructor::Emit) Return the ConstructorBuilder.
25191 (Method::Emit) Return the MethodBuilder.
25192 Check for abstract or virtual methods to be public.
25194 * rootcontext.cs (RootContext::CreateType): Register all the
25195 abstract methods required for the class to be complete and the
25196 interface methods that must be implemented.
25198 * cs-parser.jay: Report error 501 (method requires body if it is
25199 not marked abstract or extern).
25201 * expression.cs (TypeOf::Emit): Implement.
25203 * typemanager.cs: runtime_handle_type, new global type.
25205 * class.cs (Property::Emit): Generate code for properties.
25207 2001-10-02 Ravi Pratap <ravi@ximian.com>
25209 * expression.cs (Unary::ResolveOperator): Find operators on base type
25210 too - we now conform exactly to the spec.
25212 (Binary::ResolveOperator): Same here.
25214 * class.cs (Operator::Define): Fix minor quirk in the tests.
25216 * ../errors/cs0215.cs : Added.
25218 * ../errors/cs0556.cs : Added.
25220 * ../errors/cs0555.cs : Added.
25222 2001-10-01 Miguel de Icaza <miguel@ximian.com>
25224 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
25225 single integer which is really efficient
25227 2001-10-01 Ravi Pratap <ravi@ximian.com>
25229 * expression.cs (Expression::ImplicitUserConversion): Use location
25230 even in the case when we are examining True operators.
25232 * class.cs (Operator::Define): Perform extensive checks to conform
25233 with the rules for operator overloading in the spec.
25235 * expression.cs (Expression::ImplicitReferenceConversion): Implement
25236 some of the other conversions mentioned in the spec.
25238 * typemanager.cs (array_type): New static member for the System.Array built-in
25241 (cloneable_interface): For System.ICloneable interface.
25243 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
25244 we start resolving the tree and populating types.
25246 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
25248 2001-10-01 Miguel de Icaza <miguel@ximian.com>
25250 * expression.cs (Expression::ExprClassFromMemberInfo,
25251 Expression::Literalize): Create literal expressions from
25252 FieldInfos which are literals.
25254 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
25255 type casts, because they were wrong. The test suite in tests
25258 (ImplicitNumericConversion): ushort to ulong requires a widening
25261 Int32 constant to long requires widening cast as well.
25263 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
25264 for integers because the type on the stack is not i4.
25266 2001-09-30 Miguel de Icaza <miguel@ximian.com>
25268 * expression.cs (report118): require location argument.
25270 * parameter.cs: Do not dereference potential null value.
25272 * class.cs: Catch methods that lack the `new' keyword when
25273 overriding a name. Report warnings when `new' is used without
25274 anything being there to override.
25276 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
25278 * class.cs: Only add constructor to hashtable if it is non-null
25279 (as now constructors can fail on define).
25281 (TypeManager, Class, Struct): Take location arguments.
25283 Catch field instance initialization in structs as errors.
25285 accepting_filter: a new filter for FindMembers that is static so
25286 that we dont create an instance per invocation.
25288 (Constructor::Define): Catch errors where a struct constructor is
25291 * cs-parser.jay: Pass location information for various new
25294 * delegate.cs (Delegate): take a location argument.
25296 * driver.cs: Do not call EmitCode if there were problesm in the
25297 Definition of the types, as many Builders wont be there.
25299 * decl.cs (Decl::Decl): Require a location argument.
25301 * cs-tokenizer.cs: Handle properly hex constants that can not fit
25302 into integers, and find the most appropiate integer for it.
25304 * literal.cs: Implement ULongLiteral.
25306 * rootcontext.cs: Provide better information about the location of
25307 failure when CreateType fails.
25309 2001-09-29 Miguel de Icaza <miguel@ximian.com>
25311 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
25314 * expression.cs (Binary::CheckShiftArguments): Add missing type
25316 (Binary::ResolveOperator): Add type to the logical and and logical
25317 or, Bitwise And/Or and Exclusive Or code paths, it was missing
25320 (Binary::DoNumericPromotions): In the case where either argument
25321 is ulong (and most signed types combined with ulong cause an
25322 error) perform implicit integer constant conversions as well.
25324 2001-09-28 Miguel de Icaza <miguel@ximian.com>
25326 * expression.cs (UserImplicitCast): Method should always be
25328 (Invocation::BetterConversion): Simplified test for IntLiteral.
25330 (Expression::ImplicitNumericConversion): Split this routine out.
25331 Put the code that performs implicit constant integer conversions
25334 (Expression::Resolve): Become a wrapper around DoResolve so we can
25335 check eclass and type being set after resolve.
25337 (Invocation::Badness): Remove this dead function
25339 (Binary::ResolveOperator): Do not compute the expensive argumnets
25340 unless we have a union for it.
25342 (Probe::Emit): Is needs to do an isinst and then
25343 compare against null.
25345 (::CanConvert): Added Location argument. If the Location argument
25346 is null (Location.Null), then we do not report errors. This is
25347 used by the `probe' mechanism of the Explicit conversion. We do
25348 not want to generate an error for something that the user
25349 explicitly requested to be casted. But the pipeline for an
25350 explicit cast first tests for potential implicit casts.
25352 So for now, if the Location is null, it means `Probe only' to
25353 avoid adding another argument. Might have to revise this
25356 (ClassCast): New class used to type cast objects into arbitrary
25357 classes (used in Explicit Reference Conversions).
25359 Implement `as' as well.
25361 Reverted all the patches from Ravi below: they were broken:
25363 * The use of `level' as a mechanism to stop recursive
25364 invocations is wrong. That was there just to catch the
25365 bug with a strack trace but not as a way of addressing
25368 To fix the problem we have to *understand* what is going
25369 on and the interactions and come up with a plan, not
25370 just get things going.
25372 * The use of the type conversion cache that I proposed
25373 last night had an open topic: How does this work across
25374 protection domains. A user defined conversion might not
25375 be public in the location where we are applying the
25376 conversion, a different conversion might be selected
25377 (ie, private A->B (better) but public B->A (worse),
25378 inside A, A->B applies, but outside it, B->A will
25381 * On top of that (ie, even if the above is solved),
25382 conversions in a cache need to be abstract. Ie, `To
25383 convert from an Int to a Short use an OpcodeCast', not
25384 `To convert from an Int to a Short use the OpcodeCast on
25385 the variable 5' (which is what this patch was doing).
25387 2001-09-28 Ravi Pratap <ravi@ximian.com>
25389 * expression.cs (Invocation::ConversionExists): Re-write to use
25390 the conversion cache
25392 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25393 cache all conversions done, not just user-defined ones.
25395 (Invocation::BetterConversion): The real culprit. Use ConversionExists
25396 to determine if a conversion exists instead of acutually trying to
25397 perform the conversion. It's faster too.
25399 (Expression::ConvertExplicit): Modify to use ConversionExists to check
25400 and only then attempt the implicit conversion.
25402 2001-09-28 Ravi Pratap <ravi@ximian.com>
25404 * expression.cs (ConvertImplicit): Use a cache for conversions
25405 already found. Check level of recursion and bail out if necessary.
25407 2001-09-28 Miguel de Icaza <miguel@ximian.com>
25409 * typemanager.cs (string_concat_string_string, string_concat_object_object):
25410 Export standard methods that we expect for string operations.
25412 * statement.cs (Block::UsageWarning): Track usage of variables and
25413 report the errors for not used variables.
25415 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25418 2001-09-27 Miguel de Icaza <miguel@ximian.com>
25420 * codegen.cs: remove unnneded code
25422 * expression.cs: Removed BuiltinTypeAccess class
25424 Fix the order in which implicit conversions are
25427 The previous fixed dropped support for boxed conversions (adding a
25428 test to the test suite now)
25430 (UserImplicitCast::CanConvert): Remove test for source being null,
25431 that code is broken. We should not feed a null to begin with, if
25432 we do, then we should track the bug where the problem originates
25433 and not try to cover it up here.
25435 Return a resolved expression of type UserImplicitCast on success
25436 rather than true/false. Ravi: this is what I was talking about,
25437 the pattern is to use a static method as a "constructor" for
25440 Also, do not create arguments until the very last minute,
25441 otherwise we always create the arguments even for lookups that
25442 will never be performed.
25444 (UserImplicitCast::Resolve): Eliminate, objects of type
25445 UserImplicitCast are born in a fully resolved state.
25447 * typemanager.cs (InitCoreTypes): Init also value_type
25448 (System.ValueType).
25450 * expression.cs (Cast::Resolve): First resolve the child expression.
25452 (LValue): Add new method AddressOf to be used by
25455 Change the argument of Store to take an EmitContext instead of an
25456 ILGenerator, because things like FieldExpr need to be able to call
25457 their children expression to generate the instance code.
25459 (Expression::Error, Expression::Warning): Sugar functions for
25462 (Expression::MemberLookup): Accept a TypeContainer instead of a
25463 Report as the first argument.
25465 (Expression::ResolvePrimary): Killed. I still want to improve
25466 this as currently the code is just not right.
25468 (Expression::ResolveMemberAccess): Simplify, but it is still
25471 (Unary::Resolve): Catch errors in AddressOf operators.
25473 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25474 index to a byte for the short-version, or the compiler will choose
25475 the wrong Emit call, which generates the wrong data.
25477 (ParameterReference::Emit, ::Store): same.
25479 (FieldExpr::AddressOf): Implement.
25481 * typemanager.cs: TypeManager: made public variable instead of
25484 * driver.cs: document --fatal.
25486 * report.cs (ErrorMessage, WarningMessage): new names for the old
25487 Error and Warning classes.
25489 * cs-parser.jay (member_access): Turn built-in access to types
25490 into a normal simplename
25492 2001-09-27 Ravi Pratap <ravi@ximian.com>
25494 * expression.cs (Invocation::BetterConversion): Fix to cope
25495 with q being null, since this was introducing a bug.
25497 * expression.cs (ConvertImplicit): Do built-in conversions first.
25499 2001-09-27 Ravi Pratap <ravi@ximian.com>
25501 * expression.cs (UserImplicitCast::Resolve): Fix bug.
25503 2001-09-27 Ravi Pratap <ravi@ximian.com>
25505 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25506 I had introduced long ago (what's new ?).
25508 * expression.cs (UserImplicitCast::CanConvert): Static method to do
25509 the work of all the checking.
25510 (ConvertImplicit): Call CanConvert and only then create object if necessary.
25511 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25513 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25514 that is the right way.
25516 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
25517 overloading resolution. Use everywhere instead of cutting and pasting code.
25519 (Binary::ResolveOperator): Use MakeUnionSet.
25521 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
25522 we have to convert to bool types. Not complete yet.
25524 2001-09-27 Miguel de Icaza <miguel@ximian.com>
25526 * typemanager.cs (TypeManager::CSharpName): support ushort.
25528 * expression.cs (Expression::TryImplicitIntConversion): Attempts
25529 to provide an expression that performsn an implicit constant int
25530 conversion (section 6.1.6).
25531 (Expression::ConvertImplicitRequired): Reworked to include
25532 implicit constant expression conversions.
25534 (Expression::ConvertNumericExplicit): Finished.
25536 (Invocation::Emit): If InstanceExpression is null, then it means
25537 that we perform a call on this.
25539 2001-09-26 Miguel de Icaza <miguel@ximian.com>
25541 * expression.cs (Unary::Emit): Remove some dead code.
25542 (Probe): Implement Resolve and Emit for `is'.
25543 (Expression::ConvertImplicitRequired): Attempt to do constant
25544 expression conversions here. Maybe should be moved to
25545 ConvertImplicit, but I am not sure.
25546 (Expression::ImplicitLongConstantConversionPossible,
25547 Expression::ImplicitIntConstantConversionPossible): New functions
25548 that tell whether is it possible to apply an implicit constant
25549 expression conversion.
25551 (ConvertNumericExplicit): Started work on explicit numeric
25554 * cs-parser.jay: Update operator constants.
25556 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25557 (Parameters::GetSignature): Hook up VerifyArgs here.
25558 (Parameters::VerifyArgs): Verifies that no two arguments have the
25561 * class.cs (Operator): Update the operator names to reflect the
25562 ones that the spec expects (as we are just stringizing the
25565 * expression.cs (Unary::ResolveOperator): Fix bug: Use
25566 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25567 previous usage did only work for our methods.
25568 (Expression::ConvertImplicit): Handle decimal implicit numeric
25569 conversions as well.
25570 (Expression::InternalTypeConstructor): Used to invoke constructors
25571 on internal types for default promotions.
25573 (Unary::Emit): Implement special handling for the pre/post
25574 increment/decrement for overloaded operators, as they need to have
25575 the same semantics as the other operators.
25577 (Binary::ResolveOperator): ditto.
25578 (Invocation::ConversionExists): ditto.
25579 (UserImplicitCast::Resolve): ditto.
25581 2001-09-26 Ravi Pratap <ravi@ximian.com>
25583 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25584 operator, return after emitting body. Regression tests pass again !
25586 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25587 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25588 (Invocation::OverloadResolve): Ditto.
25589 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25591 * everywhere : update calls to the above methods accordingly.
25593 2001-09-26 Miguel de Icaza <miguel@ximian.com>
25595 * assign.cs (Assign): Make it inherit from ExpressionStatement.
25597 * expression.cs (ExpressionStatement): New base class used for
25598 expressions that can appear in statements, so that we can provide
25599 an alternate path to generate expression that do not leave a value
25602 (Expression::Emit, and all the derivatives): We no longer return
25603 whether a value is left on the stack or not. Every expression
25604 after being emitted leaves a single value on the stack.
25606 * codegen.cs (EmitContext::EmitStatementExpression): Use the
25607 facilties of ExpressionStatement if possible.
25609 * cs-parser.jay: Update statement_expression.
25611 2001-09-25 Miguel de Icaza <miguel@ximian.com>
25613 * driver.cs: Change the wording of message
25615 2001-09-25 Ravi Pratap <ravi@ximian.com>
25617 * expression.cs (Binary::ResolveOperator): Had forgottten to set
25618 the type of the expression to the return type of the method if
25619 we have an overloaded operator match ! The regression tests pass again !
25620 (Unary::ResolveOperator): Ditto.
25622 * expression.cs (Invocation::ConversionExists): Correct the member lookup
25623 to find "op_Implicit", not "implicit" ;-)
25624 (UserImplicitCast): New class to take care of user-defined implicit conversions.
25625 (ConvertImplicit, ForceConversion): Take TypeContainer argument
25627 * everywhere : Correct calls to the above accordingly.
25629 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25630 (ConvertImplicit): Do user-defined conversion if it exists.
25632 2001-09-24 Miguel de Icaza <miguel@ximian.com>
25634 * assign.cs: track location.
25635 (Resolve): Use implicit conversions on assignment.
25637 * literal.cs: Oops. Not good, Emit of short access values should
25638 pass (Bytes) or the wrong argument will be selected.
25640 * expression.cs (Unary::Emit): Emit code for -expr.
25642 (Unary::ResolveOperator): Handle `Substract' for non-constants
25643 (substract from zero from the non-constants).
25644 Deal with Doubles as well.
25646 (Expression::ConvertImplicitRequired): New routine that reports an
25647 error if no implicit conversion exists.
25649 (Invocation::OverloadResolve): Store the converted implicit
25650 expressions if we make them
25652 2001-09-24 Ravi Pratap <ravi@ximian.com>
25654 * class.cs (ConstructorInitializer): Take a Location argument.
25655 (ConstructorBaseInitializer): Same here.
25656 (ConstructorThisInitializer): Same here.
25658 * cs-parser.jay : Update all calls accordingly.
25660 * expression.cs (Unary, Binary, New): Take location argument.
25661 Update accordingly everywhere.
25663 * cs-parser.jay : Update all calls to the above to take a location
25666 * class.cs : Ditto.
25668 2001-09-24 Ravi Pratap <ravi@ximian.com>
25670 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25671 (Invocation::BetterConversion): Same here
25672 (Invocation::ConversionExists): Ditto.
25674 (Invocation::ConversionExists): Implement.
25676 2001-09-22 Ravi Pratap <ravi@ximian.com>
25678 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25679 Also take an additional TypeContainer argument.
25681 * All over : Pass in TypeContainer as argument to OverloadResolve.
25683 * typemanager.cs (CSharpName): Update to check for the string type and return
25686 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25689 2001-09-21 Ravi Pratap <ravi@ximian.com>
25691 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25692 (Invocation::BetterFunction): Implement.
25693 (Invocation::BetterConversion): Implement.
25694 (Invocation::ConversionExists): Skeleton, no implementation yet.
25696 Okay, things work fine !
25698 2001-09-21 Miguel de Icaza <miguel@ximian.com>
25700 * typemanager.cs: declare and load enum_type, delegate_type and
25703 * expression.cs (Expression::Emit): Now emit returns a value that
25704 tells whether a value is left on the stack or not. This strategy
25705 might be reveted tomorrow with a mechanism that would address
25706 multiple assignments.
25707 (Expression::report118): Utility routine to report mismatches on
25710 (Unary::Report23): Report impossible type/operator combination
25713 (Unary::IsIncrementableNumber): Whether the type can be
25714 incremented or decremented with add.
25715 (Unary::ResolveOperator): Also allow enumerations to be bitwise
25717 (Unary::ResolveOperator): Implement ++, !, ~,
25719 (Invocation::Emit): Deal with new Emit convetion.
25721 * All Expression derivatives: Updated their Emit method to return
25722 whether they leave values on the stack or not.
25724 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25725 stack for expressions that are statements.
25727 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25729 * expression.cs (LValue): New interface. Must be implemented by
25731 (LocalVariableReference, ParameterReference, FieldExpr): Implement
25734 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25735 interface for generating code, simplifies the code.
25737 2001-09-20 Ravi Pratap <ravi@ximian.com>
25739 * expression.cs (everywhere): Comment out return statements in ::Resolve
25740 methods to avoid the warnings.
25742 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25744 * driver.cs (parse): Report error 2001 if we can not open the
25747 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25750 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25753 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25754 otherwise nested blocks end up with the same index.
25756 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25758 * expression.cs: Instead of having FIXMEs in the Resolve
25759 functions, throw exceptions so it is obvious that we are facing a
25762 * cs-parser.jay (invocation_expression): Pass Location information.
25764 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25765 Use a basename for those routines because .NET does not like paths
25768 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25771 2001-09-19 Miguel de Icaza <miguel@ximian.com>
25773 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25774 are loading the correct data types (throws an exception if not).
25775 (TypeManager::InitCoreTypes): Use CoreLookupType
25777 * expression.cs (Unary::ResolveOperator): return the child
25778 expression for expressions which are just +expr.
25779 (Unary::ResolveOperator): Return negative literals for -LITERAL
25780 expressions (otherwise they are Unary {Literal}).
25781 (Invocation::Badness): Take into account `Implicit constant
25782 expression conversions'.
25784 * literal.cs (LongLiteral): Implement long literal class.
25785 (IntLiteral): export the `Value' of the intliteral.
25787 2001-09-19 Ravi Pratap <ravi@ximian.com>
25789 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25791 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
25792 instead of 'Operator'
25794 * expression.cs (Binary::ResolveOperator): Update accordingly.
25795 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25798 * cs-parser.jay (unary_expression): Update to use the new names.
25800 * gen-treedump.cs (GetUnary): Same here.
25802 * expression.cs (Unary::Resolve): Implement.
25803 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
25804 operators are found instead of making noise ;-)
25805 (Unary::ResolveOperator): New method to do precisely the same thing which
25806 Binary::ResolveOperator does for Binary expressions.
25807 (Unary.method, .Arguments): Add.
25808 (Unary::OperName): Implement.
25809 (Unary::ForceConversion): Copy and Paste !
25811 * class.cs (Operator::Define): Fix a small bug for the case when we have
25814 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25815 for the inbuilt operators. Only overloading works for now ;-)
25817 2001-09-18 Miguel de Icaza <miguel@ximian.com>
25819 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25820 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25822 * expression.cs (This::Emit): Implement.
25823 (This::Resolve): Implement.
25824 (TypeOf:Resolve): Implement.
25825 (Expression::ResolveSimpleName): Add an implicit this to instance
25827 (MemberAccess::Resolve): Deal with Parameters and Fields.
25828 Bind instance variable to Field expressions.
25829 (FieldExpr::Instance): New field used to track the expression that
25830 represents the object instance.
25831 (FieldExpr::Resolve): Track potential errors from MemberLookup not
25833 (FieldExpr::Emit): Implement.
25835 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25836 the last instruction contains a return opcode to avoid generating
25837 the last `ret' instruction (this generates correct code, and it is
25838 nice to pass the peverify output).
25840 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25841 initializer for static and instance variables.
25842 (Constructor::Emit): Allow initializer to be null in the case of
25843 static constructors. Only emit initializer for instance
25846 (TypeContainer::FindMembers): Return a null array if there are no
25849 Also fix the code for the MemberTypes.Method branch, as it was not
25850 scanning that for operators (or tried to access null variables before).
25852 * assign.cs (Assign::Emit): Handle instance and static fields.
25856 * driver.cs: Stop compilation if there are parse errors.
25858 * cs-parser.jay (constructor_declaration): Provide default base
25859 initializer for non-static constructors.
25860 (constructor_declarator): Do not provide a default base
25861 initializers if none was specified.
25862 Catch the fact that constructors should not have parameters.
25864 * class.cs: Do not emit parent class initializers for static
25865 constructors, that should be flagged as an error.
25867 2001-09-18 Ravi Pratap <ravi@ximian.com>
25869 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25870 Move back code into TypeContainer::Populate.
25872 2001-09-18 Ravi Pratap <ravi@ximian.com>
25874 * class.cs (TypeContainer::AddConstructor): Fix the check to
25875 compare against Name, not Basename.
25876 (Operator::OpType): Change Plus and Minus to Add and Subtract.
25878 * cs-parser.jay : Update accordingly.
25880 * class.cs (TypeContainer::FindMembers): For the case where we are searching
25881 for methods, don't forget to look into the operators too.
25882 (RegisterMethodBuilder): Helper method to take care of this for
25883 methods, constructors and operators.
25884 (Operator::Define): Completely revamp.
25885 (Operator.OperatorMethod, MethodName): New fields.
25886 (TypeContainer::Populate): Move the registering of builders into
25887 RegisterMethodBuilder.
25888 (Operator::Emit): Re-write.
25890 * expression.cs (Binary::Emit): Comment out code path to emit method
25891 invocation stuff for the case when we have a user defined operator. I am
25892 just not able to get it right !
25894 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25896 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25899 (Expression::MemberLookup): Provide a version that allows to
25900 specify the MemberTypes and BindingFlags.
25902 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25903 so it was not fetching variable information from outer blocks.
25905 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25906 Beforefieldinit as it was buggy.
25908 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25909 that Ravi put here.
25911 * class.cs (Constructor::Emit): Only emit if block is not null.
25912 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25913 deal with this by semantically definining it as if the user had
25916 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25917 constructors as we now "emit" them at a higher level.
25919 (TypeContainer::DefineDefaultConstructor): Used to define the
25920 default constructors if none was provided.
25922 (ConstructorInitializer): Add methods Resolve and Emit.
25924 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25926 2001-09-17 Ravi Pratap <ravi@ximian.com>
25928 * class.cs (TypeContainer::EmitDefaultConstructor): Register
25929 the default constructor builder with our hashtable for methodbuilders
25932 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25933 and argument_count is 0 in which case we have a match.
25934 (Binary::ResolveOperator): More null checking and miscellaneous coding
25937 2001-09-17 Ravi Pratap <ravi@ximian.com>
25939 * rootcontext.cs (IsNameSpace): Compare against null.
25941 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25943 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25944 and Unary::Operator.
25946 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25949 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25950 we have overloaded operators.
25951 (Binary::ResolveOperator): Implement the part which does the operator overload
25954 * class.cs (Operator::Emit): Implement.
25955 (TypeContainer::Emit): Emit the operators we have too.
25957 * expression.cs (Binary::Emit): Update to emit the appropriate code for
25958 the case when we have a user-defined operator.
25960 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25962 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25964 2001-09-16 Ravi Pratap <ravi@ximian.com>
25966 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25967 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25968 (Constructor::Emit): Implement.
25969 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25970 if we have no work to do.
25971 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
25974 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25975 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25977 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25980 2001-09-15 Ravi Pratap <ravi@ximian.com>
25982 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25984 (Tree::RecordNamespace): Method to do what the name says ;-)
25985 (Tree::Namespaces): Property to get at the namespaces hashtable.
25987 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
25990 * rootcontext.cs (IsNamespace): Fixed it :-)
25992 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25994 * class.cs (TypeContainer::FindMembers): Add support for
25996 (MethodCore): New class that encapsulates both the shared aspects
25997 of a Constructor and a Method.
25998 (Method, Constructor): Factored pieces into MethodCore.
26000 * driver.cs: Added --fatal which makes errors throw exceptions.
26001 Load System assembly as well as part of the standard library.
26003 * report.cs: Allow throwing exceptions on errors for debugging.
26005 * modifiers.cs: Do not use `parent', instead use the real type
26006 container to evaluate permission settings.
26008 * class.cs: Put Ravi's patch back in. He is right, and we will
26009 have to cope with the
26011 2001-09-14 Ravi Pratap <ravi@ximian.com>
26013 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
26014 FamORAssem, not FamANDAssem.
26016 2001-09-14 Miguel de Icaza <miguel@ximian.com>
26018 * driver.cs: Added --parse option that only parses its input files
26021 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
26022 incorrect. IsTopLevel is not used to tell whether an object is
26023 root_types or not (that can be achieved by testing this ==
26024 root_types). But to see if this is a top-level *class* (not
26025 necessarly our "toplevel" container).
26027 2001-09-14 Ravi Pratap <ravi@ximian.com>
26029 * enum.cs (Enum::Define): Modify to call the Lookup method on the
26030 parent instead of a direct call to GetType.
26032 2001-09-14 Ravi Pratap <ravi@ximian.com>
26034 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
26035 Modifiers.TypeAttr. This should just be a call to that method.
26037 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
26038 object so that we can determine if we are top-level or not.
26040 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
26043 * enum.cs (Enum::Define): Ditto.
26045 * modifiers.cs (FieldAttr): Re-write.
26047 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
26048 (TypeContainer::HaveStaticConstructor): New property to provide access
26049 to precisely that info.
26051 * modifiers.cs (MethodAttr): Re-write.
26052 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
26054 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
26055 of top-level types as claimed.
26057 2001-09-13 Miguel de Icaza <miguel@ximian.com>
26059 * expression.cs (MemberLookup): Fruitless attempt to lookup
26060 constructors. Maybe I need to emit default constructors? That
26061 might be it (currently .NET emits this for me automatically).
26062 (Invocation::OverloadResolve): Cope with Arguments == null.
26063 (Invocation::EmitArguments): new function, shared by the new
26064 constructor and us.
26065 (Invocation::Emit): Handle static and instance methods. Emit
26066 proper call instruction for virtual or non-virtual invocations.
26067 (New::Emit): Implement.
26068 (New::Resolve): Implement.
26069 (MemberAccess:Resolve): Implement.
26070 (MethodGroupExpr::InstanceExpression): used conforming to the spec
26071 to track instances.
26072 (FieldExpr::Resolve): Set type.
26074 * support.cs: Handle empty arguments.
26076 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
26077 SimpleLookup): Auxiliary routines to help parse a qualifier
26080 Update qualifier_identifier rule.
26082 * codegen.cs: Removed debugging messages.
26084 * class.cs: Make this a global thing, this acts just as a "key" to
26085 objects that we might have around.
26087 (Populate): Only initialize method_builders_to_methods once.
26089 * expression.cs (PropertyExpr): Initialize type from the
26092 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
26093 Resolve pattern. Attempt to implicitly convert value to boolean.
26096 * expression.cs: Set the type for the int32/int32 argument case.
26097 (Binary::ResolveOperator): Set the return type to boolean for
26098 comparission operators
26100 * typemanager.cs: Remove debugging print code.
26102 (Invocation::Resolve): resolve type.
26104 * class.cs: Allocate a MemberInfo of the correct size, as the code
26105 elsewhere depends on the test to reflect the correct contents.
26107 (Method::) Keep track of parameters, due to System.Reflection holes
26109 (TypeContainer::Populate): Keep track of MethodBuilders to Method
26112 (TypeContainer::FindMembers): Use ArrayList and then copy an array
26113 of the exact size and return that.
26115 (Class::LookupMethodByBuilder): New function that maps
26116 MethodBuilders to its methods. Required to locate the information
26117 on methods because System.Reflection bit us again.
26119 * support.cs: New file, contains an interface ParameterData and
26120 two implementations: ReflectionParameters and InternalParameters
26121 used to access Parameter information. We will need to grow this
26124 * expression.cs (Invocation::GetParameterData): implement a cache
26125 and a wrapper around the ParameterData creation for methods.
26126 (Invocation::OverloadResolve): Use new code.
26128 2001-09-13 Ravi Pratap <ravi@ximian.com>
26130 * class.cs (TypeContainer::EmitField): Remove and move into
26131 (Field::Define): here and modify accordingly.
26132 (Field.FieldBuilder): New member.
26133 (TypeContainer::Populate): Update accordingly.
26134 (TypeContainer::FindMembers): Implement.
26136 2001-09-13 Miguel de Icaza <miguel@ximian.com>
26138 * statement.cs: (VariableInfo::VariableType): New field to be
26139 initialized with the full type once it is resolved.
26141 2001-09-12 Miguel de Icaza <miguel@ximian.com>
26143 * parameter.cs (GetParameterInfo): Use a type cache to compute
26144 things only once, and to reuse this information
26146 * expression.cs (LocalVariableReference::Emit): Implement.
26147 (OpcodeCast::Emit): fix.
26149 (ParameterReference::Resolve): Implement.
26150 (ParameterReference::Emit): Implement.
26152 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
26153 that are expressions need to stay as Expressions.
26155 * typemanager.cs (CSharpName): Returns the C# name of a type if
26158 * expression.cs (Expression::ConvertImplicit): New function that
26159 implements implicit type conversions.
26161 (Expression::ImplicitReferenceConversion): Implements implicit
26162 reference conversions.
26164 (EmptyCast): New type for transparent casts.
26166 (OpcodeCast): New type for casts of types that are performed with
26167 a sequence of bytecodes.
26169 (BoxedCast): New type used for casting value types into reference
26170 types. Emits a box opcode.
26172 (Binary::DoNumericPromotions): Implements numeric promotions of
26173 and computation of the Binary::Type.
26175 (Binary::EmitBranchable): Optimization.
26177 (Binary::Emit): Implement code emission for expressions.
26179 * typemanager.cs (TypeManager): Added two new core types: sbyte
26182 2001-09-12 Ravi Pratap <ravi@ximian.com>
26184 * class.cs (TypeContainer::FindMembers): Method which does exactly
26185 what Type.FindMembers does, only we don't have to use reflection. No
26186 implementation yet.
26188 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
26189 typecontainer objects as we need to get at them.
26190 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
26192 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
26193 typecontainer object.
26195 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
26196 of just a Report object.
26198 2001-09-11 Ravi Pratap <ravi@ximian.com>
26200 * class.cs (Event::Define): Go back to using the prefixes "add_" and
26202 (TypeContainer::Populate): Now define the delegates of the type too.
26203 (TypeContainer.Delegates): Property to access the list of delegates defined
26206 * delegates.cs (Delegate::Define): Implement partially.
26208 * modifiers.cs (TypeAttr): Handle more flags.
26210 2001-09-11 Ravi Pratap <ravi@ximian.com>
26212 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
26214 (Operator::Define): Re-write logic to get types by using the LookupType method
26215 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
26216 (Indexer::Define): Ditto.
26217 (Event::Define): Ditto.
26218 (Property::Define): Ditto.
26220 2001-09-10 Ravi Pratap <ravi@ximian.com>
26222 * class.cs (TypeContainer::Populate): Now define operators too.
26223 (TypeContainer.Operators): New property to access the list of operators
26225 (Operator.OperatorMethodBuilder): New member to hold the method builder
26226 for the operator we are defining.
26227 (Operator::Define): Implement.
26229 2001-09-10 Ravi Pratap <ravi@ximian.com>
26231 * class.cs (Event::Define): Make the prefixes of the accessor methods
26232 addOn_ and removeOn_
26234 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
26235 of the location being passed in too. Ideally, this should go later since all
26236 error reporting should be done through the Report object.
26238 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
26239 (Populate): Iterate thru the indexers we have and define them too.
26240 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
26241 for the get and set accessors.
26242 (Indexer::Define): Implement.
26244 2001-09-09 Miguel de Icaza <miguel@ximian.com>
26246 * expression.cs (Binary::Resolve): Beginning of it. I scratched
26247 my previous implementation, did not work.
26249 * typemanager.cs: Add a couple of missing types (the longs).
26251 * literal.cs: Use TypeManager.bool_type instead of getting it.
26253 * expression.cs (EventExpr): New kind of expressions.
26254 (Expressio::ExprClassFromMemberInfo): finish
26256 2001-09-08 Miguel de Icaza <miguel@ximian.com>
26258 * assign.cs: Emit stores to static fields differently.
26260 2001-09-08 Ravi Pratap <ravi@ximian.com>
26262 * Merge in changes and adjust code to tackle conflicts. Backed out my
26263 code in Assign::Resolve ;-)
26265 2001-09-08 Ravi Pratap <ravi@ximian.com>
26267 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
26268 instead Report.Error and also pass in the location.
26269 (CSharpParser::Lexer): New readonly property to return the reference
26270 to the Tokenizer object.
26271 (declare_local_variables): Use Report.Error with location instead of plain
26275 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
26276 (Operator.CheckBinaryOperator): Ditto.
26278 * cs-parser.jay (operator_declarator): Update accordingly.
26280 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
26281 (CheckBinaryOperator): Same here.
26283 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
26284 on the name without any prefixes of namespace names etc. This is because we
26285 already might have something already fully qualified like
26286 'System.Console.WriteLine'
26288 * assign.cs (Resolve): Begin implementation. Stuck ;-)
26290 2001-09-07 Ravi Pratap <ravi@ximian.com>
26292 * cs-tokenizer.cs (location): Return a string which also contains
26295 * expression.cs (ElementAccess): New class for expressions of the
26296 type 'element access.'
26297 (BaseAccess): New class for expressions of the type 'base access.'
26298 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
26301 * cs-parser.jay (element_access): Implement action.
26302 (base_access): Implement actions.
26303 (checked_expression, unchecked_expression): Implement.
26305 * cs-parser.jay (local_variable_type): Correct and implement.
26306 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
26308 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
26310 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
26311 name and the specifiers.
26313 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
26315 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
26316 making them all public ;-)
26318 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
26321 2001-09-07 Miguel de Icaza <miguel@ximian.com>
26323 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
26325 (FieldExpr, PropertyExprs): New resolved expressions.
26326 (SimpleName::MemberStaticCheck): Perform static checks for access
26327 to non-static fields on static methods. Maybe this should be
26328 generalized for MemberAccesses.
26329 (SimpleName::ResolveSimpleName): More work on simple name
26332 * cs-parser.jay (primary_expression/qualified_identifier): track
26333 the parameter index.
26335 * codegen.cs (CodeGen::Save): Catch save exception, report error.
26336 (EmitContext::EmitBoolExpression): Chain to expression generation
26337 instead of temporary hack.
26338 (::EmitStatementExpression): Put generic expression code generation.
26340 * assign.cs (Assign::Emit): Implement variable assignments to
26341 local variables, parameters and fields.
26343 2001-09-06 Miguel de Icaza <miguel@ximian.com>
26345 * statement.cs (Block::GetVariableInfo): New method, returns the
26346 VariableInfo for a variable name in a block.
26347 (Block::GetVariableType): Implement in terms of GetVariableInfo
26349 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
26350 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
26352 2001-09-06 Ravi Pratap <ravi@ximian.com>
26354 * cs-parser.jay (operator_declaration): Continue on my quest : update
26355 to take attributes argument.
26356 (event_declaration): Ditto.
26357 (enum_declaration): Ditto.
26358 (indexer_declaration): Ditto.
26360 * class.cs (Operator::Operator): Update constructor accordingly.
26361 (Event::Event): Ditto.
26363 * delegate.cs (Delegate::Delegate): Same here.
26365 * enum.cs (Enum::Enum): Same here.
26367 2001-09-05 Ravi Pratap <ravi@ximian.com>
26369 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
26371 * ../tests/cs0658.cs : New file to demonstrate error 0658.
26373 * attribute.cs (Attributes): New class to encapsulate all attributes which were
26374 being passed around as an arraylist.
26375 (Attributes::AddAttribute): Method to add attribute sections.
26377 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
26378 (struct_declaration): Update accordingly.
26379 (constant_declaration): Update.
26380 (field_declaration): Update.
26381 (method_header): Update.
26382 (fixed_parameter): Update.
26383 (parameter_array): Ditto.
26384 (property_declaration): Ditto.
26385 (destructor_declaration): Ditto.
26387 * class.cs (Struct::Struct): Update constructors accordingly.
26388 (Class::Class): Ditto.
26389 (Field::Field): Ditto.
26390 (Method::Method): Ditto.
26391 (Property::Property): Ditto.
26392 (TypeContainer::OptAttribute): update property's return type.
26394 * interface.cs (Interface.opt_attributes): New member.
26395 (Interface::Interface): Update to take the extra Attributes argument.
26397 * parameter.cs (Parameter::Parameter): Ditto.
26399 * constant.cs (Constant::Constant): Ditto.
26401 * interface.cs (InterfaceMemberBase): New OptAttributes field.
26402 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
26403 the attributes as a parameter.
26404 (InterfaceProperty): Update constructor call.
26405 (InterfaceEvent): Ditto.
26406 (InterfaceMethod): Ditto.
26407 (InterfaceIndexer): Ditto.
26409 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
26410 pass the attributes too.
26411 (interface_event_declaration): Ditto.
26412 (interface_property_declaration): Ditto.
26413 (interface_method_declaration): Ditto.
26414 (interface_declaration): Ditto.
26416 2001-09-05 Miguel de Icaza <miguel@ximian.com>
26418 * class.cs (Method::Define): Track the "static Main" definition to
26419 create an entry point.
26421 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26422 EntryPoint if we find it.
26424 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26425 (EmitContext::ig): Make this variable public.
26427 * driver.cs: Make the default output file be the first file name
26428 with the .exe extension.
26430 Detect empty compilations
26432 Handle various kinds of output targets. Handle --target and
26433 rename -t to --dumper.
26435 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26436 methods inherited from Expression return now an Expression. This
26437 will is used during the tree rewriting as we resolve them during
26440 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26441 the spec. Missing entirely is the information about
26442 accessability of elements of it.
26444 (Expression::ExprClassFromMemberInfo): New constructor for
26445 Expressions that creates a fully initialized Expression based on
26446 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26449 (Invocation::Resolve): Begin implementing resolution of invocations.
26451 * literal.cs (StringLiteral): Implement Emit.
26453 2001-09-05 Ravi Pratap <ravi@ximian.com>
26455 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26458 2001-09-04 Ravi Pratap <ravi@ximian.com>
26460 * cs-parser.jay (attribute_arguments): Implement actions.
26461 (attribute): Fix bug in production. Implement action.
26462 (attribute_list): Implement.
26463 (attribute_target): Implement.
26464 (attribute_target_specifier, opt_target_specifier): Implement
26465 (CheckAttributeTarget): New method to check if the attribute target
26467 (attribute_section): Implement.
26468 (opt_attributes): Implement.
26470 * attribute.cs : New file to handle attributes.
26471 (Attribute): Class to hold attribute info.
26473 * cs-parser.jay (opt_attribute_target_specifier): Remove production
26474 (attribute_section): Modify production to use 2 different rules to
26475 achieve the same thing. 1 s/r conflict down !
26476 Clean out commented, useless, non-reducing dimension_separator rules.
26478 * class.cs (TypeContainer.attributes): New member to hold list
26479 of attributes for a type.
26480 (Struct::Struct): Modify to take one more argument, the attribute list.
26481 (Class::Class): Ditto.
26482 (Field::Field): Ditto.
26483 (Method::Method): Ditto.
26484 (Property::Property): Ditto.
26486 * cs-parser.jay (struct_declaration): Update constructor call to
26487 pass in the attributes too.
26488 (class_declaration): Ditto.
26489 (constant_declaration): Ditto.
26490 (field_declaration): Ditto.
26491 (method_header): Ditto.
26492 (fixed_parameter): Ditto.
26493 (parameter_array): Ditto.
26494 (property_declaration): Ditto.
26496 * constant.cs (Constant::Constant): Update constructor similarly.
26497 Use System.Collections.
26499 * parameter.cs (Parameter::Parameter): Update as above.
26501 2001-09-02 Ravi Pratap <ravi@ximian.com>
26503 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26504 (TypeContainer.delegates): New member to hold list of delegates.
26506 * cs-parser.jay (delegate_declaration): Implement the action correctly
26507 this time as I seem to be on crack ;-)
26509 2001-09-02 Miguel de Icaza <miguel@ximian.com>
26511 * rootcontext.cs (RootContext::IsNamespace): new function, used to
26512 tell whether an identifier represents a namespace.
26514 * expression.cs (NamespaceExpr): A namespace expression, used only
26515 temporarly during expression resolution.
26516 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26517 utility functions to resolve names on expressions.
26519 2001-09-01 Miguel de Icaza <miguel@ximian.com>
26521 * codegen.cs: Add hook for StatementExpressions.
26523 * class.cs: Fix inverted test for static flag in methods.
26525 2001-09-02 Ravi Pratap <ravi@ximian.com>
26527 * class.cs (Operator::CheckUnaryOperator): Correct error number used
26528 to make it coincide with MS' number.
26529 (Operator::CheckBinaryOperator): Ditto.
26531 * ../errors/errors.txt : Remove error numbers added earlier.
26533 * ../errors/cs1019.cs : Test case for error # 1019
26535 * ../errros/cs1020.cs : Test case for error # 1020
26537 * cs-parser.jay : Clean out commented cruft.
26538 (dimension_separators, dimension_separator): Comment out. Ostensibly not
26539 used anywhere - non-reducing rule.
26540 (namespace_declarations): Non-reducing rule - comment out.
26542 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26543 with TypeContainer::AddEnum.
26545 * delegate.cs : New file for delegate handling classes.
26546 (Delegate): Class for declaring delegates.
26548 * makefile : Update.
26550 * cs-parser.jay (delegate_declaration): Implement.
26552 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
26554 * class.cs (Event::Define): Implement.
26555 (Event.EventBuilder): New member.
26557 * class.cs (TypeContainer::Populate): Update to define all enums and events
26559 (Events): New property for the events arraylist we hold. Shouldn't we move to using
26560 readonly fields for all these cases ?
26562 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
26564 * class.cs (Property): Revamp to use the convention of making fields readonly.
26565 Accordingly modify code elsewhere.
26567 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26568 the Define method of the Property class.
26570 * class.cs : Clean up applied patch and update references to variables etc. Fix
26572 (TypeContainer::Populate): Update to define all the properties we have. Also
26573 define all enumerations.
26575 * enum.cs (Define): Implement.
26577 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
26579 * cs-parser.jay (overloadable_operator): The semantic value is an
26580 enum of the Operator class.
26581 (operator_declarator): Implement actions.
26582 (operator_declaration): Implement.
26584 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26585 validity of definitions.
26586 (Operator::CheckBinaryOperator): Static method to check for binary operators
26587 (TypeContainer::AddOperator): New method to add an operator to a type.
26589 * cs-parser.jay (indexer_declaration): Added line to actually call the
26590 AddIndexer method so it gets added ;-)
26592 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
26593 already taken care of by the MS compiler ?
26595 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
26597 * class.cs (Operator): New class for operator declarations.
26598 (Operator::OpType): Enum for the various operators.
26600 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
26602 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26603 ostensibly handle this in semantic analysis.
26605 * cs-parser.jay (general_catch_clause): Comment out
26606 (specific_catch_clauses, specific_catch_clause): Ditto.
26607 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26608 (catch_args, opt_catch_args): New productions.
26609 (catch_clause): Rewrite to use the new productions above
26610 (catch_clauses): Modify accordingly.
26611 (opt_catch_clauses): New production to use in try_statement
26612 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26613 and re-write the code in the actions to extract the specific and
26614 general catch clauses by being a little smart ;-)
26616 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26617 Hooray, try and catch statements parse fine !
26619 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26621 * statement.cs (Block::GetVariableType): Fix logic to extract the type
26622 string from the hashtable of variables.
26624 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26625 I end up making that mistake ;-)
26626 (catch_clauses): Fixed gross error which made Key and Value of the
26627 DictionaryEntry the same : $1 !!
26629 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26631 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26633 * cs-parser.jay (event_declaration): Correct to remove the semicolon
26634 when the add and remove accessors are specified.
26636 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26638 * cs-parser.jay (IndexerDeclaration): New helper class to hold
26639 information about indexer_declarator.
26640 (indexer_declarator): Implement actions.
26641 (parsing_indexer): New local boolean used to keep track of whether
26642 we are parsing indexers or properties. This is necessary because
26643 implicit_parameters come into picture even for the get accessor in the
26644 case of an indexer.
26645 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26647 * class.cs (Indexer): New class for indexer declarations.
26648 (TypeContainer::AddIndexer): New method to add an indexer to a type.
26649 (TypeContainer::indexers): New member to hold list of indexers for the
26652 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
26654 * cs-parser.jay (add_accessor_declaration): Implement action.
26655 (remove_accessor_declaration): Implement action.
26656 (event_accessors_declaration): Implement
26657 (variable_declarators): swap statements for first rule - trivial.
26659 * class.cs (Event): New class to hold information about event
26661 (TypeContainer::AddEvent): New method to add an event to a type
26662 (TypeContainer::events): New member to hold list of events.
26664 * cs-parser.jay (event_declaration): Implement actions.
26666 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
26668 * cs-parser.jay (dim_separators): Implement. Make it a string
26669 concatenating all the commas together, just as they appear.
26670 (opt_dim_separators): Modify accordingly
26671 (rank_specifiers): Update accordingly. Basically do the same
26672 thing - instead, collect the brackets here.
26673 (opt_rank_sepcifiers): Modify accordingly.
26674 (array_type): Modify to actually return the complete type string
26675 instead of ignoring the rank_specifiers.
26676 (expression_list): Implement to collect the expressions
26677 (variable_initializer): Implement. We make it a list of expressions
26678 essentially so that we can handle the array_initializer case neatly too.
26679 (variable_initializer_list): Implement.
26680 (array_initializer): Make it a list of variable_initializers
26681 (opt_array_initializer): Modify accordingly.
26683 * expression.cs (New::NType): Add enumeration to help us
26684 keep track of whether we have an object/delegate creation
26685 or an array creation.
26686 (New:NewType, New::Rank, New::Indices, New::Initializers): New
26687 members to hold data about array creation.
26688 (New:New): Modify to update NewType
26689 (New:New): New Overloaded contructor for the array creation
26692 * cs-parser.jay (array_creation_expression): Implement to call
26693 the overloaded New constructor.
26695 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
26697 * class.cs (TypeContainer::Constructors): Return member
26698 constructors instead of returning null.
26700 2001-08-26 Miguel de Icaza <miguel@ximian.com>
26702 * typemanager.cs (InitCoreTypes): Initialize the various core
26703 types after we have populated the type manager with the user
26704 defined types (this distinction will be important later while
26705 compiling corlib.dll)
26707 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26708 on Expression Classification. Now all expressions have a method
26709 `Resolve' and a method `Emit'.
26711 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26712 generation from working. Also add some temporary debugging
26715 2001-08-24 Miguel de Icaza <miguel@ximian.com>
26717 * codegen.cs: Lots of code generation pieces. This is only the
26718 beginning, will continue tomorrow with more touches of polish. We
26719 handle the fundamentals of if, while, do, for, return. Others are
26720 trickier and I need to start working on invocations soon.
26722 * gen-treedump.cs: Bug fix, use s.Increment here instead of
26725 * codegen.cs (EmitContext): New struct, used during code
26726 emission to keep a context. Most of the code generation will be
26729 * cs-parser.jay: Add embedded blocks to the list of statements of
26730 this block. So code generation proceeds in a top down fashion.
26732 2001-08-23 Miguel de Icaza <miguel@ximian.com>
26734 * statement.cs: Add support for multiple child blocks.
26736 2001-08-22 Miguel de Icaza <miguel@ximian.com>
26738 * codegen.cs (EmitCode): New function, will emit the code for a
26739 Block of code given a TypeContainer and its ILGenerator.
26741 * statement.cs (Block): Standard public readonly optimization.
26742 (Block::Block constructors): Link children.
26743 (Block::Child): Child Linker.
26744 (Block::EmitVariables): Emits IL variable declarations.
26746 * class.cs: Drop support for MethodGroups here, delay until
26748 (Method::): Applied the same simplification that I did before, and
26749 move from Properties to public readonly fields.
26750 (Method::ParameterTypes): Returns the parameter types for the
26751 function, and implements a cache that will be useful later when I
26752 do error checking and the semantic analysis on the methods is
26754 (Constructor::GetCallingConvention): Renamed from CallingConvetion
26755 and made a method, optional argument tells whether this is a class
26756 or a structure to apply the `has-this' bit.
26757 (Method::GetCallingConvention): Implement, returns the calling
26759 (Method::Define): Defines the type, a second pass is performed
26760 later to populate the methods.
26762 (Constructor::ParameterTypes): implement a cache similar to the
26763 one on Method::ParameterTypes, useful later when we do semantic
26766 (TypeContainer::EmitMethod): New method. Emits methods.
26768 * expression.cs: Removed MethodGroup class from here.
26770 * parameter.cs (Parameters::GetCallingConvention): new method.
26772 2001-08-21 Miguel de Icaza <miguel@ximian.com>
26774 * class.cs (TypeContainer::Populate): Drop RootContext from the
26777 (Constructor::CallingConvention): Returns the calling convention.
26778 (Constructor::ParameterTypes): Returns the constructor parameter
26781 (TypeContainer::AddConstructor): Keep track of default constructor
26782 and the default static constructor.
26784 (Constructor::) Another class that starts using `public readonly'
26785 instead of properties.
26787 (Constructor::IsDefault): Whether this is a default constructor.
26789 (Field::) use readonly public fields instead of properties also.
26791 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26792 track of static constructors; If none is used, turn on
26793 BeforeFieldInit in the TypeAttributes.
26795 * cs-parser.jay (opt_argument_list): now the return can be null
26796 for the cases where there are no arguments.
26798 (constructor_declarator): If there is no implicit `base' or
26799 `this', then invoke the default parent constructor.
26801 * modifiers.cs (MethodAttr): New static function maps a set of
26802 modifiers flags into a MethodAttributes enum
26803 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
26804 MethodAttr, TypeAttr to represent the various mappings where the
26805 modifiers are used.
26806 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
26808 2001-08-19 Miguel de Icaza <miguel@ximian.com>
26810 * parameter.cs (GetParameterInfo): Fix bug where there would be no
26813 * interface.cs (PopulateIndexer): Implemented the code generator
26814 for interface indexers.
26816 2001-08-17 Miguel de Icaza <miguel@ximian.com>
26818 * interface.cs (InterfaceMemberBase): Now we track the new status
26821 (PopulateProperty): Implement property population. Woohoo! Got
26822 Methods and Properties going today.
26824 Removed all the properties for interfaces, and replaced them with
26825 `public readonly' fields.
26827 2001-08-16 Miguel de Icaza <miguel@ximian.com>
26829 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26830 initialize their hashtables/arraylists only when they are needed
26831 instead of doing this always.
26833 * parameter.cs: Handle refs and out parameters.
26835 * cs-parser.jay: Use an ArrayList to construct the arguments
26836 instead of the ParameterCollection, and then cast that to a
26839 * parameter.cs: Drop the use of ParameterCollection and use
26840 instead arrays of Parameters.
26842 (GetParameterInfo): Use the Type, not the Name when resolving
26845 2001-08-13 Miguel de Icaza <miguel@ximian.com>
26847 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26848 and instead use public readonly fields.
26850 * class.cs: Put back walking code for type containers.
26852 2001-08-11 Miguel de Icaza <miguel@ximian.com>
26854 * class.cs (MakeConstant): Code to define constants.
26856 * rootcontext.cs (LookupType): New function. Used to locate types
26859 2001-08-08 Miguel de Icaza <miguel@ximian.com>
26861 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
26862 this System.Reflection code is. Kudos to Microsoft
26864 * typemanager.cs: Implement a type cache and avoid loading all
26865 types at boot time. Wrap in LookupType the internals. This made
26866 the compiler so much faster. Wow. I rule!
26868 * driver.cs: Make sure we always load mscorlib first (for
26869 debugging purposes, nothing really important).
26871 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
26872 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
26874 * rootcontext.cs: Lookup types on their namespace; Lookup types
26875 on namespaces that have been imported using the `using' keyword.
26877 * class.cs (TypeContainer::TypeAttr): Virtualize.
26878 (Class::TypeAttr): Return attributes suitable for this bad boy.
26879 (Struct::TypeAttr): ditto.
26880 Handle nested classes.
26881 (TypeContainer::) Remove all the type visiting code, it is now
26882 replaced with the rootcontext.cs code
26884 * rootcontext.cs (GetClassBases): Added support for structs.
26886 2001-08-06 Miguel de Icaza <miguel@ximian.com>
26888 * interface.cs, statement.cs, class.cs, parameter.cs,
26889 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26890 Drop use of TypeRefs, and use strings instead.
26892 2001-08-04 Miguel de Icaza <miguel@ximian.com>
26896 * class.cs (Struct::Struct): set the SEALED flags after
26897 checking the modifiers.
26898 (TypeContainer::TypeAttr): new property, returns the
26899 TypeAttributes for a class.
26901 * cs-parser.jay (type_list): Oops, list production was creating a
26902 new list of base types.
26904 * rootcontext.cs (StdLib): New property.
26905 (GetInterfaceTypeByName): returns an interface by type name, and
26906 encapsulates error handling here.
26907 (GetInterfaces): simplified.
26908 (ResolveTree): Encapsulated all the tree resolution here.
26909 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26912 * driver.cs: Add support for --nostdlib, to avoid loading the
26913 default assemblies.
26914 (Main): Do not put tree resolution here.
26916 * rootcontext.cs: Beginning of the class resolution.
26918 2001-08-03 Miguel de Icaza <miguel@ximian.com>
26920 * rootcontext.cs: Provide better error reporting.
26922 * cs-parser.jay (interface_base): set our $$ to be interfaces.
26924 * rootcontext.cs (CreateInterface): Handle the case where there
26925 are no parent interfaces.
26927 (CloseTypes): Routine to flush types at the end.
26928 (CreateInterface): Track types.
26929 (GetInterfaces): Returns an array of Types from the list of
26930 defined interfaces.
26932 * typemanager.c (AddUserType): Mechanism to track user types (puts
26933 the type on the global type hash, and allows us to close it at the
26936 2001-08-02 Miguel de Icaza <miguel@ximian.com>
26938 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26939 RecordInterface instead.
26941 * cs-parser.jay: Updated to reflect changes above.
26943 * decl.cs (Definition): Keep track of the TypeBuilder type that
26944 represents this type here. Not sure we will use it in the long
26945 run, but wont hurt for now.
26947 * driver.cs: Smaller changes to accomodate the new code.
26949 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26952 * rootcontext.cs (CreateInterface): New method, used to create
26953 the System.TypeBuilder type for interfaces.
26954 (ResolveInterfaces): new entry point to resolve the interface
26956 (CodeGen): Property, used to keep track of the code generator.
26958 2001-07-26 Miguel de Icaza <miguel@ximian.com>
26960 * cs-parser.jay: Add a second production for delegate_declaration
26963 (enum_body): Put an opt_comma here instead of putting it on
26964 enum_body or enum_member_declarations so we can handle trailing
26965 commas on enumeration members. Gets rid of a shift/reduce.
26967 (type_list): Need a COMMA in the middle.
26969 (indexer_declaration): Tell tokenizer to recognize get/set
26971 * Remove old targets.
26973 * Re-add the parser target.
26975 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26977 * cs-parser.jay: Add precendence rules for a number of operators
26978 ot reduce the number of shift/reduce conflicts in the grammar.
26980 2001-07-17 Miguel de Icaza <miguel@ximian.com>
26982 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26985 Get rid of old crufty code.
26987 * rootcontext.cs: Use this to keep track of the parsed
26988 representation and the defined types available to the program.
26990 * gen-treedump.cs: adjust for new convention.
26992 * type.cs: Split out the type manager, and the assembly builder
26995 * typemanager.cs: the type manager will live here now.
26997 * cil-codegen.cs: And the code generator here.
26999 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
27001 * makefile: Fixed up for easy making.
27003 2001-07-13 Simon Cozens <simon@simon-cozens.org>
27005 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
27008 (unary_expression): Expand pre_increment_expression and
27009 post_decrement_expression to reduce a shift/reduce.
27011 2001-07-11 Simon Cozens
27013 * cs-tokenizer.cs: Hex numbers should begin with a 0.
27015 Improve allow_keyword_as_indent name.
27017 2001-06-19 Miguel de Icaza <miguel@ximian.com>
27019 * Adjustments for Beta2.
27021 2001-06-13 Miguel de Icaza <miguel@ximian.com>
27023 * decl.cs: Added `Define' abstract method.
27024 (InTransit): new property, used to catch recursive definitions.
27026 * interface.cs: Implement `Define'.
27028 * modifiers.cs: Map Modifiers.constants to
27029 System.Reflection.TypeAttribute flags.
27031 * class.cs: Keep track of types and user-defined types.
27032 (BuilderInit): New method for creating an assembly
27033 (ResolveType): New function to launch the resolution process, only
27034 used by interfaces for now.
27036 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
27037 that are inserted into the name space.
27039 2001-06-08 Miguel de Icaza <miguel@ximian.com>
27041 * ARGH. I have screwed up my tree so many times due to the use of
27042 rsync rather than using CVS. Going to fix this at once.
27044 * driver.cs: Objetify driver. Load assemblies, use assemblies to
27047 2001-06-07 Miguel de Icaza <miguel@ximian.com>
27049 * Experiment successful: Use System.Type rather that our own
27052 2001-05-25 Miguel de Icaza <miguel@ximian.com>
27054 * cs-parser.jay: Removed nsAliases from here.
27056 Use new namespaces, handle `using XXX;'
27058 * namespace.cs: Reimplemented namespace handling, use a recursive
27059 definition of the class. Now we can keep track of using clauses
27060 and catch invalid using clauses.
27062 2001-05-24 Miguel de Icaza <miguel@ximian.com>
27064 * gen-treedump.cs: Adapted for all the renaming.
27066 * expression.cs (Expression): this class now has a Type property
27067 which returns an expression Type.
27069 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
27070 `Type', as this has a different meaning now in the base
27072 2001-05-22 Miguel de Icaza <miguel@ximian.com>
27074 * interface.cs, class.cs: Removed from all the sources the
27075 references to signature computation, as we can not do method
27076 signature computation during the parsing time, as we are not
27077 trying to solve at that point distinguishing:
27081 void a (NS.Blah x) {}
27084 Which depending on the context might be valid or not, as we do not
27085 know if Blah is the same thing as NS.Blah at that point.
27087 * Redid everything so the code uses TypeRefs now instead of
27088 Types. TypeRefs are just temporary type placeholders, that need
27089 to be resolved. They initially have a pointer to a string and the
27090 current scope in which they are used. This is used later by the
27091 compiler to resolve the reference to an actual Type.
27093 * DeclSpace is no longer a CIR.Type, and neither are
27094 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
27095 are all DeclSpaces, but no Types.
27097 * type.cs (TypeRefManager): This implements the TypeRef manager,
27098 which keeps track of all the types that need to be resolved after
27099 the parsing has finished.
27101 2001-05-13 Miguel de Icaza <miguel@ximian.com>
27103 * ARGH. We are going to have to store `foreach' as a class rather
27104 than resolving it, as we need to verify error 1579 after name
27105 resolution. *OR* we could keep a flag that says `This request to
27106 IEnumerator comes from a foreach statement' which we can then use
27107 to generate the error.
27109 2001-05-10 Miguel de Icaza <miguel@ximian.com>
27111 * class.cs (TypeContainer.AddMethod): we now add methods to the
27112 MethodGroup instead of the method hashtable.
27114 * expression.cs: Add MethodGroup abstraction, which gets us one
27115 step closer to the specification in the way we handle method
27118 * cs-parser.jay (primary_expression): qualified_identifier now
27119 tried to match up an identifier to a local variable reference or
27120 to a parameter reference.
27122 current_local_parameters is now a parser global variable that
27123 points to the current parameters for the block, used during name
27126 (property_declaration): Now creates an implicit `value' argument to
27129 2001-05-09 Miguel de Icaza <miguel@ximian.com>
27131 * parameter.cs: Do not use `param' arguments as part of the
27132 signature, per the spec.
27134 2001-05-08 Miguel de Icaza <miguel@ximian.com>
27136 * decl.cs: Base class for classes, structs and interfaces. This
27137 is the "Declaration Space"
27139 * cs-parser.jay: Use CheckDef for checking declaration errors
27140 instead of having one on each function.
27142 * class.cs: Factor out some code for handling error handling in
27143 accordance to the "Declarations" section in the "Basic Concepts"
27144 chapter in the ECMA C# spec.
27146 * interface.cs: Make all interface member classes derive from
27147 InterfaceMemberBase.
27149 2001-05-07 Miguel de Icaza <miguel@ximian.com>
27151 * Many things: all interfaces are parsed and generated in
27152 gen-treedump. Support for member variables, constructors,
27153 destructors, properties, constants is there.
27155 Beginning of the IL backend, but very little done, just there for
27158 2001-04-29 Miguel de Icaza <miguel@ximian.com>
27160 * cs-parser.jay: Fix labeled statement.
27162 * cs-tokenizer.cs (escape): Escape " and ' always.
27163 ref_line, ref_name: keep track of the line/filename as instructed
27164 by #line by the compiler.
27167 2001-04-27 Miguel de Icaza <miguel@ximian.com>
27169 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
27170 to match the values in System.CodeDOM.
27172 Divid renamed to Divide.
27174 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
27176 (Statements.set): remove.
27178 * System.CodeDOM/CodeCatchClause.cs: always have a valid
27181 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
27182 falseStatements always have valid values.
27184 * cs-parser.jay: Use System.CodeDOM now.