1 2008-02-18 Marek Safar <marek.safar@gmail.com>
4 * ecore.cs (IsApplicable): Params methods have lower priority.
6 * support.cs: Return correct parameter modifier for params types.
8 2008-02-18 Marek Safar <marek.safar@gmail.com>
10 * generic.cs (TypeParameter): Cache attribute target name.
12 * support.cs: Removed unused variable.
14 * typemanager.cs: Removed debugging leftover.
16 * ecore.cs: Use local type instead of a property;
18 * class.cs (VerifyMembers): Consider also parent to test whether type member
21 * expression.cs (FullMethodDesc): Removed.
23 * attribute.cs (IsValidArgumentType): Made static.
25 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
27 Cleanup to be more readable.
28 * Makefile (GMCS_PROFILE): Remove.
29 (COMPILER_NAME): New helper.
31 2008-02-15 Miguel de Icaza <miguel@novell.com>
33 * cs-tokenizer.cs: if a conditional expression happens inside a
34 (...) this also means that we do not need to de-ambiguate between
35 an parenthesized expression and a cast.
39 * constant.cs (SideEffectConstant): a constant value that happens
40 to have a side effect.
42 Fixes the build regressions introduced by the fix for #359789
44 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
46 * expression.cs (Conditional.Emit): when emitting the ternary
47 operator, use local variables to generate code verifiable code.
49 The verifier cannot infer that the type on stack before the
50 stloc.0 is executed is of type ParentB. This happens because the
51 stack merge algorithm uses only parent types when deciding which
52 is the common type. This is described in Part III 1.8.1.3 of ECMA
55 This code compiled with mcs is not verifiable under MS. The MS
56 verifier picks the first common interface of Foo and Bar, which is
57 wrong, but doesn't use a full join type of the 2 interfaces.
59 CSC uses a clever hack to compile such code in a verifiable
60 way. It stores the intermediate values in a local variable with
65 2008-02-14 Miguel de Icaza <miguel@novell.com>
67 * expression.cs: Do not fold BitwiseAnd operators when the left
68 side is a false constant, because we still need to evaluate the
73 * support.cs: Instead of throwing an InternalErrorException when
74 the position of the stream is outside the boundary of our buffer,
75 reset the state of the reader, and restart the reading from the
76 beginning of the file.
78 2008-02-14 Marek Safar <marek.safar@gmail.com>
80 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
82 2008-02-14 Marek Safar <marek.safar@gmail.com>
85 * decl.cs: A protected types used inside a private class which parents
86 derives from the protected class are accessible.
88 2008-02-13 Marek Safar <marek.safar@gmail.com>
90 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
91 the parameterless constructor.
93 2008-02-13 Marek Safar <marek.safar@gmail.com>
95 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
96 lookup methods to use standard member cache when doing member lookup.
98 2008-02-12 Marek Safar <marek.safar@gmail.com>
100 * driver.cs: Don't report full path for referenced module as assembly error.
102 2008-02-12 Marek Safar <marek.safar@gmail.com>
104 * Makefile: Fixed `qh' target to work on all machines.
106 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
107 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
108 and HasElementType with TypeManager implementation.
110 2008-02-08 Marek Safar <marek.safar@gmail.com>
112 A fix for bugs #325134, #359749
113 * expression.cs, ecore.cs: Try to resolve an extension method even if the
114 first binds point to non-method member expression.
116 2008-02-08 Marek Safar <marek.safar@gmail.com>
118 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
120 2008-02-08 Marek Safar <marek.safar@gmail.com>
122 A fix for bugs #321394, #323028
123 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
124 Reworked naive IsAccessibleAs implementation to handle nested types.
126 2008-02-05 Jb Evain <jbevain@novell.com>
128 * class.cs: use generic type comparison for parameters
131 2008-02-05 Marek Safar <marek.safar@gmail.com>
133 A fix for bug #325372
134 * class.cs: Use generic type comparison when testing method signatures.
136 2008-02-05 Marek Safar <marek.safar@gmail.com>
138 A fix for bug #357047
139 * ecore.cs: Applied C# 3.0 changes to better conversion.
141 2008-02-05 Marek Safar <marek.safar@gmail.com>
143 A fix for bug #358374
144 * cs-parser.jay: Correctly set modifiers for all constructor types.
146 2008-02-04 Marek Safar <marek.safar@gmail.com>
148 A fix for bug #355251
149 * generic.cs: Added base class constraint based type inference.
151 2008-02-01 Marek Safar <marek.safar@gmail.com>
153 A fix for bug #357255
154 * decl.cs: One more missing visibility check.
156 2008-02-01 Marek Safar <marek.safar@gmail.com>
158 * support.cs: Fixed broken return.
160 2008-01-25 Marek Safar <marek.safar@gmail.com>
162 * report.cs: Correctly reset warnings count after probing.
164 2008-01-25 Martin Baulig <martin@ximian.com>
167 (NamespaceEntry.SymbolFileID): Make this work again after
168 MemberName.ToString() is gone.
170 2008-01-25 Marek Safar <marek.safar@gmail.com>
172 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
175 2008-01-25 Marek Safar <marek.safar@gmail.com>
177 * generic.cs: Use full implicit conversion for type inference fixing.
179 2008-01-24 Marek Safar <marek.safar@gmail.com>
181 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
182 Fixed user operator conversions.
184 2008-01-24 Marek Safar <marek.safar@gmail.com>
186 * generic.cs: Do nullable type to null comparison optimization during
189 2008-01-24 Marek Safar <marek.safar@gmail.com>
191 A fix for bug #355163
192 * generic.cs: Enabled l-value resolve on nullable expressions.
194 2008-01-24 Marek Safar <marek.safar@gmail.com>
196 A fix for bug #353986
197 * class.cs: Ingore static ctors with parameters for any further checks.
199 2008-01-24 Marek Safar <marek.safar@gmail.com>
201 A fix for bug #354310
202 * namespace.cs: Removed redundant check.
204 2008-01-24 Marek Safar <marek.safar@gmail.com>
206 A fix for bug #354928
207 * expression.cs: ElementInitializers can be resolved only once.
209 2008-01-24 Marek Safar <marek.safar@gmail.com>
211 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
212 Condition expressions.
214 2008-01-23 Marek Safar <marek.safar@gmail.com>
216 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
218 2008-01-22 Marek Safar <marek.safar@gmail.com>
220 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
223 * generic.cs: Implemented coalesce expression.
225 2008-01-22 Marek Safar <marek.safar@gmail.com>
227 A fix for bug #355145
228 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
229 expression tree type inference.
231 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
234 * expression.cs (Binary.IsUnsignedType): Fix typo.
236 2008-01-22 Marek Safar <marek.safar@gmail.com>
238 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
240 2008-01-22 Marek Safar <marek.safar@gmail.com>
242 A fix for bug #355161
243 * ecore.cs, expression.cs: Wider range of extension method supported
246 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
248 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
249 AssemblyBuilder to operate in compiler context. Fixes mcs part of
252 2008-01-22 Marek Safar <marek.safar@gmail.com>
254 A fix for bug #355148
255 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
257 2008-01-22 Miguel de Icaza <miguel@novell.com>
259 * expression.cs (CreateExpressionTree): Add support for or and
260 logical or, and indent following the coding conventions.
262 * typemanager.cs (LinqExpression): renamed from
263 ExpressionTreeManager, for a shorter name.
265 Use TypeManager.CoreLookupType to lookup types from our core
266 assemblies and turn those into "Type" variables.
268 Consumers that previously used "Namespace" and "Type" from this
269 class should instead use the TypeExpression which is a type that
270 is fully resolved (without involving the regular C# resolution
273 This typically looks like this:
275 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
276 new MemberAccess (texpr, name, type_arguments, loc)
278 This avoids the problem in: #355178
280 2008-01-21 Marek Safar <marek.safar@gmail.com>
282 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
283 feature in parser only as we do in other cases.
285 2008-01-21 Marek Safar <marek.safar@gmail.com>
287 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
288 typemanager.cs: A refactoring of params arguments to reuse existing
289 expressions (params -> array initializer) to emit params argument instead
290 of specialized handling.
291 It was required by expression tree implementation and it has other benefits
292 as well, we now apply same optimization for params arguments as we do for
295 2008-01-18 Marek Safar <marek.safar@gmail.com>
297 A fix for bug #353526
298 * generic.cs: A type inference of params arguments may not required any
299 temporary array creation.
301 2008-01-18 Marek Safar <marek.safar@gmail.com>
303 A fix for bug #353534
304 * generic.cs, ecore.cs, expression.cs: A method group type inference is
305 supported for delegates only.
307 2008-01-18 Marek Safar <marek.safar@gmail.com>
309 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
310 type for more than 1 candidates.
312 2008-01-18 Marek Safar <marek.safar@gmail.com>
314 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
317 2008-01-16 Marek Safar <marek.safar@gmail.com>
319 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
320 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
321 operator) expressions.
323 2008-01-16 Zoltan Varga <vargaz@gmail.com>
325 * statement.cs: Avoid declaring an IL variable for this_variable since it is
326 not accessed from the generated IL.
328 2008-01-14 Marek Safar <marek.safar@gmail.com>
330 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
331 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
332 statement.cs: The first expression tree implementation drop, mostly
335 2008-01-14 Marek Safar <marek.safar@gmail.com>
337 * ecore.cs (IsNestedChild): Refactored.
339 2008-01-11 Marek Safar <marek.safar@gmail.com>
341 * lambda.cs: Don't use a cast on unknown expression statement.
343 2008-01-10 Geoff Norton <gnorton@novell.com>
345 * cs-tokenizer.cs: One more token to distinguish between method and lambda
348 2008-01-09 Marek Safar <marek.safar@gmail.com>
350 * doc.cs: Report better /doc crash details.
352 2008-01-09 Marek Safar <marek.safar@gmail.com>
354 A fix for bug #352536
355 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
357 2008-01-08 Marek Safar <marek.safar@gmail.com>
359 A fix for bug #352287
360 * ecore.cs, expression.cs: Do `this' access checking in all member access
363 2008-01-08 Marek Safar <marek.safar@gmail.com>
365 * rootcontext.cs, driver.cs: Switch to linq mode by default.
367 * report.cs: Reset message stacks.
369 2008-01-08 Marek Safar <marek.safar@gmail.com>
371 * generic.cs (InferInPhases): Correctly calculate params position.
373 2008-01-08 Marek Safar <marek.safar@gmail.com>
375 * cs-tokenizer.cs: No need to parse full string when parsing lambda
378 2008-01-07 Marek Safar <marek.safar@gmail.com>
380 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
382 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
384 * driver.cs: Updated --help option.
386 2008-01-07 Marek Safar <marek.safar@gmail.com>
388 * generic.cs (InferParamsTypeArguments): Removed.
389 (InferInPhases): Add params type inference.
390 (LowerBoundInference): Fixed scoring mechanism.
392 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
394 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
396 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
397 byte array for unsigned "baked" assemblies.
399 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
401 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
402 array for assemblies that are not strongnamed.
404 2008-01-04 Marek Safar <marek.safar@gmail.com>
406 A fix for bug #351481
407 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
408 declaring type for nested generic types.
410 2008-01-04 Marek Safar <marek.safar@gmail.com>
412 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
415 2008-01-03 Marek Safar <marek.safar@gmail.com>
417 A fix for bug #351047
418 * expression.cs (Binary.ResolveOperator): Allow equality operators between
419 null and structs only when equality and inequality operators are defined
420 either as an user-operators or predefined operators.
422 2008-01-03 Marek Safar <marek.safar@gmail.com>
424 A fix for bug #351047
425 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
427 2008-01-03 Marek Safar <marek.safar@gmail.com>
429 A fix for bug #351257
430 * cs-tokenizer.cs: Advance line number for '\r' correctly.
432 2008-01-03 Marek Safar <marek.safar@gmail.com>
434 A fix for bug #351157
435 * class.cs (Using): Fixed yet another broken cloning.
437 (Block): Put back more sensible default value for statements.
439 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
441 * codegen.cs: Allow AssemblyVersion with only major version component.
444 2007-12-29 Marek Safar <marek.safar@gmail.com>
446 A fix for bug #324654
447 * class.cs: Use FullName property as member name.
449 2007-12-28 Marek Safar <marek.safar@gmail.com>
451 A fix for bug #342117
452 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
453 constructor constraint.
455 2007-12-28 Marek Safar <marek.safar@gmail.com>
457 A fix for bug #338273
458 * class.cs (ProbertyBase): Access modifier checks are required for overrides
461 2007-12-28 Marek Safar <marek.safar@gmail.com>
463 A fix for bug #350839
464 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
466 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
468 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
471 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
473 * statement.cs: Changed some Hashtables to use HybridDictionaries
474 instead. It was observed that some HashTables only contained a few
475 items in the vast majority of cases. Since HybridDictionary is
476 more efficient on small sets (<10 elements), "known_variables"
477 from class ExplicitBlock as well as "labels" and "constants " from
478 class Block were changed to HybridDictionaries.
480 Atsai results: (56216kb->54987kb)
482 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
485 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
487 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
490 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
492 * expression.cs: foreach loop to for loop, saved on allocation of
493 enumerator (59333kb->59141kb)
495 * statement.cs. Changed foreach loops to for loops, saved on
496 allocation of enumerator (59141kb->59006kb)
498 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
499 when constructed with no specified capacity. This was causing a
500 few ArrayLists to allocate more memory than they would potentially
501 need in the Block class and MemberCache class. Setting the
502 ArrayLists to construct with a capacity of 1 saves some
503 memory. (56216kb->55585kb)
505 2007-12-27 Marek Safar <marek.safar@gmail.com>
507 A fix for bug #347189 (2nd issue)
508 * expression.cs (MemberAccess): Nested type can be found in base non-generic
511 2007-12-27 Miguel de Icaza <miguel@novell.com>
513 * report.cs: Do not use colors if stdout and stderr are not a
516 2007-12-27 Marek Safar <marek.safar@gmail.com>
518 A fix for bug #346998
519 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
522 2007-12-27 Marek Safar <marek.safar@gmail.com>
524 A fix for bug #343465
525 * class.cs: Explicit method name for nested types uses dots only.
527 2007-12-27 Marek Safar <marek.safar@gmail.com>
529 A fix for bug #343707
530 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
532 2007-12-27 Marek Safar <marek.safar@gmail.com>
534 * ecore.cs: Report type inference errors only when arguments count matches
537 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
539 * expression.cs, report.cs: New warning.
541 * typemanager.cs: Catch anonymous method type too.
543 2007-12-23 Marek Safar <marek.safar@gmail.com>
545 A fix for bug #346379
546 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
548 2007-12-23 Marek Safar <marek.safar@gmail.com>
550 A fix for bug #347359
551 * expression.cs (Invocation): Don't resolve already resolved expression.
553 2007-12-23 Marek Safar <marek.safar@gmail.com>
555 A fix for bug #347189
556 * class.cs (FixedField): Use non-dependent code only in the define phase.
558 2007-12-23 Marek Safar <marek.safar@gmail.com>
560 A fix for bug #348076
561 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
563 2007-12-22 Marek Safar <marek.safar@gmail.com>
565 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
566 discovered extension methods.
568 2007-12-22 Marek Safar <marek.safar@gmail.com>
570 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
573 2007-12-21 Miguel de Icaza <miguel@novell.com>
575 * report.cs (ErrorMessage): Add support for using colors on
576 terminals that support it.
578 2007-12-21 Marek Safar <marek.safar@gmail.com>
580 * ecore.cs: Use information about expanded params for error reporting.
582 2007-12-21 Marek Safar <marek.safar@gmail.com>
584 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
585 and logic for params overloads.
587 2007-12-15 Miguel de Icaza <miguel@novell.com>
589 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
590 as this is also created from the parser. Fixes #349034
592 2007-12-12 Miguel de Icaza <miguel@novell.com>
594 * statement.cs (Throw.CloneTo): it is valid to have empty
595 expressions for throw.
597 2007-12-03 Marek Safar <marek.safar@gmail.com>
599 * cs-parser.jay: Set delegate constraint parsing region correctly.
601 2007-12-03 Marek Safar <marek.safar@gmail.com>
603 A fix for bug #345467
604 * typemanager.cs (IsEqual): Compare generic parameters position only.
606 2007-11-28 Marek Safar <marek.safar@gmail.com>
608 * expression.cs (BaseAccess): Type arguments can be null.
610 2007-11-27 Raja R Harinath <harinath@gmail.com>
612 * statement.cs (Block.Resolve): Ensure flow-branching tree is
613 consistent even when an error has occured.
614 (Switch.Resolve): Likewise.
616 2007-11-22 Marek Safar <marek.safar@gmail.com>
618 A fix for bug #334505
619 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
622 2007-11-22 Marek Safar <marek.safar@gmail.com>
624 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
625 refactorings required to resolve extension methods correctly when mixing
626 generics and non-generics members.
628 2007-11-20 Marek Safar <marek.safar@gmail.com>
630 A fix for bug #342584
631 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
634 2007-11-19 Marek Safar <marek.safar@gmail.com>
636 A fix for bug #342512
637 * delegate.cs: Use delegate argument expression when is available. Don't
638 emit virtual call when class is sealed.
640 2007-11-16 Marek Safar <marek.safar@gmail.com>
642 A fix for bug #325423
643 * assign.cs (FieldInitializer): Use resolved expression for emit.
645 * class.cs: Print less confusing error message.
647 2007-11-16 Marek Safar <marek.safar@gmail.com>
649 * cs-tokenizer.cs: Removed GMCS ifdefs.
651 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
654 * cs-parser.jay: Disabled nullable check.
656 * generic-mcs: Copied more generic stuff.
658 2007-11-16 Marek Safar <marek.safar@gmail.com>
660 * gcs-parser.jay: Merged to cs-parser.jay.
662 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
663 * *.csproj, *.sources: Updated to use only jay parser file.
665 2007-11-16 Marek Safar <marek.safar@gmail.com>
667 * gcs-parser.jay: Added nullable and default expression feature checks.
669 2007-11-16 Marek Safar <marek.safar@gmail.com>
671 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
672 it fixes many TODOs and hidden bugs.
674 * expression: Removed duplicate error check.
676 2007-11-15 Marek Safar <marek.safar@gmail.com>
678 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
679 implicitly type local variable only when it is used in a declaration.
681 2007-11-15 Marek Safar <marek.safar@gmail.com>
683 * attribute.cs: Use CS0612 for empty strings.
685 2007-11-14 Marek Safar <marek.safar@gmail.com>
687 * lambda.cs, statement.cs: Contextual return may act as a statement.
689 2007-11-14 Marek Safar <marek.safar@gmail.com>
691 A fix for a regression cause by #324222
692 * class.cs: Don't report unused even when it implements an interface.
694 2007-11-13 Marek Safar <marek.safar@gmail.com>
696 A fix for bug #341205
697 * ecore.cs, expression.cs: Method group expression cannot do static
698 method access with an instance reference check before overloading takes
701 2007-11-13 Marek Safar <marek.safar@gmail.com>
703 A fix for bug #325359
704 * class.cs: Use predictable name for automatically generated property.
706 2007-11-12 Marek Safar <marek.safar@gmail.com>
708 A fix for bug #324996
709 * expression.cs (Is): Handle case where D is nullable and T is not
712 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
714 2007-11-12 Marek Safar <marek.safar@gmail.com>
716 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
717 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
718 Flush small error reporting changes.
720 2007-11-09 Marek Safar <marek.safar@gmail.com>
722 A fix for bug #324996
723 * expression.cs: Rewrote Is expression implementation to work with
724 generics, nullable types, anonymous method. A const result expression
725 uses existing infrastructure instead of custom not fully-featured one.
727 2007-11-08 Marek Safar <marek.safar@gmail.com>
729 A fix for bug #340202
730 * class.cs: Consider generics for volatile field.
732 2007-11-08 Marek Safar <marek.safar@gmail.com>
734 A fix for bug #335594
735 * expression.cs: Use conversion rules when handling string addition.
737 2007-11-07 Marek Safar <marek.safar@gmail.com>
739 A fix for bug #336651
740 * expression.cs: Fixed a crash when probing is on.
742 2007-11-07 Marek Safar <marek.safar@gmail.com>
744 A fix for bug #324242
745 * covert.cs: Added a conversion from any nullable-type with an
746 underlying enum-type to the type System.Enum.
748 2007-11-07 Marek Safar <marek.safar@gmail.com>
750 A fix for bug #324222
751 * class.cs: Report all non-used event fields.
753 2007-11-07 Marek Safar <marek.safar@gmail.com>
755 A fix for bug #325161
756 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
757 qualifier for generic types.
759 2007-11-07 Marek Safar <marek.safar@gmail.com>
761 A fix for bug #322971
762 * expression.cs, ecore.cs: Added intermediate result value check for
765 2007-11-07 Marek Safar <marek.safar@gmail.com>
767 A fix for bug #324754
768 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
769 when it was requested.
771 2007-11-07 Marek Safar <marek.safar@gmail.com>
773 A fix for bug #325101
774 * expression.cs: Do type not value comparison for `is' expression.
776 2007-11-07 Marek Safar <marek.safar@gmail.com>
778 A fix for bug #320236
779 * convert.cs: Don't apply user conversion on underlying target type.
781 2007-11-06 Marek Safar <marek.safar@gmail.com>
783 * expression.cs: Don't use unresolved expression for error reporting.
785 2007-11-06 Marek Safar <marek.safar@gmail.com>
787 A fix for bugs #337712, #324490
788 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
789 overloading resolution too.
791 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
792 the process consistent and more robust.
794 * expression.cs, linq.cs, report.cs: Update.
796 2007-11-02 Marek Safar <marek.safar@gmail.com>
798 A fix for bug #332909
799 * attribute.cs: Resolve attributes in correct context using error
802 * rootcontext.cs: Define Obsolete attribute members as core members.
804 2007-11-02 Marek Safar <marek.safar@gmail.com>
806 * statement.cs: Removed unused methods.
808 2007-10-31 Wade Berrier <wberrier@novell.com>
810 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
811 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
814 2007-10-31 Marek Safar <marek.safar@gmail.com>
816 A fix for bug #338102
817 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
818 methods registered as non-generics.
820 2007-10-31 Marek Safar <marek.safar@gmail.com>
822 A fix for bugs #337712, #324490
823 * delegate.cs: Delegate covariance and contravariance is not allowed for
826 2007-10-31 Marek Safar <marek.safar@gmail.com>
828 A fix for bug #337719
829 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
832 2007-10-30 Marek Safar <marek.safar@gmail.com>
834 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
836 2007-10-29 Marek Safar <marek.safar@gmail.com>
838 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
841 2007-10-29 Raja R Harinath <rharinath@novell.com>
843 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
845 2007-10-29 Marek Safar <marek.safar@gmail.com>
847 A fix for bug #334652
848 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
849 extension methods when we have not found the best candidate in normal
852 2007-10-27 Marek Safar <marek.safar@gmail.com>
854 * AssemblyInfo.cs: Keep up-to-date.
856 2007-10-27 Marek Safar <marek.safar@gmail.com>
858 * Makefile: Fixed generics compiler name.
860 2007-10-27 Marek Safar <marek.safar@gmail.com>
862 * lambda.test: removed, lambda parsing is done differently.
864 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
866 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
868 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
870 2007-10-27 Marek Safar <marek.safar@gmail.com>
872 * Makefile, *.sources : All C# compilers are in mcs folder.
874 * *.cs: Use existing 2_1 define for smcs.
876 2007-10-26 Marek Safar <marek.safar@gmail.com>
878 A fix for bug #335847
879 * assign.cs, expression.cs: Couple of changes to avoid creating a
880 temporary variable for each object initializer assignment statement. It
881 simplifies struct initialization too, otherwise two temporary variables
883 Implemented optimization of redundant default element initializers.
885 2007-10-25 Marek Safar <marek.safar@gmail.com>
887 A fix for bug #336766
888 * expression.cs (Class.CheckBase): Use generic name when method is
891 2007-10-25 Marek Safar <marek.safar@gmail.com>
893 A fix for bug #334737
894 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
895 variable and not variable argument for prepared copies.
897 2007-10-24 Marek Safar <marek.safar@gmail.com>
899 A fix for bug #325110
900 * class.cs, expression.cs, attribute.cs: Use open generic method when
901 checking conditional attribute.
903 2007-10-24 Marek Safar <marek.safar@gmail.com>
905 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
906 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
907 FeatureIsNotAvailable.
909 2007-10-24 Marek Safar <marek.safar@gmail.com>
911 ** C# 3.0 Partial methods
913 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
914 methods support. Because of member cache issue with generics only
915 non-generics partial methods are fully supported.
917 2007-10-23 Marek Safar <marek.safar@gmail.com>
919 * class.cs, decl.cs: Rewrote member overloads check to cope with
920 generics and to use member cache for member checking. It also improves
921 performance and fixes remaining overloads issues.
923 2007-10-20 Marek Safar <marek.safar@gmail.com>
925 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
926 roottypes.cs, typemanager.cs:
928 A member cache creation logic changed to add members immediately and
929 not rely on fallback. The member cache is now only prefered way
930 how to access and find type declaration members. It saves 5 MB of memory
931 during MWF compilation and makes code ready for more optimizations and
932 clean-ups, it's also a pre-requirement for partial methods.
934 2007-10-18 Raja R Harinath <harinath@gmail.com>
936 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
937 handling for generic parameters.
939 2007-10-15 Marek Safar <marek.safar@gmail.com>
941 * class.cs (FixedField): Removed redundant volatile check.
943 2007-10-15 Marek Safar <marek.safar@gmail.com>
945 * class.cs, decl.cs: Fixed overload members verification to do only one
946 check per possible collision.
948 2007-10-13 Marek Safar <marek.safar@gmail.com>
950 A fix for bug #325478
951 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
952 and create only one disposable flags container.
954 2007-10-12 Marek Safar <marek.safar@gmail.com>
956 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
957 * statement.cs (Fixed): Fixed variables cloning.
959 2007-10-12 Marek Safar <marek.safar@gmail.com>
961 A fix for bug #333342
962 * class.cs (EventField): Don't mark value type event as synchronized.
964 2007-10-12 Marek Safar <marek.safar@gmail.com>
966 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
967 inference to identify best candidate method correctly.
968 (ProperyExpr): A range variable is read only and cannot be modified.
970 2007-10-11 Marek Safar <marek.safar@gmail.com>
972 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
973 logic to identify best candidate method correctly.
975 2007-10-11 Marek Safar <marek.safar@gmail.com>
977 * location.cs (Equals, GetHashCode): Removed.
979 2007-10-11 Marek Safar <marek.safar@gmail.com>
981 * report.cs: Implemented message recorder. It is used mainly for lambda
982 expressions to capture otherwise swallowed error messages.
984 * anonymous.cs, lambda.cs.cs: Do full parameters check.
986 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
988 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
990 * expression.cs (MemberAccess): Always report lookup failure.
992 * location.cs: Implemented Equals, GetHashCode.
994 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
996 2007-10-10 Jb Evain <jbevain@novell.com>
998 * codegen.cs: re-enable assembly version check.
1000 2007-10-09 Marek Safar <marek.safar@gmail.com>
1002 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
1005 * namespace.cs (UsingAlias): Do correct version check.
1007 2007-10-08 Marek Safar <marek.safar@gmail.com>
1009 * expresison.cs, ecore.cs: Issue extension method error message when
1012 * rootcontext.cs: Added ISO_2 compiler mode option.
1014 2007-10-08 Marek Safar <marek.safar@gmail.com>
1016 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
1019 2007-10-08 Marek Safar <marek.safar@gmail.com>
1021 * attribute.cs (GetString, GetBoolean): Work with both literal and
1024 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
1025 Moved method overload specific methods to MethodGroupExpr.
1027 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
1028 it should be less memory consuming.
1030 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
1032 * codegen.cs: remove the assembly version check until the buildbot is
1035 2007-10-07 Jb Evain <jbevain@novell.com>
1037 * attribute.cs (Attribute.GetString): if the value
1038 expression is a StringConstant, return its string value.
1040 2007-10-07 Jb Evain <jbevain@novell.com>
1042 * typemanager.cs: add `assembly_version_attribute_type`.
1043 * codegen.cs: on attribute emission, check that the
1044 AssemblyVersionAttribute doesn't overflow.
1046 2007-10-05 Marek Safar <marek.safar@gmail.com>
1048 A fix for bug #324677
1049 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
1050 parent container of a scope container with currently resolved one.
1052 2007-10-05 Marek Safar <marek.safar@gmail.com>
1054 A fix for bug #325534
1055 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
1058 2007-10-05 Marek Safar <marek.safar@gmail.com>
1060 A fix for bug #327504
1061 * class.cs (Operator.Define): Refactored implicit and explicit user
1062 operator conversion rules.
1064 2007-10-05 Marek Safar <marek.safar@gmail.com>
1066 A fix for bug #327520
1067 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
1069 2007-10-04 Marek Safar <marek.safar@gmail.com>
1071 A fix for bug #328022
1072 * class.cs (MethodData.Define): Use correct method to check whether
1073 a method implementents an accessor.
1075 2007-10-04 Marek Safar <marek.safar@gmail.com>
1077 A fix for bug #330069
1078 * statement.cs (Fixed.Resolve): Read the first array element only when
1079 an array is instantiated.
1081 2007-10-04 Marek Safar <marek.safar@gmail.com>
1083 * expression.cs, assign.cs, generics.cs: Print correct operator when
1084 compound assignment is used.
1086 2007-10-04 Marek Safar <marek.safar@gmail.com>
1088 A fix for bug #325841
1089 * expression.cs (ArrayAccess): Use full argument cloning only for
1090 string compound concatenation.
1092 2007-10-03 Marek Safar <marek.safar@gmail.com>
1094 A fix for bug #328774
1095 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
1097 (PropertyExpr.EmitAssign): Fixed string concatenation compound
1100 2007-10-03 Raja R Harinath <rharinath@novell.com>
1103 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
1104 Event accessibility checks here. Remove some bogus code that
1105 accidently made GenericMethods work.
1106 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
1108 2007-09-25 Marek Safar <marek.safar@gmail.com>
1110 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
1112 * statement.cs (Block): Refactored AddVariable to allow error handling
1115 * generic.cs: New stub.
1117 2007-09-23 Marek Safar <marek.safar@gmail.com>
1119 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
1122 2007-09-17 Marek Safar <marek.safar@gmail.com>
1124 * class.cs: Use partial container to record whether any partial part
1125 contains static field initializer and therefore default contructor has
1128 2007-09-14 Marek Safar <marek.safar@gmail.com>
1130 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
1131 mono-list when only one of two partial parts has defined accessibility
1134 2007-09-14 Marek Safar <marek.safar@gmail.com>
1136 A fix for bug #82845
1138 * class.cs (TypeContainer): Set correct resolve context for all field
1141 2007-09-13 Marek Safar <marek.safar@gmail.com>
1143 * assign.cs: Fixed a crash when field is resolved twice with an error.
1145 * codegen.cs: Changed InFieldInitializer to be flag.
1147 * anonymous.cs, ecore.cs, expression.cs: Update after
1148 IsInFieldInitializer rename.
1150 * const.cs: Removed unused parameter.
1152 * class.cs: Changed the way how we resolve and emit field initializers.
1153 The field initilizers have to have access to contructor block to emit
1154 compiler generated code.
1156 2007-09-13 Marek Safar <marek.safar@gmail.com>
1158 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
1159 generics use TypeContainer instead.
1161 2007-09-12 Marek Safar <marek.safar@gmail.com>
1163 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
1165 * lambda.cs (ResolveParameters): Use more powerful
1166 InflateGenericArgument.
1168 * parameters.cs: Better exception message.
1170 2007-09-10 Marek Safar <marek.safar@gmail.com>
1172 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
1173 correct expression block type.
1175 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
1177 * expression.cs (Invocation): Extracted method group resolve to
1180 2007-09-07 Marek Safar <marek.safar@gmail.com>
1182 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
1183 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
1185 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
1186 generic extension methods.
1188 2007-09-06 Marek Safar <marek.safar@gmail.com>
1190 A fix for bug #82676 (Do I get it right now?)
1191 * convert.cs (Binary.ResolveOperator): An interface is converted to the
1192 object before a standard conversion is applied.
1194 2007-09-06 Marek Safar <marek.safar@gmail.com>
1196 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
1199 2007-09-05 Marek Safar <marek.safar@gmail.com>
1201 A fix for bug #82676
1202 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
1203 non-generic interface types.
1205 2007-09-05 Marek Safar <marek.safar@gmail.com>
1207 A fix for bug #82690
1208 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
1210 2007-09-05 Marek Safar <marek.safar@gmail.com>
1212 A fix for bug #82571
1213 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
1214 modifier for container based methods.
1216 2007-09-05 Marek Safar <marek.safar@gmail.com>
1218 A fix for bug #82676
1219 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
1220 any interface-type T means to any of interface type T.
1222 2007-09-04 Marek Safar <marek.safar@gmail.com>
1224 * namespace.cs: We have 2 versions of System.Core assembly.
1226 2007-09-04 Marek Safar <marek.safar@gmail.com>
1228 A fix for bug #82652
1229 * class.cs (Class.GetClassBases): Compare types and not expressions.
1231 2007-09-04 Marek Safar <marek.safar@gmail.com>
1233 A fix for bug #82620
1234 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
1235 actually never worked before.
1236 (IndexerAccess): Emit prepared arguments before they are modified.
1238 2007-09-04 Marek Safar <marek.safar@gmail.com>
1240 A fix for bug #82563
1241 * assign.cs: Revert wrong fix.
1243 * expression.cs (VariableReference.EmitAssign): Handle ref reference
1245 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
1246 Instead of ldelema/stdind we have to use temporary variables to handle
1247 cases like String.Concat (params string[]).
1249 2007-08-31 Marek Safar <marek.safar@gmail.com>
1251 * class.cs: EmitAttributes to Emit rename.
1253 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
1255 (MemberCore.HasClsCompliantAttribute): Don't depend on
1256 GetClsCompliantAttributeValue execution.
1258 2007-08-31 Marek Safar <marek.safar@gmail.com>
1260 * anonymous.cs: Use shorter type prefix.
1262 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
1265 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
1266 variables when probing is on.
1268 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
1269 unresolved variables.
1270 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
1271 handle transparent identifiers.
1273 2007-08-26 Marek Safar <marek.safar@gmail.com>
1275 * attribute.cs (IsClsCompliant): Add nullable types test.
1277 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
1279 * doc.cs : catch other types of exception than XmlException to
1280 report CS1570. Fixed bug #82565.
1282 2007-08-23 Marek Safar <marek.safar@gmail.com>
1284 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
1285 The number of delegate parameters has to match.
1286 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
1289 2007-08-21 Marek Safar <marek.safar@gmail.com>
1291 * anonymous.cs (AnonymousMethod): Generate private anonymous method
1292 to fix problem with private arguments.
1294 2007-08-20 Marek Safar <marek.safar@gmail.com>
1296 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
1298 * decl.cs (MemberName): Ignore generic type with no generic arguments.
1300 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
1301 empty. Add cloning suport.
1303 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
1305 2007-08-20 Marek Safar <marek.safar@gmail.com>
1307 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
1308 to create EmptyCast. It handles EmptyConstantCast specialization for
1311 2007-08-18 Marek Safar <marek.safar@gmail.com>
1313 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
1314 (EmitArrayArgument): One routine for array arguments.
1315 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
1317 2007-08-17 Marek Safar <marek.safar@gmail.com>
1319 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
1321 2007-08-17 Marek Safar <marek.safar@gmail.com>
1323 * anonymous.cs: MemberLookupFinal update.
1325 * class.cs (ConstructorInitializer): Is expression based.
1327 * delegate.cs: MethodGroupExpr update.
1329 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
1331 (Error_MemberLookupFailed): Customizable error override.
1332 (MethodGroupExpr): Keep queried type for later usage.
1333 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
1336 * expression.cs: Error_MemberLookupFailed refactoring.
1337 (New.DoResolve): Resolve as much as possible.
1338 (ElementInitializer.Error_MemberLookupFailed): Object initializer
1339 customization for invalid member types.
1341 * statement.cs: MethodGroupExpr update.
1343 2007-08-16 Marek Safar <marek.safar@gmail.com>
1345 * modifier.cs (Check): Check all modifiers and not only accessibility
1348 2007-08-16 Marek Safar <marek.safar@gmail.com>
1350 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
1351 type and not an expression.
1353 2007-08-16 Marek Safar <marek.safar@gmail.com>
1355 * statement.cs (Catch.Clone): Type and variable can be null.
1357 2007-08-16 Marek Safar <marek.safar@gmail.com>
1359 A fix for bug #81979
1360 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
1361 I am really not sure whether this is the best fix.
1363 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
1366 2007-08-14 Marek Safar <marek.safar@gmail.com>
1368 ** C# 3.0 Object and collection initializers (major re-write)
1370 * assign.cs (DoResolve): Initializers are not assign related.
1372 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
1373 used during collection or object initialization.
1375 * expression.cs (Error_InvalidArguments): Add initializers specific
1376 messages. More will come later because it requires some general
1378 (New.DoResolve): Better error handling for unsafe types.
1379 (EmptyExpressionStatement): New class.
1380 (ElementInitializer): An object initializer expression.
1381 (CollectionElementInitializer): A collection initializer expression.
1382 (CollectionOrObjectInitializers): A block of object or collection
1384 (NewInitialize): New expression with element/object initializers.
1386 * statement.cs: Reverted object/collection initializer hacks.
1388 * typemanager.cs (CSharpName): Filter __arglist type.
1390 2007-08-09 Marek Safar <marek.safar@gmail.com>
1392 ** C# 3.0 Anonymous Types (update to the latest standard)
1394 * expression.cs (Binary.ResolveOperator): Threat all null based types
1396 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
1397 (AnonymousTypeParameter): Updated.
1399 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
1400 (AnonymousTypeClass): New anonymous type container.
1402 * class.cs (AddField): Return operation result.
1404 * generic.cs: Another empty TypeArguments overload.
1406 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
1407 are stored at top of normal hierarchy.
1409 * typemanager.cs (CSharpName): Filter anonymous types.
1411 2007-08-09 Marek Safar <marek.safar@gmail.com>
1413 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
1414 as single Concat call. How could we miss that :-(
1416 2007-08-08 Marek Safar <marek.safar@gmail.com>
1418 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
1420 2007-08-07 Miguel de Icaza <miguel@novell.com>
1422 * expression.cs: Fix the previous commit, the creation of the
1423 arguments array list needs also to be conditional on the arguments
1426 * class.cs: Add a little bit of help to help narrow down problems.
1428 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
1429 not try to copy in that case.
1431 * driver.cs: When building SMCS, include a new different set of
1432 default assemblies here. Do this here so we can control whether
1433 to include the default assemblies with /noconfig.
1435 2007-08-03 Marek Safar <marek.safar@gmail.com>
1437 A fix for bug #81979
1438 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
1441 2007-08-03 Marek Safar <marek.safar@gmail.com>
1443 A fix for bug #82300
1445 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
1446 we are in probing scope.
1448 2007-08-03 Marek Safar <marek.safar@gmail.com>
1450 A fix for bug #82301
1452 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
1453 (Statement.CloneTo): Clone and not map children blocks.
1455 2007-08-03 Marek Safar <marek.safar@gmail.com>
1457 A fix for bug #82299
1459 * expression.cs (LocalVariableReference.CloneTo): Remap local info
1462 * statement.cs (Statement.CloneTo): Clone variables before statements
1463 to allow remaping of local variables.
1465 2007-08-03 Marek Safar <marek.safar@gmail.com>
1467 A fix for bug #82296
1470 * report.cs: Log crash details for future clone problems.
1472 * statement.cs (Return.Clone): Don't clone non-existent expression.
1474 2007-08-03 Raja R Harinath <harinath@gmail.com>
1476 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
1477 (Class.AddBasesForPart): Move CS0537 check here from ...
1478 * cs-parser.jay (class_declaration): ... here. Move calling of
1479 'AddBasesForPart' to ...
1480 (class_bases): ... here.
1481 (struct_declaration, interface_declaration): Update to changes.
1483 2007-08-02 Marek Safar <marek.safar@gmail.com>
1485 A fix for bug #81923
1487 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
1488 conversion is allowed.
1490 2007-08-02 Marek Safar <marek.safar@gmail.com>
1492 A fix for bug #81564
1494 * ecore.cs (EventExpr): Add IsBase handling.
1496 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
1499 2007-08-02 Raja R Harinath <harinath@gmail.com>
1501 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
1502 * cs-parser.jay: Some whitespace cleanups.
1503 (current_delegate): New.
1505 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
1506 a dummy code block, and use 'type_name' instead of 'member_name'.
1507 (interface_declaration, class_declaration): Likewise.
1508 (delegate_declaration): Likewise. Rearrange slightly and use
1510 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
1511 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
1513 2007-08-02 Marek Safar <marek.safar@gmail.com>
1515 A fix for bug #82039
1517 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
1520 * typemanager.cs (CSharpName): Split to string overload.
1522 2007-08-02 Marek Safar <marek.safar@gmail.com>
1525 * report.cs: Updated warning CS0472.
1527 2007-08-01 Marek Safar <marek.safar@gmail.com>
1529 A fix for bug #82181
1531 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
1533 2007-08-01 Marek Safar <marek.safar@gmail.com>
1535 A fix for bug #82277
1536 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
1538 2007-08-01 Marek Safar <marek.safar@gmail.com>
1540 ** C# 3.0 Type Inference (major bits are working)
1542 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
1543 (.ImplicitStandardConversionExists): Uses compatible.
1544 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
1545 (.InferReturnType): New method.
1546 (.Compatible): Refactored.
1547 (.ResolveParameters): Uses factory to create resolved parameters.
1548 (.CompatibleMethod): Add probing mode support.
1549 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
1550 clearly distinguish between 2 different operations.
1551 (LambdaMethod): Moved to lambda.cs.
1552 (AnonymousMethod): Removed unused fields and methods.
1553 (AnonymousDelegate): Simplified.
1555 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
1557 * convert. cs (ImplicitConversionStandard): Compatible works differently.
1559 * delegate.cs (Delegate): New mehods to reduce code duplication.
1560 (.GetConstructor): New method.
1561 (.GetInvokeMethod): New method.
1562 (DelegateCreation): Updated.
1564 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
1566 (OverloadResolve): Made probing little bit faster.
1568 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
1571 * generic.cs (TypeInferenceContext): Dummy implementation.
1573 * iterators.cs: Updated after Resolve/Define rename.
1575 * lambda.cs (LambdaExpression)
1576 (.ResolveParameters): Handles both type of arguments and type inference too.
1578 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
1579 (InflateTypes): Updated.
1581 * support.cs (InflateTypes): Changed signature and updated.
1583 * typemanager.cs (LookupMemberCache): Better dynamic type check.
1584 (MemberLookup_FindMembers): More MS tricks.
1585 (GetParameterData): Ditto.
1586 (GetDelegateParameters): Uses quick path for dynamic types.
1588 2007-08-01 Marek Safar <marek.safar@gmail.com>
1590 * class.cs (MethodData.Define): EmitContext is required for generic stuff
1593 2007-07-31 Marek Safar <marek.safar@gmail.com>
1595 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
1598 2007-07-26 Jb Evain <jbevain@novell.com>
1600 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
1601 which takes a boolean 'report_errors', similar to the GetMethod.
1602 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
1603 in .net 2.1, do not report errors here.
1605 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
1606 System.Runtime.CompilerServices.RequiredAttributeAttribute and
1607 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
1610 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
1611 of the type InternalsVisibleToAttribute before the first call
1612 to CoreLookupType which is allowed to fail (third boolean parameter
1613 to true). Because, during the resolution for a type that is not
1614 immediately found, we try to check if the type is not defined in
1615 a friend assembly, and to do so, we need the
1616 InternalVisibleToAttribute.
1618 2007-07-23 Miguel de Icaza <miguel@novell.com>
1620 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
1621 feature that allows structs to be compared against null and inline
1622 the result as true or false.
1624 Notice that the same code is not permitted inside a generic block
1625 of code that would do:
1627 class Foo<T> where T : struct {
1634 It is only allowed if the type of T is not bound (no where
1635 clause). In my opinion, this CSC 2 behavior is broken but people
1636 seem to be using it (IronRuby does, a few bug reports on bugzilla
1637 have it and some people have complained about it).
1639 All of the users that depend on this behavior have code that is
1642 * report.cs (Warning, Error): make these take object arguments,
1643 not strings, as that allows us to take advantage of Format.
1645 2007-07-20 William Holmes <billholmes54@gmail.com>
1647 * decl.cs: Changed MemberName.CountTypeArguments to also check the
1648 Left member variable for the Count.
1649 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
1650 MemberName.CountTypeArguments to avoid a NRE.
1652 This code is contributed under the MIT X11 license
1654 2007-07-18 Marek Safar <marek.safar@gmail.com>
1656 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
1658 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
1660 * doc.cs : generic method arguments are written as ``x while generic
1661 type arguments are `x. Combined with the previous change, fixed bug
1664 2007-07-18 Raja R Harinath <rharinath@novell.com>
1667 * expression.cs (Binary.ResolveOperator): When converting
1668 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
1670 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
1672 * doc.cs : when T: or whatever x: is specified, it does not really
1673 check the doc comment's syntax correctness. Fixed bug #82006.
1675 2007-07-18 Marek Safar <marek.safar@gmail.com>
1677 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
1678 LambdaExpression better.
1680 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
1682 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
1684 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
1685 as it can be generated.
1687 * expression.cs (Invocation.Error_InvalidArguments): Show correct
1690 * lambda.cs (LambdaExpression): Refactored to share same code with
1691 AnonymousMethodExpression.
1693 2007-07-17 Marek Safar <marek.safar@gmail.com>
1695 * anonymous.cs (MakeName): Include host name for easier debugging.
1696 (LambdaMethod): New class for lambda spcecific stuff.
1698 * attribute.cs: Set EmitContext return type.
1700 * class.cs: Set EmitContext return type.
1702 * codegen.cs (EmitContext): Return type cannot be null to stop messing
1703 with null/void meaning.
1705 * iterators.cs (ContainerType): Implemented.
1707 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
1709 * statement.cs (Return): Updated to lambda expressions.
1710 (Block.CloneTo): Parent can be null.
1712 2007-07-13 Marek Safar <marek.safar@gmail.com>
1714 A fix for bug #81917
1715 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
1717 * class.cs (FixedField): Check whether field is in unsafe scope.
1719 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
1720 (FieldExpr.Emit): Fixed buffers cannot be volatile.
1722 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
1725 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
1727 2007-07-13 Marek Safar <marek.safar@gmail.com>
1729 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
1730 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
1733 2007-07-13 Marek Safar <marek.safar@gmail.com>
1735 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
1737 2007-07-13 Marek Safar <marek.safar@gmail.com>
1739 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
1740 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
1742 * codegen.cs(EmitContext): Add ProbingMode flag.
1744 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
1746 * driver.cs: For now set both warning values.
1748 * ecore.cs (SimpleName): Name is readonly.
1749 (MethodGroup.OverloadResolve): One quick path for probing.
1751 * expression.cs (Unary): Set Oper r/o.
1752 (Binary): Set Oper r/o.
1753 (ParameterReference): Set few instance variables as r/o.
1754 (ParameterReference.DoResolveBase): Don't capture aruments when
1756 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
1757 (Arglist): arguments are private.
1758 (SizeOf): type is private and r/o.
1759 (MemberAccess): arguments are private.
1761 * report.cs: Enhanced reporting on/off capabilities.
1763 * lambda.cs: Uses ec.IsInProbingMode.
1764 (ContextualReturn): Derives from return.
1766 * rootcontext.cs: For now set both warning values.
1768 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
1770 (Return.Resolve): Don't die immediately.
1771 (Block.Resolve): Speed-up probing.
1772 (Block.CloneTo): Clone only child blocks.
1774 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
1776 * iterators.cs: reverted Miguel's latest change (r81925) as it
1777 breaks the build in System.
1779 2007-07-13 Miguel de Icaza <miguel@novell.com>
1781 * iterators.cs (Yield.CheckContext): Check for the iterator type
1782 also here as we can call into Yield even in codepaths that are not
1784 (MethodOrOperator is the only path that was checked).
1786 In addition to the standard check, use a more specific check for
1787 constructors to report a more verbose error.
1789 2007-07-12 Miguel de Icaza <miguel@novell.com>
1791 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
1792 report the warning and continue
1794 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
1795 values on the stack on the call to Emit. Use EmitStatement if
1796 possible, or using Emit + Pop if not possible. Fixes #82064
1798 2007-07-12 Raja R Harinath <rharinath@novell.com>
1800 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
1801 avoid try...finally in some cases.
1803 2007-07-10 Marek Safar <marek.safar@gmail.com>
1805 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
1807 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
1808 instead of method. Re-use standard error handling.
1809 (ConstructorInitializer.Emit): Simplified.
1811 * delegate.cs: Updated after Invocation.EmitCall change.
1813 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
1814 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
1815 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
1816 method and don't permanently changing input arguments.
1817 (MethodGroupExpr): Introduced resolved best_candidate, when method group
1818 is resolved it has one of the candidates is the best one which is later
1819 used to emit. Removed a few unused method.
1820 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
1822 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
1823 (Binary.ResolveOperator): Ditto.
1824 (ConditionalLogicalOperator.DoResolve): Ditto.
1825 (Invocation): Uses method group.
1826 (Invocation.DoResolve): Simplified.
1827 (Invocation.EmitCall): Removed useless is_static.
1828 (Invocation.Emit): Delegate to method group.
1829 (Invocation.EmitStatement): Simplified.
1830 (New): Uses method group.
1831 (MemberAccess.DoResolve): Don't destroy original expression.
1833 * statement.cs (ForEach.Resolve): Use null for no method arguments.
1835 2007-07-04 Marek Safar <marek.safar@gmail.com>
1837 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
1840 * lambda.cs: Add custom error message type.
1842 2007-07-03 Marek Safar <marek.safar@gmail.com>
1844 * lambda.cs: Simplified little bit.
1846 * parameter.cs: Introduced ImplicitLambdaParameter.
1847 (Parameters.CreateFullyResolved): New factory instead of ctor.
1851 * delegate.cs: Updated parameter creation.
1853 2007-07-03 Marek Safar <marek.safar@gmail.com>
1855 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
1858 * generic.cs: Synchronized with gmcs.
1860 2007-07-03 Marek Safar <marek.safar@gmail.com>
1862 * class.cs (Indexer): Check return type as soon as possible.
1864 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
1867 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
1869 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
1871 * parameter.cs (Parameter): Use expression type when it is available.
1873 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
1874 method modifier for the first parameter only.
1876 2007-06-24 Marek Safar <marek.safar@gmail.com>
1878 A fix for bug #81938
1879 * typemanager.cs (ChangeType): Fixed couple of char conversions.
1881 * constant.cs: Tide up an exception message.
1883 2007-06-22 Marek Safar <marek.safar@gmail.com>
1885 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
1886 an uninitialized variable is used.
1888 * expression.cs (LocalVariableReference.DoResolve): Ditto.
1890 2007-06-22 Marek Safar <marek.safar@gmail.com>
1892 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
1893 not found error handling.
1895 * expression.cs (ArrayCreation): Removed redundant fields and little bit
1897 (ArrayCreation.ResolveArrayElement): To be ready to customization.
1898 (ArrayCreation.DoResolve): Simplified.
1899 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
1900 its own resolve process.
1901 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
1903 2007-06-20 Marek Safar <marek.safar@gmail.com>
1905 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
1908 2007-06-20 Marek Safar <marek.safar@gmail.com>
1910 * cs-tokenizer.cs: Removed var related stuff.
1912 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
1913 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
1914 a type and a keyword at same time.
1916 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
1919 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
1920 implicitly typed arrays, more changes will follow.
1922 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
1924 2007-06-19 Marek Safar <marek.safar@gmail.com>
1926 * ecore.cs (VarExpr): Removed Handled field.
1928 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
1929 build-in assign functionality.
1930 (ForEach.Resolve): Removed all implicitly typed local variable code and
1932 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
1933 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
1935 2007-06-18 Marek Safar <marek.safar@gmail.com>
1937 * assign.cs: Removed implicitly typed local variable check.
1939 * expression.cs (LocalVariableReference.DoResolve): Add check for self
1940 referencing implicitly typed local variable.
1941 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
1944 * statement.cs (Fixed): Removed unsupported implicitly typed local
1947 2007-06-15 Marek Safar <marek.safar@gmail.com>
1949 * decl.cs (MemberName): Moved all Unbound stuff to parser.
1951 2007-06-14 Marek Safar <marek.safar@gmail.com>
1953 A fix for bugs #81855 and #76274
1954 * attribute.cs (AttachTo): Always set owner for global attributes to
1957 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
1960 * cs-parser.jay: Assembly and module attributes must precede all other
1961 elements except using clauses and extern alias declarations.
1963 2007-06-13 Marek Safar <marek.safar@gmail.com>
1965 A fix for bug #81748
1967 * expression.cs: More checks for non ISO-1 features.
1969 2007-06-12 Marek Safar <marek.safar@gmail.com>
1971 A fix for bug #81807
1972 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
1973 present inside switch statement and it is required by nullable check.
1975 2007-06-12 Marek Safar <marek.safar@gmail.com>
1977 A fix for bug #81840
1978 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
1979 when type matching fails.
1981 * namespace.cs: Tiny error message change.
1983 2007-06-12 Marek Safar <marek.safar@gmail.com>
1985 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
1986 reporting. Added automatic property check.
1988 * class.cs: Updated after CheckAbstractAndExtern relocation.
1989 (AEventPropertyAccessor.GetSignatureForError): Customized.
1991 2007-06-11 Marek Safar <marek.safar@gmail.com>
1993 * class.cs (DefineBaseTypes): Base type can be undefined.
1995 * ecore.cs (TypeLookup): Minor refactoring.
1996 (DoResolveAsTypeStep): Removed redundant check.
1998 * namespace.cs (Lookup): Removed redundant check.
2000 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
2001 ResolveAsTypeTerminal step.
2002 (BootstrapCorlib_*): Simplified.
2003 (PopulateCoreType): Core types can be now external.
2005 2007-06-07 Marek Safar <marek.safar@gmail.com>
2007 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
2009 (InferTypeArguments): Infers anonymous expression type arguments.
2010 (Compatible): Split to Compatible and InferTypeArguments.
2012 * lambda.cs: Updated.
2014 2007-06-08 Marek Safar <marek.safar@gmail.com>
2016 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
2018 2007-06-07 Raja R Harinath <harinath@gmail.com>
2020 Fix #80477, cs0135-2.cs, cs0135-3.cs
2021 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
2022 names to the "known" variables list.
2023 (Block.CheckInvariantMeaningInBlock): Handle the fact the
2024 parameter names are also "known".
2025 (Block.CheckError136): Remove.
2026 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
2029 2007-06-07 Marek Safar <marek.safar@gmail.com>
2031 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
2033 2007-06-06 Marek Safar <marek.safar@gmail.com>
2035 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
2036 internal error not an user error.
2038 * expression.cs (IsApplicable): Refactored to make debugging easier.
2040 * support.cs: More tricks for non-mono runtimes.
2042 * typemanager.cs (CoreLookupType): Made public.
2043 (InitSystemCore): All linq specific stuff moved to linq.cs
2045 2007-06-05 Marek Safar <marek.safar@gmail.com>
2047 * typemanager.cs (CSharpSignature): One more missing build-in types
2049 More tricks for non-mono runtime.
2051 2007-06-05 Raja R Harinath <harinath@gmail.com>
2053 * statement.cs (Block.CheckError136_InParents): Remove.
2054 (Block.AddVariable): Use GetParameterInfo instead.
2055 (ToplevelBlock.ProcessArguments): Likewise.
2057 2007-06-04 Raja R Harinath <rharinath@novell.com>
2059 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
2061 (ToplevelBlock.GetParameterInfo): Split out of ...
2062 (ToplevelBlock.GetParameterRefernce): ... this.
2063 (ToplevelBlock.ParameterMap): Remove.
2064 * expression.cs (ParameterReference): Update to use
2065 ToplevelParameterInfo.
2067 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
2070 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
2071 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
2073 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
2074 (ToplevelBlock.ProcessParameters) ... here.
2075 (ToplevelBlock..ctor): Invoke it.
2077 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
2080 * statement.cs (IKnownVariable): New interface.
2081 (LocalInfo): Implement it.
2082 (ToplevelParameterInfo): New class.
2083 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
2084 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
2085 GetKnownVariableInfo.
2087 2007-06-03 Raja R Harinath <harinath@gmail.com>
2089 Partly speed up CS0136 error checks.
2090 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
2091 'recurse' parameter.
2092 (Block.DoCheckError136): Only check errors in parameters. Move
2093 local variable checks ...
2094 (Block.AddVariable): ... here, and ...
2095 (ToplevelBlock.ResolveMeta): ... here.
2097 2007-06-02 Raja R Harinath <harinath@gmail.com>
2099 * statement.cs (Block.IsChildOf): Remove.
2101 * statement.cs (Statement.Clone): Move special case code ...
2102 (Block.CloneTo): ... here.
2104 2007-05-29 Raja R Harinath <rharinath@novell.com>
2106 * statement.cs (ToplevelBlock.container): Remove field. It's
2107 redundant with 'Parent'.
2108 (ToplevelBlock.ContainerBlock): Remove accessor.
2109 (ToplevelBlock..ctor): Update to changes. Register anonymous
2110 child with parent here, ...
2111 * cs-parser.jay (end_anonymous): ... not here. Don't modify
2113 (start_anonymous): Don't save current_block.
2114 (top_current_block): Remove.
2116 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
2117 (Block.Resolve): Update to changes.
2118 (Block..ctor): Move setting of "correct" 'Toplevel'
2119 and 'Explicit' fields to ...
2120 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
2122 2007-05-27 Raja R Harinath <harinath@gmail.com>
2125 * statement.cs (Block.Implicit): Remove.
2126 (Block): Update to changes.
2127 * flowanalysis.cs: Likewise.
2129 Mildly speed up CheckInvariantMeaningInBlock
2130 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
2131 Recursively call AddKnownVariable to all enclosing blocks.
2132 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
2133 Remove recursive calls.
2134 (Block): Update to changes.
2136 New ExplicitBlock invariants
2137 * statement.cs (Block.Explicit): New field. It points to the
2138 immediately enclosing non-implicit block.
2139 (Block..ctor): Maintain the invariant.
2140 * cs-parser.jay: Take advantage of invariant.
2142 Introduce ExplicitBlock
2143 * statement.cs (ExplicitBlock): New.
2144 (ToplevelBlock): Derive from it.
2145 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
2147 (Block.Implicit): Update to changes.
2148 * cs-parser.jay: Update to changes.
2151 * codegen.cs (EmitContext.IsLastStatement): Remove.
2152 * statement.cs (Block.DoEmit): Update to changes.
2154 2007-05-25 Raja R Harinath <rharinath@novell.com>
2156 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
2157 modifying current_block directly.
2159 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
2161 * class.cs: Implemented automatic properties (C# 3.0)
2162 Thanks to Marek for the help.
2164 2007-05-23 Raja R Harinath <rharinath@novell.com>
2166 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
2167 variable as assigned, note also that all its components are
2169 (MyBitVector.SetRange): New. Function to set multiple bits to true.
2171 2007-05-19 Marek Safar <marek.safar@gmail.com>
2173 * anonymous.cs, class.cs: Emit Compiler generated attribute when
2174 member is marked as compiler generated.
2176 * decl.cs (MemberCore): Refactored ModFlags into property.
2178 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
2179 (Check): Check only accessibility modifiers.
2181 2007-05-18 Raja R Harinath <rharinath@novell.com>
2183 Track all assignable slots in one bit array
2184 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
2185 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
2186 logic from VariableMap constructor here. Use the same 'offset'
2187 variable that's later used for computing offsets of local
2189 * flowanalysis.cs (UsageVector.parameters): Remove.
2190 (UsageVector): Update to changes.
2191 (VariableMap): Remove.
2193 Avoid creating ParameterMap in every block
2194 * statement.cs (Block.ParameterMap): Move ...
2195 (ToplevelBlock.ParameterMap): ... here.
2196 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
2198 * flowanalysis.cs (FlowBranching.param_map): Remove.
2199 (FlowBranching.UsageVector): Update to changes.
2200 (FlowBranchingToplevel.CheckOutParameters): Likewise.
2202 * statement.cs (Block.CloneTo): Clone Toplevel field too.
2204 * expression.cs (ParameterReference): Distinguish between block
2205 where parameter was referenced and declared.
2207 2007-05-18 Marek Safar <marek.safar@gmail.com>
2209 * flowanalysis.cs, statement.cs: Put back improved error handling.
2211 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
2215 Imporved object and collection initialization (C# 3.0).
2217 2007-05-15 Marek Safar <marek.safar@gmail.com>
2219 A fix for bug #81380
2220 * expression.cs (Is.DoResolve): Only value types have constant `is'
2223 2007-05-15 Raja R Harinath <rharinath@novell.com>
2225 * statement.cs (ToplevelBlock.child): Remove.
2227 2007-05-15 Raja R Harinath <harinath@gmail.com>
2229 Rationalize ResolveMeta: refactoring
2230 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
2231 out constant handling code into ...
2232 (Block.DoResolveConstants): ... this.
2234 Rationalize ResolveMeta: kill local_map
2235 * statement.cs (Block.local_map, Block.LocalMap): Remove.
2236 (Block.AssignableSlots): New.
2237 (Block.ResolveMeta): Make protected. Don't create a VariableMap
2238 for locals -- move code from VariableMap here. Avoid unnecessary
2240 * flowanalysis.cs (FlowBranching.local_map): Remove.
2241 (FlowBranching..ctor): Use Block.AssignableSlots.
2242 (VariableMap): Remove unused constructors.
2244 2007-05-11 Raja R Harinath <rharinath@novell.com>
2246 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
2248 2007-05-11 Marek Safar <marek.safar@gmail.com>
2250 * typemanager.cs (IsFriendAssembly): Should not be called for building
2253 2007-05-09 Marek Safar <marek.safar@gmail.com>
2255 * literal.cs (NullConstant): Print null in all cases.
2257 * expression.cs (Binary.ResolveOperator): Implemented delegate
2258 comparison based on C# 2.0 changes.
2260 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
2262 This code is contributed under the MIT X11 license
2264 The following enables support for several C# 3.0 language features:
2266 * cs-tokenizer.cs: Added support for the "var" keyword.
2268 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
2269 Added VarExpr class to facilitate type inferencing.
2271 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
2272 to support anonymous types.
2274 * assign.cs: Added support for type inferencing and initialization.
2276 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
2278 * expression.cs: Added implicit array support to ArrayCreation.
2279 Added 5 types and 1 interface:
2281 IInitializable Implementing classes can inject initializing
2282 statements after object instantiation.
2284 Initializer Stores data for object initialization.
2286 AnonymousType An expression for anonymous types.
2288 AnonymousTypeParameter Stores data about an anonymous type's field.
2290 NewInitialize An expression for object initialization.
2292 CollectionInitialize An expression for collection initialization.
2294 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
2297 2007-05-06 Marek Safar <marek.safar@gmail.com>
2299 A fix for bug #81500
2300 * cs-tokenizer.cs: Add special handling for coalescing operator.
2302 2007-05-06 Marek Safar <marek.safar@gmail.com>
2304 A fix for bug #81529
2305 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
2306 its value from base class until it is redefined.
2308 2007-05-02 Raja R Harinath <rharinath@novell.com>
2310 Fix regression in cs0631-3.cs
2311 * cs-parser.jay (operator_declarator): Add opt_attributes to error
2312 fallback. Make error fallback catch more cases.
2314 2007-05-01 Miguel de Icaza <miguel@novell.com>
2316 * cs-parser.jay: Allow parameters in operator declarations to have
2319 2007-04-27 Miguel de Icaza <miguel@novell.com>
2321 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
2324 * lambda.cs (ContextualReturn.Resolve): An expression is valid
2325 inside the ContextualReturn, it does not have to be an
2326 ExpressionStatement.
2328 2007-04-24 Miguel de Icaza <miguel@novell.com>
2330 * lambda.cs (ContextualReturn.Resolve): if the return type is not
2333 2007-04-23 Miguel de Icaza <miguel@novell.com>
2335 * anonymous.cs (AnonymousContainer): split the virtual Resolve
2336 method in two methods: ResolveNoDefine and Resolve.
2338 ResolveNoDefine will stop just after ResolveTopBlock has been
2341 Resolve will then continue by creating a method and issuing the
2342 call to method.Define ().
2344 (AnonymousMethod): Split and implement the new Resolve and
2345 ResolveNoDefine as well.
2347 * lambda.cs (LambdaExpression): Split the anonymous method
2348 resolution code into a separate routine (CoreCompatibilityTest)
2349 from DoCompatibleTest.
2351 (LambdaExpression.TryBuild): New method, this method tries to
2352 build the LambdaExpression with the given set of types to be used
2353 as the types for the various parameters of the lambda expression.
2355 If the compilation succeed with the given types, the infered type
2356 of the Anonymous method is returned, otherwise null is returned.
2358 2007-04-23 Marek Safar <marek.safar@gmail.com>
2360 A fix for bug #81414
2361 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
2363 2007-04-22 Miguel de Icaza <miguel@novell.com>
2365 * cs-tokenizer.cs: Change various identifiers here from the
2366 camelCasing to the recommended Linux-like style for instance
2367 variables from the Coding Guidelines.
2369 2007-04-19 Martin Baulig <martin@ximian.com>
2372 (Convert.ImplicitReferenceConversionCore): Allow conversions from
2373 System.Enum to System.ValueType.
2375 2007-04-13 Martin Baulig <martin@ximian.com>
2377 Rewrote implicit reference conversions. We need to distinguish
2378 between implicit reference conversions (13.1.4) and implicit
2379 boxing conversions (13.1.5).
2381 According to the spec, there's an an implicit conversion
2382 "From a one-dimensional array-type S[] to IList<T> and base
2383 interfaces of this interface, provided there is an implicit
2384 reference conversion from S to T." Note that this does not
2385 include boxing conversions.
2388 (Convert.ImplicitTypeParameterBoxingConversion): New method.
2389 (Convert.ImplicitReferenceConversion): Split into
2390 ImplicitReferenceConversionCore() and
2391 ImplicitBoxingConversionExist().
2392 (Convert.ImplicitReferenceConversionExists): Use the new
2393 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
2395 2007-04-12 Martin Baulig <martin@ximian.com>
2397 * convert.cs (Convert.ImplicitReferenceConversion): Move the
2398 `TypeManager.null_type' checks up to the top of the method.
2400 2007-04-11 Marek Safar <marek.safar@gmail.com>
2402 A fix for bug #81350
2403 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
2406 2007-04-11 Martin Baulig <martin@ximian.com>
2408 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
2409 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
2410 to make this work for generic classes; fixes #79561.
2412 2007-04-11 Martin Baulig <martin@ximian.com>
2414 * expression.cs (As): Add support for nullable types; fixes #79371.
2416 2007-04-11 Martin Baulig <martin@ximian.com>
2418 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
2419 `type.FullName' is null; fixes #80243.
2421 2007-04-11 Martin Baulig <martin@ximian.com>
2423 * expression.cs (Invocation.IsApplicable): Don't modify the method
2424 if type inference succeeded, but the method was not applicable.
2427 2007-04-10 Marek Safar <marek.safar@gmail.com>
2429 A fix for bug #81324
2430 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
2431 internal and external namespaces containers.
2433 2007-04-10 Martin Baulig <martin@ximian.com>
2435 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
2436 TypeManager.DropGenericMethodArguments() so we also call
2437 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
2439 2007-04-10 Martin Baulig <martin@ximian.com>
2441 * iterators.cs (Iterator.CreateIterator): Don't crash if
2442 `method.ReturnType' is null. This happens if something went wrong
2443 while resolving that typ (we already reported an error in this case).
2445 2007-04-10 Martin Baulig <martin@ximian.com>
2447 * expression.cs (New.DoResolve): Don't call CheckComImport() on
2448 generic interfaces; report the CS0144 directly.
2450 2007-04-10 Martin Baulig <martin@ximian.com>
2452 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
2453 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
2455 2007-04-10 Martin Baulig <martin@ximian.com>
2457 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
2459 2007-04-09 Raja R Harinath <rharinath@novell.com>
2462 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
2463 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
2466 * statement.cs (For.Resolve): If resolution fails, use
2469 2007-04-08 Marek Safar <marek.safar@gmail.com>
2471 * anonymous.cs (MakeName): Make faster and zero-based.
2472 (VerifyExplicitParameterCompatibility): Back to mode where generic
2473 parameter is ignored.
2474 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
2476 * class.cs (EmitType): Method can emit another new method.
2478 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
2480 * driver.cs: Updated.
2482 * lambda.cs: Reuse predefined empty parameters.
2484 * parameter.cs: Updated
2486 * support.cs: Implemented InflateTypes.
2488 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
2489 (InitSystemCore): Introduced to isolate 3.0 dependencies.
2491 2007-04-03 Martin Baulig <martin@ximian.com>
2495 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
2496 version of TypeManager.IsOverride() which also works with generic
2499 2007-04-03 Martin Baulig <martin@ximian.com>
2504 (Convert.ExplicitReferenceConversion): We need to cast when
2505 converting from IList<T> to S[].
2507 2007-04-01 Marek Safar <marek.safar@gmail.com>
2509 * decl.cs (FindExtensionMethods): Consider all candidates with same name
2512 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
2514 2007-03-31 Marek Safar <marek.safar@gmail.com>
2516 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
2517 argument and return type inferring.
2519 * codegen.cs (InferReturnType): Flag whether return can be inferred.
2520 (ReturnType): Turned to property.
2522 * statement.cs (Return): Implemented return type inferring.
2524 * support.cs (ReflectionParameters): Use local types if possible.
2526 2007-03-30 Raja R Harinath <rharinath@novell.com>
2528 * flowanalysis.cs (FlowBranching.Reachability): Remove.
2529 (FlowBranching.UsageVector): Update to changes.
2531 Prepare to kill 'Reachability'
2532 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
2533 argument of constructor.
2535 2007-03-29 Raja R Harinath <rharinath@novell.com>
2537 Prepare to kill 'Reachability'
2538 * flowanalysis.cs (UsageVector.is_unreachable): New.
2539 (UsageVector): Update to maintain 'is_unreachable' in parallel to
2540 'reachability', and verify they're consistent.
2543 * expression.cs (New.EmitStatement): Handle type parameters here too.
2545 2007-03-29 Martin Baulig <martin@ximian.com>
2550 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
2551 CompilerGeneratedClass.
2552 (ScopeInfo.EmitScopeInstance): Make this protected.
2553 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
2554 `ec.CurrentAnonymousMethod.Scope == Scope'.
2556 * statement.cs (Block.ScopeInfo): Make this a property.
2558 2007-03-27 Raja R Harinath <harinath@gmail.com>
2560 Prepare to kill 'Reachability'
2561 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
2562 (FlowBranching.UsageVector.Reachability): Remove property.
2563 (FlowBranching.UsageVector.IsUnreachable): New property.
2564 (FlowBranching.UsageVector.ResetBarrier): New.
2565 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
2566 * codegen.cs, statement.cs: Update to changes.
2568 2007-03-27 Martin Baulig <martin@ximian.com>
2573 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
2576 2007-03-26 Raja R Harinath <rharinath@novell.com>
2578 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
2579 instead of TriState. Remove all mention of TriState.
2581 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
2582 replaced by a boolean. Add boolean 'is_unreachable' field, check
2583 and maintain invariants.
2585 2007-03-25 Marek Safar <marek.safar@gmail.com>
2587 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
2589 2007-03-25 Marek Safar <marek.safar@gmail.com>
2591 * expression.cs: Stop using obsolete 2.0 opcodes.
2593 2007-03-25 Marek Safar <marek.safar@gmail.com>
2595 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
2596 one of the latests Martin's fixes.
2598 2007-03-23 Miguel de Icaza <miguel@novell.com>
2600 * expression.cs: On BigEndian systems, swap the bytes, temporary
2601 solution until we get a new bitconverter class.
2603 2007-03-23 Martin Baulig <martin@ximian.com>
2607 * decl.cs (MemberCache.AddMembers): Add generic methods both as
2608 "Method" and "Method`1". Normally, a cache lookup is done on the
2609 "Method" form (ie. without the generic arity), but this one makes
2610 lookups on the full form work as well.
2612 2007-03-22 Raja R Harinath <rharinath@novell.com>
2614 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
2617 2007-03-20 Bill Holmes <billholmes54@gmail.com>
2619 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
2620 ordered_member_list, to TypeBuilder to store members to be defined
2621 in the order they were parsed in.
2622 - ordered_explicit_member_list contains all properties indexers
2623 and methods that are defined as explicit implementation of an
2624 interface or base class.
2625 - ordered_member_list contains all properties indexers and methods
2626 that are not defined as explicit implementation of an interface
2629 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
2630 functionality in these removed classes has been replaced with
2631 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
2632 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
2634 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
2635 to CheckForDuplications inside GetMethod and SetMethod Define Method
2636 to handle method property and indexer name conflicts.
2640 All code is contributed under the MIT/X11 license.
2642 2007-03-20 Martin Baulig <martin@ximian.com>
2644 * class.cs (TypeContainer.Interfaces): Removed; they're now
2645 included in `TypeContainer.Types'.
2647 2007-03-20 Martin Baulig <martin@ximian.com>
2649 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
2651 * class.cs (TypeContainer.CreateType): New public method. This is
2652 now called before DefineType() to create the TypeBuilders.
2653 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
2654 has already been created by CreateType().
2655 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
2656 don't resolve our base classes here; this has been moved into
2657 DefineBaseTypes(). We're now called from CreateType().
2658 (TypeContainer.DefineBaseTypes): New private method; resolve our
2659 base classes here. We're now called from DefineType().
2662 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
2663 our types first to create all the TypeBuilders. After that, call
2664 TypeContainer.DefineType() on all the types which'll resolve their
2665 base classes and setup the resolve order.
2667 2007-03-20 Martin Baulig <martin@ximian.com>
2669 * class.cs (TypeContainer.Enums): Removed; they're now included in
2670 `TypeContainer.Types'.
2672 2007-03-20 Martin Baulig <martin@ximian.com>
2675 (TypeContainer.DefineType): Don't call ResolveMembers() here.
2676 (TypeContainer.DoResolveMembers): Call DefineType() on our
2677 `compiler_generated' classes; moved here from DefineNestedTypes().
2680 (RootContext.ResolveTree): Call ResolveMembers() on all
2681 TypeContainer's in the `type_container_resolve_order'.
2683 2007-03-19 Marek Safar <marek.safar@gmail.com>
2685 * class.cs: Use corlib to handle InternalMethodImplAttribute.
2687 2007-03-17 Marek Safar <marek.safar@gmail.com>
2689 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
2690 implementation flags.
2692 2007-03-17 Marek Safar <marek.safar@gmail.com>
2694 * class.cs: More optimizations for type parameters.
2696 2007-03-15 Marek Safar <marek.safar@gmail.com>
2698 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
2700 * ecore.cs, parameter.cs: More common code for both corlibs.
2702 * typemanager.cs (IsGenericMethod): Simplified.
2704 2007-03-15 Raja R Harinath <rharinath@novell.com>
2706 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2708 * statement.cs, iterators.cs, lambda.cs: Update to changes.
2710 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
2711 unconditionally. Simplify explanation.
2712 (Try.Resolve, Using.Resolve): Likewise.
2714 2007-03-15 Martin Baulig <martin@ximian.com>
2718 * decl.cs (DeclSpace): If we're a partial class, use our
2719 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
2721 2007-03-15 Raja R Harinath <rharinath@novell.com>
2723 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2725 (FlowBranching.UsageVector): Update to changes.
2726 (FlowBranching.MergeSiblings): Likewise.
2727 * statement.cs: Likewise.
2729 2007-03-15 Martin Baulig <martin@ximian.com>
2734 (MemberCache): Added a special .ctor for type parameters.
2737 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
2740 2007-03-09 Martin Baulig <martin@ximian.com>
2742 * enum.cs (Enum): Make this a TypeContainer.
2743 (EnumMember): Derive from `Const'.
2746 (Const.DoResolveValue): New protected virtual method; move most of
2747 the functionality of ResolveValue() here so we can override it in
2749 (Const.CreateConstantReference): Make this virtual.
2751 * class.cs (Kind): Add `Kind.Enum'.
2752 (TypeContainer.Emit): Don't emit the enums here; they're already
2753 in the `RootContext.typecontainer_resolve_order'.
2755 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
2756 here; they're already in the `typecontainer_resolve_order'.
2758 * ecore.cs (EnumConstant.ConvertImplicitly): Add
2759 TypeManager.DropGenericTypeArguments().
2762 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
2763 (TypeManager.IsEnumType): Likewise.
2764 (TypeManager.EnumToUnderlying): Likewise.
2765 (TypeManager.IsEqual): Add support for enums.
2767 2007-03-12 Raja R Harinath <rharinath@novell.com>
2769 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
2770 DefaultParameterValueAttribute to be undefined, say if System.dll
2773 2007-03-11 Marek Safar <marek.safar@gmail.com>
2775 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
2778 2007-03-10 Marek Safar <marek.safar@gmail.com>
2780 * class.cs, parameter.cs: Unified parameters verification.
2782 2007-03-08 Martin Baulig <martin@ximian.com>
2784 * cs-parser.jay (constructor_header): Pass the location to the
2785 newly created TopLevelBlock.
2787 2007-03-07 Martin Baulig <martin@ximian.com>
2789 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
2791 2007-03-06 Miguel de Icaza <miguel@novell.com>
2793 * convert.cs (ExplicitReferenceConversionExists): Sync this method
2794 with the changes from David, fixes the build.
2796 2007-03-05 David Mitchell <dmitchell@logos.com>
2798 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
2799 and its base interfaces to a one-dimensional array type S[],
2800 provided there is an implicit or explicit reference conversion
2803 2007-03-03 Marek Safar <marek.safar@gmail.com>
2805 * cs-tokenizer.cs: Implemented basic linq grammar.
2807 * driver.cs: Set linq lang version on demand.
2809 2007-02-26 Marek Safar <marek.safar@gmail.com>
2811 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
2813 2007-02-25 Marek Safar <marek.safar@gmail.com>
2815 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
2818 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
2820 Check property and event extern attributes.
2822 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
2825 2007-02-24 Marek Safar <marek.safar@gmail.com>
2827 A fix for bug #80407
2828 * ecore.cs: Don't report ambiguity error when methods have same parent.
2830 2007-02-23 Marek Safar <marek.safar@gmail.com>
2832 A fix for bug #80878
2833 * class.cs, cs-parser.jay: Event property can host anonymous methods.
2835 2007-02-22 Marek Safar <marek.safar@gmail.com>
2837 * attribute.cs: Enable ExtensionAttribute presence test.
2839 2007-02-22 Marek Safar <marek.safar@gmail.com>
2841 * class.cs: Warn about missing GetHashCode only when Equals is override.
2843 * decl.cs: Check accessibility of type arguments.
2845 * typemanager.cs: Correctly report nullable array.
2847 2007-02-20 Marek Safar <marek.safar@gmail.com>
2849 * class.cs, report.cs: Capture more details when things go wrong.
2851 2007-02-20 Marek Safar <marek.safar@gmail.com>
2853 A fix for bug #80650
2854 * cs-parser.jay: Anonymous container starts at constructor declaration
2855 and not at block beginning because it has to be usable in constructor
2858 * statement.cs: Use context location and not block one for error reporting.
2860 2007-02-18 Marek Safar <marek.safar@gmail.com>
2862 A fix for bug #78712
2863 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
2866 2007-02-18 Marek Safar <marek.safar@gmail.com>
2868 A fix for bug #80493 by Atsushi Enomoto
2869 * cs-parser.jay: Ignore invalid attribute target.
2871 2007-02-18 Marek Safar <marek.safar@gmail.com>
2873 * cs-tokenizer.cs: Ignore '\0' as white space character.
2875 2007-02-17 Miguel de Icaza <miguel@novell.com>
2877 * cs-parser.jay: Add support for lambda expressions to the mcs
2880 * lambda.cs: Only clone when we are probing, not on the final call
2881 (Compatible is the final call).
2883 * statement.cs (CloneContext): Introduce class to provide block
2884 remapping during clone.
2886 All statements Clone themselves now.
2888 (Clone): special handling for blocks, when we clone a block, we
2889 register the block inside this routine, as children of the block
2890 might trigger a lookup.
2892 * expression.cs: Add support for CloneContext in all expressions.
2894 2007-02-17 Marek Safar <marek.safar@gmail.com>
2896 A fix for bug #80493
2897 * statement.cs: Report ambiguous warning when interfaces are not related.
2899 2007-02-15 Marek Safar <marek.safar@gmail.com>
2901 C# 3.0 extension methods.
2903 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
2904 cannot be used directly.
2906 * class.cs (Class.Emit): Emit extension attribute if any class method
2907 is extension method.
2908 (Method.Define): Add basic extension method validation conditions.
2909 (Method.Emit): Emit extension attribute for method.
2911 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
2912 extension method exists. Currently we follow same approach as Microsoft
2913 does, emit even if a method or a class are private but this can change
2916 * cs-parser.jay: Add handling of `this' keyword in method parameters
2919 * decl.cs (DeclSpace.IsStaticClass): New property.
2920 (MemberCache.FindExtensionMethods): Looks for extension methods with
2921 defined name and extension type.
2923 * doc.cs: Updated after OverloadResolve changes.
2925 * driver.cs: Add new soft reference to System.Core.dll.
2927 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
2928 (ExtensionMethodGroupExpr): Represents group of extension methods.
2930 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
2931 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
2932 to MethodGroupExpr and made non-static for easier customization.
2933 (Invocation.DoResolve): Add extension method lookup when no standard
2935 (MemberAccess.DoResolve): Try extension methods if no member exists.
2937 * modifiers.cs: Add METHOD_EXTENSION modifier.
2939 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
2940 as well as candidate extension type.
2941 (ComputeNamespaces): When assembly constains extension methods registers
2943 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
2944 extension method lookup.
2945 (Namespace.LookupExtensionMethod): Looks for extension method in this
2947 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
2948 find a method which matches name and extensionType.
2950 * parameter.cs (Parameter): Add This modifer.
2951 (HasExtensionMethodModifier): New property.
2952 (Resolve): Add extension parameter check.
2953 (ModFlags): turned to property to exclude this modifier as it is not real
2955 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
2957 * support.cs (ParameterData): Add ExtensionMethodType.
2958 (ReflectionParameters): Implemented ExtensionMethodType interface property.
2960 * typemanager.cs: Add type and ctor extension attribute type.
2962 2007-02-15 Miguel de Icaza <miguel@novell.com>
2964 * report.cs (DisableErrors, EnableErrors): used to prevent error
2965 output when we are "trying" to compile various methods with
2968 * ecore.cs (Expression): Add Clone method that calls the virtual
2969 CloneTo method. The current CloneTo method in Expression throws
2970 an exception so we can track down all the places where this must
2971 be implemented (not using abstract, because that would be a lot of
2972 up-front-work before we can start testing the implementation
2975 Important: we only need Clone capabilities for expressions created
2976 by the parser, as the expressions we will be cloning are
2977 expressions in the pre-resolved state. This vastly simplifies
2980 (SimpleName): Add CloneTo that does nothing.
2981 (EmptyCast): Add CloneTo.
2983 * expression.cs (Binary): Implement CloneTo.
2984 (Invocation.IsApplicable): Store the current ec in
2985 EmitContext.TempEc and restore it on return. This is used so we
2986 do not have to sprinkle hundres of methods with an extra
2987 EmitContext, we know that the only user is the lambda expression
2988 ImplicitConversionExists code.
2990 (Argument): Add Cloning capabilities.
2991 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
2992 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
2993 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
2994 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
2995 IndexerAccess): Add Clone capability.
2997 (LocalVariableReference, This): TODO: needs cloned Block mapping.
2999 (Argument): Add cloning capability.
3001 * assign.cs (Assign): Implement CloneTo.
3003 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
3005 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
3006 version by calling Convert with the EmitContext (that we are
3007 currently storing in ec, this is not great, but will do for now,
3008 to avoid passing EmitContext parameters to hundreds of functions
3009 that do not need them now).
3011 (SetExpression): Remove, it is not needed.
3013 (ContextualReturn): Implement CloneTo.
3015 * statement.cs (Statement): Implement cloning infrastructure,
3016 similar to expressions.
3018 (Block): Partial implementation of Clone for statements.
3020 (Return): Implement clone.
3022 * constant.cs (Constant.CloneTo): New method, does nothing.
3024 * codegen.cs (TempEc): Add a static EmitContext as a temporary
3025 solution, until we decide how to exactly do this.
3027 2007-02-14 Marek Safar <marek.safar@gmail.com>
3029 A fix for bug #80493
3030 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
3031 a property is override we need to use second accessor.
3033 2007-02-13 Marek Safar <marek.safar@gmail.com>
3035 A fix for bug #80418
3036 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
3039 2007-02-13 Marek Safar <marek.safar@gmail.com>
3041 Another fix for bug #80749
3042 * pending.cs: Abstract class has priority over interfaces.
3044 2007-02-13 Marek Safar <marek.safar@gmail.com>
3046 Another fix for bug #80749
3047 * pending.cs: Abstract class has priority over interfaces.
3049 2007-02-13 Marek Safar <marek.safar@gmail.com>
3051 Another fix for bug #80749
3052 * pending.cs: Abstract class has priority over interfaces.
3054 2007-02-13 Marek Safar <marek.safar@gmail.com>
3056 Another fix for bug #80749
3057 * pending.cs: Abstract class has priority over interfaces.
3059 2007-02-13 Marek Safar <marek.safar@gmail.com>
3061 * class.cs Better error message.
3063 * driver.cs: Add shorter versions of -optimize option.
3065 2007-02-13 Martin Baulig <martin@ximian.com>
3067 * class.cs (Constructor.Emit): Check the return value of
3068 ec.ResolveTopBlock() and return on error.
3070 2007-02-13 Raja R Harinath <rharinath@novell.com>
3072 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
3073 message to fix error message regression.
3075 2007-02-12 Marek Safar <marek.safar@gmail.com>
3077 * delegate.cs: Delegate creation expression cannot be of Nullable type.
3079 2007-02-12 Marek Safar <marek.safar@gmail.com>
3081 A fix for bug #80749
3082 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
3083 its parent container.
3085 * class.cs (DefineFieldInitializers): Each initializer can has different
3088 * const.cs: Updated.
3090 2007-02-11 Miguel de Icaza <miguel@novell.com>
3092 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
3093 now all the heavy lifting to check that embedded statements or
3094 expressions have the right form is done in the ContextualReturn.
3096 (ContextualReturn): New class.
3098 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
3099 method that can be invoked to report 201, so we do not replicate
3102 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
3104 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
3105 treating tabs as spaces.
3107 2007-02-09 Marek Safar <marek.safar@gmail.com>
3109 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
3110 * assign.cs: Use full implicit conversion for right side check.
3112 2007-02-09 Marek Safar <marek.safar@gmail.com>
3114 * statement.cs (Switch): Switch over boolean type is not standardized.
3116 2007-02-08 Marek Safar <marek.safar@gmail.com>
3118 A fix for bug #80755
3119 * decl.cs (FindBaseEvent): Don't use method cache for events.
3121 2007-02-07 Marek Safar <marek.safar@gmail.com>
3123 * cs-parser.jay: Better syntax error handling.
3125 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
3126 instead of underlying type value.
3128 2007-02-06 Marek Safar <marek.safar@gmail.com>
3130 * driver.cs: Check define identifier before is registered.
3132 * namespace.cs: Use existing error message.
3134 * report.cs: New warning.
3136 2007-02-06 Marek Safar <marek.safar@gmail.com>
3138 A fix for bug #80742
3139 * expression.cs: Delegate Invoke method can be called directly.
3141 2007-02-06 Marek Safar <marek.safar@gmail.com>
3143 A fix for bug #80676
3144 * class.cs (IsEntryPoint): The Main method can have params modifier.
3146 2007-02-04 Miguel de Icaza <miguel@novell.com>
3148 * parameter.cs (Parameter, Parameters): Add Clone method.
3150 * anonymous.cs (Compatible): Turn method into virtual method, so
3151 LambdaExpression can implement a different behavior.
3153 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
3154 out the basic checking here, so it can be used by
3157 * lambda.cs: Introduce "Compatible" function that will do the
3160 2007-02-02 Marek Safar <marek.safar@gmail.com>
3162 * attribute.cs: Unified one error message.
3164 * class.cs (Class): Use type attributes and not properties to test static
3166 (IsEntryPoint): Don's pass local variable.
3168 * convert.cs: Removed duplicate check.
3170 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
3172 * driver.cs: Don't crash when soft reference does not exist.
3174 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
3175 (UsingEntry): Removed redundant allocation.
3177 * parameter.cs: Add fast path for type parameters.
3179 * support.cs: Don't allocate attribute when it's not used.
3181 2007-01-30 Miguel de Icaza <miguel@novell.com>
3184 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
3185 this into a virtual method, so we can override it in LambdaExpression.
3187 * driver.cs: Improve diagnostics in case of failure.
3189 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
3190 write a function that is slightly more complex and that parses:
3192 type identifier [, type identifier]* )
3194 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
3197 (canEmpty ? i >= 0 : i > 0)
3199 2007-01-30 Raja R Harinath <rharinath@novell.com>
3201 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
3202 exception on possibly valid code.
3204 2007-01-29 Raja R Harinath <rharinath@novell.com>
3206 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
3208 (parse_opt_type_arguments): Remove. It's almost the same as
3210 (parse_namespace_or_typename): Use parse_less_than.
3212 2007-01-28 Miguel de Icaza <miguel@novell.com>
3214 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
3215 this bug took a few hours to find, because the state saved and
3216 restored by PushPosition and PopPosition was ignoring the state of
3217 parse_generic_less_than.
3219 I can also now remove the handling of OP_LT and OP_GT, this solves
3222 * cs-tokenizer.cs: store the location for the ARROW token, we use
3225 (PushPosition, PopPosition): save/restore also `current_token',
3226 restore `parse_generic_less_than' (was missing).
3228 (parse_opt_type_arguments): use parse_type, not
3229 parse_namespace_or_typename to parse types.
3231 * lambda.cs: Empty new file, will eventually have the lambda
3232 expression implementation.
3234 * lambda.test: used to test the internal tokenizer.
3236 * report.cs (FeatureIsNotISO1): Rename from
3237 FeatureIsNotStandardized, because it was about the language level
3238 (1 vs 2) it was not about standarization.
3240 (FeatureRequiresLINQ): New.
3242 * support.cs (SeekableStreamReader): Only require that the reader
3243 is a TextReader, not a StreamReader, so we can plug StringReader.
3245 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
3246 given position in the input stream the following tokens can be
3247 parsed as a type followed by an identifier.
3249 (is_punct): after a '(' if parse_type_and_parameter returns true,
3250 then return a special token OPEN_PARENS_LAMBDA which is used to
3251 avoid reduce/reduce errors in the grammar for the
3252 lambda_expression rules.
3254 (parse_type): implement a type parser inside the
3255 tokenizer, the parser only returns true or false depending on
3256 whether the input at a given position can be parsed as a type.
3258 (peek_token): new method used during type parsing.
3260 2007-01-28 Raja R Harinath <rharinath@novell.com>
3263 * anonymous.cs (ScopeInfo.InflateParameters): New.
3264 (AnonymousContainer.Resolve): Use it to redirect types of
3265 delegate parameters.
3267 2007-01-27 Raja R Harinath <rharinath@novell.com>
3270 * expression.cs (Error_InvalidArguments): Don't use two different
3271 messages for CS1503. Use ExtraInformation and
3272 SymbolRelatedToPreviousError instead.
3275 * decl.cs (DeclSpace.initialize_type_params): Don't access
3276 'type_params' of a partial class directly.
3278 2007-01-26 Miguel de Icaza <miguel@novell.com>
3280 * constant.cs: Removed a handful of out-of-range checks that were
3283 2007-01-25 Marek Safar <marek.safar@gmail.com>
3285 * expression.cs (CheckUselessComparison): Add additional check for char
3288 * namespace.cs: Fixed typo.
3290 2007-01-23 Miguel de Icaza <miguel@novell.com>
3292 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
3293 gone, instead we inline the test, preventing the needless casts to
3294 longs, ulongs and doubles for the parameters, avoiding calls to
3295 methods that overchecked stuff, and instead inlined things
3298 2007-01-20 Marek Safar <marek.safar@gmail.com>
3300 * cs-parser.jay: Better parameter error handling.
3302 2007-01-17 Marek Safar <marek.safar@gmail.com>
3304 A fix for bug #80368, #80522
3305 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
3306 whether array initializer contains constants only.
3307 (ArrayCreation.Emit): Use better formula to decide when
3308 are array initializers for static initialization.
3309 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
3310 have to emit even constants otherwise they are pre-initialized.
3312 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
3313 Raja R Harinath <rharinath@novell.com>
3315 Fix emit order of 'get' vs. 'set'.
3316 * support.cs (Accessors): New.
3317 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
3318 Note the order in which accessors are declared in the source.
3319 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
3320 Refactored from Property.Define and Indexer.Define.
3321 (PropertyBase.DefineAccessors): New helper that calls the above in
3322 appropriate order as noted by the parser.
3323 (Property.Define, Indexer.Define): Update to changes.
3324 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
3326 2007-01-17 Raja R Harinath <rharinath@novell.com>
3328 Fix cs0029-6.cs and gcs0029-2.cs (regression)
3329 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
3330 there's an implicit conversion from the current type to the target
3331 type before converting the underlying constant.
3333 2007-01-16 Marek Safar <marek.safar@gmail.com>
3335 * const.cs (ResolveValue): Updated after constant conversion was made more
3338 * constant.cs (GetAttributableValue): constant to object conversion is
3339 used for attributes only.
3340 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
3341 constant conversions.
3342 (LongConstant.ConvertImplicitly): Ditto.
3344 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
3345 (ImplicitConversionStandard): Handle constant conversion as extra step.
3346 It solves the issue when constant conversion was called indirectly like
3347 inside array initializer and constant folding was skipped.
3349 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
3352 * statement.cs(ImplicitConversionStandard): Updated after constant
3353 conversion was made more generic.
3355 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
3357 * expression.cs (As.DoResolve): Use GenericConstraints instead of
3358 Constraints, solves the problem where the compiler incorrectly
3359 reported that a type parameter was not constrained to a class (Bug
3362 2007-01-14 Marek Habersack <grendello@gmail.com>
3364 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
3366 2007-01-14 Marek Safar <marek.safar@gmail.com>
3368 A fix for bug #80368
3369 * assign.cs (FieldInitializer): New class implements field
3370 initializer statement.
3372 * attribute.cs: Update after FieldMember rename.
3374 * class.cs (PropertyBasedMember): New common class for property based
3376 (InterfaceMemberBase): New base class for all members which can be used as
3377 an interface members.
3378 (MethodCore): Moved really common code to InterfaceMemberBase.
3379 (Method.Define): Equal and GetHasCode detection is relevant for methods
3381 (MethodData.Define): Don't assume that public event implements an
3382 interface automatically.
3383 (MethodData.DefineMethodBuilder): Issue an error even if only extern
3385 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
3386 (FieldMember): Merged with FieldBase.
3387 (EventProperty.AEventPropertyAccessor): New specialization to check whether
3388 event extern modifier can be used.
3389 (EventField.EventFieldAccessor): Moved event field specific code here.
3390 (Event.AllowedModifiers): Even event can be extern.
3391 (Event.FindOutBaseMethod): New override specific to events.
3392 (Indexer.parameters): Reintroduce parameters because base class holds
3393 only properties common data.
3394 (Indexer.CheckForDuplications): Indexers are threated as methods so we
3395 need do extra parameters check.
3397 * const.cs: Update after FieldMember rename.
3399 * decl.cs (MemberCache.FindBaseEvent): New method.
3401 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
3402 to reflect that indexer is now derived from PropertyBased.
3404 * ecore.cs (GetMemberType): Made public.
3405 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
3408 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
3410 * typemanager.cs (CSharpSignature): Correctly print event accessors.
3411 (RegisterEvent): Removed.
3412 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
3413 (GetPrivateFieldOfEvent): Renamed to GetEventField.
3415 2007-01-11 Raja R Harinath <rharinath@novell.com>
3418 * statement.cs (CollectionForeach.TryType): Prefer generic
3419 GetEnumerator over non-generic variant. Fix code to follow comments.
3421 2007-01-09 Raja R Harinath <rharinath@novell.com>
3424 * support.cs (ReflectionParameter): Don't use an invalid index on
3425 the generic parameter data.
3427 2007-01-08 Miguel de Icaza <miguel@novell.com>
3429 * driver.cs: Just add a tiny bit of infrastructure.
3431 2007-01-02 Marek Safar <marek.safar@gmail.com>
3433 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
3434 where field type is struct from current assembly.
3436 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
3439 2007-01-02 Marek Safar <marek.safar@gmail.com>
3441 A fix for bug #80381
3442 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
3445 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
3447 (Namespace.LookupType): Always use core types from corlib when speficied.
3449 * report.cs: A new warning.
3451 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
3452 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
3453 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
3455 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
3456 (InitCoreTypes): Set expression type of object_type and value_type
3457 immediately after lookup.
3459 2007-01-01 Miguel de Icaza <miguel@novell.com>
3461 * cs-tokenizer.cs: Accept Pc class characters (Connector
3462 Punctuation) as valid identifiers. Fixes #78259
3464 * expression.cs (Invocation.DoResolve): Moved the check for the
3465 use of `this' for doing method calls to the Invocation resolution
3466 step, after overload resolution has taken place instead of doing
3467 the check at the low-level `This.DoResolve' level.
3469 The `This.DoResolve'(appens before overload resolution, so it has
3470 no way of knowing if the method that will be called will be
3471 instace or static, triggering an erroneous report for cs0188 (Bug
3474 We now do the check for instance method invocations after we know
3475 what method will be called.
3477 (This.CheckThisUsage): Move the actual use of this structure
3478 checking into its own method and expose it.
3480 * Everywhere that called Error_ValueCannotBeConverted: pass a new
3483 Exceptions: Null.ConvertImplicitly,
3484 Constant.ImplicitConversionRequired as there are too many call
3485 sites for passing the ec.
3487 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
3488 EmitContext, if the value is null, then we do not try to provide
3489 the extra information from the error (If a userdefined conversion
3490 exists, as UserDefinedConversion requires a non null-EmitContext).
3494 2006-12-30 Raja R Harinath <rharinath@novell.com>
3496 * flowanalysis.cs (MyBitVector): Document some invariants.
3497 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
3498 introduced below, and add a couple of others,
3500 2006-12-30 Marek Safar <marek.safar@gmail.com>
3502 * attribute.cs (GetMethodObsoleteAttribute): Uses new
3503 GetPropertyFromAccessor and GetEventFromAccessor.
3505 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
3506 overrides non-obsolete one.
3507 (Indexer.Define): Error message has been moved to the parser.
3509 * cs-parser.jay: Better syntax errors handling.
3511 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
3512 when an invocation has no arguments.
3514 * ecore.cs: Removed not used caching.
3516 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
3519 * report.cs: Add a new warning.
3521 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
3523 * typemanager.cs (enumeration_type): Removed.
3524 (CSharpSignature): Reuses IsSpecialMethod.
3525 (IsEqual): Hack for MS BCL.
3526 (GetPropertyFromAccessor): New method.
3527 (GetEventFromAccessor): New method.
3528 (IsSpecialMethod): Fixed to handle more cases.
3530 2006-12-30 Marek Safar <marek.safar@gmail.com>
3532 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
3533 Made white spaces array static.
3535 * ecore.cs (RemoveGenericArity): Optimized.
3537 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
3539 (MyBitVector.initialize_vector): Simplified.
3541 2006-12-22 Miguel de Icaza <miguel@novell.com>
3543 * ecore.cs: Am not entirely happy with this hack, but it seems to
3544 address the issue in 80257 (a small test case for
3547 I set the MethodGroupExpr.Type to an internal compiler type
3548 (itself in this case) to force the resolution to take place. Why
3549 it does not take place with a null is beyond me.
3551 2006-12-20 Marek Safar <marek.safar@gmail.com>
3553 A fix for bug #80288
3554 * expression.cs (ResolveOperator): Consider user defined conversion for
3555 logical and operator too.
3556 (EmitBranchable): Optimization for logical and when full constant folding
3557 could not be applied but one operand is constant.
3559 2006-12-19 Marek Safar <marek.safar@gmail.com>
3561 * class.cs (GetClassBases): Write 5 times every day, will never use
3562 FullName for error reporting.
3564 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
3566 2006-12-19 Martin Baulig <martin@ximian.com>
3568 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
3569 the symbol file info here.
3571 2006-12-18 Marek Safar <marek.safar@gmail.com>
3573 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
3574 of `elseif' is taking then following sections are not taking.
3575 Fixes an issue reported on mono mailing list.
3577 2006-12-18 Marek Safar <marek.safar@gmail.com>
3579 A fix for bug #80300
3580 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
3581 a caller is not taking.
3583 2006-12-18 Raja R Harinath <rharinath@novell.com>
3585 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
3586 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
3587 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
3588 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
3589 * class.cs: Update to changes.
3591 2006-12-17 Marek Safar <marek.safar@gmail.com>
3593 A fix for bug #79934
3594 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
3597 * class.cs (ResolveMembers): Register an iterator in current container and
3600 2006-12-16 Raja R Harinath <rharinath@novell.com>
3603 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
3604 satisfy a params annotated parameter.
3606 2006-12-16 Marek Safar <marek.safar@gmail.com>
3608 A fix for bug #77014
3609 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
3610 paramters correctly and not rely on hacks in Parameters class.
3611 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
3613 (Invocation.VerifyArgumentsCompat): Ditto.
3614 (Invocation.EmitArguments): Changed to correctly emit params arguments at
3617 * parameter.cs (HasParams): Don't assume that params is the last one.
3619 * support.cs (ReflectionParameters.ctor): Look for params attribute
3621 (ReflectionParameters.ParameterType): Removed hack when we returned last
3622 parameter for out of range parameters.
3623 (ParameterName, ParameterModifier): Ditto.
3625 2006-12-14 Marek Safar <marek.safar@gmail.com>
3627 A fix for bug #79987
3628 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
3629 when assembly is not CLS compliant but type is. I have no idea why is this
3632 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
3634 2006-12-13 Miguel de Icaza <miguel@novell.com>
3636 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
3637 in struct constructors, they are basically no-ops.
3639 2006-12-12 Marek Safar <marek.safar@gmail.com>
3641 * cs-tokenizer.cs (Position): Save preprocessor status too.
3643 2006-12-12 Marek Safar <marek.safar@gmail.com>
3645 A fix for bug #77794
3646 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
3648 2006-12-12 Marek Safar <marek.safar@gmail.com>
3650 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
3652 (pp_expr): Report error for an invalid expression.
3653 (handle_preprocessing_directive): Simplified; add more error checking.
3655 2006-12-11 Marek Safar <marek.safar@gmail.com>
3657 A fix for bug #74939
3658 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
3659 directives handling.
3661 2006-12-10 Marek Safar <marek.safar@gmail.com>
3663 A fix for bugs #80093, and #75984
3664 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
3665 logic, it seems to me as it worked before "by coincidence".
3666 (xtoken): Simplified to use reworked handle_preprocessing_directive.
3667 (cleanup): Enabled endif check.
3669 2006-12-09 Marek Safar <marek.safar@gmail.com>
3671 A fix for bug #80162
3672 * statement.cs (CollectionForeach.TryType): Generics and non-generics
3673 enumerators are never ambiguous.
3675 2006-12-08 Raja R Harinath <rharinath@novell.com>
3678 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
3680 2006-12-06 Marek Safar <marek.safar@gmail.com>
3682 A fix for bug #80144
3683 * class.cs (EventProperty.Define): Explicit implementation means
3684 that an even is used.
3686 2006-12-06 Marek Safar <marek.safar@gmail.com>
3688 Fixes the operators implementation (part II)
3690 * cfold.cs (DoConstantNumericPromotions): Renamed to
3691 DoBinaryNumericPromotions and simplified.
3692 (BinaryFold): Couple of conversion fixes; simplified.
3694 * constant.cs, ecore.cs, literal.cs
3695 (ToType): Renamed to ConvertImplicitly.
3696 (Reduce): Renamed to ConvertExplicitly.
3698 * class.cs, convert.cs: Updated.
3700 * expression.cs: TryReduce doesn't throw an exception.
3702 2006-12-01 Marek Safar <marek.safar@gmail.com>
3704 A fix for bug #80108
3705 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
3708 2006-11-30 Marek Safar <marek.safar@gmail.com>
3710 Fixes unary operators implementation (part I)
3713 * cfold.cs (Error_CompileTimeOverflow): Made internal
3715 * const.cs (IConstant): Changed to use reference to constant and
3716 not constant itself.
3717 Updated IConstant implementations.
3719 * constant.cs (CreateConstant): New factory method.
3720 Updated IConstant implementation.
3722 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
3724 * ecore.cs: Updated to use CreateConstantReference.
3726 * enum.cs: Reflects IConstant changes.
3728 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
3730 * literal.cs (NullConstant): Change to be independently usable.
3732 2006-11-29 Martin Baulig <martin@ximian.com>
3734 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
3735 we need to emit the scope initializer before calling the base .ctor.
3737 * anonymous.cs: Merged back from the new anonymous methods branch.
3738 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
3740 * expression.cs (ParameterReference.DoResolveBase): Create a
3741 "normal" ScopeInfo when capturing parameters rather than using the
3742 root scope; this makes things work with anonymous methods having
3746 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
3748 2006-11-22 Marek Safar <marek.safar@gmail.com>
3750 A fix for bug #79987
3751 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
3752 check to a base class.
3753 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
3754 only when assembly has missing attribute.
3755 * report.cs: Update.
3757 2006-11-21 Marek Safar <marek.safar@gmail.com>
3759 * cs-tokenizer.cs: Merged with gmcs version.
3761 2006-11-20 Marek Safar <marek.safar@gmail.com>
3764 * cs-parser.jay: Better error message when partial keyword is misplaced.
3766 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
3768 A fix for bug #79810
3769 report.cs: CS1058 only applies to 2.0 profile (gmcs).
3770 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
3771 a RuntimeWrappedException by default.
3773 2006-11-18 Marek Safar <marek.safar@gmail.com>
3775 A fix for bug #79843
3776 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
3778 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
3780 2006-11-18 Marek Safar <marek.safar@gmail.com>
3782 * driver.cs, namespace.cs: Uses faster IndexOf version.
3784 2006-11-17 Marek Safar <marek.safar@gmail.com>
3786 A fix for bug #79941
3787 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
3789 (Operator.Define): Implicit/Explicit operator of same type is duplicate
3790 even if internal name is different.
3791 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
3792 (UserDefinedConversion): Simplified as the operators cannot be internal.
3793 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
3795 (MethodLookup): Replaced EmitContext with parentType.
3796 * expression.cs: Updated.
3798 2006-11-09 Raja R Harinath <rharinath@novell.com>
3800 * driver.cs (BadAssembly): Handle all the ugliness of
3801 DefineDynamicAssembly.
3803 2006-11-08 Raja R Harinath <rharinath@novell.com>
3805 Address parts of #58244 -- most of what's left is in the runtime
3806 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
3807 CS1509 error checks, and handle them for all assembly loads, not
3808 just the first invocation.
3809 (LoadModule): Likewise. Move handling of 'adder_method' ...
3810 * codegen.cs (AssemblyClass.AddModule): ... here.
3812 2006-11-02 Marek Safar <marek.safar@gmail.com>
3814 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
3815 IEnumerable<T> is ambiguous.
3817 2006-10-31 Marek Safar <marek.safar@gmail.com>
3819 A fix for bug #67689
3820 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
3821 GetEnumerator is ambiguous.
3823 * report.cs: Add new warning.
3825 2006-10-29 Marek Safar <marek.safar@gmail.com>
3827 A fix for bug #78602
3828 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3829 to protected member can be nested type.
3831 2006-10-28 Marek Safar <marek.safar@gmail.com>
3833 A fix for bug #78965
3834 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3835 to protected member must derive from current type.
3837 2006-10-27 Marek Safar <marek.safar@gmail.com>
3839 assign.cs: Reuses error method.
3841 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
3842 instead of type for constants.
3843 (Expression.Error_ValueAssignment): Common error method.
3845 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
3848 2006-10-27 Marek Safar <marek.safar@gmail.com>
3850 A fix for bug #79081
3851 * expression.cs (MemberAccess.DoResolve): Check nested type
3854 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
3856 * doc.cs : nested delegates were not handled. Fixed bug #79754.
3858 2006-10-26 Marek Safar <marek.safar@gmail.com>
3860 A fix for bug #76591
3861 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
3863 2006-10-26 Marek Safar <marek.safar@gmail.com>
3865 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
3866 type forwarder of the same type multiple times.
3868 2006-10-26 Raja R Harinath <rharinath@novell.com>
3871 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
3872 instance as an rvalue, even when we later resolve as an lvalue.
3874 2006-10-25 Martin Baulig <martin@ximian.com>
3876 * anonymous.cs: Fix #79673.
3878 2006-10-24 Marek Safar <marek.safar@seznam.cz>
3880 A fix for bug #79666
3881 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
3882 ignored when is optimized (= default value) as its value is already set.
3884 2006-10-23 Marek Safar <marek.safar@seznam.cz>
3886 A fix for bug #79724
3887 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
3888 TypeContainer for type lookup.
3890 2006-10-23 Marek Safar <marek.safar@seznam.cz>
3892 A fix for bug #79231
3893 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
3894 * expression.cs (OverloadResolve): Always convert type name for
3896 (ResolveNamespaceOrType): Don't confuse a nested type with any
3899 2006-10-18 Martin Baulig <martin@ximian.com>
3901 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
3903 2006-10-17 Miguel de Icaza <miguel@novell.com>
3905 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
3906 an int32, but requesting an int64 from the conversion
3908 2006-10-12 Martin Baulig <martin@ximian.com>
3911 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
3913 2006-10-12 Martin Baulig <martin@ximian.com>
3916 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
3918 2006-10-11 Miguel de Icaza <miguel@novell.com>
3920 * convert.cs: Remove broken code: I was doing the "Existance"
3921 tests for Implicit conversions.
3923 2006-10-10 Miguel de Icaza <miguel@novell.com>
3925 * convert.cs: Added one missing case in
3926 ImplicitStandardConversionExists uint64 to intptr.
3930 * typemanager.cs (uintptr_type): another core known type.
3932 * ecore.cs (OperatorCast): routine used to do cast operations that
3933 depend on op_Explicit. We could change some of the Decimal
3934 conversions to use this.
3936 This one has a probe mechanism that checks both types for an op_
3937 which it coudl be used to eliminate two classes: CastToDecimal
3938 and CastFromDecimal.
3940 * convert.cs: Implement the conversions documented in #59800
3942 2006-10-10 Martin Baulig <martin@ximian.com>
3944 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
3945 before RootScope.ResolveMembers().
3947 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
3948 `CurrentType' if appropriate.
3950 2006-10-09 Marek Safar <marek.safar@seznam.cz>
3952 A fix for bug #78568
3953 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
3954 when contains binary operators.
3955 * cs-parser.jay: Updated.
3957 2006-10-09 Martin Baulig <martin@ximian.com>
3960 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
3961 moved that into Define() and also do the other type parameter
3962 checks there. Fixes #79094. Added gtest-292.cs.
3965 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
3966 since that doesn't include type parameters; don't use `Ldelema'
3967 for type parameters. Fixes #78980. Added gtest-293.cs.
3969 2006-10-08 Marek Safar <marek.safar@seznam.cz>
3972 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
3973 conversion is allowed.
3975 2006-10-06 Marek Safar <marek.safar@seznam.cz>
3977 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
3978 error reporting when no error occurs.
3980 2006-10-06 Marek Safar <marek.safar@seznam.cz>
3982 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
3985 2006-10-06 Raja R Harinath <rharinath@novell.com>
3988 * class.cs (DefineTypeBuilder): Check circular dependencies before
3989 setting the parent of the TypeBuilder.
3990 (CheckRecursiveDefinition): Don't use 'BaseType', since
3991 it may not be valid until after DefineTypeBuilder. Use
3992 'base_type' instead.
3994 2006-10-04 Martin Baulig <martin@ximian.com>
3996 Merged the Anonymous Methods patch.
3998 * anonymous.cs, iterators.cs: The new anonymous methods code.
4000 * statement.cs (Variable): New public abstract class.
4001 (LocalInfo.Variable): New public property.
4002 (LocalInfo.ResolveVariable): New public method.
4003 (Block.Flags): Add `IsIterator'.
4004 (Block.AddVariable): Improved the CS0136 check.
4005 (Block.AnonymousChildren): New public property.
4006 (Block.AddAnonymousChild): New public method.
4007 (ToplevelBlock): Update to use the new anonymous method framework.
4008 (ToplevelBlock.ctor): `container' is now a `Block' and not a
4009 `ToplevelBlock'; this is required to correctly implement the
4011 (Fixed, Using): Use `TemporaryVariable' instead of directly
4012 creating the `LocalBuilder'.
4014 * parameter.cs (Parameter.ResolveVariable): New public method.
4015 (Parameters.ResolveVariable): Likewise.
4017 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
4019 * class.cs (TypeContainer): Replaced the `iterators' list and
4020 corresponding methods with a list of `CompilerGeneratedClass'es.
4021 (TypeContainer.ResolveMembers): New public method.
4022 (Method): `IIteratorContainer' has been replaced by
4025 * expression.cs (VariableReference): New public abstract base
4026 class for `LocalVariableReference', `ParameterReference' and
4029 * codegen.cs (EmitContext): Removed `capture_context',
4030 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
4031 (EmitContext.EmitThis): Removed.
4033 * cs-parser.jay: Replace `iterator_container' with
4036 2006-10-04 Martin Baulig <martin@ximian.com>
4038 * generic.cs (GenericMethod): Don't make this abstract.
4039 (Constraints.Clone): Added dummy implementation.
4041 2006-10-04 Raja R Harinath <harinath@gmail.com>
4044 * namespace.cs (LookForAnyGenericType): Avoid nullref on
4045 'declspaces'. Avoid allocating arrays willy-nilly.
4048 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
4049 cases out of the switch.
4051 2006-09-28 Marek Safar <marek.safar@seznam.cz>
4053 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
4054 message when non-generic type is used with the type arguments.
4055 * expression.cs: Updated.
4057 2006-09-28 Raja R Harinath <rharinath@novell.com>
4060 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
4061 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4062 Change semantics slightly. Don't insist on having only one
4063 temporary EmptyExpression -- just throttle the creation of new ones.
4066 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
4067 non-interfaces too. If no methods are found, don't try to create
4070 2006-09-28 Marek Safar <marek.safar@seznam.cz>
4072 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
4075 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
4076 us produce better error message.
4078 2006-09-27 Marek Safar <marek.safar@seznam.cz>
4080 * expression.cs (Binary.ResolveOperator): Warn about a side effect
4081 of the `|' operator.
4083 * report.cs: A new warning added.
4085 2006-09-27 Martin Baulig <martin@ximian.com>
4087 * generic.cs (GenericMethod): Don't make this abstract.
4089 2006-09-27 Martin Baulig <martin@ximian.com>
4092 (InternalErrorException): Added overloaded ctor taking a params array.
4094 2006-09-26 Marek Safar <marek.safar@seznam.cz>
4096 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
4097 Fixed the cases when same error was reported twice.
4099 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
4100 now report symbol information.
4102 2006-09-25 Martin Baulig <martin@ximian.com>
4104 * class.cs: Completely unified with the gmcs version.
4106 2006-09-25 Martin Baulig <martin@ximian.com>
4108 * typemanager.cs (TypeManager.IsNullableType): New public function.
4109 (TypeManager.IsNullableTypeOf): Likewise.
4110 (TypeManager.IsNullableValueType): Likewise.
4112 * class.cs (MethodCore): Added the `GenericMethod' argument from
4113 gmcs and also unified all classes derived from `MethodCore' with gmcs.
4115 2006-09-24 Raja R Harinath <harinath@gmail.com>
4117 * convert.cs: Unify with gmcs version.
4119 2006-09-24 Marek Safar <marek.safar@seznam.cz>
4121 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
4122 verify them as well.
4124 * report.cs: New warning.
4126 2006-09-24 Marek Safar <marek.safar@seznam.cz>
4128 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
4129 for anonymous block with out argument.
4131 2006-09-24 Marek Safar <marek.safar@seznam.cz>
4133 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
4134 not used private events only.
4136 2006-09-23 Marek Safar <marek.safar@seznam.cz>
4138 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
4140 * const.cs (Const.Define): Check for constant type.
4141 (Const.IsConstantTypeValid): Looks for valid constant types.
4143 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
4145 * ecore.cs (EmptyConstantCast): New common class for all constant based
4148 * expression.cs (Is.DoResolve): Handle null constant especially.
4149 (New.DoResolve): Check for new void().
4150 (MemberAccess.DoResolve): Cope with all kind of nulls.
4152 * literal.cs (NullConstant): Uses EmptyConstantCast.
4153 (NullDefault): Based on EmptyConstantCast.
4154 (NullLiteral): Uses EmptyConstantCast.
4156 * statement.cs (Block.ResolveMeta): Check for constant type.
4158 2006-09-22 Martin Baulig <martin@ximian.com>
4160 * delegate.cs, attribute.cs: Merged with the gmcs versions.
4162 2006-09-22 Raja R Harinath <rharinath@novell.com>
4164 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
4168 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
4169 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
4172 2006-09-22 Martin Baulig <martin@ximian.com>
4174 * ecore.cs: Merged with the gmcs version.
4176 * generic.cs (ConstructedType): New dummy class.
4177 (TypeArguments): Don't make this abstract.
4180 (TypeManager.IsGenericTypeDefinition): New method.
4181 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
4183 2006-09-22 Raja R Harinath <rharinath@novell.com>
4185 * expression.cs (ComposedCast): Check for arrays of TypedReference
4186 before creating the type, not after.
4188 2006-09-21 Marek Safar <marek.safar@seznam.cz>
4190 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
4191 after ToType change.
4193 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
4194 when constant must be implicitly convertible.
4196 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
4198 * ecore.cs (NullCast): Derives from NullConstant.
4200 * expression.cs (Is.DoResolve): Removed useless variables.
4201 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
4202 (New.Constantify): Add enum support.
4203 (MemberAccess.DoResolve): Add warning when accessing null constant or
4206 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
4209 * literal.cs (NullConstant): New abstract class with common
4210 functionality for all null specializations.
4211 (NullDefault): Represents default(X) when result can be
4213 (NullLiteral): Updated.
4215 * report.cs: Add new warning.
4217 2006-09-21 Martin Baulig <martin@ximian.com>
4219 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
4221 2006-09-21 Martin Baulig <martin@ximian.com>
4223 * generic.cs (GenericConstraints): New dummy class.
4224 (Constraints): Likewise.
4225 (TypeParameter): Likewise.
4226 (TypeParameterName): Likewise.
4227 (GenericMethod): Likewise.
4229 * typemanager.cs (TypeManager.GetGenericArguments): New method.
4231 * decl.cs: Merged with the gmcs version.
4233 2006-09-21 Raja R Harinath <rharinath@novell.com>
4235 * generic.cs (TypeParameter): Implement IMemberContainer.
4236 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
4238 * rootcontext.cs: Unify with gmcs version.
4240 * report.cs: Unify with gmcs version.
4241 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
4242 from gmcs/generics.cs.
4243 * generics.cs (TypeParameter): New dummy class.
4245 * support.cs: Unify with gmcs version.
4247 2006-09-20 Raja R Harinath <rharinath@novell.com>
4249 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
4250 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
4252 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
4253 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
4254 * mcs.exe.sources: Add generic.cs.
4256 * codegen.cs: Unify with gmcs version.
4258 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
4259 (EmitContext): Add GenericDeclContainer implementation.
4260 * decl.cs (MemberCore, DeclSpace): Likewise.
4261 * namespace.cs: Remove #ifdef GMCS_SOURCE.
4263 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
4264 MCS TypeManager has a corresponding dummy method.
4266 2006-09-19 Martin Baulig <martin@ximian.com>
4268 * expression.cs: Completely merged with the gmcs version.
4270 2006-09-19 Martin Baulig <martin@ximian.com>
4272 * expression.cs (Invocation): Merged with the gmcs version.
4273 (ArrayAccess.GetStoreOpcode): Likewise.
4275 2006-09-19 Martin Baulig <martin@ximian.com>
4278 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
4279 (TypeManager.IsGenericMethodDefinition): Likewise.
4281 2006-09-19 Martin Baulig <martin@ximian.com>
4284 (TypeManager.IsEqual): Moved the gmcs implementation here.
4285 (TypeManager.DropGenericTypeArguments): Likewise.
4286 (TypeManager.DropGenericMethodArguments): Likewise.
4287 (TypeManager.GetTypeArguments): Moved here from gmcs.
4288 (TypeManager.HasGenericArguments): Likewise.
4290 2006-09-19 Martin Baulig <martin@ximian.com>
4292 * expression.cs (Binary): Merged with the gmcs version.
4294 2006-09-19 Martin Baulig <martin@ximian.com>
4296 * expression.cs (Probe, As, Is): Merged with the gmcs version.
4298 2006-09-19 Martin Baulig <martin@ximian.com>
4300 * typemanager.cs: Merged with the gmcs version.
4302 2006-09-16 Raja R Harinath <rharinath@novell.com>
4304 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
4305 * driver.cs: Likewise.
4307 2006-09-16 Marek Safar <marek.safar@seznam.cz>
4310 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
4311 only if parent type is class.
4312 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
4315 2006-09-15 Marek Safar <marek.safar@seznam.cz>
4318 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
4320 * typemanager.cs(CSharpName): Converts NullType to null.
4322 2006-09-15 Martin Baulig <martin@ximian.com>
4325 (TypeManager.GetMethodName): Added mcs implementation.
4326 (TypeManager.IsEqual): Likewise.
4329 (SimpleName.RemoveGenericArity): Added dummy implementation.
4331 * pending.cs: Merged with the gmcs version.
4333 2006-09-15 Martin Baulig <martin@ximian.com>
4335 * statement.cs: Merge with the gmcs version.
4337 2006-09-15 Martin Baulig <martin@ximian.com>
4339 * statement.cs (Switch): Merge with the gmcs implementation
4340 (without nullables), which is newer.
4342 2006-09-15 Martin Baulig <martin@ximian.com>
4344 * statement.cs (Block.Variables): Make this public.
4345 (ToplevelBlock.Parameters): Make this a property.
4346 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
4348 2006-09-15 Martin Baulig <martin@ximian.com>
4350 * namespace.cs: Merge with the gmcs version.
4352 2006-09-15 Martin Baulig <martin@ximian.com>
4354 * decl.cs (MemberName): Minor code cleanups.
4356 2006-09-15 Martin Baulig <martin@ximian.com>
4358 * parameter.cs: Merge with the gmcs version.
4360 2006-09-15 Martin Baulig <martin@ximian.com>
4362 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
4363 and an error in mcs.
4365 2006-09-15 Martin Baulig <martin@ximian.com>
4367 * flowanalysis.cs: Merged from GMCS; added the generics code into
4368 a `GMCS_SOURCE' conditional so we can share this file.
4370 2006-09-08 Martin Baulig <martin@ximian.com>
4372 * typemanager.cs (TypeManager.interlocked_type): New public field.
4373 (TypeManager.int_interlocked_compare-exchange): New public field.
4374 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
4375 enumerator types here and call InitGenericCoreTypes().
4376 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
4377 after calling InitEnumUnderlyingTypes().
4380 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
4381 `classes_second_stage'.
4383 2006-09-14 Marek Safar <marek.safar@seznam.cz>
4385 * assign.cs, ecore.cs, expression.cs: Share error message text.
4386 * class.cs (FieldMember.Define): Check for varible of static type.
4387 * driver.cs (LoadAssembly): Uses error output for errors.
4388 * statement.cs: Updated.
4390 2006-09-08 Marek Safar <marek.safar@seznam.cz>
4392 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
4395 2006-09-07 Martin Baulig <martin@ximian.com>
4398 (MainDriver): Revert r62663 from Marek; see #70506 for details.
4400 2006-08-29 Miguel de Icaza <miguel@novell.com>
4402 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
4404 2006-08-17 Miguel de Icaza <miguel@novell.com>
4406 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
4407 #52019 and #79064, the use of the \uXXXX sequence in source code
4408 to represent unicode characters.
4410 2006-08-15 Marek Safar <marek.safar@seznam.cz>
4412 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
4414 * class.cs, ecore.cs, statement.cs: Merged to one error message.
4416 2006-08-13 Miguel de Icaza <miguel@novell.com>
4418 * assign.cs: Catch attempts to assign to a method groups in += and
4421 2006-08-13 Marek Safar <marek.safar@seznam.cz>
4424 * cs-parser.jay: Don't destroy current array type by typeof of array's.
4426 2006-08-12 Marek Safar <marek.safar@seznam.cz>
4428 * class.cs (Method.Define): Issue a warning when generic method looks like
4430 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
4433 2006-08-09 Marek Safar <marek.safar@seznam.cz>
4435 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
4437 * decl.cs (MemberCache.FindMembers): When container is interface we need to
4438 search all base interfaces as a member can be ambiguous.
4439 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
4440 Constructor member type filter.
4441 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
4442 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
4443 reporting for returned memberinfos.
4444 * report.cs: Updated.
4445 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
4446 version to work on all runtimes.
4447 (TypeManager.RealMemberLookup): Removed members filtering.
4449 2006-08-08 Raja R Harinath <rharinath@novell.com>
4451 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
4452 (PropertyExpr.EmitAssign): Likewise.
4453 * expression.cs (Indirection.EmitAssign): Likewise.
4454 (LocalVariableReference.EmitAssign): Likewise.
4455 (ParameterReference.EmitAssign): Likewise.
4456 (Invocation.EmitArguments): Likewise.
4457 (ArrayAccess.EmitAssign): Likewise.
4458 (IndexerAccess.EmitAssign): Likewise.
4459 (This.EmitAssign): Likewise.
4460 (ConditionalLogicalOperator.Emit): Likewise.
4463 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
4464 instead of ArrayList. If the hashtable has a LocalBuilder, don't
4465 leave it in after returning it.
4466 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
4468 2006-08-06 Marek Safar <marek.safar@seznam.cz>
4470 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
4473 2006-08-03 Raja R Harinath <rharinath@novell.com>
4475 Fix cs0146-3.cs and cs0146-4.cs.
4476 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
4477 enclosing types don't depend on the current type.
4479 2006-08-02 Raja R Harinath <rharinath@novell.com>
4482 * class.cs (TypeContainer.DoDefineMembers): Use
4483 FindBaseMemberWithSameName on Parent, since we're interested in
4484 whether we hide inherited members or not.
4485 (FindBaseMemberWithSameName): Make slightly more robust.
4487 Fix the non-generic testcase from #77396
4488 * decl.cs (DeclSpace.DeclContainer): Remove override.
4490 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
4491 declspaces for doppelgangers too.
4492 (UsingEntry): Implement IResolveContext.
4493 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
4494 'this' as the resolve context.
4495 (LocalAliasEntry): Likewise.
4497 Implement parts of #77403
4498 * roottypes.cs (RootDeclSpace): New. Used to represent the
4499 toplevel declaration space. Each namespace declaration introduces
4500 a "partial" root declaretion space.
4501 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
4502 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
4503 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
4504 from 'current_namespace.SlaveDeclSpace'.
4505 (namespace_declaration): Likewise.
4506 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
4507 check. It can't happen now.
4508 * decl.cs (DeclSpace.LookupType): Likewise.
4509 * driver.cs (MainDriver): Sanity check.
4511 2006-08-01 Raja R Harinath <rharinath@novell.com>
4513 * decl.cs (DeclSpace.FindNestedType): Remove.
4514 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
4515 LookupTypeContainer to get the container of the nested type.
4516 * class.cs (TypeContainer.FindNestedType): Make non-override.
4518 2006-07-31 Raja R Harinath <rharinath@novell.com>
4520 * decl.cs (DeclSpace.PartialContainer): Move field from ...
4521 * class.cs (TypeContainer.PartialContainer): ... here.
4522 (TypeContainer.AddBasesForPart): New helper.
4523 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
4525 * cs-parser.jay (current_class): Convert to DeclSpace.
4526 (struct_declaration, interface_declaration, class_declaration):
4527 Use AddBasesForPart instead of .Bases directly.
4528 * const.cs, iterators.cs: Update to changes.
4530 2006-07-28 Raja R Harinath <rharinath@novell.com>
4532 * class.cs (TypeContainer.AddMemberType): Rename from
4534 (TypeContainer.AddMember): Rename from AddToMemberContainer.
4535 (AddTypeContainer): New. Combine AddClassOrStruct and
4537 (AddPartial): Update. Add 'is_partial' argument.
4538 * roottypes.cs: Update to changes.
4539 * cs-parser.jay (push_current_class): New helper for handling
4540 current_container and current_class.
4541 (struct_declaration, interface_declaration, class_declaration):
4544 2006-07-26 Raja R Harinath <rharinath@novell.com>
4546 * roottypes.cs: Rename from tree.cs.
4548 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
4549 * tree.cs (Tree, ITreeDump): Remove types.
4550 * rootcontext.cs (tree, Tree): Remove fields.
4551 (root, ToplevelTypes): New.
4552 * *.cs: Update to rename.
4554 * tree.cs (Tree.RecordDecl): Remove.
4555 (RootTypes.AddToTypeContainer): Record the toplevel type in its
4557 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
4559 2006-07-23 Raja R Harinath <harinath@gmail.com>
4561 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
4562 DoFlowAnalysis and OmitStructFlowAnalysis here.
4563 (ec.With): Rename from WithUnsafe and generalize.
4564 (ec.WithCheckState): Remove. All users can be handled by 'With'.
4565 (ec.WithFlowAnalyis): New.
4566 * ecore.cs, expression.cs, statement.cs: Update.
4568 2006-07-22 Raja R Harinath <harinath@gmail.com>
4570 * statement.cs (Block.ResolveMeta): Simplify slightly.
4572 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
4573 multiple boolean fields. Convert InUnsafe, constant_check_state,
4574 check_state to flags.
4575 (CheckState, ConstantCheckState): Update.
4576 (InUnsafe): New read-only property.
4577 (FlagsHandle): Rename from CheckStateHandle and convert to handle
4579 (WithUnsafe): New helper similar to WithCheckState.
4580 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
4581 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
4583 2006-07-21 Raja R Harinath <rharinath@novell.com>
4585 Make comparisons use the same IL irrespective of whether they're
4586 in a 'checked' or 'unchecked' context: one of the issues in #78899
4587 * codegen.cs (EmitContext.CheckState): Make read-only property.
4588 (EmitContext.ConstantCheckState): Likewise.
4589 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
4590 helper that implement a save/restore stack for CheckState
4591 values. This is the only way to change check-state.
4592 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
4593 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
4594 (CheckedExpr.EmitBranchable): New forwarding method.
4595 (UnCheckedExpr): Likewise.
4596 * statement.cs (Block.ResolveMeta): Use WithCheckState.
4597 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
4598 (Checked.Resolve, checked.DoEmit): Likewise.
4600 2006-07-20 Miguel de Icaza <miguel@novell.com>
4602 * anonymous.cs: Cache the resolved anonymous delegate, and return
4603 this so that the ResolveTopBlock is only triggered once, not
4606 Currently we trigger ResolvetopBlock twice due to a first pass of
4607 argument check compatibility, and a second pass that does the
4610 2006-07-15 Marek Safar <marek.safar@seznam.cz>
4612 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
4614 * rootcontext.cs (Reset): Add helper_classes.
4616 2006-07-15 Marek Safar <marek.safar@seznam.cz>
4619 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
4622 2006-07-13 Miguel de Icaza <miguel@novell.com>
4624 * statement.cs (Lock): Handle expressions of type
4625 TypeManager.null_type specially. Fixes #78770
4627 2006-07-08 Marek Safar <marek.safar@seznam.cz>
4629 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
4632 2006-07-08 Marek Safar <marek.safar@seznam.cz>
4634 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
4635 for accessors as well.
4636 * ecore.cs (EventExpr): Add AccessorTable.
4638 2006-07-01 Marek Safar <marek.safar@seznam.cz>
4641 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
4642 for CS0122 where appropriate.
4643 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
4645 (Filter): Assembly can be null in the case of top level attributes.
4647 2006-06-25 Marek Safar <marek.safar@seznam.cz>
4651 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
4652 is done at global level.
4654 2006-06-24 Marek Safar <marek.safar@seznam.cz>
4656 A fix for #77002, Implemented TypeForwarder support.
4658 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
4659 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
4660 * typemanager.cs (): Add type_forwarder_attr_type.
4662 2006-06-24 Marek Safar <marek.safar@seznam.cz>
4664 * report.cs: Add CS0469 warning.
4666 2006-06-21 Martin Baulig <martin@ximian.com>
4668 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
4669 the `try'-block, so we also report CS0016 etc. there.
4671 2006-06-21 Martin Baulig <martin@ximian.com>
4674 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
4676 2006-06-21 Martin Baulig <martin@ximian.com>
4678 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
4679 also report CS1686 for parameters.
4681 2006-06-21 Martin Baulig <martin@ximian.com>
4683 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
4684 instead of an error if the value is not implicitly convertible to
4685 the switch types; fixes #77964.
4687 2006-06-21 Raja R Harinath <rharinath@novell.com>
4690 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
4691 FieldBuilder is null.
4694 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
4695 'left' and 'right' before error-checking.
4697 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
4699 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
4701 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
4702 (FieldExpr.DoResolve): likewise.
4703 (PropertyExpr.InstanceResolve): likewise.
4704 (EventExpr.InstanceResolve): likewise.
4706 2006-06-04 Marek Safar <marek.safar@seznam.cz>
4708 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
4709 attribute applicable tests for attribute argument.
4711 2006-06-02 Raja R Harinath <rharinath@novell.com>
4714 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
4715 (Binary.OverloadResolve_PredefinedIntegral): New.
4716 (Binary.OverloadResolve_PredefinedFloating): New.
4717 (Binary.OverloadResolve_PredefinedString): New.
4718 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
4719 Follow the standard more closely, and treat numeric promotions in
4720 terms of overload resolution.
4721 (Binary.CheckShiftArguments): Simplify.
4723 2006-06-01 Raja R Harinath <rharinath@novell.com>
4725 * flowanalysis.cs (MyBitVector): Simplify representation.
4726 (MyBitVector.Clone): Avoid allocating BitArray.
4727 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
4728 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
4729 (*): Update. Change all references to MyBitVector.And and
4730 MyBitVector.Or to &= and |=.
4732 2006-05-29 Raja R Harinath <rharinath@novell.com>
4735 * cs-parser.jay (formal_parameter_list): Extend the pattern below
4736 to param arguments too.
4738 2006-05-26 Miguel de Icaza <miguel@novell.com>
4740 * cs-parser.jay: Catch another parsing form for arglist being
4741 followed by other arguments. Fixes #78313.
4743 2006-05-24 Raja R Harinath <rharinath@novell.com>
4745 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
4746 checking of out parameters to ...
4747 (FlowBranchingToplevel.Merge): ... here.
4748 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
4749 set, propagate the origin upward, and only complain if there was
4751 (FlowBranchingException.AddContinueOrigin): Likewise.
4752 (FlowBranchingException.AddReturnOrigin): Likewise.
4753 (FlowBranchingException.AddGotoOrigin): Likewise.
4755 2006-05-23 Raja R Harinath <rharinath@novell.com>
4757 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
4758 unreachable, skip it.
4759 (FlowBranchingException.Merge): Always propagate jumps, even if
4760 the finally block renders subsequent code unreachable.
4762 2006-05-18 Raja R Harinath <rharinath@novell.com>
4765 * statement.cs (Goto.Resolve): Move responsibility for resolving
4766 'goto' to FlowBranching.AddGotoOrigin.
4767 (Goto.SetResolvedTarget): New. Callback to set the
4768 LabeledStatement that's the target of the goto.
4769 (Goto.DoEmit): Use Leave instead of Br when crossing an
4770 unwind-protect boundary.
4771 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
4772 LookupLabel and adjust to new semantics.
4773 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
4774 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
4775 Goto.SetResolvedTarget to update target.
4776 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
4777 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
4778 AddBreakOrigin & co. Delay propagation until ...
4779 (FlowBranchingException.Merge): ... this.
4781 * statement.cs (Block.Resolve): Always depend on flow-branching to
4782 determine unreachability. Kill workaround that originally emitted
4783 only one statement after an "unreachable" label (see infloop in
4786 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
4787 This is still "wrong", but anything better would probably need a
4788 multi-pass algorithm.
4789 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
4790 usage vector. Force current usage vector to be reachable, to
4791 optimistically signify backward jumps.
4792 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
4794 (FlowBranchingLabeled.Merge): New. If no backward jump was
4795 detected, return the original salted-away usage vector instead,
4796 updated with appropriate changes. Print unreachable warning if
4798 * statement.cs (Block.Resolve): Don't print unreachable warning on
4799 a labeled statement.
4801 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
4803 * driver.cs: Pass filename without path to AssemblyBuilder's
4804 AddResourceFile. Fixes bug #78407.
4806 2006-05-17 Raja R Harinath <rharinath@novell.com>
4808 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
4809 * flowanalysis.cs (FlowBranchingLabeled): ... here.
4810 (FlowBranching.MergeChild): Overwrite
4811 reachability information from Labeled branchings too.
4813 2006-05-16 Raja R Harinath <rharinath@novell.com>
4815 * statement.cs (Goto.Resolve): Merge jump origins here ...
4816 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
4818 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
4819 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
4820 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
4821 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
4823 * statement.cs (Goto.Resolve): ... not here.
4824 (Goto.Emit): Remove CS1632 check.
4826 2006-05-14 Marek Safar <marek.safar@seznam.cz>
4828 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
4831 2006-05-11 Raja R Harinath <rharinath@novell.com>
4833 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
4834 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
4835 (FlowBranchingException.Label): Likewise.
4837 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
4839 (MyBitVector.Or): Use it to avoid losing information (Count).
4840 (FlowBranching.MergeOrigins): Likewise.
4842 * flowanalysis.cs (UsageVector.IsDirty): Remove.
4843 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
4844 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
4845 (UsageVector.ToString): Simplify.
4846 (UsageVector.MergeSiblings): Move here from ...
4847 (FlowBranching.Merge): ... here.
4848 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
4851 2006-05-10 Raja R Harinath <rharinath@novell.com>
4853 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
4854 null bitvector is treated as all-true.
4856 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
4857 (MyBitVector): Rationalize invariants. 'vector != null' implies
4858 that we have our own copy of the bitvector. Otherwise,
4859 'InheritsFrom == null' implies all inherited bits are true.
4861 2006-05-09 Marek Safar <marek.safar@seznam.cz>
4863 * statement.cs (LocalInfo): Add IsConstant.
4864 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
4865 local variable for constants.
4867 2006-05-09 Raja R Harinath <rharinath@novell.com>
4869 * flowanalysis.cs (MyBitVector.Empty): New.
4870 (MyBitVector): Don't allow InheritedFrom to be null.
4871 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
4872 (UsageVector, FlowBranching): Update to changes.
4874 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
4875 recursion. The 'Parent == null' condition isn't sufficient for
4877 (FlowBranching.AddBreakOrigin): Likewise.
4878 (FlowBranching.AddContinueOrigin): Likewise.
4879 (FlowBranching.AddReturnOrigin): Likewise.
4880 (FlowBranching.StealFinallyClauses): Likewise.
4881 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
4882 (FlowBranching.CheckOutParameters): Likewise.
4883 (FlowBranchingToplevel): Terminate all the above recursions here.
4884 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
4885 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
4887 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
4889 (FlowBranchingToplevel): New. Empty for now.
4890 (FlowBranching.MergeTopBlock): Update.
4891 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
4892 branching for the anonymous delegate.
4893 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
4895 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
4896 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
4897 information at the start of the merge. Reorganize.
4899 2006-05-07 Marek Safar <marek.safar@seznam.cz>
4901 * class.cs (MethodData.Define): Method cannot implement interface accessor.
4903 2006-05-07 Marek Safar <marek.safar@seznam.cz>
4905 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
4906 to newly introduced ctor.
4908 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
4909 message to one place.
4910 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
4913 2006-05-07 Marek Safar <marek.safar@seznam.cz>
4915 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
4917 * ecore.cs (Expression.ResolveAsConstant): Updated.
4919 * statement.cs (ResolveMeta): Updated.
4921 2006-05-06 Marek Safar <marek.safar@seznam.cz>
4923 * cs-parser.jay: __arglist cannot be used in initializer.
4925 2006-05-06 Marek Safar <marek.safar@seznam.cz>
4928 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
4931 2006-05-05 Raja R Harinath <rharinath@novell.com>
4933 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
4934 (LabeledStatement): Add 'name' parameter.
4935 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
4936 (Block.AddLabel): Update to changes.
4937 * cs-parser.jay (labeled_statement): Likewise.
4939 * flowanalysis.cs (BranchingType.Labeled): New.
4940 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
4941 (FlowBranchingLabeled): New. Does nothing for now, but will
4942 eventually handle 'goto' flows.
4943 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
4944 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
4945 that's terminated ...
4946 (Block.Resolve): ... here.
4948 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
4949 (UsageVector.MergeFinallyOrigins): Likewise.
4950 (FlowBranching.InTryOrCatch): Likewise.
4951 (FlowBranching.AddFinallyVector): Likewise.
4952 (FlowBranchingException): Update to changes.
4955 * statement.cs (Return.Resolve): Move error checking to ...
4956 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
4957 (FlowBranchingException): Handle return origins like break and
4959 (FlowBranching.UsageVector.CheckOutParameters): Remove.
4961 2006-05-04 Marek Safar <marek.safar@seznam.cz>
4964 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
4967 2006-05-04 Marek Safar <marek.safar@seznam.cz>
4970 * class.cs (MethodData.Define): Do public accessor check only when method
4971 implements an interface.
4973 2006-05-04 Raja R Harinath <rharinath@novell.com>
4975 Remove special handling of 'break'
4976 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
4977 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
4978 (UsageVector.Break): Remove.
4979 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
4981 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
4983 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
4984 UsageVector.Breaks (). Don't set NeedsReturnLabel.
4986 2006-05-03 Marek Safar <marek.safar@seznam.cz>
4989 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
4990 be the interface member.
4992 2006-05-03 Marek Safar <marek.safar@seznam.cz>
4995 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
4996 for emitting small (int) values.
4998 2006-05-03 Raja R Harinath <rharinath@novell.com>
5001 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
5002 control-flow passes through the 'finally' after merging-in all the
5003 control-flows from 'try' and the 'catch' clauses.
5005 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
5006 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
5007 always true at the only non-recursive entry point.
5008 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
5009 FlowBranchingBreakable.
5010 (FlowBranchingLoop): Remove.
5011 * statement.cs (Return.DoResolve): Update to changes.
5014 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
5015 (FlowBranching.CreateBranching): Handle it: create a
5016 FlowBranchingContinuable.
5017 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
5018 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
5019 except that it handles the 'continue' command.
5020 (FlowBranching.UsageVector.MergeOrigins): Rename from
5022 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
5023 except that it overrides AddContinueOrigin.
5024 (FlowBranchingException): Override AddContinueOrigin, similar to
5026 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
5027 Create a new branching around the embedded statement.
5028 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
5029 control flow after the embedded statement.
5030 (Continue.Resolve): Move all error checking to AddContinueOrigin.
5032 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
5033 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
5034 FlowBranchingBreakable.
5035 (FlowBranchingSwitch): Remove.
5038 * statement.cs (Break.Resolve): Simplify. Move responsibility for
5039 error reporting to ...
5040 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
5041 Rename from 'AddBreakVector'. Add new location argument. Return
5042 a bool indicating whether the 'break' crosses an unwind-protect.
5043 (FlowBranchingException.AddBreakOrigin): Add.
5044 (FlowBranchingException.Merge): Propagate 'break's to surrounding
5045 flowbranching after updating with the effects of the 'finally'
5047 (FlowBranchingBreakable): New common base class for
5048 FlowBranchingLoop and FlowBranchingSwitch.
5050 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
5052 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
5054 2006-05-02 Raja R Harinath <rharinath@novell.com>
5056 * statement.cs (Do.Resolve): If the loop is infinite, set the
5058 (While.Resolve, For.Resolve): Set a barrier after the embedded
5059 statement. There's no direct control flow that goes from the end
5060 of the embedded statement to the end of the loop.
5061 * flowanalysis.cs (FlowBranching.Infinite): Remove.
5062 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
5063 above ensure that the reachability is correctly computed.
5065 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
5066 (UsageVector.MergeBreakOrigins): If the current path is
5067 unreachable, treat it as if all parameters/locals are initialized.
5068 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
5069 infinite loops before merging-in break origins.
5071 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
5072 (Reachability.Reachable): Split part into ...
5073 (Reachability.Unreachable): ... this. Simplify.
5074 (Reachability.IsUnreachable): Use 'Unreachable' instead.
5076 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
5077 (Reachability.SetThrowsSometimes): Likewise.
5078 (FlowBranchingBlock.MergeTopBlock): Don't compare against
5079 TriState.Always, use corresponding property.
5080 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
5081 (Block.Resolve): Likewise. Remove some redundant checks.
5083 2006-05-02 Raja R Harinath <harinath@gmail.com>
5085 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
5086 (Reachability.Meet): Don't bother checking AlwaysThrows --
5087 barrier is always set.
5088 (FlowBranchingBlock.Merge): Likewise.
5090 2006-05-01 Raja R Harinath <harinath@gmail.com>
5092 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
5093 checks for unreachable.
5095 2006-05-01 Marek Safar <marek.safar@seznam.cz>
5098 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
5100 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
5101 whether field is really assigned.
5103 2006-04-30 Raja R Harinath <harinath@gmail.com>
5105 * flowanalysis.cs (Reachability): Make 4-argument constructor
5107 (Reachability.Meet): Rename from 'And'. Remove static variant.
5108 (Reachability.Always): Rename from the highly misleading
5109 'Reachability.Never'.
5110 (FlowBranching.Merge): Update to changes. Mark an impossible
5111 situation with a 'throw'.
5112 (*): Update to changes.
5114 2006-04-29 Raja R Harinath <harinath@gmail.com>
5116 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
5118 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
5119 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
5120 (*): Update to changes.
5121 * statement.cs: Update to changes.
5123 2006-04-28 Marek Safar <marek.safar@seznam.cz>
5126 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
5128 2006-04-28 Raja R Harinath <harinath@gmail.com>
5130 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
5133 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
5134 argument to two arguments: an usage-vector and a bool. Move call
5135 to FlowBranching.Merge () ...
5136 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
5138 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
5139 handling of loop and switch reachability to ...
5140 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
5142 2006-04-27 Raja R Harinath <harinath@gmail.com>
5144 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
5145 handling to FlowBranchingLoop.InLoop.
5146 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
5148 2006-04-26 Marek Safar <marek.safar@seznam.cz>
5151 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
5152 anonymous method is allowed from AnonymousContainer here.
5154 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
5156 2006-04-24 Raja R Harinath <rharinath@novell.com>
5159 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
5161 2006-04-23 Marek Safar <marek.safar@seznam.cz>
5164 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
5165 (DoubleConstant.Reduce): Ditto.
5167 2006-04-23 Raja R Harinath <rharinath@novell.com>
5169 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
5170 Remove 'lvalue_right_side' argument. Move parts to ...
5171 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
5172 (LocalVariable.DoResolveLValue): ... these.
5174 2006-04-21 Raja R Harinath <rharinath@novell.com>
5177 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
5178 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
5179 (LocalVariableReference.DoResolveBase): Use it to implement new
5181 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
5182 (Argument.Resolve): Simplify. Move CS1510 check ...
5183 * ecore.cs (Expression.ResolveLValue): ... here.
5184 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
5185 (PropertyExpr.DoResolveLValue): Likewise.
5186 (FieldExpr.Report_AssignToReadonly): Likewise.
5187 (FieldExpr.DoResolve): Add 'out_access' argument. Use
5188 LValueMemberAccess or LValueMemberOutAccess on instance depending
5190 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
5191 DoResolve as appropriate.
5193 2006-04-20 Raja R Harinath <rharinath@novell.com>
5196 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
5197 implicit conversions on 'out' and 'ref' arguments.
5199 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
5200 improve clarity. Remove dead code.
5203 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
5204 (Catch.Resolve): Resolve VarBlock if it exists.
5206 2006-04-19 Miguel de Icaza <miguel@novell.com>
5208 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
5209 twice, this was some residual code, the enumerator was emitted
5210 properly in the two branche of if later.
5212 2006-04-19 Raja R Harinath <rharinath@novell.com>
5214 * expression.cs (Cast.ResolveLValue): Remove. The result of a
5215 cast is never an lvalue.
5216 (Cast.DoResolve, Cast.ResolveRest): Combine.
5217 (Argument.Emit): Simplify slightly. Move 'Expr is
5218 IMemoryLocation' check ...
5219 (Argument.Resolve): ... here.
5220 (Argument.Error_LValueRequired): Remove. Inline into only user.
5222 Simplifications. Fix cs0191-2.cs
5223 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
5224 CS1649 and CS1651 to ...
5225 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
5226 the actual selection of the error code and message to a lookup
5227 table. Add a dummy return value to simplify callsites.
5228 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
5229 readonly fields of other instances of the same type. Move CS0197
5231 * expression.cs (Argument.Resolve): ... here. Simplify code.
5232 Ensure that ec.InRefOutArgumentResolving is only set during LValue
5233 resolution of an out or ref argument. The code simplification
5234 above uses this invariant.
5236 2006-04-18 Raja R Harinath <rharinath@novell.com>
5238 Possibly fix #77752. Fix cs1690-[4-7].cs.
5239 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
5240 CheckMarshallByRefAccess. Drop parameter.
5241 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
5243 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
5245 * report.cs (AllWarnings): Add CS1690.
5246 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
5248 (LocalVariableReference.DoResolveBase): Update.
5250 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5252 * class.cs (MethodOrOperator): Moved common parts from method class.
5253 detect obsolete attributes.
5254 (Method.Define): Simplified as it reuses code from base.
5255 (Constructor.ValidAttributeTargets): Fixed issue found during
5257 (Destructor.ValidAttributeTargets): Fixed issue found during
5259 (Operator): Finished refactoring set off by #78020. Operator class is now
5260 ordinary method class.
5262 * anonymous.cs: Updated.
5264 * decl.cs (DeclSpace): Add IsGeneric
5266 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5268 * class.cs (Constructor.Emit): Don't emit the attributes twice.
5270 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5272 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
5273 detect obsolete attributes.
5274 (Method.CreateEmitContext): Moved to MethodOrOperator.
5276 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5279 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
5280 customized exception to make crash detection easier.
5281 (MethodOrOperator): Started to work on new base class for methods and
5283 (Method): Derives from MethodOrOperator.
5284 (Constructor.Emit): Emits its own attributes.
5285 (AbstractPropertyEventMethod.Emit): Ditto.
5286 (Operator): Derives from MethodOrOperator, will refactor fully in extra
5288 (Operator.Emit): It's temporary more tricky than should be.
5290 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
5292 * report.cs (InternalErrorException): Add ctor with inner exception.
5294 2006-04-08 Marek Safar <marek.safar@seznam.cz>
5297 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
5300 2006-04-07 Marek Safar <marek.safar@seznam.cz>
5303 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
5306 2006-04-06 Marek Safar <marek.safar@seznam.cz>
5308 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
5309 attribute is present and Guid not.
5310 (Interface.ApplyAttributeBuilder): Ditto.
5312 * attribute.cs: Add error message.
5314 2006-04-06 Marek Safar <marek.safar@seznam.cz>
5318 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
5319 sources (it's composite) so hold them in extra array as they are used in
5320 Emit phase only. It worked in the previous versions by mistake.
5321 (Attribute.Emit): Emit attribute for more owners when exist.
5323 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
5324 it has now different behaviour.
5326 2006-04-04 Marek Safar <marek.safar@seznam.cz>
5328 * constant.cs (Constant.IsDefaultInitializer): New method.
5330 * class.cs: Updated.
5332 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
5333 re-initialize default values. It saves KBs almost for every assembly.
5334 Thanks Zoltan for the idea.
5335 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
5336 (ArrayCreation.DoResolve): Resolve only once.
5337 (ArrayCreation.Emit): Emit static initializer only when it is faster.
5338 (ArrayCreation.GetAttributableValue): Cope with optimized values.
5340 2006-04-03 Zoltan Varga <vargaz@gmail.com>
5342 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
5345 2006-04-01 Marek Safar <marek.safar@seznam.cz>
5347 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
5348 in an embedded statement too.
5350 2006-04-01 Raja R Harinath <rharinath@novell.com>
5353 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
5355 2006-04-01 Marek Safar <marek.safar@seznam.cz>
5359 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
5362 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
5364 2006-03-31 Marek Safar <marek.safar@seznam.cz>
5366 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
5369 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
5370 LocalTemporary change.
5372 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
5374 (ClassOrStruct.DefineFieldInitializers): Implemented static field
5375 initializers optimization.
5376 (ClassOrStruct.TypeAttr): Moved from modifiers.
5377 (Constructor.CheckBase): Don't crash when static ctor has parameters.
5378 (FieldBase.ResolveInitializer): Resolves initializer.
5379 (FieldBase.HasDefaultInitializer): New property.
5381 * cs-parser.jay: Removed message.
5383 * expression.cs (CompilerGeneratedThis): New specialization.
5385 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
5387 2006-03-28 Marek Safar <marek.safar@seznam.cz>
5389 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
5391 2006-03-27 Marek Safar <marek.safar@seznam.cz>
5393 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
5394 be now EnumConstants only.
5396 2006-03-27 Marek Safar <marek.safar@seznam.cz>
5398 * attribute.cs, driver.cs: Reset more caches.
5400 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5402 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
5404 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5406 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
5407 for easier reuse. Updated all overrides.
5408 (IntegralConstant): New base class for all integral constants.
5409 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
5410 of the constant range, report custom error.
5411 (UIntConstant.Reduce): Fixed uint conversion.
5413 * ecore.cs, literal.cs: Reduce updates.
5415 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5419 * class.cs (Constructor.Define): Removed extra if for default ctors.
5420 A patch from Atsushi Enomoto.
5422 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5424 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
5425 GetAttributableValue.
5427 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
5430 * convert.cs (ImplicitConversionRequired): Error message moved to
5433 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
5434 automatic implicit conversion of an output value.
5435 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
5437 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
5439 (TypeOf.GetAttributableValue): Add extra handling for object type.
5441 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
5442 special error message.
5444 2006-03-25 Marek Safar <marek.safar@seznam.cz>
5446 * class.cs (Constructor.Emit): Don't crash when struct ctor is
5448 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
5449 compatible with MS runtime.
5451 2006-03-23 Marek Safar <marek.safar@seznam.cz>
5453 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
5454 attribute arguments here.
5456 * class.cs (Indexer.Define): The check was moved to attribute class.
5458 2006-03-22 Marek Safar <marek.safar@seznam.cz>
5460 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
5461 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
5464 2006-03-22 Raja R Harinath <rharinath@novell.com>
5466 Support ParameterDefaultValueAttribute in gmcs. Also applied to
5467 mcs to keep code differences small.
5468 * attribute.cs (Attribute.GetParameterDefaultValue): New.
5469 * typemanager.cs (parameter_default_value_attribute_type): New.
5470 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
5473 2006-03-21 Marek Safar <marek.safar@seznam.cz>
5475 * expression.cs (StringConcat.Append): Reverted back to no warning state.
5477 2006-03-21 Marek Safar <marek.safar@seznam.cz>
5479 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
5481 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
5484 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
5486 * doc-bootstrap.cs : fix build.
5488 2006-03-20 Marek Safar <marek.safar@seznam.cz>
5490 * expression.cs (StringConcat.Append): Issue a warning when empty string
5493 2006-03-20 Marek Safar <marek.safar@seznam.cz>
5495 * assign.cs (CompoundAssign.ResolveSource): Removed.
5497 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
5500 * class.cs (TypeContainer.FindMethods): Removed.
5501 (TypeContainer.CheckMemberUsage): Made static.
5503 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
5505 * constant.cs (CheckRange): Removed unused type argument.
5506 (CheckUnsigned): Removed unused type argument.
5508 * cs-parser.jay: Updated after MemberAccess clean up.
5509 Uses Length for empty string test.
5511 * cs-tokenizer.cs: Uses Length for empty string test.
5512 (IsCastToken): Made static.
5513 (is_hex): Made static.
5514 (real_type_suffix): Made static.
5516 * decl.cs (SetupCache): Made static.
5517 (OnGenerateDocComment): Removed unused ds argument.
5519 * delegate.cs (VerifyDelegate): Removed unused argument.
5521 * doc.cs: Uses Length for empty string test.
5523 * driver.cs: Uses Length for empty string test.
5525 * enum.cs (IsValidEnumType): Made static
5527 * expression.cs (EnumLiftUp): Removed unused argument.
5528 (ResolveMethodGroup): Ditto.
5529 (BetterConversion): Ditto.
5530 (GetVarargsTypes): Ditto.
5531 (UpdateIndices): Ditto.
5532 (ValidateInitializers): Ditto.
5533 (MemberAccess.ctor): Ditto.
5534 (GetIndexersForType): Ditto.
5536 * flowanalysis.cs: (MergeFinally): Removed unused argument.
5538 * iterators.cs: Updated after MemberAccess clean up.
5540 * location.cs: Uses Length for empty string test.
5542 * namespace.cs: Uses Length for empty string test.
5544 * report.cs (CheckWarningCode): Made static.
5546 * statement.cs (LabeledStatement): Removed unused argument.
5548 * typemanager.cs (FilterNone): Removed.
5550 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5552 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
5555 * class.cs: Updated.
5557 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5559 * cs-parser.jay.cs: __arglist is not allowed for delegates.
5561 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5565 * expression.cs (VerifyArgumentsCompat): Reverted to double error
5566 reporting, it's more tricky than I thought.
5568 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5572 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
5574 (AnonymousMethod.ImplicitStandardConversionExists): New method.
5575 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
5576 Add more error reporting; Fixed issue with params.
5578 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
5580 * cs-parser.jay: AnonymousMethod requires host container.
5582 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
5584 2006-03-18 Raja R Harinath <harinath@gmail.com>
5586 * class.cs: Change 'TypeContainer ds' constructor argument to
5587 'DeclSpace parent'. Some classes were missed below due to
5588 different naming convention.
5590 * class.cs (MemberCore.Parent): Delete. This makes the
5591 ParentContainer changes below enforceable by the compiler.
5593 Treat pointers to enclosing declaration space as 'DeclSpace', not
5595 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
5596 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
5598 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
5600 (Block.AddThisVariable): Likewise.
5601 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
5602 (AbstractPropertyEventMethod.Emit): Likewise.
5603 (AbstractPropertyEventMethod.EmitMethod): Likewise.
5604 (GetMethod.Define, SetMethod.Define): Likewise.
5605 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
5606 (DelegateMethod.EmitMethod): Likewise.
5608 Fix regression test-partial-13.cs.
5609 Rationalize use of PartialContainer. Ensure that the partial
5610 class semantics can be tied to type-correctness, i.e., any
5611 violation will cause a compile error.
5612 * class.cs, const.cs: Access all fields that belong to class
5613 TypeContainer via ParentContainer. Arguments of EmitContexts and
5614 Resolve()-like functions still use 'Parent'.
5616 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
5617 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
5618 (PropertyMethod.CheckModifiers): Remove unused argument.
5619 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
5622 2006-03-17 Raja R Harinath <harinath@gmail.com>
5624 Make semantics of PartialContainer simpler.
5625 * decl.cs (DeclSpace.IsPartial): Remove.
5626 * class.cs (TypeContainer.IsPartial): Likewise.
5627 (TypeContainer..ctor): Set PartialContainer to point to self.
5628 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
5629 (TypeContainer.FindNestedType): Likewise.
5630 (MemberCore.ParentContainer): Simplify. Remove deprecation.
5632 2006-03-17 Marek Safar <marek.safar@seznam.cz>
5634 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
5636 2006-03-15 Marek Safar <marek.safar@seznam.cz>
5638 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
5641 2006-03-15 Marek Safar <marek.safar@seznam.cz>
5643 * class.cs (Operator.Define): An error for base conversion was not
5646 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
5648 * iterator.cs : yield break is allowed in try statement which has
5649 catch clauses. Fixed bug #77767.
5651 2006-03-13 Marek Safar <marek.safar@seznam.cz>
5653 A fix for #77593, #77574.
5655 * class.cs (MethodCore.CheckBase): Another if for operator.
5657 2006-03-09 Marek Safar <marek.safar@seznam.cz>
5659 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
5662 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
5663 (DelegateCreation.ImplicitStandardConversionExists): New method for just
5666 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
5669 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
5670 Updated after another emitcontext usage was clean up. It should help us to
5671 synchronize with gmcs easier.
5673 2006-03-04 Marek Safar <marek.safar@seznam.cz>
5677 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
5678 (Event.Define): ditto
5679 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
5681 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
5682 Removed redundant code and set NewSlot for Invoke method too.
5684 * parameter.cs (Parameters.ctor): Add custom, type ctor.
5685 (Parameters.MergeGenerated): New method. Use this method when you merge
5686 compiler generated argument with user arguments.
5688 2006-03-03 Marek Safar <marek.safar@seznam.cz>
5690 * attribute.cs (ResolveAsTypeTerminal): Removed.
5692 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
5693 specialization for predefined types; 30% speed up.
5694 Finally placed obsolete check to right place.
5695 (Expression.ResolveType): Removed.
5697 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
5698 Updated after ResolveType was removed.
5700 * expression.cs (Cast.ctor): Check void cast.
5701 (Binary.ResolveAsTypeTerminal): Is never type.
5702 (Conditional.ResolveAsTypeTerminal): Is never type.
5704 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
5706 2006-03-01 Raja R Harinath <rharinath@novell.com>
5709 * expression.cs (ParameterReference.DoResolveBase): Change return
5711 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
5715 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
5718 * typemanager.cs (GetFullNameSignature): Don't nullref on
5719 protected accessors.
5721 2006-02-27 Marek Safar <marek.safar@seznam.cz>
5723 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
5724 these two separated members to simplify the code.
5725 (Attribute.Resolve): Refactored to use new fields and methods.
5726 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
5727 implemented obsolete attribute checking.
5728 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
5729 implemented obsolete checking again. It look line never ending quest ;-)
5730 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
5732 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
5734 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
5736 *class.cs (Property.Define): Add RegisterProperty call.
5738 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
5739 argument groups (only 2).
5741 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
5742 encoding expression to arguments.
5743 (Expression.ExprClassToResolveFlags): Just turned to property.
5745 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
5746 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
5747 optimized as well as implemented support for zero-length attributes.
5749 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
5750 Add caching of PropertyInfo's.
5752 2006-02-25 Marek Safar <marek.safar@seznam.cz>
5754 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
5755 error multiple times.
5757 2006-02-25 Marek Safar <marek.safar@seznam.cz>
5759 New partial class implementation.
5760 A fix for #77027, #77029, #77403
5762 * attribute.cs (Attributable): Made attributes protected.
5764 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
5765 the replacements of ClassPart and PartialContainer.
5766 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
5767 (TypeContainer.AddInterface): Ditto.
5768 (TypeContainer.AddPartial): The main method for partial classes. It checks
5769 for errors and merges ModFlags and attributes. At the end class is added to
5771 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
5773 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
5774 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
5775 from the rest of partial classes.
5776 (TypeContainer.GetClassBases): Simplified.
5777 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
5779 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
5780 (TypeContainer.HasExplicitLayout): Uses Flags now.
5781 (PartialContainer): Removed.
5782 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
5783 (StaticClass): Was merged with Class.
5784 (Class.GetClassBases): class and static class bases are verified here.
5785 (Class.TypeAttr): Added static attributes when class is static.
5786 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
5787 (MemberBase): In some cases we need to call parent container for partial
5788 class. It should be eliminated but it's not easy now.
5790 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
5792 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
5793 partial classed to accumulate class comments.
5794 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
5796 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
5798 * driver.cs (MainDriver): Tree.GetDecl was removed.
5800 * modifiers.cs (Modifiers): Add partial modifier.
5802 * tree.cs (Tree.decl): Removed.
5803 (RootTypes): Started to use this class more often for root types
5806 2006-02-22 Marek Safar <marek.safar@seznam.cz>
5810 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
5811 external interface does not have an attribute.
5813 2006-02-22 Marek Safar <marek.safar@seznam.cz>
5815 Another prerequisites for new partial classs implementation.
5817 * attribute.cs (Attribute.Equal): Implemented.
5818 (Attribute.Emit): Changed as attributes can be applied more than twice.
5819 (Attributes.Emit): Check for duplicate attributes here.
5821 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
5822 as a parameter, clean-up.
5824 2006-02-11 Marek Safar <marek.safar@seznam.cz>
5828 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
5829 contains obsolete attribute check which can in some cases look for base
5830 type of current class which is not initialized yet.
5831 (TypeContainer.BaseType): Replacement of ptype.
5833 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
5835 2006-02-11 Marek Safar <marek.safar@seznam.cz>
5837 First of prerequisites for new partial classs implemention.
5839 * attribute.cs (Attributable): Extended by ResolveContext;
5840 Attributes finally have correct context for resolving in all cases.
5841 (AttachTo): Attribute owner is assigned here.
5843 * codegen.cs (IResolveContext): Introduce new interface to hold
5844 all information needed in resolving phase.
5845 (EmitContext): Implements IResolveContext; more clean-up needed here.
5847 * decl.cs (MemberCore): Implemented IResolveContext.
5849 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
5850 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
5851 parameter.cs, statement.cs, tree.cs, typemanager.cs:
5852 Refactored to use new IResolveContext instead of EmitContext; cleanup
5854 2006-02-06 Miguel de Icaza <miguel@novell.com>
5856 * codegen.cs (EmitScopeInitFromBlock): check here the
5857 capture_context, there is no need to make two calls to the
5860 * anonymous.cs: Add some debugging messages that might help me
5861 track other instances of this problem in the future (the
5862 regression of test 467).
5864 * cs-parser.jay: track the variable block, as we need to initalize
5865 any captured variables declared in this block for the "catch"
5866 portion of the "Try" statement.
5868 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
5869 scope initialization for captured variables.
5871 Also, move the emit for the variables after the block location has
5874 2006-02-06 Marek Safar <marek.safar@seznam.cz>
5876 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
5878 2006-02-02 Miguel de Icaza <miguel@novell.com>
5880 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
5881 commit yesterday, the initialization for the roots is necessary.
5882 What is not necessary is the scope activation.
5884 2006-02-02 Raja R Harinath <rharinath@novell.com>
5886 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
5887 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
5889 (Argument.Resolve): Remove CS0206 checks.
5891 2006-02-01 Miguel de Icaza <miguel@novell.com>
5893 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
5894 scopes for all the roots, the scopes will now be emitted when the
5895 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
5897 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
5898 code. This reduces a lot of existing cruft.
5900 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
5901 that the ScopeInfo is generated as we enter the scope, not at the
5902 time of use, which is what we used to do before.
5904 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
5905 every time a Block is about to be emitted if we have a
5908 2006-02-01 Raja R Harinath <rharinath@novell.com>
5910 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
5912 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
5914 * typemanager.cs (cons_param_array_attribute): Make private.
5915 (Reset): Set it to null.
5916 (InitCoreHelpers): Don't initialize it.
5917 (ConsParamArrayAttribute): New. Initialize it as needed.
5918 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
5920 2006-01-31 Miguel de Icaza <miguel@novell.com>
5922 * expression.cs: There might be errors reported during the
5923 selection of applicable methods. If there are errors, do not
5924 continue execution as it will lead the compiler to crash.
5926 2006-01-30 Miguel de Icaza <miguel@novell.com>
5928 * expression.cs: Member access is not allowed on anonymous
5929 methods. Fixes #77402.
5931 2006-01-30 Raja R Harinath <rharinath@novell.com>
5934 * cs-parser.jay (VariableDeclaration): Don't set
5935 current_array_type to null.
5936 (field_declaration, event_declaration, declaration_statement):
5937 Set it to null here.
5939 2006-01-28 Raja R Harinath <harinath@gmail.com>
5941 * typemanager.cs (GenericParameterPosition): New.
5944 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
5946 * doc.cs : To process "include" elements, first we should create
5947 another list than XmlNodeList, because it could result in node
5948 removal, which could result in that the XmlNodeList gives up
5951 (Also made code identical to gmcs again.)
5953 2006-01-25 Miguel de Icaza <miguel@novell.com>
5955 * ecore.cs: Introduce an error report that we were not catching
5956 before, if not silent, we must report the error. Gonzalo ran into
5959 2006-01-23 Miguel de Icaza <miguel@novell.com>
5961 A fix for bug: #76957
5963 * iterators.cs (MoveNextMethod.CreateMethodHost): call
5964 ComputeMethodHost before creating the method, this is a new
5967 * anonymous.cs (AnonymousContainer): Now we track all the scopes
5968 that this method references (RegisterScope). The actual scope
5969 where the method is hosted is computed with the ComputeMethodHost
5970 before we create the method.
5972 Moved the Deepest routine here.
5974 (AnonymousContainer.ComputeMethodHost): New routine used to
5975 compute the proper ScopeInfo that will host the anonymous method.
5977 (ScopeInfo): Deal with multiple roots. The problem was that we
5978 did not have a unique root where all ScopeInfos could be hanged
5979 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
5982 Remove AdjustMethodScope which is now computed at the end. Remove
5983 LinkScope which did a partial link, instead link all ScopeInfos
5984 before code generation from the new "LinkScopes" routine.
5986 Simplify all the Add* routines as they no longer need to maintain
5987 the tree, they just need to record that they are using variables
5990 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
5991 routines to produce the forest of ScopeInfo trees.
5993 * class.cs (TypeContainer.AppendMethod): This is just like
5994 AddMethod, but ensures that an interface implementation method
5995 (IEnumerable.XXX) is not inserted at the beginning of the queue of
5996 methods, but at the end.
5998 We use this functionality to ensure that the generated MoveNext
5999 method in the iterator class is resolved/emitted before the
6000 enumerator methods created.
6002 This is required because the MoveNext method computes the right
6003 ScopeInfo for the method. And the other methods will eventually
6004 need to resolve and fetch information computed from the anonymous
6007 2006-01-21 Raja R Harinath <harinath@gmail.com>
6008 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6011 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
6013 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
6014 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
6016 2006-01-18 Raja R Harinath <rharinath@novell.com>
6018 Fix #76656, cs0231-2.cs.
6019 * cs-parser.jay (formal_parameter_list): Make error case catch
6021 (parenthesized_expression_0): Add CS1026 check.
6022 (invocation_expression): Remove unused { $$ = lexer.Location }.
6024 2006-01-17 Raja R Harinath <rharinath@novell.com>
6027 * cs-parser.jay (statement_expression): Don't list out the
6028 individual statement-expressions. Convert syntax error into
6031 2006-01-16 Raja R Harinath <rharinath@novell.com>
6034 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
6035 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
6036 CheckIntermediateModification.
6037 (FieldExpr.DoResolve): Add new two-argument version that
6038 allows us to resolve the InstanceExpression as an lvalue.
6039 The one-argument variant is now just a wrapper.
6040 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
6041 Resolve the lhs as an lvalue if the it has a value type.
6042 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
6043 from Assign.DoResolve.
6044 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
6045 resolved as an lvalue.
6046 (PropertyExpr.DoResolve): Update.
6047 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
6048 has a value type. Move CS1612 check here from
6049 CheckIntermediateModification.
6050 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
6051 * expression.cs (EmptyExpression.OutAccess): New. Used as the
6052 'right_side' of a ResolveLValue on an 'out' argument.
6053 (EmptyExpression.LValueMemberAccess): New. Used as the
6054 'right_side' of a propagated ResolveLValue on a value type.
6055 (LocalVariableReference.DoResolveBase): Recognize
6056 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
6058 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
6059 EmptyExpression.Null.
6061 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
6063 * typemanager.cs : added IsGenericParameter(). In mcs it always
6065 * doc.cs : for generic parameters, use GenericParameterPosition,
6068 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
6070 * expression.cs: Fix Console.WriteLine ((this = x).foo);
6072 2006-01-12 Miguel de Icaza <miguel@novell.com>
6074 This fixes the problem where we used ldfld instead of ldflda to
6075 load the "THIS" pointer on captured parameters, when THIS is a
6076 value type. See bug #77205.
6078 * iterators.cs (CapturedThisReference.Emit): Pass false to
6079 EmitThis (we do not need the address).
6081 * codegen.cs (EmitThis): it needs to know whether we need the
6082 address of `this' or not. This is used by value types.
6084 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
6085 every other call passes false.
6087 2006-01-12 Raja R Harinath <rharinath@novell.com>
6090 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
6092 * expression.cs (Invocation.OverloadResolve): Update.
6093 (Invocation.DoResolve): Avoid double resolution of invocation.
6095 2006-01-11 Raja R Harinath <rharinath@novell.com>
6098 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
6099 unary negation of floating point types as 0-expr; negation cannot
6100 overflow in floating point types.
6103 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
6104 on operands of 'void' type.
6107 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
6108 and ExclusiveOr for boolean constants too.
6110 2006-01-09 Raja R Harinath <rharinath@novell.com>
6113 * expression.cs (Invocation.OverloadResolve): Replace reflected
6114 override methods with their base virtual methods, rather than
6116 * typemanager.cs (TypeManager.GetOverride): New.
6118 2006-01-05 Jb Evain <jbevain@gmail.com>
6120 * class.cs (Property.Define, Indexer.Define): do not tag the
6121 properties as SpecialName | RTSpecialName.
6123 2006-01-04 Miguel de Icaza <miguel@novell.com>
6125 * class.cs (MethodCore.IsDuplicateImplementation): This method was
6126 doing a low-level comparission of parameter types. It was lacking
6127 a check for __argslist.
6129 2005-12-30 Miguel de Icaza <miguel@novell.com>
6131 * expression.cs (ParameterReference.DoResolveBase): Allow
6132 reference parameters if they are local to this block.
6134 This allows the ref and out parameters of a delegate to be used in
6135 an anonymous method, for example:
6137 delegate void set (out int x);
6139 set s = delegate (out int x){
6143 This is used by functionality introduced late in the C# language.
6145 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
6146 method that take ref and out parameters.
6148 Fixes #77119 which was a late change in the spec.
6150 2005-12-23 Miguel de Icaza <miguel@novell.com>
6152 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
6153 parent if its the same scope. Fixes #77060.
6155 2005-12-21 Miguel de Icaza <miguel@novell.com>
6157 * driver.cs: Report the case of no source files and no -out:
6160 2005-12-20 Raja R Harinath <rharinath@novell.com>
6163 * expression.cs (ComposedCast.GetSignatureForError): Define.
6165 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6169 * namespace.cs (NamespaceEntry): Add extern_aliases as a
6170 ListDictionary, to contain the ExternAliasEntry entries (in
6171 addition to the NamespaceEntry.aliases hashtable). This field is
6172 shared between the original entry and its doppelganger (bodyless
6174 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
6175 extern_aliases field.
6176 (NamespaceEntry.Lookup): Move the IsImplicit check after the
6177 lookup in extern_aliases.
6179 2005-12-16 Raja R Harinath <rharinath@novell.com>
6182 * class.cs (TypeContainer.Mark_HasEquals): New.
6183 (TypeContainer.Mark_HasGetHashCode): New.
6184 (ClassPart): Override them.
6185 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
6188 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
6189 'parent' argument to the base constructor.
6191 Remove all mention of TypeContainer from decl.cs.
6192 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
6193 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
6194 (DeclSpace.DeclSpace): Likewise.
6195 (DeclSpace.DefineMembers): Remove unused argument.
6196 * cs-parser.jay (pop_current_class): Update to changes. Simplify
6197 debugging check -- we don't care if the debug code throws an
6198 InvalidCastException instead of an InternalErrorException.
6199 * class.cs (TypeContainer.DefineMembers): Update to changes.
6200 (TypeContainer.DoDefineMembers): Likewise.
6201 (TypeContainer.GetMethods): Likewise.
6202 (PropertyMember.Define): Likewise.
6203 (MemberBase.Parent): New property that forwards to
6204 MemberCore.Parent, but ensures that we get a TypeContainer.
6205 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
6206 (RootContext.PopulateTypes): Likewise. Remove special case code
6207 for !RootContext.StdLib: DefineMembers is idempotent.
6209 2005-12-14 Miguel de Icaza <miguel@novell.com>
6211 * convert.cs (ExplicitConversionCore): Check the return value from
6212 ExplicitConversionCore which can return null on failure. Fixes #76914
6214 2005-12-13 Marek Safar <marek.safar@seznam.cz>
6216 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
6218 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
6220 * doc.cs : The search for referenced namespace was insufficient to
6221 get global one as it used to do. Fixed bug #76965.
6223 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
6225 * doc.cs : check name in cref in the last phase that whether it is
6228 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6230 * cs-tokenizer.cs : reverted the latest change: it somehow broke
6233 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6235 * doc.cs : so it turned out that we cannot skip override check for
6236 interface members. Fixed bug #76954.
6238 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6240 * cs-tokenizer.cs : fixed bug #75984:
6241 - #warning and #error should not be handled when the source line
6243 - #line is not checked strictly when the source line is disabled.
6244 - #define and #undef is on the other hand checked strictly at any
6247 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
6249 * cs-tokenizer.cs : missing Location (actually, filename) in one of
6252 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6254 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
6256 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
6258 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
6259 (FieldBase.Initializer): Initializer is now optional.
6260 (EventField.Define): Only event field can have initializer.
6262 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
6264 * const.cs (Const): Reuse initializer.
6266 * cs-parser.jay: Updated after FieldBase changes.
6267 Added current_array_type to simplify array initializers.
6269 * ecore.cs (NullCast.IsDefaultValue): Implemented.
6271 * expression.cs, iterators.cs: Updated.
6273 * namespace.cs (NamespaceEntry): Made UsingFound private.
6275 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6277 * parameterCollection.cs: Obsolete, removed.
6278 * parser.cs: Obsolete, removed.
6280 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6283 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
6285 * enum.cs (Enum.Define): Set obsolete context here.
6287 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
6290 - FindDocumentedMember() now expects 1) paramList as null
6291 when "we don't have to check the number of parameters" and
6292 2) Type.EmptyTypes when "there is no arguments".
6293 - Introduced FoundMember struct to hold the exact type which was
6294 used to find the documented member (the above change broke
6295 test-xml-044; it might be better just to use DeclaringType than
6296 what MS does, like this change does, but it depends on usage.)
6298 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
6300 * doc.cs : documented member might be from DeclaringType for nested
6301 types. Fixed bug #76782.
6303 2005-12-03 Ben Maurer <bmaurer@ximian.com>
6305 * anonymous.cs: Have the param code handle leaving copies on the
6306 stack etc. Allows anonymous params to take part in the assignment
6307 code (++, +=, etc). Fixes bug #76550
6309 * expression.cs: Handle the prepare_for_load/leave_copy by passing
6310 it down to the anon code.
6312 * iterators.cs: Use dummy var here
6314 * codegen.cs: Handle new vars
6316 2005-12-01 Marek Safar <marek.safar@seznam.cz>
6319 * class.cs (MethodData.Define): Set proper Obsolete context.
6321 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
6323 (FieldExpr.DoResolve): Ditto.
6325 2005-12-01 Marek Safar <marek.safar@seznam.cz>
6328 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
6329 parent is not obsolete.
6331 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
6333 * doc.cs : (FindDocumentedMember) find parameterless members first
6334 and get CS0419 in the early stage. Fixed first case of bug #76727.
6336 2005-11-30 Marek Safar <marek.safar@seznam.cz>
6339 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
6340 no error was reported.
6342 *expression.cs (Binary.DoResolve): left can be null.
6344 2005-11-22 Marek Safar <marek.safar@seznam.cz>
6347 * class.cs (MethodData.Emit): Parameters should be labeled first.
6349 2005-11-21 Marek Safar <marek.safar@seznam.cz>
6352 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
6354 2005-11-18 Marek Safar <marek.safar@seznam.cz>
6356 * attribute.cs (AreParametersCompliant): Moved to Parameter.
6358 * class.cs (MethodCore): Parameter clean up.
6359 (IMethodData): Added ParameterInfo.
6360 (MethodData): Parameter clean up.
6361 (Indexer.Define): Parameter clean up.
6373 * typemanager.cs: Parameter clean up.
6375 * delegate.cs (Define): Get rid of duplicated code.
6377 * expression.cs (ParameterReference): Removed useless parameters
6379 (Invocation): Ditto.
6381 * parameter.cs (ParamsParameter): New class, params specialization.
6382 (ArglistParameter): Attemp to separate arglist.
6383 (Parameter): Refactored to be reusable and faster.
6384 (Parameter.Modifier): Made understandable.
6385 (Parameters): Changed to be used as a class for `this' assembly
6386 parameters. Refactored to use new specialized classes.
6388 * support.cs (ParameterData): Added Types property.
6389 (InternalParameters): Deleted.
6391 2005-08-20 Martin Baulig <martin@ximian.com>
6393 Merging this patch from GMCS to fix #75867.
6395 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
6396 scope if we don't already have it.
6398 2005-11-17 Martin Baulig <martin@ximian.com>
6401 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
6402 inherit the scope from our parent. Fixes #76653.
6404 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6406 * doc.cs : the previous patch does not actually fix the bug.
6407 PropertyInfo override check is now implemented and really fixed it.
6408 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
6410 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6412 * doc.cs : apply "override filter" also to properties.
6415 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6417 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
6418 no need to check overrides. For classes, omit those results from
6419 interfaces since they must exist in the class. Fixed bug #76726.
6421 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6423 * typemanager.cs : (GetFullNameSignature) differentiate indexers
6424 with different parameters. Fixed the second problem in #76685.
6426 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6428 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
6429 get expected 'protected' access in CheckValidFamilyAccess()).
6432 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6434 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
6435 Fixed bug #76705. CS1569 was incorrectly commented out.
6437 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
6439 * doc.cs : use Invocation.IsOverride() to do real override check.
6440 * expression.cs : made Invocation.IsOverride() internal.
6442 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
6444 * doc.cs : use TypeManager.FindMembers() instead of (possible)
6445 TypeBuilder.FindMembers() and filter overriden base members out.
6448 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6450 * doc.cs : ref/out parameters are represented as '@' (instead of
6451 '&' in type FullName). Fixed bug #76630 (additionally crefs).
6453 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6455 * doc.cs : when there was no '.' in cref to methods in doc comment,
6456 then parameters were missing in the output. Fixed bug #76691.
6458 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6460 * driver.cs : don't output docs when there is an error.
6463 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6466 Now it should detect indexers. Fixed primary concern in bug #76685.
6467 Fixed CS0419 message to not show the identical member signature in
6470 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6472 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
6473 instead of Type.FindMembers() since it does not handle events.
6476 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
6478 * codegen.cs: Fixed typo (speficied -> specified).
6480 2005-11-11 Marek Safar <marek.safar@seznam.cz>
6483 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
6485 2005-11-11 Marek Safar <marek.safar@seznam.cz>
6487 * attribute.cs: Changed error message.
6489 * cs-tokenizer.cs: One more check.
6491 2005-11-10 Marek Safar <marek.safar@seznam.cz>
6493 * statement.cs (Block.Resolve): Ignore empty statement.
6495 2005-11-10 Marek Safar <marek.safar@seznam.cz>
6497 * report.cs: Made error/warning methods more strict to avoid
6500 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
6501 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
6502 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
6503 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
6505 2005-11-08 Marek Safar <marek.safar@seznam.cz>
6507 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
6508 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
6510 * class.cs (TypeContainer.IsComImport): New property.
6511 (Constructor.Define): Create proper ctor for ComImport types.
6513 * expression.cs (New.CheckComImport): Fixed.
6515 2005-11-07 Miguel de Icaza <miguel@novell.com>
6517 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
6518 that a parameter has been captured does not mean that we do not
6519 have to do the rest of the processing. This fixes the second part
6520 of #76592. If there was another anonymous method capturing
6521 values in the past, the Scope would never be set for the second
6522 method that captured the same parameter.
6524 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
6525 properly manipulate the stack. Second part of fix for #76592.
6527 * expression.cs (New): Add support for invoking "new" on
6528 interfaces that have been flagged with the ComImport attribute and
6529 the CoClass. Fixes #76637
6531 * statement.cs (Try.DoEmit): When a variable is captured, do not
6532 try to emit the vi.LocalBuilder variable as it has been captured.
6533 Create a temporary variable and store the results on the
6534 FieldBuilder. Fixes #76642
6536 2005-11-07 Marek Safar <marek.safar@seznam.cz>
6538 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
6540 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
6542 * expression.cs (Binary.DoResolve): Added && optimalization.
6544 * typemanager.cs (AddUserType): Removed useless argument.
6546 2005-11-04 Marek Safar <marek.safar@seznam.cz>
6548 * statement.cs (Block.variables): Uses ListDictionary.
6550 2005-11-03 Marek Safar <marek.safar@seznam.cz>
6553 * class.cs (PartialContainer.EmitType): Customized to emit
6554 security attributes.
6555 (ClassPart.ApplyAttributeBuilder): Transform security attribute
6556 for partial classes.
6558 2005-11-03 Marek Safar <marek.safar@seznam.cz>
6561 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
6562 access has to be fixed.
6564 * typemanager.cs (IsUnmanagedType): Wrong common field type.
6566 2005-11-01 Marek Safar <marek.safar@seznam.cz>
6569 * ecore.cs (NullCast.Reduce): Implemented.
6571 * expression.cs (ArrayCreation.CheckIndices): Correcly check
6574 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
6576 (Foreach.Resolve): Catch null properly.
6578 2005-10-29 Marek Safar <marek.safar@seznam.cz>
6580 * cs-tokenizer.cs: Warning text fix.
6582 * driver.cs: AllWarningNumbers exposed on public interface.
6584 * report.cs (): Reviewed warning numbers.
6585 (IsValidWarning): Use binary search.
6587 2005-10-29 Marek Safar <marek.safar@seznam.cz>
6589 * driver.cs: Implemeted resource visibility.
6590 (Resources): New class for code sharing between /res: and
6593 2005-10-28 Marek Safar <marek.safar@seznam.cz>
6596 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
6599 * convert (Convert.ImplicitReferenceConversion): NullCast holds
6602 * ecore.cs (NullCast): Child is contant only.
6604 * literal.cs (NullLiteral.Reduce): null can be converted to any
6607 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
6609 * driver.cs: Use Encoding.Default as default code page instead
6612 2005-10-27 Raja R Harinath <rharinath@novell.com>
6615 * expression.cs (Invocation.Error_InvalidArguments): Handle
6616 __arglist parameters.
6617 (Invocation.VerifyArgumentsCompat): Likewise.
6618 * support.cs (ReflectionParameters.GetSignatureForError): Print
6619 __arglist parameters.
6620 (InternalParamters.GetSignatureForError): Likewise.
6621 * parameter.cs (Parameters.GetSignatureForError): Likewise.
6623 2005-10-26 Marek Safar <marek.safar@seznam.cz>
6625 * attribute.cs (GetPropertyValue): Made public.
6627 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
6629 Add new property WrapNonExceptionThrows to handle 2.0 assembly
6631 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
6634 * driver.cs: Reflect method name change.
6636 * statement.cs (Try.Resolve): Warn when try has both general
6639 * typemanager.cs: runtime_compatibility_attr_type new predefined
6642 2005-10-26 Raja R Harinath <harinath@gmail.com>
6645 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
6646 treat it as an empty parameter list.
6648 2005-10-26 Raja R Harinath <rharinath@novell.com>
6651 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
6652 ResolveAsTypeStep silent.
6653 * statement.cs (Block.AddConstant): Mark block as used.
6654 (Block.ResolveMeta): Avoid piling on error messages
6655 if a constant initializer resolution fails.
6657 2005-10-25 Raja R Harinath <rharinath@novell.com>
6659 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
6661 (NamespaceEntry.VerifyAllUsing): New.
6662 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
6663 behaviour. Delegates actual resolution of alias to ...
6664 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
6665 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
6667 * driver.cs (Driver.MainDriver): Update.
6669 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
6670 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
6672 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
6674 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
6675 RootNamespace.DefineNamespacesForAll.
6677 2005-10-24 Raja R Harinath <harinath@gmail.com>
6679 * typemanager.cs (assemblies, external_aliases, modules)
6680 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
6681 (ComputeNamespaces, GetRootNamespace): Remove extra staging
6682 overhead. Move resposibility ...
6683 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
6684 * driver.cs, attribute.cs, codegen.cs: Update to changes.
6686 2005-10-23 Raja R Harinath <harinath@gmail.com>
6688 * namespace.cs (RootNamespace.all_namespaces): Renamed from
6689 cached_namespaces. Improve usage.
6690 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
6691 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
6692 Move from GlobalRootNamespace and simplify.
6693 (RootNamespace.Global): Make instance variable.
6694 (RootNamespace.RootNamespace): Add "alias name" parameter.
6695 (GlobalRootNamespace): Simplify drastically.
6696 (Namespace.Lookup): Don't use GetNamespace.
6697 * typemanager.cs (GetRootNamespace): Rename from
6698 ComputeNamespaceForAlias.
6699 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
6701 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6703 * anonymous.cs (AnonymousContainer): Don't crash when container
6706 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6708 * expression.cs (Binary.DoResolve): Warn when comparing same
6711 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6714 * expression.cs (Binary.DoResolve): It looks like there are no
6715 convetsion rules in enum context.
6717 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6719 Add support for extern alias qualifiers.
6720 * typemanager.cs: Move some LookupTypeReflection code
6721 to namespace.cs, to have cleaner code. Added some methods
6722 to help us keep track of the extern aliased references.
6723 * driver.cs: Add suport for extern alias assemblies on command
6724 line and check for their warnings/errors. Also keep track of the
6725 extern aliased assemblies.
6726 * namespace.cs: Move the global functionality of Namespace
6727 to GlobalRootNamespace/RootNamespace. Now the global namespace
6728 is GlobalRootNamespace.Globa. Also the code moved from
6729 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
6730 Finally added LocalAliasEntry (AliasEntry before) and
6731 ExternAliasEntry, to handle alias statements.
6732 * cs-parser.jay: Add support in the grammar for extern alias
6734 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
6735 Update callings to Namespace (now in GlobalRootNamespace).
6737 2005-10-18 Raja R Harinath <rharinath@novell.com>
6740 * class.cs (TypeContainer.DefineType): Move updating of
6741 topological sort earlier in the code.
6742 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
6744 2005-10-18 Marek Safar <marek.safar@seznam.cz>
6747 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
6749 * constant.cs (Constant.TryReduce): Moved from Cast class.
6750 (Reduce): Made little bit more OO and fixed missing conversions.
6752 * ecore.cs (Reduce): Implemented.
6753 (Binary.EnumLiftUp): New method to upgrade values to enum values.
6755 * literal.cs (Reduce): Implemented.
6757 * class.cs: Reverted Miguel's wrong commit.
6759 2005-10-14 Miguel de Icaza <miguel@novell.com>
6761 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
6763 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
6765 * cs-parser.jay, expression.cs : CS0214 was missing error location
6766 for constants. Fixed bug #76404.
6768 2005-10-11 Marek Safar <marek.safar@seznam.cz>
6771 * convert.cs (ExplicitConversionCore): Fixed object->enum
6774 2005-10-10 Raja R Harinath <rharinath@novell.com>
6776 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
6778 (PropertyExpr.EmitCall): Likewise.
6779 * expression.cs (Invocation.EmitArguments): Handle case where
6781 (Invocation.EmitCall): Avoid allocating temporary variable if
6782 there are no arguments.
6784 2005-10-07 Raja R Harinath <rharinath@novell.com>
6787 * convert.cs (ImplicitConversionStandard): Move conversion of
6788 void* to arbitrary pointer types ...
6789 (ExplicitConversionStandard): .. here.
6790 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
6791 error to always print typenames.
6793 2005-10-07 Raja R Harinath <rharinath@novell.com>
6795 * convert.cs (GetConversionOperator): Rename from
6796 GetConversionOperators. Move operator selection code from ...
6797 (UserDefinedConversion): ... here.
6799 2005-10-06 Marek Safar <marek.safar@seznam.cz>
6801 * convert.cs (ExplicitConversionCore): Removed duplicate enum
6804 2005-10-05 Marek Safar <marek.safar@seznam.cz>
6806 * assign.cs (Assign.DoResolve): Error method changed.
6808 * cfold.cs (DoConstantNumericPromotions): Error method changed.
6810 * const.cs (ResolveValue): Reset in_transit immediately.
6812 * constant.cs: Error method changed.
6814 * convert.cs: Removed useless location parameter.
6815 (ExplicitNumericConversion): Don't do double enum check.
6816 (ExplicitConversionCore): Renamed from ExplicitConversion.
6817 (ExplicitUnsafe): Extracted from ExplicitConversion.
6818 (ExplicitConversion): Uses for error reporting.
6820 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
6822 (ResolveBoolean): Uses common error method.
6823 (CastToDecimal): Get rid of ec.
6824 (CastFromDecimal): Optimized.
6825 (ConvCast): Get rid of ec.
6827 * enum.cs (ResolveValue): Reset in_transit immediately.
6828 (Emit): Return after first error.
6830 * expression.cs: Convert changes.
6832 * literal.cs: Error method changed.
6834 * statement.cs: Error method changed.
6836 2005-10-03 Raja R Harinath <rharinath@novell.com>
6838 * support.cs (SeekableStreamReader.Position): Don't error out when
6839 the requested position is just beyond the end of the current
6842 2005-09-28 Raja R Harinath <rharinath@novell.com>
6844 * support.cs (SeekableStreamReader): Simplify drastically. Don't
6845 try to keep in sync with the byte count of the underlying Stream.
6846 However, this limits us to a window size of 2048 characters: i.e.,
6847 the maximum lookahead of our lexer/parser can be 2048 characters.
6849 2005-09-28 Marek Safar <marek.safar@seznam.cz>
6852 * driver.cs: Fix compilation files with full root path.
6854 2005-09-25 Miguel de Icaza <miguel@novell.com>
6856 * report.cs (SymbolRelatedToPreviousError): Format the output so
6857 it does not use an open parenthesis that is never closed.
6859 * driver.cs: Follow coding guidelines
6861 2005-09-27 Marek Safar <marek.safar@seznam.cz>
6864 * const.cs (Const.ResolveValue): Check for assigning non-null
6865 value to reference type.
6867 2005-09-27 Marek Safar <marek.safar@seznam.cz>
6869 * anonymous.cs: Implemented ExprClassName.
6871 * assign.cs (Assign.DoResolve): Don't chrash when type is not
6874 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
6877 * class.cs (StaticClass.DefineContainerMembers): Report protected
6880 * codegen.cs: if(ed) PRODUCTION.
6882 * convert.cs (Error_CannotImplicitConversion): Better error
6885 * cs-parser.jay: More error checks.
6887 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
6889 * driver.cs (CSCParseOption): Enabled wrong option check.
6891 * ecore.cs (Expression.ExprClassName): Turned to property.
6892 (MemberExpr.CheckIntermediateModification): For checking boxed
6893 value types modification.
6895 * statement.cs (Fixed.Resolve): Expression type must be
6896 convertible to fixed type.
6897 (CollectionForeach.GetEnumeratorFilter,TryType):
6898 Small refactoring for easier error checking.
6900 2005-09-26 Marek Safar <marek.safar@seznam.cz>
6902 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
6905 * class.cs (GeneratedBaseInitializer): New class for customization
6906 compiler generated initializers.
6907 (MemberBase.DoDefine): Check Obsolete attribute here.
6908 (FieldMember.DoDefine): Ditto.
6910 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
6913 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
6914 (MemberCore.GetObsoleteAttribute): Removed argument.
6915 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
6916 (MemberCore.CheckObsoleteType): New helper.
6920 * statement.cs: Updates after MemberCore changes.
6922 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
6923 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
6925 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
6926 obsolete attribute for compiler construct.
6927 (As.DoResolve): Cache result.
6929 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
6931 2005-09-26 Raja R Harinath <rharinath@novell.com>
6934 * expression.cs (This.VerifyFixed): In a value type T, the type of
6935 'this' is T&, iow, 'this' is either an out or ref parameter. In a
6936 value type R, 'this' is treated as a value parameter.
6938 2005-09-22 Miguel de Icaza <miguel@novell.com>
6940 * statement.cs (Lock): Use the TemporaryVariable class instead of
6941 manually using local variables as those do not work when variables
6944 * ecore.cs: Moved the TemporaryVariable class from being a nested
6945 class inside Foreach to be a public class that can be employed in
6948 2005-09-19 Marek Safar <marek.safar@seznam.cz>
6950 * cs-parser.jay: interface_accessors replaced by
6951 accessor_declarations.
6953 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
6956 * statement.cs (GotoCase.Resolve): Convert null constant to
6958 (SwitchLabel.ResolveAndReduce): Ditto.
6959 (SwitchLabel.NullStringCase): Custom null stamp.
6960 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
6962 typemanager.cs (CSharpSignature): Don't skip first argument
6965 2005-09-18 Miguel de Icaza <miguel@novell.com>
6967 * driver.cs: Set InEmacs based on the environment variable EMACS.
6969 * location.cs (InEmacs): in this mode, do not report column
6970 location as it confuses Emacs.
6972 2005-09-16 Marek Safar <marek.safar@seznam.cz>
6974 * cfold.cs, constant.cs, convert.cs, ecore.cs,
6975 expression.cs, iterators.cs, literal.cs: Store constants and
6978 * class.cs (MemberBase.ShortName): Pass location.
6980 * cs-parser.jay: Some location fixes.
6982 * ecore.cs (Expression.Location): Made virtual.
6984 2005-09-05 Miguel de Icaza <miguel@novell.com>
6986 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
6987 if the underlying types are the same, otherwise we need to produce
6988 code that will do the proper cast.
6990 This was exposed by Marek's constant rewrite which produced
6991 invalid code for the call site:
6994 void Method (X v) {}
6998 This fixes test-49.cs
7000 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
7002 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
7003 Type/Object should be allowed as well. Fixed bug #75968.
7005 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
7007 * expression.cs : (Binary.DoResolve): when one is enum constant and
7008 another is constant 0, then return enum one *as enum type*.
7011 2005-09-02 Raja R Harinath <rharinath@novell.com>
7013 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
7017 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
7018 flow-branching for LocalVariableReferences in case we were invoked
7019 from a MemberAccess.
7020 * expression.cs (LocalVariableReference.VerifyAssigned): New.
7022 (LocalVariableReference.DoResolveBase): ... this.
7023 (MemberAccess.Resolve): Do the check that was disabled during
7026 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
7029 (PartialContainer.Create): check abstract/sealed/static strictly
7030 but abstract/sealed can exist only at one side. Fixed bug #75883.
7032 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
7035 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
7036 specified, don't default to UnmanagedType.I4.
7038 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
7040 * expression.cs : conditional operator should check possibly
7041 incorrect assign expression. Fixed bug #75946.
7043 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
7045 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
7046 Reverting the change. gmcs is much complex than mcs on this matter.
7048 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
7050 * cs-tokenizer.cs : To read another token ahead of the actual
7051 consumption, use new SavedToken and cache token instead of moving
7052 back the stream with SeekableStreamReader (it seemed problematic).
7054 driver.cs : Thus use StreamReader directly.
7055 * support.cs : Thus removed SeekableStreamReader.
7057 2005-08-30 Raja R Harinath <rharinath@novell.com>
7060 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
7061 (ScopeInfo.EmitScopeType): Use it to construct field names from
7062 names of captured locals.
7065 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
7066 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
7067 Pass 'target_type' to BoxedCast. Don't default to 'object'.
7068 (ExplicitConversion): Remove enum cases already handled by
7069 implicit conversion. Move implicit conversion check to the beginning.
7070 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
7071 * expression.cs (ArrayCreation.EmitDynamicInitializers):
7072 Don't treat System.Enum as a struct.
7074 2005-08-30 Jb Evain <jbevain@gmail.com>
7076 * attribute.cs: handles as expression in parameters.
7078 2005-08-30 Raja R Harinath <rharinath@novell.com>
7081 * class.cs (TypeContainer.VerifyClsName): Don't use a
7082 PartialContainer when verifying CLS compliance.
7083 (AbstractPropertyEventMethod): Set Parent here, ...
7084 (PropertyMethod): ... not here.
7086 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
7088 * attribute.cs : escaped attribute name should not be allowed to be
7089 resolved (e.g. @class as classAttribute). Fixed bug #75930.
7091 2005-08-29 Raja R Harinath <rharinath@novell.com>
7094 * convert.cs (ImplicitStandardConversionExists): Allow zero also
7095 when converting a long constant to unsigned long.
7096 * expression.cs (Invocation.OverloadResolve): Add sanity check to
7097 detect where IsApplicable and VerifyArgumentsCompat disagree.
7099 2005-08-29 Raja R Harinath <rharinath@novell.com>
7100 and Carlos Alberto Cortez <carlos@unixmexico.org>
7103 * class.cs (TypeContainer.CanElideInitializer): New helper.
7104 (TypeContainer.EmitFieldInitializers): Use it to determine if we
7105 can safely emitting the initializer of a field.
7107 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7109 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
7110 allowed inside a switch (without loop). Fixed bug #75433.
7112 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
7114 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
7115 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
7117 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7119 * driver.cs : kinda reverting the default encoding changes (not exact
7120 revert since I noticed that "codepage:reset" might not work fine).
7122 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7124 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
7125 Location. Now getter and setter store location correctly.
7126 (errors/cs0111-12.cs now reports the expected location.)
7128 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7130 * driver.cs : Use default encoding on the environment.
7131 Removed (now that) extra parameter for SeekableStreamReader.
7132 * support.cs : (SeekableStreamReader) third .ctor() argument for
7133 StreamReader is not required (always true). preamble size could
7134 be acquired in simpler and safe way.
7136 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
7138 * cs-parser.jay: report CS0642 at warning level 3
7139 and report CS0642 for an if else statement also
7140 fixes bug #74745. Patch by John Luke (and a bit
7142 Removed extra CS0642 warning check for "while",
7144 * statement.cs: In Block.Resolve(), CS0642 check
7145 is reimplemented to check a sequence of an empty
7146 statement and a block.
7148 Both fix bug #66777.
7150 2005-08-24 Marek Safar <marek.safar@seznam.cz>
7152 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
7153 detection until I fix it.
7155 * cs-tokenizer.cs: Changed error message.
7157 * cs-parser.jay: Fixed 2 error locations.
7159 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
7160 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
7163 * enum.cs (GetSignatureForError): Fixed.
7165 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
7169 * typemanager.cs (RegisterProperty): Removed.
7171 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
7173 2005-08-24 Raja R Harinath <rharinath@novell.com>
7176 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
7177 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
7179 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7181 * expression.cs : tiny fix is required for not warning positive ulong.
7184 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7186 * expression.cs : add CS0652 check for constant and integral
7187 expression. Fixed bug #53974.
7189 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7191 * expression.cs : in DoNumericPromotions(), check if there is implicit
7192 conversion overload for string (to check CS0034). Fixed bug #52492.
7194 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7196 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
7198 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7200 * ecore.cs : report location when it is *not* Null.
7202 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7208 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
7209 correctly. Fixed bug #75721.
7211 2005-08-23 Raja R Harinath <rharinath@novell.com>
7213 * support.cs (SeekableStreamReader.Position): Avoid an expensive
7214 loop that performs 'min (pos, char_count)'.
7217 * expression.cs (Unary.ResolveOperator): Don't discard implicit
7218 converted value in Operator.OnesComplement.
7220 2005-08-22 Ben Maurer <bmaurer@ximian.com>
7222 * anonymous.cs: If the anon method is pulled into a helper class,
7223 it needs to be `internal' not `private'. Fixes runtime behavior on
7226 2005-08-20 Martin Baulig <martin@ximian.com>
7228 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7229 scope if we don't already have it.
7231 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
7232 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
7235 2005-08-17 Marek Safar <marek.safar@seznam.cz>
7238 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
7241 2005-08-16 Marek Safar <marek.safar@seznam.cz>
7243 The big constants rewrite
7244 Fix #75746, #75685 and more
7245 As a side effect saved 1MB for MWF ;-)
7247 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
7248 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
7249 enum based for corlib compilation.
7251 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
7254 * class.cs (FixedField.Define): Use ResolveAsConstant.
7256 * const.cs (IConstant): Interface constants and enums.
7257 (Const.ResolveValue): New method for constant resolvning.
7258 (ExternalConstant): Constants from imported assemblies.
7260 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
7261 conversion; like enums.
7262 (Constant.ToType): Converts this constant to different type.
7263 (Constant.Increment): Adds 1.
7265 * convert.cs (ImplicitConversionRequired): Simplified.
7267 * cs-parser.jay: Create EnumMember directly.
7269 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
7271 * doc.cs (GenerateEnumDocComment): Removed.
7273 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
7274 (ConvertIntLiteral): Removed.
7275 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
7277 * enum.cs (EnumMember): Implement IConstant.
7278 (Enum.IsValidEnumConstant): Removed.
7279 (Enum.GetNextDefaultValue): Removed.
7280 (Enum.FindMembers): Updated.
7281 (Enum.GenerateDocComment): Iterate enum members.
7283 * expression.cs (Cast.TryReduce): Handle enums correctly.
7284 (New.Constantify): Made public.
7285 (MemberAccess.DoResolve): Removed contant specific if(s).
7287 * literal.cs (NullLiteral): Implement new abstract methods.
7289 * statement.cs (GotoCase.Resolve): Use new constant methods.
7290 (SwitchLabel.ResolveAndReduce): Use new constant methods.
7292 * typemanager.cs (LookupEnum): Removed.
7293 (IsEnumType): Fixed to work with corlib.
7294 (RegisterConstant): Removed.
7295 (LookupConstant): Removed.
7296 (GetConstant): Changed to work with IConstant.
7298 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
7300 * location.cs : Fixed overflown (>255) column number.
7302 2005-08-03 Raja R Harinath <rharinath@novell.com>
7304 First cut of the qualified-alias-member feature.
7305 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
7307 * cs-parser.jay (DOUBLE_COLON): New token.
7308 (namespace_or_type_name): Add rule for recognizing
7309 qualified-alias-members.
7310 (primary_expression): Likewise.
7311 (element_access): Allow QualifiedAliasMember as a possible
7312 type-bearing expression.
7313 (local_variable_type, local_variable_pointer_type): Likewise.
7314 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
7315 aliases in the current and enclosing namespace declarations.
7316 (NamespaceEntry.UsingAlias): Add CS0440 warning.
7317 * decl.cs (MemberName.is_double_colon): New.
7318 (MemberName.MemberName): Add new constructor for alias-member.
7319 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
7320 * expression.cs (QualifiedAliasMember): New expression type.
7322 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7324 * location.cs : it borked when no argument was specified.
7326 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7328 * location.cs : tiny ToString() format fix.
7330 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7332 * statement.cs : oops, it was missing.
7334 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7336 A set of fixes for precise line/column location.
7339 "token" field now holds a file/line "delta", a line number offset
7340 from the segment, and a column number. See also:
7341 http://lists.ximian.com/pipermail/mono-devel-list/2004-
7342 December/009508.html
7343 Removed static IsNull. Use instance IsNull property instead.
7345 For some tokens it stores Location. For Identifier it stores
7346 LocatedToken which is a pair of string name and location.
7347 Column numbers are adjusted only at getChar().
7349 Use Location.ToString() for reporting (it now contains column).
7351 Largely modified to use LocatedToken instead of
7352 string (IDENTIFIER), and to acquire Location from some tokens.
7353 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
7354 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
7356 Now MemberName holds Location. DeclSpace.ctor() receives Location
7357 as a parameter. Removed extra parameters to all derived classes.
7358 Replaced Location.IsNull() with instance property.
7359 * assign.cs, expression.cs :
7360 Added .ctor() overload that omits Location.
7362 Added "nameEscaped" flag that indicates the identifier was escaped
7363 in the source file. This fixes bug #57047.
7365 2005-08-02 Marek Safar <marek.safar@seznam.cz>
7367 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
7368 New method, looking for lo-case imported cls type.
7370 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
7373 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
7375 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
7377 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
7379 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
7381 Optimized to save 3.5 MB for SWF compilation.
7383 2005-08-01 Marek Safar <marek.safar@seznam.cz>
7385 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
7386 (PartialContainer.Create): Moved logic AddToContainer.
7387 (PartialContainer.MarkForDuplicationCheck): Shares name.
7389 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
7392 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
7394 (Namespace.GetSignatureForError): New method.
7396 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
7397 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
7399 2005-08-01 Raja R Harinath <rharinath@novell.com>
7402 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
7403 member lookup rather than qualifier_type, since qualifier_type can
7406 2005-08-01 Marek Safar <marek.safar@seznam.cz>
7408 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
7411 2005-07-31 Miguel de Icaza <miguel@novell.com>
7413 * statement.cs: Copy the local exception into the exception
7414 captured local. Fixes 75674
7416 2005-07-31 Raja R Harinath <harinath@gmail.com>
7419 * expression.cs (Invocation.OverloadResolve): Don't report error
7420 CS1501 if error CS1502 has been reported.
7421 (New.DoResolve): Delegate CS1501 reporting to
7422 Invocation.OverloadResolve.
7425 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
7426 invariant-meaning-in-block property in an enclosing block if
7429 2005-07-29 Marek Safar <marek.safar@seznam.cz>
7431 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
7432 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
7433 (Switch.CheckSwitch): Just save 50kb for SWF.
7435 2005-07-27 Martin Baulig <martin@ximian.com>
7437 * anonymous.cs (CaptureContext.AddField): Added
7438 `AnonymousContainer am' argument; compute its toplevel scope if
7439 it's not already computed. Fixes #75649.
7441 2005-07-26 Raja R Harinath <rharinath@novell.com>
7444 * class.cs (Constructor.Emit): Reset block to null if the block
7447 2005-07-25 Marek Safar <marek.safar@seznam.cz>
7449 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
7451 2005-07-25 Marek Safar <marek.safar@seznam.cz>
7453 * class.cs (MethodData.Define): Check whether accessor implementing
7454 interface is public.
7456 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
7458 2005-07-22 Marek Safar <marek.safar@seznam.cz>
7461 * namespace.cs (LookupType): Moved same type check to...
7463 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
7466 2005-07-21 Raja R Harinath <rharinath@novell.com>
7468 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
7469 already found a typebuilder.
7470 * class.cs (MethodCore.IsDuplicateImplementation): Compare
7471 MemberNames, not strings.
7473 * const.cs (Error_ExpressionMustBeConst):
7474 Rename from Error_EpressionMustBeConst.
7475 * const.cs, class.cs, statement.cd: Update.
7477 2005-07-21 Marek Safar <marek.safar@seznam.cz>
7481 * const.cs (Const.LookupConstantValue): Report missing contant expression
7483 (Error_EpressionMustBeConstant): Only one error method.
7485 * class.cs, statement.c: Updated.
7487 2005-07-20 Raja R Harinath <rharinath@novell.com>
7489 * statement.cs (Block.Flags): Add back HasVarargs.
7490 (Block.flags): Make protected.
7491 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
7493 * typemanager.cs (types, typecontainers, user_types): Remove.
7494 (UserTypes, TypeContainers): Likewise.
7495 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
7496 (CleanUp, Reset): Update.
7497 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
7498 (GetNestedType): Use Type.GetNestedType.
7499 (CoreLookupType): Take two arguments, the namespace and the
7500 basename of the type. Update to use the Namespace.Lookup
7502 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
7503 (RealMemberLookup): Use IsNestedChildOf instead of playing with
7504 string concatenation and substring matches.
7505 * class.cs, enum.cs, delegate.cs: Update to changes.
7507 2005-07-20 Marek Safar <marek.safar@seznam.cz>
7509 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
7510 Expression and made virtual.
7512 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
7513 (ImplicitStandardConversionExists): Fixed `byte' typo ?
7515 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
7517 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
7520 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
7523 2005-07-18 Marek Safar <marek.safar@seznam.cz>
7526 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
7527 AssemblyCultureAttribute is not used on executable.
7530 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
7532 2005-07-16 Raja R Harinath <rharinath@novell.com>
7535 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
7536 New. Reports CS0252/CS0253.
7537 Mostly taken from preliminary patch by Duncak Mak.
7538 (Binary.DoResolveOperator): Store results of operator lookup.
7539 Use them to detect if we need to warn about unintended reference
7542 2005-07-15 Raja R Harinath <rharinath@novell.com>
7545 * namespace.cs (Namespace.Lookup): Add back location parameter.
7546 (Namespace.LookupType): Add CS0436 report. Add location parameter.
7547 * delegate.cs, ecore.cs, expression.cs: Update to changes.
7549 * codegen.cs (EmitContext.DeclSpace): Make readonly.
7550 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
7551 (Namespace.LookupType): ... this.
7552 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
7554 * typemanager.cs (LookupTypeReflection): Remove buggy code that
7555 purported to handle pointers.
7556 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
7559 2005-07-15 Marek Safar <marek.safar@seznam.cz>
7561 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
7564 2005-07-15 Raja R Harinath <rharinath@novell.com>
7566 * namespace.cs (Namespace.Lookup): Drop location parameter.
7567 (NamespaceEntry.LookupAlias): Remove. Merge into ...
7568 (NamespaceEntry.Lookup): ... this.
7569 (NamespaceEntry.Error_AmbiguousTypeReference):
7570 Move here from DeclSpace.
7571 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
7573 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
7574 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
7575 Move to NamespaceEntry.
7576 * delegate.cs, expression.cs: Update to changes.
7578 2005-07-14 Marek Safar <marek.safar@seznam.cz>
7580 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
7581 CheckAttributeType and refactored.
7582 (Attribute.ResolvePossibleAttributeType): Changed to reuse
7583 ResolveAsTypeTerminal error handling.
7584 (ResolveAsTypeTerminal): Introduced because of global attributes extra
7586 (GetSignatureForError): Print errors in same way.
7589 * codegen.cs: Reflect attribute GetSignatureForError change.
7592 * expression.cs: Add silent parameter to ResolveAsTypeStep.
7594 * namespace.cs (UsingEntry): Refactored to make fields private.
7597 statement.cs: Error_UnexpectedKind has extra parameter.
7599 2005-07-14 Raja R Harinath <rharinath@novell.com>
7601 * ecore.cs (IAlias): Remove.
7602 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
7603 that implement the interface.
7604 * namespace.cs (Namespace): Likewise.
7605 (Namespace.declspaces): Renamed from 'defined_names'.
7606 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
7607 DeclSpace instead of an IAlias.
7608 * tree.cs (Tree.AddDecl): Update.
7610 2005-07-12 Raja R Harinath <rharinath@novell.com>
7612 * statement.cs (Block.Flags); Remove HasVarargs.
7613 (Block.HasVarargs): Move to ToplevelBlock.
7614 (Block.ThisVariable, Block.AddThisVariable): Likewise.
7615 (Block.Variables): Make protected. Initialize variable hashtable
7617 (Block.AddVariable): Update.
7618 (Block.Resolve): Update to changes.
7619 (ToplevelBlock.HasVarargs): New boolean.
7620 (ToplevelBlock.ThisVariable): Move here from Block.
7621 (ToplevelBlock.AddThisVariable): Likewise.
7622 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
7623 * expression.cs (This.ResolveBase): Update to changes.
7624 (ArglistAccess.DoResolve): Likewise.
7626 2005-07-11 Marek Safar <marek.safar@seznam.cz>
7629 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
7631 * class.cs (TypeContainer.VerifyMembers): Distinguish between
7632 not used and not used & assigned.
7633 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
7635 2005-07-11 Marek Safar <marek.safar@seznam.cz>
7638 * expression.cs (Is.DoResolve): null is never provided type.
7640 2005-07-08 Marek Safar <marek.safar@seznam.cz>
7643 * cs-parser.jay: Less strict event error rule to catch more errors.
7645 2005-07-08 Martin Baulig <martin@ximian.com>
7647 Fix test-iter-10.cs - distinguish whether we `yield' in a property
7648 gettter (allowed) or setter (not allowed).
7650 * class.cs (Accessor): Implement IIteratorContainer.
7651 (Accessor.Yields): New public field.
7652 (PropertyBase.PropertyMethod.Define): Handle iterators on a
7656 (get_accessor_declaration, set_accessor_declaration): Set the
7657 `yields' flag on the accessor, not the property.
7658 (property_declaration): Do the iterators check on a per-accessor
7659 basis and not for the whole property.
7661 2005-07-08 Martin Baulig <martin@ximian.com>
7663 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
7664 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
7666 2005-07-07 Marek Safar <marek.safar@seznam.cz>
7669 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
7670 (ExtractSecurityPermissionSet): Cope with self referencing security
7671 attributes properly.
7673 * driver.cs (SetOutputFile): Made public property OutputFile.
7675 2005-07-07 Raja R Harinath <rharinath@novell.com>
7678 * class.cs (TypeContainer.first_nonstatic_field): Rename from
7679 has_nonstatic_fields. Make into a FieldBase pointer.
7680 (TypeContainer.AddField): Add CS0282 check.
7681 (TypeContainer.EmitType): Update.
7683 2005-07-06 Miguel de Icaza <miguel@novell.com>
7685 * cs-tokenizer.cs (consume_identifier): Do not create strings to
7686 compare if they start with __.
7688 2005-07-06 Raja R Harinath <rharinath@novell.com>
7690 * statement.cs (Switch.SwitchGoverningType): Only look at
7691 UserCasts that don't need implicit standard conversions to one of
7692 the allowed switch types (Fixes test-322.cs).
7693 (LocalInfo.Resolve): Re-enable sanity-test.
7695 2005-07-06 Marek Safar <marek.safar@seznam.cz>
7697 * cs-tokenizer.cs (consume_identifier): Detect double undescores
7699 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
7701 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
7703 2005-07-06 Raja R Harinath <rharinath@novell.com>
7706 * ecore.cs (SimpleName.GetSignatureForError): Add.
7707 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
7708 (MemberAccess.GetSignatureForError): Add.
7710 2005-07-05 Marek Safar <marek.safar@seznam.cz>
7712 The big error and warning messages review.
7742 * typemanager.cs: Updated.
7744 * class.cs: (MethodCore.SetYields): Moved here to share.
7745 (PropertyMethod.Define): Moved iterator setup here.
7747 * iterators.cs: Add orig_method to have full access to parent
7750 2005-07-05 Raja R Harinath <rharinath@novell.com>
7752 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
7753 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
7754 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
7755 variable of struct type.
7756 * expression.cs (Unary.ResolveOperator): Update to change.
7757 (Indirection.VerifyFixed): Likewise.
7758 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
7759 (ParameterReference.VerifyFixed): Value parameters are fixed.
7760 (This.VerifyFixed): Treat 'this' as a value parameter.
7761 * statement.cs (LocalInfo.IsFixed): Remove.
7763 2005-07-01 Martin Baulig <martin@ximian.com>
7765 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
7766 `ec.EmitThis ()' to get the correct scope.
7768 2005-07-01 Martin Baulig <martin@ximian.com>
7770 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
7771 instance is a ParameterReference; fixes #75299.
7773 2005-07-01 Martin Baulig <martin@ximian.com>
7775 Reverted Marek's latest patch (r46725):
7776 - it contains structural changes which are neither mentioned in
7777 the ChangeLog nor explained anywhere; for example the additional
7778 argument of EmitContext's and Iterator's .ctor's and the
7779 TypeContainer.DefineMembers() change.
7780 - structural changes like this should go in in seperate patches
7781 and not be hidden in a huge patch which just seems to affect
7782 warnings and errors.
7783 a big and hard to understand patch.
7784 - it breaks iterators and causes regressions, for instance in
7787 2005-06-30 Raja R Harinath <rharinath@novell.com>
7790 * expression.cs (Indexers.map): Remove.
7791 (Indexers.Append): Filter out inaccessible setters and getters.
7792 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
7795 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
7797 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
7798 (FieldExpr.Emit, PropertyExpr.Emit): Update.
7799 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
7800 * expression.cs (Invocation.EmitCall): Add CS0120 check.
7802 2005-06-30 Marek Safar <marek.safar@seznam.cz>
7805 * class.cs (FieldBase.GetInitializerExpression): One more field
7808 2005-06-28 Miguel de Icaza <miguel@novell.com>
7810 * pending.cs: Do not define a proxy if the base method is virtual,
7811 it will be picked up by the runtime (bug 75270).
7813 2005-06-08 Martin Baulig <martin@ximian.com>
7815 The big Iterators rewrite :-)
7817 * iterators.cs: Rewrite this to use the anonymous methods framework.
7819 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
7820 before the TypeContainers; see 2test-21.cs.
7823 (TypeContainer.DefineType): Don't create a new EmitContext if we
7824 already have one (this only happens if we're an Iterator).
7825 (TypeContainer.Define): Also call Define() on all our iterators.
7826 (Method.CreateEmitContext): Added support for iterators.
7829 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
7830 (AnonymousContainer.CreateMethodHost): Moved here from
7831 AnonymousMethod and made abstract.
7832 (AnonymousContainer.CreateScopeType): New abstract method.
7833 (AnonymousContainer.IsIterator): New public property.
7834 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
7835 get the ScopeTypeBuilder rather than manually defining it here.
7836 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
7839 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
7840 before RootContext.DefineTypes().
7842 * codegen.cs (EmitContext.RemapToProxy): Removed.
7843 (EmitContext.CurrentAnonymousMethod): Changed type from
7844 AnonymousMethod -> AnonymousContainer.
7845 (EmitContext.ResolveTopBlock): Protect from being called twice.
7846 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
7847 (EmitContext.EmitThis): Removed the iterators hacks; use the
7848 anonymous methods framework for that.
7851 (ToplevelBlock.Container): Make this a property, not a field.
7852 (ToplevelBlock.ReParent): New public method; move the
7853 ToplevelBlock into a new container.
7854 (Foreach.TemporaryVariable): Simplify.
7856 2005-06-05 Martin Baulig <martin@ximian.com>
7858 * statement.cs (LocalInfo.CompilerGenerated): New flag.
7859 (Block.AddTemporaryVariable): New public method; creates a new
7860 `LocalInfo' for a temporary variable.
7861 (Block.EmitMeta): Create the LocalBuilders for all the temporary
7863 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
7864 non-iterator variables.
7866 2005-06-05 Martin Baulig <martin@ximian.com>
7868 * statement.cs (Foreach.TemporaryVariable): Create the
7869 LocalBuilder in the Emit phase and not in Resolve since in some
7870 situations, we don't have an ILGenerator during Resolve; see
7871 2test-19.cs for an example.
7873 2005-06-04 Martin Baulig <martin@ximian.com>
7875 **** Merged r45395 from GCS ****
7877 The big Foreach rewrite - Part II.
7879 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
7880 with `PropertyInfo ienumerator_getcurrent'.
7882 * codegen.cs (VariableStorage): Removed.
7885 (Foreach): Derive from Statement, not ExceptionStatement.
7886 (Foreach.CollectionForeach): New nested class. Moved all the code
7887 dealing with collection foreach here.
7888 (Foreach.ForeachHelperMethods): Removed.
7889 (Foreach.TemporaryVariable): Implement IMemoryLocation.
7891 2005-05-23 Martin Baulig <martin@ximian.com>
7893 * statement.cs (Try.DoResolve): Don't create a `finally' if we
7894 don't need to. Fix #75014.
7896 2005-05-20 Martin Baulig <martin@ximian.com>
7898 Merged r44808 from GMCS.
7900 * class.cs (TypeContainer.CircularDepException): Removed.
7901 (TypeContainer.DefineType): Removed the `InTransit' stuff.
7902 (TypeContainer.CheckRecursiveDefinition): Check for circular class
7903 (CS0146) and interface (CS0529) dependencies here.
7905 2005-06-21 Raja R Harinath <rharinath@novell.com>
7907 * expression.cs (Invocation.EmitCall): Fix initialization
7908 'this_call' to reflect current behaviour. Fix indentation.
7910 * convert.cs (FindMostEncompassedType): Add two trivial special
7911 cases (number_of_types == 0 || number_of_types == 1).
7912 (FindMostEncompasingType): Likewise.
7914 2005-06-17 Raja R Harinath <rharinath@novell.com>
7916 Some cleanups preparing for the fix of #75283.
7917 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
7919 (EventExpr.InstanceResolve): Likewise.
7920 (EventExpr.DoResolve): Remove redundant checks.
7922 2005-06-10 Duncan Mak <duncan@novell.com>
7924 * cs-tokenizer.cs (process_directives): New flag for controlling
7925 the processing of preprocessor directives.
7926 (x_token): After seeing a '#', return Token.NONE instead of going
7927 to handle_preprocessing_directive() when not processing
7928 directives. This avoids unnecessary processing during the token peek in
7933 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
7934 the existing error reporting methods instead of Report.Error.
7936 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
7937 after Raja's rewrite.
7939 2005-06-08 Miguel de Icaza <miguel@novell.com>
7941 * class.cs: Small fix.
7943 2005-06-08 Raja R Harinath <rharinath@novell.com>
7946 * class.cs (GetPartialBases): Fix return value check of
7949 2005-06-07 Raja R Harinath <rharinath@novell.com>
7951 Ensure that partial classes are registered in their enclosing
7952 namespace. Initial part of fix of #75160.
7953 * tree.cs (Tree.RecordDecl): Add new namespace argument.
7954 Register declspace with namespace here, not in
7955 DeclSpace.RecordDecl.
7956 * cs-parser.jay: Pass namespace to RecordDecl.
7957 * class.cs (PartialContainer.Create): Likewise.
7958 (ClassPart.DefineType): New sanity-check. Throws an exception if
7960 * decl.cs (Declspace.RecordDecl): Remove.
7961 * namespace.cs (NamespaceEntry.DefineName): Remove.
7963 2005-06-06 Marek Safar <marek.safar@seznam.cz>
7965 * rootcontext.cs: Reset TargetExt as well.
7967 2005-06-03 Raja R Harinath <rharinath@novell.com>
7969 * ecore.cs (Expression.Resolve): Emit CS0654 error when
7972 2005-06-02 Raja R Harinath <rharinath@novell.com>
7974 Fix #75080, cs0119.cs.
7975 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
7977 (Expression.Resolve): ... this. Use it. Remove bogus code
7978 allowing ExprClass.Type and ExprClass.Namespace for
7979 ResolveFlags.VariableOrValue.
7980 (Expression.Resolve) [1-argument variant]: Change default resolve
7981 flags based on language version.
7982 (Expression.Error_UnexpectedKind): Use a simple string array
7983 rather than an ArrayList.
7984 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
7986 (TypeOfVoid.DoResolve): Likewise.
7987 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
7988 flags argument -- it always has the same value.
7990 2005-05-31 Raja R Harinath <rharinath@novell.com>
7993 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
7994 Use it in the error message.
7995 * assign.cs, expression.cs, statement.cs: Update.
7997 2005-05-30 Raja R Harinath <rharinath@novell.com>
8000 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
8001 the "almostMatchedMember" case too.
8002 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
8003 that failed the accessibility checks to 'almost_match'.
8005 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
8007 * attribute.cs: Use internal MethodBuilder methods to set
8008 ExactSpelling and SetLastError on PInvoke methods, instead
8009 of passing them via charset. Fixes #75060.
8011 2005-05-27 Raja R Harinath <rharinath@novell.com>
8013 * parameter.cs (Parameter): Remove TODO comment.
8014 (Parameter.DefineParameter): Remove Location parameter.
8015 (Parameters.LabelParameters): Likewise.
8016 * class.cs (Constructor.Emit): Update to change.
8017 (MethodData.Emit): Likewise.
8018 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
8019 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
8021 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
8024 Removed Parameters.Location and added Parameter.Location instead.
8025 Removed Location parameter from Emit() and GetSignature().
8032 Modified all related calls.
8034 2005-05-26 Raja R Harinath <rharinath@novell.com>
8036 Improve user-defined conversion handling.
8037 * convert.cs (GetConversionOperators): Rewrite. Return only the
8038 applicable operators.
8039 (AddConversionOperators): New. Helper for GetConversionOperators.
8040 (FindMostEncompassedType, FindMostEncompassingType): Verify that
8041 there is only one most encompassed/encompassing type.
8042 (FindMostSpecificSource, FindMostSpecificTarget): Remove
8043 "applicable operator" handling.
8044 (UserConversion): Move cache here from GetConversionOperators.
8045 Directly cache the chosen operator, rather than the whole
8047 (ExplicitNumericConversion): Fix buggy implementation of Decimal
8048 case. Allow conversion of decimal to sbyte and byte too.
8049 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
8050 New static methods. Used to avoid allocating EmptyExpressions in
8053 2005-05-24 Duncan Mak <duncan@novell.com>
8055 * ecore.cs (CastFromDecimal): New class for casting a decimal to
8056 another class, used in Convert.ExplicitNumericConversion.
8057 (CastToDecimal): New class, similar to above, but casts to
8058 System.Decimal, used in Convert.ImplicitNumericConversion and also
8059 in explicit convesion from double/float to decimal.
8061 * convert.cs (ImplicitNumericConversion): Handle implicit
8062 conversions to System.Decimal.
8063 (ExplicitNumericConversion): handle explicit conversions to
8068 2005-05-20 Miguel de Icaza <miguel@novell.com>
8070 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
8071 know the type at this stage, just break through. Fixes #75008
8073 2005-05-19 Martin Baulig <martin@ximian.com>
8076 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
8077 to disable error reporting.
8079 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
8080 here since we don't want to report an error; see the new test-336.cs.
8082 2005-05-19 Raja R Harinath <rharinath@novell.com>
8084 * statement.cs (ToplevelBlock.GetParameterReference)
8085 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
8086 Move here from class Block.
8087 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
8088 * expression.cs (ParameterReference.DoResolveBase): Likewise.
8090 2005-05-18 Martin Baulig <martin@ximian.com>
8095 (FlowBranching.Reachability): Add non-static public And() and Or()
8097 (FlowBranchingSwitch): New class; do the `break_origins' thing
8098 like in FlowBranchingLoop.
8099 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
8100 reachability, not just locals and parameters.
8101 (FlowBranching.MergeChild): Remove some of the hacks for loop and
8102 switch; MergeBreakOrigins() now takes care of that.
8104 2005-05-18 Martin Baulig <martin@ximian.com>
8106 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8107 a loop and may leave it, reset the barrier; fixes #74974.
8109 2005-05-17 Marek Safar <marek.safar@seznam.cz>
8111 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
8114 * cs-parser.jay: Catch more lexical errors.
8116 * report.cs: Add one more Error method.
8119 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
8121 2005-05-17 Martin Baulig <martin@ximian.com>
8123 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
8126 2005-05-16 Raja R Harinath <rharinath@novell.com>
8128 Fix test-382.cs. Emit values of decimal constants.
8129 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
8131 (TypeContainer.AddField): ... this.
8132 (TypeContainer.EmitFieldInitializers): Allow the list of fields
8133 with initializers to include 'Const's.
8134 (ClassPart.RegisterFieldForInitialization): Forward to
8136 * const.cs (Const.Const): Pass initializer to base class.
8137 (Const.Define): In case of decimal constants, register them for
8138 initialization in a static constructor.
8140 2005-05-14 Martin Baulig <martin@ximian.com>
8142 * statement.cs (Block.Resolve): Correctly handle unreachable code;
8143 do not call ResolveUnreachable() on unreachable statements in
8144 here, see the comment in the source code.
8146 2005-05-13 Raja R Harinath <rharinath@novell.com>
8149 * expression.cs (BinaryResolveOperator): If one of the operands of
8150 an equality comparison is 'null' and the other is a pointer type,
8151 convert the null to a NullPointer.
8152 * convert.cs (ImplicitReferenceConversion): If the expression is a
8153 NullLiteral and the target type is a pointer type, return a
8154 NullPointer instead.
8155 (ImplicitConversionStandard): Likewise.
8157 2005-05-13 Marek Safar <marek.safar@seznam.cz>
8159 * cs-parser.jay: Set readonly context based on special constructs.
8161 * expression.cs (LocalVariableReference.DoResolveBase): Improved
8162 readonly variable error handling.
8164 * rootcontext.cs (EmitCode): Don't verify members when error
8167 * statement.cs (LocalInfo): Add reaodnly context information.
8168 (SetReadOnlyContext, GetReadOnlyContext): New methods.
8170 2005-05-13 Raja R Harinath <rharinath@novell.com>
8172 * statement.cs (Block.Resolve): Revert change below. Modify fix
8173 for #74041 to initialize 'resolved' to false only for explicit
8174 blocks. Fixes #74873.
8176 2005-05-12 Raja R Harinath <harinath@gmail.com>
8179 * typemanager.cs (unmanaged_enclosing_types): New.
8180 (IsUnmanagedType): Avoid infloops by using
8181 'unmanaged_enclosing_types' to talk with recursive invocations.
8183 2005-05-13 Martin Baulig <martin@ximian.com>
8185 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
8186 instance variable, not a local. Fix #74873.
8187 (Block.ResolveUnreachable): Set it to true here.
8189 2005-05-11 Duncan Mak <duncan@novell.com>
8191 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
8192 continuing to process for 'arg'.
8193 (handle_preprocessing_directive): Check the argument of the #endif
8194 directive and report error CS1025 if there are any trailing
8197 According to the C# spec, having even whitespace after the #endif
8198 directive is illegal; however, because we call arg.TrimEnd ()
8199 beforehand, we have the same behavior as csc, allowing whitespace
8200 after the directive.
8204 2005-05-11 Marek Safar <marek.safar@seznam.cz>
8208 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
8209 (Constructor.GetObsoleteAttribute): Implemented correctly.
8211 2005-05-10 Martin Baulig <martin@ximian.com>
8213 * support.cs (ReflectionParameters.ParameterModifier): Use
8214 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
8215 and `ParameterAttributes.In'. Fixes #74884.
8217 2005-05-10 Marek Safar <marek.safar@seznam.cz>
8219 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
8221 * expression.cs (Argument.GetParameterModifier): Turned to property.
8222 (Invocation.Error_InvalidArguments): Add more descriptive errors.
8224 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
8227 2005-05-09 Raja R Harinath <rharinath@novell.com>
8230 * decl.cs (MemberCache.AddMethods): Register override methods,
8231 rather than non-override methods.
8232 * typemanager.cs (RegisterOverride): New.
8233 (IsOverride): Update.
8235 2005-05-09 Marek Safar <marek.safar@seznam.cz>
8239 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
8240 recursive declaration.
8242 * statement.cs (Block.ResolveMeta): Report any error in resolving.
8244 2005-05-06 Marek Safar <marek.safar@seznam.cz>
8246 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
8248 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
8250 2005-05-05 Raja R Harinath <rharinath@novell.com>
8253 * decl.cs (DeclSpace.FamilyAccessible):
8254 Use TypeManager.IsNestedFamilyAccessible.
8256 Fix reopened #64812.
8257 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
8260 2005-05-04 Raja R Harinath <rharinath@novell.com>
8261 Abin Thomas <projectmonokochi@rediffmail.com>
8262 Anoob V E <projectmonokochi@rediffmail.com>
8263 Harilal P R <projectmonokochi@rediffmail.com>
8266 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
8267 allow access to all static members.
8269 2005-05-04 Martin Baulig <martin@ximian.com>
8271 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
8273 2005-05-04 Martin Baulig <martin@ximian.com>
8277 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
8278 section at the end; make things work if `default' is not the last
8281 2005-05-04 Martin Baulig <martin@ximian.com>
8285 * statement.cs (Switch): Replaced the `got_default' field with a
8286 `default_section' one.
8287 (Switch.CheckSwitch): Set `default_section' here.
8288 (Switch.Resolve): If we're a constant switch and the constant is
8289 not found, use the default section.
8291 2005-05-03 Martin Baulig <martin@ximian.com>
8293 * expression.cs (ArrayAccess.EmitGetLength): New public method.
8295 * statement.cs (Foreach.ArrayForeach): New nested class.
8296 (Foreach.TemporaryVariable): New nested class.
8297 (Foreach.EmitArrayForeach): Removed; this is now in the new
8300 2005-05-03 Raja R Harinath <rharinath@novell.com>
8302 * pending.cs (BaseImplements): Move the #74773 fix here. This is
8304 (VerifyPendingMethods): Revert change below.
8306 * typemanager.cs (IsOverride, RegisterNonOverride): New.
8307 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
8308 that used to trigger warning -28. Remove warning -28.
8309 * expression.cs (Invocation.OverloadResolve): Use
8310 TypeManager.IsOverride to distinguish override methods.
8313 * pending.cs (VerifyPendingMethods): If a base type implements the
8314 requested interface, don't bother checking individual methods of
8315 the base type. As a side-effect, this prevents the creation of
8316 unnecessary proxies.
8318 2005-05-02 Martin Baulig <martin@ximian.com>
8322 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8323 Also `And' the locals if the old vector is null.
8324 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
8325 null; in this case we basically reset all the variables.
8327 2005-05-02 Martin Baulig <martin@ximian.com>
8331 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
8332 Added `FlowBranching branching' argument; always `and' the
8333 variables instead of `or'ing them unless we're an infinite loop.
8335 * statement.cs (While.Resolve): Create a new sibling unless we're
8338 2005-05-02 Martin Baulig <martin@ximian.com>
8342 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
8343 arguments; use it instead of creating a new TopLevelBlock.
8344 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
8345 our ConstructorInitializer.
8348 (TopLevelBlock.TopLevelBranching): New public property.
8349 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
8350 and create our `TopLevelBranching'.
8352 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
8353 anonymous method host, use `block.TopLevelBranching' rather than
8354 creating a new branching.
8356 2005-04-20 Miguel de Icaza <miguel@novell.com>
8358 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
8359 a ScopeInfo, if any of the current children is a child of the new
8360 entry, move those children there.
8362 2005-04-30 Martin Baulig <martin@ximian.com>
8364 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
8365 at the beginning of a SwitchSection. Fix #73335.
8367 2005-04-27 Marek Safar <marek.safar@seznam.cz>
8370 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
8372 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
8373 (FieldExpr.DoResolve): Obsolete members are ignored for field
8376 2005-04-26 Marek Safar <marek.safar@seznam.cz>
8378 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
8379 of arrays detection.
8381 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
8383 (Field.VerifyClsCompliance): Volatile fields are not compliant.
8385 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
8388 2005-04-25 Ben Maurer <bmaurer@ximian.com>
8390 * cs-parser.jay: Use the prefered version of -unsafe in error
8393 2005-04-22 Marek Safar <marek.safar@seznam.cz>
8395 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
8398 2005-04-20 John Luke <john.luke@gmail.com>
8400 * driver.cs: fix typo in error message, --outout to --output
8402 2005-04-20 Marek Safar <marek.safar@seznam.cz>
8404 * codegen.cs (InRefOutArgumentResolving): New field.
8406 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
8407 fields outside contructor.
8409 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
8411 2005-04-19 Miguel de Icaza <miguel@novell.com>
8413 * anonymous.cs (CaptureContext.EmitParameterInstance): The
8414 parameter code was not completed ever, so it was not as up-to-date
8415 as local variables. Must finish it.
8417 The bug fix was to compare the Toplevel of the block, not the
8418 current block. Thanks for Ben for pointing this out.
8420 2005-04-19 Raja R Harinath <rharinath@novell.com>
8422 * decl.cs (AddMethods): Use the declaring type of the problem
8423 method to determine if we want to squash a warning.
8425 2005-04-19 Marek Safar <marek.safar@seznam.cz>
8427 * attribute.cs: Removed debug output.
8429 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
8431 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
8434 2005-04-18 Raja R Harinath <rharinath@novell.com>
8437 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
8438 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
8439 all null comparisons against reference types.
8441 2005-04-18 Marek Safar <marek.safar@seznam.cz>
8444 * class.cs (TypeContainer.CircularDepException) New nested
8446 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
8447 (TypeContainer.DefineType): Removed error, reset InTransit before
8449 (Class.DefineType): Throw exception when is in Transit.
8450 Catch exception and report error.
8451 (Struct.DefineType): Throw exception when is in Transit.
8452 Catch exception and report error.
8453 (Interface.DefineType): Throw exception when is in Transit.
8454 Catch exception and report error.
8456 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
8457 handle nested exception handlers.
8459 * flowanalysis.cs (InTryWithCatch): New method, search for try with
8462 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
8463 InFinally and InCatch storage.
8465 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
8466 (Catch.Resolve): Set and Restore ec.InCatch.
8467 (Try.Resolve): Set and Restore ec.InFinally.
8468 (Try.HasCatch): True when try has catch.
8470 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
8472 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
8473 for the same event member, so exclude such cases from warning 419.
8476 2005-04-16 Miguel de Icaza <miguel@novell.com>
8478 * expression.cs (Binary.ResolveOperator): Apply patch from John
8479 Luke to fix bug 59864: operators &, | and ^ on enumerations
8480 require that the same enum type on both sides.
8482 * driver.cs: Add warnings to old flag usage, this is to assist
8483 people who produce Makefiles and hope that the Makefiles will be
8486 * class.cs (TypeContainer.EmitType): Moved the definition of the
8487 special $PRIVATE$ field from the resolve phase to the Emit phase.
8488 During resolve we do not know if we are a struct with
8489 HasExplicitLayout, we know this only after the attributes for the
8492 Set the FieldOffset to zero on the dummy field that we create for
8493 the class. Fixes 74590.
8495 2005-04-16 Raja R Harinath <rharinath@novell.com>
8498 * ecore.cs (PropertyExpr.resolved): New.
8499 (DoResolve): Use it to handle a case of double resolution here.
8500 Handle a case of identical-name-and-type-name.
8501 * expression.cs (ArrayCreation.CheckIndices): Avoid double
8502 resolution by storing the results of expression resolution back
8503 into the "probes" array.
8505 2005-04-15 Raja R Harinath <rharinath@novell.com>
8507 Fix cs0208-7.cs and cs0208-8.cs.
8508 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
8509 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
8510 error reporting to point out the reason a struct is not unmanaged.
8512 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8514 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
8515 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
8517 2005-04-13 Raja R Harinath <rharinath@novell.com>
8520 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
8521 IdenticalNameAndTypeName here.
8522 (EventExpr.InstanceResolve): Likewise.
8524 2005-04-13 Marek Safar <marek.safar@seznam.cz>
8526 C# 2.0 DefaultCharSetAttribute implementation
8528 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
8529 which allows us to set GlobalNamespace for every resolve.
8530 (Attribute.ResolveArguments): Cut from Resolve.
8531 (Attribute.GetCharSetValue): Returns CharSet named argument.
8532 (Attribute.DefinePInvokeMethod): Gets default charset from
8534 (GlobalAttribute.ResolveAsTypeStep): Override.
8535 (GlobalAttribute.ResolveArguments): Override.
8537 * class.cs (TypeAttr): Is protected.
8539 * codegen.cs (ModuleClass.DefaultCharSet): New member.
8540 (ModuleClass.DefaultCharSetType): New memeber.
8541 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
8543 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
8544 charset from module.
8546 * delegate.cs (TypeAttr): Override.
8547 (Delegate.DefineType): Use this TypeAttr.
8549 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
8550 at very early stage (before types are defined) to resolve model
8551 module attributes. It will probably not work with corlib but it
8554 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
8555 charset from module.
8557 * typemanager.cs (default_charset_type): New type.
8559 2005-04-13 Raja R Harinath <rharinath@novell.com>
8561 * decl.cs (MemberCache.AddMethods): Don't warn if
8562 System.Object.Finalize has buggy MethodAttributes.
8564 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
8567 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8569 * doc.cs : detect ambiguous reference to overloaded members.
8570 Fixed bug #71603. MS 1.1 csc does not detect it.
8572 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8574 * doc.cs : delegates must not be referenced with parameters.
8577 2005-04-12 Miguel de Icaza <miguel@novell.com>
8579 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
8581 2005-04-10 Miguel de Icaza <miguel@novell.com>
8583 * driver.cs (MainDriver): Stop processing if the CLS stage found
8586 (CompilerCallableEntryPoint.InvokeCompiler): Always
8587 reset after execution; Take a TextWriter argument for the
8590 * report.cs: Use the error stream instead of hardcoding stderr.
8592 2005-04-09 Miguel de Icaza <miguel@novell.com>
8594 * class.cs: Reduce code paths to test, too small of an
8595 optimization to make it worth the extra testing. Always perform
8598 2005-04-08 Raja R Harinath <rharinath@novell.com>
8601 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
8602 operators that had errors reported on them.
8604 2005-04-08 Marek Safar <marek.safar@seznam.cz>
8606 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
8608 (Attribute.Resolve): Add named argument type checking.
8610 * class.cs (FixedField.Define): Use IsPrimitiveType
8612 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
8614 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
8615 unsafe parameter types.
8617 * statement.cs (Using.ResolveExpression): Add better error description.
8619 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
8621 2005-04-08 Raja R Harinath <rharinath@novell.com>
8624 * attribute.cs (Attribute.GetAttributeUsage): Resolve
8625 AttributeUsageAttribute in the emitcontext of the attribute class,
8626 not in the emitcontext of the attributable entity it was attached to.
8627 * cs-parser.jay: Use 'current_class', not 'current_container',
8628 when creating a GlobalAttribute.
8630 2005-04-08 Alp Toker <alp@atoker.com>
8632 * pending.cs: The fix to #58413 failed to compile methods implementing
8633 interfaces with/without params modifiers and vice versa, even though
8634 params modifiers aren't part of the signature. Make the modifier check
8635 less strict as in csc.
8637 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
8638 Anoob V E <projectmonokochi@rediffmail.com>
8639 Harilal P R <projectmonokochi@rediffmail.com>
8642 * pending.cs (TypeAndMethods.mods): New. Store the parameter
8643 modifiers of pending methods.
8644 (PendingImplementation.PendingImplementation): Initialize it.
8645 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
8646 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
8647 with ParameterData. Add check for modifiers.
8648 * class.cs (MethodData.Define): Update to changes.
8650 2005-04-07 Raja R Harinath <rharinath@novell.com>
8652 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
8654 2005-04-07 Marek Safar <marek.safar@seznam.cz>
8656 * class.cs (PropertyMethod.Define): Check private accessor in abstract
8659 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
8662 * typemanager.cs: Registered RequiredAttributeAttribute.
8664 2005-04-06 Marek Safar <marek.safar@seznam.cz>
8666 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
8667 Warning CS0169 is back at level 3.
8668 (IMethodData.SetMemberIsUsed): New method.
8670 * decl.cs (IsUsed): New value; moved from FieldBase.Status
8671 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
8673 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
8675 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
8677 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
8680 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
8683 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
8684 to avoid the problems with nested types.
8686 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
8687 Anoob V.E <projectmonokochi@rediffmail.com>
8688 Harilal P.R <projectmonokochi@rediffmail.com>
8689 Raja R Harinath <rharinath@novell.com>
8692 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
8694 * typemanager (GetConstructor): Make public.
8696 2005-04-05 John Luke <john.luke@gmail.com>
8697 Raja R Harinath <rharinath@novell.com>
8700 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
8701 struct too. Return false quicker in a few cases.
8702 (VerifyUnManaged): Use it.
8704 2005-04-05 Raja R Harinath <rharinath@novell.com>
8707 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
8708 not 'unreachable_seen'.
8710 2005-04-04 Marek Safar <marek.safar@seznam.cz>
8712 * attribute.cs (Attribute.GetValue): Removed unused.
8714 * codegen.cs (CodeGen.TrimExt): Removed unused.
8716 * cs-parser.jay (output): Removed unused.
8718 * cs-tokenizer.cs (hex_digits): Removed unused.
8720 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
8722 * expression.cs (Indirection.LoadExprValue): Removed unused.
8723 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
8725 * iterators.cs (Iterator.param_types): Removed unused.
8727 * statement.cs (Goto.block): Removed unused.
8728 (ToplevelBlock.did): Removed unused.
8729 (Switch.ResolveConstantSwitch): Removed unused.
8731 2005-04-01 Ben Maurer <bmaurer@ximian.com>
8733 * rootcontext.cs: Allow mcs to bootstrap with the compilation
8736 2005-04-01 Raja R Harinath <rharinath@novell.com>
8738 Fix #74232 and cs0208-3.cs.
8739 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
8740 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
8741 unmanaged type. Don't use FieldBuilders when 't' is a
8742 TypeBuilder. Use ModFlags and MemberType fields.
8743 * class.cs (MemberBase.member_type): Rename from MemberType.
8744 (MemberBase.MemberType): New property. Determines member_type on
8746 (MemberBase.DoDefine): Don't initialize MemberType here.
8747 (FieldMember.Define): Likewise.
8749 2005-04-01 Marek Safar <marek.safar@seznam.cz>
8752 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
8753 Attributes are emitted there.
8755 2005-04-01 Raja R Harinath <rharinath@novell.com>
8757 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
8758 keyword in 'partial enum' too.
8759 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
8761 Report from Kamil Skalski <nazgul@omega.pl>.
8764 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
8765 have partial containers too.
8767 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
8768 in block' checks to Block.CheckInvariantMeaningInBlock.
8769 * statement.cs (Block.GetKnownVariableInfo): Make private.
8770 (Block.IsVariableUsedInChildBlock): Remove.
8771 (Block.IsVariableUsedInBlock): Likewise.
8772 (Block.CheckInvariantMeaningInBlock): New. Show location of
8773 conflicting declaration.
8774 (Block.AddVariable): Make error messages less long-winded and more
8775 specific. Show location of conflicting declaration.
8776 * parameter.cs (Parameters.Location): New readonly property.
8778 2005-03-31 Raja R Harinath <rharinath@novell.com>
8780 Clean up semantics of invoking ResolveMemberAccess.
8781 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
8782 can have an instance, ensure that we pass in a non-TypeExpression
8783 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
8784 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
8785 argument. Update to changes and simplify.
8786 (FieldExpr.Emitinstance): Remove CS0120 check.
8787 (PropertyExpr.EmitInstance): Likewise.
8788 * expression.cs (Argument.Resolve): Likewise.
8789 (Invocation.DoResolve): Update to changes in semantics of
8792 2005-03-31 Marek Safar <marek.safar@seznam.cz>
8795 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
8798 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
8800 2005-03-31 Raja R Harinath <rharinath@novell.com>
8802 Fix difference in behaviour with commandline invocation.
8803 * driver.cs (Driver.Reset): New.
8804 (CompilerCallableEntryPoint): Call it.
8806 * statement.cs (If.Resolve): Avoid spurious "uninitialized
8807 variable" warnings if the boolean expression failed to resolve.
8809 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
8811 * attribute.cs: Fix the union of several permissions when some of them
8812 are unrestricted (so the result isn't an unrestricted permission set).
8815 2005-03-30 Raja R Harinath <rharinath@novell.com>
8817 * ecore.cs (MemberExpr): New class. Convert from interface
8819 (MemberExpr.ResolveMemberAccess): Refactor and move here from
8820 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
8822 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
8823 (MethodGroupExpr.IsExplicitImpl): Remove.
8824 (Expression.GetFieldFromEvent): Remove.
8825 (SimpleName.MemberStaticCheck): Remove.
8826 (SimpleName.DoSimpleNameResolve): Update to changes.
8827 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
8828 (MemberAccess.IdenticalNameAndTypeName): Remove.
8829 (MemberAccess.error176): Move to MemberExpr.
8830 (MemberAccess.DoResolve): Update to changes.
8831 (BaseAccess.DoResolve): Likewise.
8833 2005-03-30 Marek Safar <marek.safar@seznam.cz>
8835 C# 2.0 Conditional attribute class implementation
8837 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
8838 Analyzes class whether it has attribute which has ConditionalAttribute
8839 and its condition is not defined.
8841 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
8842 (Class.IsExcluded): New method. Search for at least one defined
8843 condition in ConditionalAttribute of attribute class.
8845 2005-03-30 Raja R Harinath <rharinath@novell.com>
8847 * ecore.cs (PropertyExpr): Derive from Expression, not
8848 ExpressionStatement.
8849 (PropertyExpr.EmitStatement): Remove.
8851 2005-03-29 Raja R Harinath <rharinath@novell.com>
8854 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
8855 internal field "value__" of an enum be private. The examples for
8856 "value__" that I found on MSDN all used FieldAttributes.Private.
8858 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
8859 Don't mention IL method attribute names.
8861 Fix #47991. Remove a TODO.
8862 * statement.cs (Block.Toplevel): Make into a field.
8863 (Block.Parameters): Move into ToplevelBlock.
8864 (Block.known_variables): Rename from child_variable_names.
8865 (Block.Block): Remove variants that take Parameters. Initialize
8866 'Toplevel' with the immediately surrounding toplevel block.
8867 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
8868 LocalInfo parameter.
8869 (Block.GetKnownVariableInfo): New.
8870 (Block.IsVariableNameUsedInChildBlock): Update.
8871 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
8872 the block, even though it may not be in scope.
8873 (Block.AddVariable): Remove Parameters parameter. Use
8874 Toplevel.Parameters instead.
8875 (Block.AddConstant): Remove Parameters parameter.
8876 (Block.GetParameterReference): Update to use Toplevel.Parameters.
8877 (Block.IsParamaterReference): Likewise.
8878 (Block.IsLocalParameter): Likewise. Simplify a lot.
8879 (ToplevelBlock.Parameters): New. Moved from Block.
8880 (ToplevelBlock.ToplevelBlock): Update to changes. Always
8881 initialize Parameters to a non-null value.
8882 * cs-parser.jay: Update to changes.
8883 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
8884 simple names that mean different things in the same block. Use
8885 Block.IsVariableNameUsedInBlock.
8887 2005-03-28 Raja R Harinath <rharinath@novell.com>
8889 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
8890 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
8891 GetTypeHandle. It is possible for a reflected type to derive from
8892 a TypeBuilder (e.g., int[] derives from the TypeBuilder
8893 System.Array during mscorlib compilation).
8894 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
8895 contain a method_hash, don't create one either. Don't create a
8896 deep copy of the base cache's method_hash.
8897 (MemberCache.SetupCache): Rename back from DeepCopy.
8898 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
8899 already initialized. If we see an override function, add its
8900 underlying base virtual function to the member_hash too.
8902 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
8904 2005-03-26 Raja R Harinath <harinath@acm.org>
8907 * assign.cs (Assign.DoResolve): When the RHS of an assignment
8908 fails to resolve, ensure that the LHS is still resolved as an
8911 2005-03-25 Raja R Harinath <harinath@acm.org>
8913 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
8915 (Enum.current_ec): Remove.
8916 (Enum.LookupEnumValue): Remove EmitContext argument.
8917 Just uses the one created during DefineType.
8918 (Enum.FindMembers): Update.
8919 * expression.cs (MemberAccess.DoResolve): Update.
8921 2005-03-22 Marek Safar <marek.safar@seznam.cz>
8923 * assign.cs (Assign.DoResolve): Check for CS1717 when
8924 source and target are same (uses Equals).
8926 * expression.cs (LocalVariableReference, ParameterReference,
8927 This): Implemented Equals, GetHashCode.
8929 * statement.cs (Block.GetParameterReference): Removed useless
8932 2005-03-22 Raja R Harinath <rharinath@novell.com>
8935 * statement.cs (Block.AddVariable): Ensure that we skip implicit
8936 blocks before deciding whether the error is cs0136 or cs0128.
8938 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
8939 (using_alias_directive, using_namespace_directive): Pass
8940 MemberName, not an expression to Namespace.UsingAlias and
8942 (MakeName): Use the MemberName of the namespace.
8943 * namespace.cs (Namespace.MemberName): New.
8944 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
8945 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
8947 * decl.cs (MemberName.Name): Make readonly.
8948 (MemberName.FromDotted): New "constructor".
8949 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
8950 (MemberCore.Name): Compute from MemberName on demand.
8951 (MemberCore.SetMemberName): Provide a way to change the
8953 (MemberCore.AddToContainer): Don't take a fullname parameter.
8954 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
8955 fully qualified name of the container to the member name.
8956 (TypeContainer.AddToTypeContainer): Use a fully qualified name
8957 only if the type is a member of the root container.
8958 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
8959 MemberName.Left rather than searching for an embedded ".".
8960 (PartialContainer.CreatePart): Update to changes in RootContext.
8961 (MemberBase.ShortName): Turn into a property. Use
8962 MemberCore.SetMemberName.
8963 (MemberBase.ExplicitInterfaceName): Remove.
8964 (MemberBase.UpdateMemberName): Remove.
8965 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
8966 (PropertyBase.SetMemberName): New override.
8967 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
8968 (Tree.GetDecl): New.
8969 (Tree.AllDecls): Rename from Decls.
8970 * attribute.cs, enum.cs, report.cs: Update to changes.
8971 * driver.cs (MainDriver): Use MemberName.FromDotted on
8972 RootContext.MainClass.
8974 2005-03-21 Marek Safar <marek.safar@seznam.cz>
8976 * class.cs (FixedField.Define): Check for CS1664 and more sanity
8979 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
8981 2005-03-18 Marek Safar <marek.safar@seznam.cz>
8983 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
8984 property accessor modifiers.
8986 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
8987 fixed buffer attribute (CS1716).
8988 (PropertyMethod.HasCustomAccessModifier): When property accessor
8989 has custom modifier.
8991 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
8993 (PropertyExpr.DoResolveLValue): Add CS0272.
8995 2005-03-17 Miguel de Icaza <miguel@novell.com>
8997 * convert.cs: When converting to a pointer, use the proper Conv.U
8998 or Conv.I depending on the source data type.
9000 * cs-tokenizer.cs: Make the size for large decimal constants,
9003 2005-03-17 Martin Baulig <martin@ximian.com>
9005 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
9006 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
9008 2005-03-17 Martin Baulig <martin@ximian.com>
9010 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
9011 to bool so we can return an error condition.
9012 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
9015 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
9017 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
9020 2005-03-16 Raja R Harinath <rharinath@novell.com>
9022 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
9023 Refactor to avoid traversing the list of assemblies, and to avoid
9024 string concatenation.
9025 * typemanager.cs (guid_attr_type): Remove.
9026 (negative_hits, pointers, references): Remove hashes.
9028 (GetConstructedType): New. Uses type_hash to handle constructed
9029 types (arrays, references, pointers).
9030 (GetReferenceType, GetPointerType): Use it.
9031 (GetNestedType): New. Uses type_hash to handle nested types of
9033 (LookupType, LookupTypeDirect): Remove.
9034 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
9035 'types' hash and LookupTypeReflection directly.
9036 (params_string, params_object): Use GetConstructedType.
9037 * namespace.cs (Namespace.cached_types): New. Cache of reflected
9039 (Namespace.Lookup): Use cached_types.
9040 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
9041 provided by old TypeManager.LookupType.
9042 * rootcontext.cs (MakeFQN): Remove.
9043 * decl.cs (DeclSpace.MakeFQN): Likewise.
9044 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
9045 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9046 TypeManager.GetConstructedType.
9047 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
9049 2005-03-15 Marek Safar <marek.safar@seznam.cz>
9051 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
9054 * cs-parser.jay: Reports CS1527 for any namespace element.
9056 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
9059 * expression.cs (ParameterReference.IsAssigned): Changed error to
9061 (Error_WrongNumArguments): Moved CS0245 detection here.
9063 * statement.cs (Return.Resolve): Add CS1622 report.
9065 2005-03-11 Marek Safar <marek.safar@seznam.cz>
9067 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
9069 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
9071 * attribute.cs expression.cs: Get rid of some allocations.
9073 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
9075 * doc.cs : just eliminate the latest change.
9077 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
9079 * doc.cs : commented out the latest change. It breaks xml-030.cs
9081 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
9083 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
9084 fail. So invoke CreateType() in FindDocumentedType().
9086 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
9088 * cs-tokenizer.cs : added IsKeyword().
9089 * doc.cs : Detect keyword incorrectly used as identifier.
9090 Allow identifiers prefixed by @.
9092 2005-03-10 Marek Safar <marek.safar@seznam.cz>
9094 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
9095 It caused exception in namespace resolving (again!).
9097 * class.cs (Class.ctor): Removed exit.
9098 (PropertyMethod.ctor): ditto.
9100 * codegen.cs (Codegen.Reset): Reset static data.
9101 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
9103 * cs-tokenizer.cs (Cleanup): Removed.
9105 * driver.cs (GetSystemDir): Rewrote to one line command.
9106 It caused problem with unloaded dynamic modules.
9107 (UnixParseOption): Removed Exit.
9108 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
9109 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
9110 Now can be mcs used as library.
9112 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
9115 * location.cs (Reset): Reset static data.
9117 * namespace.cs (Reset): Reset static data.
9119 * report.cs (Report.Reset): Reset static data.
9121 * rootcontext.cs (RootContext.Reset): Reset static data.
9123 * tree.cs (RootTypes.ctor): Use Location.Null
9125 * typemanager.cs (TypeManager.Reset): Reset static data.
9126 (CoreLookupType): Removed Exit.
9127 (TypeHandle.Reset): Reset static data.
9129 2005-03-10 Raja R Harinath <rharinath@novell.com>
9132 * typemanager.cs (ComputeNamespaces): Import namespaces from
9133 referenced modules too.
9135 2005-03-09 Raja R Harinath <rharinath@novell.com>
9137 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
9140 2005-03-09 Raja R Harinath <rharinath@novell.com>
9142 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
9143 enclosing DeclSpace. This ensures that a name-lookup populates
9144 more caches and there are fewer 'TypeExpression's. Carve out
9145 nested type lookup into ...
9146 (LookupNestedTypeInHierarchy): ... this.
9148 2005-03-09 Raja R Harinath <rharinath@novell.com>
9150 Clean up a few partial-class semantics.
9151 Fixes test-357.cs and cs1618-2.cs.
9152 * cs-parser.jay (struct_declaration): Use 'current_class' as
9153 parent of newly-created struct. Remove call to Register ().
9154 Use 'pop_current_class' to complete handing the current struct.
9155 (interface_declaration): Likewise.
9156 (class_declaration): Likewise.
9157 (enum_declaration): Use 'current_class' as parent of newly created
9159 (delegate_declaration): Likewise.
9160 (pop_current_class): New function. This is used to handle closing
9161 up the 'current_class' and 'current_container', and pointing them
9162 to the enclosing class/container.
9163 (CSharpParser): Initialize 'current_class' too.
9164 * decl.cs (MemberCore): Add check for invariant: a partial
9165 container is not a parsed entity, and thus does not enclose any
9167 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
9168 (DeclSpace.BaseTypeExpr): Use it.
9169 (DeclSpace.LookupType): Add check for invariant.
9170 * class.cs (TypeContainer): Add check for invariant: a nested
9171 class should have the same NamespaceEntry as its enclosing class.
9172 (TypeContainer.EmitFieldInitializers): Make virtual.
9173 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
9175 (TypeContainer.Register): Remove.
9176 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
9177 null. Use TypeResolveEmitContext for resolving base types and
9178 interfaces. Move initialization of Parts.TypeBuilder here from
9180 (TypeContainer.DefineNestedTypes): ... here.
9181 (PartialContainer): Take a Namespace not a NamespaceEntry.
9182 (PartialContainer.Create): Don't use Register. Call the
9183 appropriate Add... function directly.
9184 (ClassPart): Take both the PartialContainer and the enclosing
9185 class as constructor arguments.
9186 (ClassPart.EmitFieldInitializers): Override.
9187 (ClassPart.PartFindNestedTypes): Remove.
9188 (FieldBase.GetInitializerExpression): Resolve the initializer
9189 expression in the emit context of the enclosing class.
9190 * tree.cs (RootTypes): Remove Register ().
9192 2005-03-08 Marek Safar <marek.safar@seznam.cz>
9194 * cs-parser.jay: Removed CS0134.
9196 * driver.cs: Removed CS1901.
9198 * expression.cs (SizeOf.DoResolve): Don't report CS0233
9199 for predefined types.
9201 2005-03-07 Duncan Mak <duncan@novell.com>
9203 * codegen.cs (Save): Catch UnauthorizedAccessException as
9204 well. Fixes bug #73454.
9206 2005-03-07 Marek Safar <marek.safar@seznam.cz>
9208 * cs-tokenizer.cs (xtoken): Add CS1035.
9210 * class.cs (MethodData.Define): Add CS0683.
9211 (FieldMember.ctor): Add CS0681.
9213 2005-03-07 Raja R Harinath <rharinath@novell.com>
9215 * ecore.cs (SimpleName.DoResolve): Rename from
9216 SimpleName.DoResolveAllowStatic.
9217 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
9218 Pass 'intermediate' flag to MemberStaticCheck.
9219 (SimpleName.MemberStaticCheck): Skip "static check" only in case
9220 of "intermediate" lookups via MemberAccess.
9221 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
9222 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
9224 2005-03-07 Raja R Harinath <rharinath@novell.com>
9227 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
9228 slipped in because of variable names that are identical to a
9229 builtin type's BCL equivalent ('string String;', 'int Int32;').
9230 (PropertyExpr.EmitInstance): Likewise.
9232 2005-03-04 Marek Safar <marek.safar@seznam.cz>
9234 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
9236 * report.cs (warning_ignore_table): Made public.
9238 2005-03-04 Raja R Harinath <rharinath@novell.com>
9241 * class.cs (MethodData.Emit): Pass 'container' to
9242 container.GetObsoleteAttribute instead of 'container.Parent'.
9244 2005-03-03 Marek Safar <marek.safar@seznam.cz>
9246 * cs-parser.jay: Add 1534 error test.
9248 * iterators.cs (Yield.CheckContext): Add error 1629.
9249 (Iterator.ctor): Save unsafe modifier.
9250 (MoveNextMethod.DoEmit): Restore unsafe context.
9252 * namespace.cs (UsingAlias): Better error message.
9254 2005-03-03 Dan Winship <danw@novell.com>
9256 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
9257 the warning message [#73219]
9259 2005-03-03 Raja R Harinath <rharinath@novell.com>
9261 Fix compile with MCS 1.0.0.0.
9262 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
9263 w_restore to not depend on string constant folding.
9265 2005-03-03 Raja R Harinath <rharinath@novell.com>
9267 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
9268 CS0246 check to users who passed 'silent = false'.
9269 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
9271 (SimpleName.SimpleNameResolve): Update.
9272 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
9273 (MemberAccess.IdenticalNameAndTypeName): Update.
9274 * doc.cs (FindDocumentedTypeNonArray): Update.
9276 2005-03-03 Raja R Harinath <rharinath@novell.com>
9278 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
9279 * parameters.cs (ComputeAndDefineParameters): Remove.
9280 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
9281 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
9282 Use GetParameterInfo.
9284 2005-03-02 Marek Safar <marek.safar@seznam.cz>
9286 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
9288 2005-03-02 Raja R Harinath <rharinath@novell.com>
9290 Unify DeclSpace.LookupType and DeclSpace.FindType.
9291 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
9292 is in charge of defining nested types on demand.
9293 (DeclSpace.LookupType): Use it when the current_type is a
9294 TypeBuilder. Use LookupTypeDirect for reflected types.
9295 (DeclSpace.FindType): Remove.
9296 (DeclSpace.LookupInterfaceOrClass): Likewise.
9297 (DeclSpace.DefineTypeAndParents): Likewise.
9298 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
9299 DeclSpace.LookupType.
9300 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
9301 * typemanager.cs (LookupType): Simplify.
9302 (AddUserType): Remove type from negative_hits.
9303 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
9304 * class.cs (TypeContainer.FindMembers): Move handling of nested
9306 (TypeContainer.FindMembers_NestedTypes): ... here.
9307 (TypeContainer.FindNestedType): Implement override.
9308 (ClassPart.FindNestedType): Delegate to PartialContainer.
9309 (ClassPart.PartFindNestedType): Looks up the nested types of the
9312 2005-03-02 Martin Baulig <martin@ximian.com>
9314 * class.cs (TypeContainer.DoDefineMembers): We also need a default
9315 static constructor in static classes.
9317 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
9319 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
9320 sizeParamIndex is not specified.
9322 2005-03-01 Marek Safar <marek.safar@seznam.cz>
9325 * report.cs (WarningMessage.IsEnabled): Missing null check.
9327 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9329 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
9330 in the fields and not in the properties.
9332 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
9334 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
9337 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9339 * attribute.cs: Small refactoring (improved robustness).
9340 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
9341 (ValidateGuid): Removed.
9342 (Resolve): Removed referenced to above mentioned.
9343 (GetAttributeUsage): Made private and changed to work without
9345 (GetIndexerAttributeValue): Don't crash.
9346 (GetConditionalAttributeValue): Ditto.
9347 (GetClsCompliantAttributeValue): Ditto.
9348 (ExtractSecurityPermissionSet): All attributes exceptions are
9350 (GetPropertyValue): New helper.
9351 (GetMethodImplOptions): New method.
9352 (DefinePInvokeMethod): Reuse common code. Implemented handling of
9353 some missing properties.
9355 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
9356 (Method.ApplyAttributeBuilder): Updated.
9358 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
9361 2005-02-28 Raja R Harinath <rharinath@novell.com>
9364 * report.cs (Report.SymbolRelatedToPreviousError): Handle
9365 non-simple types (array, pointer, reference).
9367 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9369 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
9371 * class.cs (MethodCore.IsDuplicateImplementation): Special error
9373 (Method.CheckBase): Catch wrong destructor here.
9374 (MethodData.Define): Add errors 550, 668.
9376 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
9378 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
9380 * pending.cs (VerifyPendingMethods): Add error 551.
9382 * typemanager.cs (CSharpName): Next error report helper.
9384 2005-02-25 Marek Safar <marek.safar@seznam.cz>
9386 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
9387 attributes. Removed useless attribute double check.
9388 It saves almost 2MBs for corlib.
9390 2005-02-25 Raja R Harinath <rharinath@novell.com>
9393 * statement.cs (ExpressionStatement.Resolve): Make robust to being
9394 called twice in case of error.
9396 2005-02-23 Chris Toshok <toshok@ximian.com>
9398 Fix compiler portions of #72827.
9399 * statement.cs (Block.Emit): call Begin/EndScope on the
9400 EmitContext instead of the ILGenerator.
9402 * codegen.cs (EmitContext.BeginScope): new method, call
9403 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
9405 (EmitContext.BeginScope): same, but EndScope and CloseScope
9407 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
9408 offset and call the superclass's OpenScope(int) with it.
9409 (SymbolWriter.CloseScope): get the current il
9410 offset and call superclass's CloseScope(int) with it.
9412 2005-02-23 Marek Safar <marek.safar@seznam.cz>
9414 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
9415 CS1677 for out and ref as well.
9417 * class.cs (Method.Define): Add error CS1599 detection.
9419 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
9421 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
9423 * delegate.cs (Delegate.Define): Add error CS1599 detection.
9425 * support.cs.cs (ModifierDesc): New helper method.
9427 2005-02-23 Raja R Harinath <rharinath@novell.com>
9428 Abin Thomas <projectmonokochi@rediffmail.com>
9429 Anoob V E <projectmonokochi@rediffmail.com>
9430 Harilal P R <projectmonokochi@rediffmail.com>
9433 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
9434 MemberLookup (used for error reporting) actually returns a result.
9435 Fix error report number (122, not 112).
9437 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
9438 Anoob V E <projectmonokochi@rediffmail.com>
9439 Harilal P R <projectmonokochi@rediffmail.com>
9442 * pending.cs (PendingImplementation.GetAbstractMethods):
9443 Find NonPublic members too.
9445 2005-02-22 Marek Safar <marek.safar@seznam.cz>
9447 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
9450 * class.cs (MethodCore.CheckMethodAgainstBase):
9451 Add error 239 report.
9453 2005-02-21 Raja R Harinath <rharinath@novell.com>
9456 * expression.cs (Invocation.IsApplicable): Make public.
9457 (Invocation.IsParamsMethodApplicable): Likewise.
9458 * delegate.cs (Delegate.VerifyApplicability): Don't use
9459 Invocation.VerifyArgumentCompat for parameter applicability
9460 testing. Use Invocation.IsApplicable and
9461 Invocation.IsParamsMethodApplicable.
9463 2005-02-21 Marek Safar <marek.safar@seznam.cz>
9465 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
9467 * class.cs (Operator.Define): Add error 217 report.
9469 2005-02-21 Raja R Harinath <rharinath@novell.com>
9471 * namespace.cs (UsingEntry.Resolve): Undo change below.
9473 2005-02-21 Raja R Harinath <rharinath@novell.com>
9476 * ecore.cs (Expression.MemberLookupFailed): Add argument to
9477 disable the error message when the extended MemberLookup also
9479 (Expression.MemberLookupFinal): Update.
9480 (SimpleName.DoSimpleNameResolve): Update.
9481 * expression.cs (MemberAccess.ResolveNamespaceOrType):
9482 Don't use MemberLookupFinal.
9483 (New.DoResolve): Update.
9484 (BaseAccess.CommonResolve): Update.
9486 2005-02-21 Raja R Harinath <rharinath@novell.com>
9489 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
9490 occured previously, don't resolve again.
9492 2005-02-21 Marek Safar <marek.safar@seznam.cz>
9495 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
9496 argument. Call ResolveAttributeUsage for unresolved.
9497 when types doesn't match ctor arguments.
9499 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
9500 for nested attribute classes.
9501 (Class.attribute_usage): Removed.
9502 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
9503 for attribute class.
9505 * ecore.cs (IsAttribute): Removed.
9507 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
9509 * rootcontext.cs (RegisterAttribute): Removed, attributes are
9511 (attribute_types): Removed.
9512 (EmitCode): Global attributes are emited as the latest.
9514 2005-02-18 Marek Safar <marek.safar@seznam.cz>
9516 * class.cs (EmitFieldInitializers): Don't emit field initializer
9517 for default values when optimilization is on.
9519 * constant.cs (Constant.IsDefaultValue): New property.
9521 * driver.cs: Add /optimize handling.
9525 * literal.cs: Implement new IsDefaultValue property.
9527 * rootcontext.cs (Optimize): New field, holds /optimize option.
9529 2005-02-18 Raja R Harinath <rharinath@novell.com>
9531 Fix crasher in re-opened #72347.
9532 * namespace.cs (Namespace.Lookup): Return null if
9533 DeclSpace.DefineType returns null.
9536 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
9538 2005-02-18 Raja R Harinath <rharinath@novell.com>
9540 Fix remainder of #63202. Change semantics of DoResolveLValue: it
9541 now returns null if it cannot resolve to an lvalue.
9542 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
9543 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
9544 returned null. Remove check for SimpleName.
9545 (EventExpr.DoResolveLValue): New.
9546 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
9547 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
9549 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
9551 (Unary.ResolveOperator): Move CS0211 check ...
9552 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
9554 (Unary.DoResolveLValue): Simplify.
9555 (AddressOf.DoResolveLValue): New.
9556 (ArrayAccess.DoResolveLValue): New.
9558 2005-02-16 Marek Safar <marek.safar@seznam.cz>
9560 * attribute.cs (Attribute.Resolve): Add arguments casting for
9561 when types doesn't match ctor arguments.
9563 2005-02-16 Raja R Harinath <rharinath@novell.com>
9565 Fix parts of #63202.
9566 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
9567 lookup of operator in base type. Ensure that all checks happen
9568 when the operator resolves to an "op_..." method.
9570 2005-02-15 Raja R Harinath <rharinath@novell.com>
9573 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
9574 'ignore_cs0104' parameter. Pass it to ...
9575 (NamespaceEntry.Lookup): ... this.
9576 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
9577 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
9578 (TypeLookupExpression.DoResolveAsTypeStep): Update.
9579 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
9580 Update. Request that cs0104 errors be ignored.
9581 (ComposedCast.ResolveAsTypeStep): Update.
9583 2005-02-14 Raja R Harinath <rharinath@novell.com>
9586 * expression.cs (Invocation.BetterFunction): Remove support for
9587 comparing virtual functions and their overrides.
9588 (Invocation.IsOverride): New.
9589 (Invocation.OverloadResolve): Don't consider 'override' functions
9590 during candidate selection. Store them in a lookaside list.
9591 If the selected method is a 'virtual' function, use the list to
9592 find any overrides that are closer to the LHS type.
9594 2005-02-14 Marek Safar <marek.safar@seznam.cz>
9596 * expression.cs (New.DoResolve): Add complex core type reduction.
9597 (New.Constantify): Converts complex core type syntax like 'new int ()'
9600 2005-02-14 Raja R Harinath <rharinath@novell.com>
9602 * decl.cs (EntryType.EntryType): New constructor to create an
9603 updated copy of a cache entry.
9604 (MemberCache.AddMethods): Use it.
9605 (MemberCache.ClearDeclaredOnly): Remove.
9606 (MemberCache.MemberCache): Update.
9608 2005-02-11 Miguel de Icaza <miguel@novell.com>
9610 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
9611 variable. This one is represents the actual low-level declaration
9612 of the method, as opposed to the semantic level `IsStatic'.
9614 An anonymous method which is hosted into a static method might be
9615 actually an instance method. IsStatic would reflect the
9616 container, while MethodIsStatic represents the actual code
9619 * expression.cs (ParameterReference): Use the new MethodIsStatic
9620 instead of IsStatic.
9622 * anonymous.cs (AnonymousMethod.Compatible): Pass the
9623 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
9624 set on the current EmitContext.
9626 * expression.cs (Cast): Overload DoResolveLValue so we can pass
9627 resolve our casted expression as an LValue. This triggers the
9628 proper LValue processing that is later required by Assign.
9632 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
9634 2005-02-11 Marek Safar <marek.safar@seznam.cz>
9636 C# 2.0 Fixed buffer implementation
9638 * anonymous.cs: Update after RegisterHelperClass renaming.
9640 * attribute.cs (AttributeTester.fixed_buffer_cache):
9641 Cache of external fixed buffers.
9642 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
9643 implementation if field is fixed buffer else null.
9646 (TypeContainer.AddField): Accept FieldMember instead of Field.
9647 (FieldBase.IsFieldClsCompliant): Extracted code from
9648 VerifyClsCompliance descendant customization.
9649 (FixedField): New class handles fixed buffer fields.
9650 (FixedFieldExternal): Keeps information about imported fixed
9652 (IFixedField): Make access to internal or external fixed buffer
9655 * cs-parser.jay: Add fixed buffer parsing.
9657 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
9660 * expression.cs (Indirection): Extended implementation to accept
9662 (PointerArithmetic.Emit): Get element from fixed buffer as well.
9663 (ElementAccess.MakePointerAccess): Get type as parameter.
9664 (DoResolve): Add fixed buffer field expression conversion.
9665 (DoResolveLValue): Ditto.
9666 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
9667 (ArrayPtr): Derives from FixedBufferPtr.
9668 (ArrayPtr.Emit): Add extra emit for array elements.
9670 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
9672 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
9673 for compiler generated types.
9674 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
9676 * statement.cs (Fixed): Refactored to be easier add fixed buffer
9677 and consume less memory.
9678 (Fixed.Resolve): Add fixed buffer case.
9680 * typemanager.cs (compiler_generated_attr_ctor,
9681 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
9682 (HasElementType): Add our own implementation to work on every
9685 2005-02-11 Miguel de Icaza <miguel@novell.com>
9687 * anonymous.cs (CaptureContext): Track whether `this' has been
9690 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
9691 only captured `this' if it was implicitly done (instance
9692 methods/variables were used).
9694 * codegen.cs (EmitContext.CaptureThis): New method to flag that
9695 `this' must be captured.
9697 2005-01-30 Miguel de Icaza <miguel@novell.com>
9699 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
9700 is null it means that there has been no need to capture anything,
9701 so we just create a sibling.
9703 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
9705 Just a partial fix. The other half is fairly elusive.
9707 2005-02-10 Raja R Harinath <rharinath@novell.com>
9709 Fix #52586, cs0121-4.cs.
9710 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
9711 and return a hashtable.
9712 (MemberCache.ClearDeclaredOnly): New.
9713 (MemberCache.MemberCache): Update to change. Make a deep copy of
9714 the method_hash of a base type too.
9715 (MemberCache.AddMethods): Adapt to having a deep copy of the base
9716 type methods. Overwrite entries with the same MethodHandle so
9717 that the ReflectedType is correct. The process leaves in base
9718 virtual functions and their overrides as distinct entries.
9719 (CacheEntry): Now a class instead of a struct. It shouldn't alter
9720 matters since it was boxed in a ArrayList before.
9721 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
9723 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
9724 case of a virtual function and its override (choose the overload
9726 (Invocation.OverloadResolve): Avoid 'override' members during
9727 'applicable_type' calculation.
9729 2005-02-09 Raja R Harinath <rharinath@novell.com>
9731 Combine two near-redundant caches.
9732 * typemanager.cs (method_params): Rename from method_internal_params.
9733 (TypeManager.GetParameterData): New. Replace
9734 Invocation.GetParameterData.
9735 (TypeManager.LookupParametersByBuilder): Remove.
9736 * expression.cs (Invocation.method_parameter_cache): Remove.
9737 (Invocation.GetParameterData): Remove.
9739 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
9742 2005-02-08 Raja R Harinath <rharinath@novell.com>
9745 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
9746 TypeManager.multicast_delegate_type is null, resolve it by looking
9747 up "System.MulticastDelegate".
9748 * rootcontext.cs (RootContext.ResolveCore): Simplify.
9750 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
9751 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
9752 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
9755 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
9756 (LabeledStatement.AddReference): New. Set 'referenced'.
9757 (Goto.Resolve): Use it.
9759 2005-02-05 John Luke <john.luke@gmail.com>
9761 * driver.cs: remove duplicate -doc line in Usage ()
9763 2005-02-04 Raja R Harinath <rharinath@novell.com>
9765 * location.cs (Location.AddFile): Fix CS2002 error report.
9767 2005-02-02 Martin Baulig <martin@ximian.com>
9769 * delegate.cs (Delegate.DefineType): Report an internal error if
9770 TypeManager.multicast_delegate_type is null. See bug #72015 for
9773 2005-02-02 Raja R Harinath <rharinath@novell.com>
9775 Fix a crasher in a variant of #31984.
9776 * const.cs (Constant.CheckBase): New override that defers the
9777 new-or-override check in case the base type hasn't been populated
9779 (Constant.Define): Ensure the new-or-override check is performed.
9781 2005-02-01 Duncan Mak <duncan@ximian.com>
9783 * const.cs (LookupConstantValue): Check that `ce' is not null
9784 before calling GetValue ().
9786 2005-02-01 Raja R Harinath <rharinath@novell.com>
9788 Fix test-334.cs (#69519).
9789 * cs-parser.jay (using_alias_directive): Pass in an expression to
9790 NamespaceEntry.UsingAlias.
9791 (using_namespace_directive): Pass in an expression to
9792 NamespaceEntry.Using.
9793 (namespace_name): Don't flatten to a string.
9794 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
9795 (NamespaceEntry.AliasEntry.Resolve): Lookup using
9797 (NamespaceEntry.UsingEntry): Likewise.
9798 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
9800 (NamespaceEntry.LookupForUsing): Remove.
9801 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
9803 (NamespaceEntry.Lookup): Remove support for dotted names.
9805 2005-02-01 Raja R Harinath <rharinath@novell.com>
9807 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
9809 (NamespaceEntry.ImplicitParent): Compute on demand.
9810 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
9811 parallels the current.
9812 (NamespaceEntry.LookupForUsing): Use it.
9813 (NamespaceEntry.Lookup): If the current namespace-entry is
9814 implicit, don't search aliases and using tables.
9816 2005-02-01 Raja R Harinath <rharinath@novell.com>
9819 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
9821 (TypeContainer.BaseCache): Compute on demand.
9822 (TypeContainer.FindMembers): Define constants and types if they're
9823 not already created.
9824 (FieldMember.Define): Move resetting of ec.InUnsafe before error
9826 * const.cs (Constant.Define): Make idempotent.
9828 2005-01-29 Miguel de Icaza <miguel@novell.com>
9830 * pending.cs: Produce better code (no nops produced by using Ldarg
9833 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
9834 i - 1' it should be arg + 1.
9838 2005-01-28 Raja R Harinath <rharinath@novell.com>
9840 * attribute.cs (Attribute.CheckAttributeType): Make private
9842 (Attribute.ResolveType): Make virtual.
9843 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
9844 handling of RootContext.Tree.Types.
9846 2005-01-27 Raja R Harinath <rharinath@novell.com>
9848 Update attribute-handling to use the SimpleName/MemberAccess
9850 * cs-parser.jay (attribute): Pass in an expression to the
9851 constructors of Attribute and GlobalAttribute.
9852 * attribute.cs (Attribute): Take an expression for the name.
9853 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
9854 passed in attribute name expression.
9855 (Attribute.CheckAttributeType): Use it.
9856 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
9857 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
9858 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
9859 argument to prevent error messages if the lookup fails.
9861 2005-01-27 Marek Safar <marek.safar@seznam.cz>
9863 * expression.cs (Indirection): Implemented IVariable interface
9864 to support indirection in AddressOf operator.
9865 (PointerArithmetic.Emit): Add optimalization for case where
9866 result can be precomputed.
9868 2005-01-26 Martin Baulig <martin@ximian.com>
9870 * class.cs (TypeContainer.AttributeTargets): Return the correct
9871 AttributeTargets depending on our `Kind' instead of throwing an
9872 exception; fixes #71632.
9874 2005-01-26 Marek Safar <marek.safar@seznam.cz>
9877 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
9880 2005-01-25 Raja R Harinath <rharinath@novell.com>
9883 * expression.cs (MemberAccess.DoResolve): Don't complain with
9884 cs0572 when the LHS of a member access has identical name and type
9887 2005-01-25 Marek Safar <marek.safar@seznam.cz>
9890 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
9892 Create custom PermissionSet only for PermissionSetAttribute.
9894 2005-01-24 Marek Safar <marek.safar@seznam.cz>
9897 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
9898 delegates in static class.
9900 2005-01-24 Martin Baulig <martin@ximian.com>
9902 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9903 merging an implicit block, just use its reachability.
9905 * statement.cs (Block.Resolve): Make the unreachable code check
9906 work wrt. implicit blocks; see test-337 from #63842.
9908 2005-01-21 Alp Toker <alp@atoker.com>
9910 * cs-parser.jay: destructor_declaration's container is PartialContainer
9911 not Class when partial types are used, so use Kind prop instead of
9914 2005-01-22 Miguel de Icaza <miguel@ximian.com>
9916 * cs-parser.jay: Improve error reporting when an interface
9919 2005-01-20 Dick Porter <dick@ximian.com>
9921 * support.cs: SeekableStreamReader fix from Sandor Dobos
9922 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
9923 chars are read. Fixes bug 70369.
9925 2005-01-20 Raja R Harinath <rharinath@novell.com>
9927 * cs-parser.jay (catch_clause): Simplify current_block handling
9930 2005-01-17 Miguel de Icaza <miguel@ximian.com>
9932 * convert.cs (ImplicitStandardConversionExists): Synchronize the
9933 code with ImplicitStandardConversion to handle the implicit
9934 conversion of method groups into valid delegate invocations.
9936 The problem is that in parameter handling we were using this code
9937 path. Fixes bug #64698
9939 2005-01-19 Raja R Harinath <rharinath@novell.com>
9941 * cs-parser.jay: Fix several infelicities.
9942 - Avoid assigning to the parser value stack. Code like
9943 '$3 = null' is unclean. Synthesize a value for the code block
9945 - Avoid using oob_stack for storing location information. Use ...
9946 (_mark_): ... this. New (empty) rule. Saves the current location
9948 (foreach_statement): Avoid using oob_stack for current_block
9949 handling. Use technique used in for_statement and
9950 using_statement. Synthesize a value for the code block to store
9951 additional intermediate information.
9953 2005-01-13 Miguel de Icaza <miguel@ximian.com>
9955 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
9956 of a different type is only allowed to private fields of a
9957 containing type, not on fields of a base class.
9959 See test-174.cs and error cs0122-9.cs
9961 2005-01-13 Raja R Harinath <rharinath@novell.com>
9963 Fix test-335.cs (bug #58126).
9964 * cs-parser.jay (argument): Split out non-expression parts of the
9965 rule into 'non_simple_argument'.
9966 (invocation_expression): Support parenthesized invocations with
9967 multiple arguments, and with single non-simple arguments.
9969 2005-01-13 Raja R Harinath <rharinath@novell.com>
9971 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
9974 2005-01-12 Raja R Harinath <rharinath@novell.com>
9976 Fix cs0038-1.cs, cs1640-6.cs.
9977 * ecore.cs (Expression.Resolve): Remove special-case for
9978 SimpleName in error-handling.
9979 (Expression.almostMatchedMembers): Relax access permission to
9981 (Expression.MemberLookupFailed): Handle duplicates in
9982 almostMatchedMembers list.
9983 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
9984 * expression.cs (New.DoResolve): Report CS1540 for more cases.
9985 * typemanager.cs (GetFullNameSignature): Use the MethodBase
9986 overload if the passed in MemberInfo is a MethodBase.
9988 2005-01-12 Marek Safar <marek.safar@seznam.cz>
9991 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
9992 for non-CAS & merge permission sets properly.
9994 2005-01-11 Raja R Harinath <rharinath@novell.com>
9996 Improve standard-compliance of simple name and member access
9997 resolution. Fixes bugs #52697, #57200, #67520, #69519.
9998 * ecore.cs (FullNamedExpression): New abstract base class
9999 for Namespaces and TypeExpressions.
10000 (ResolveFlags.SimpleName): Remove.
10001 (SimpleName): Remove support for dotted names.
10002 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
10003 DeclSpace.FindType and DeclSpace.LookupType.
10004 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
10005 (Expression.ExprClassName): Make member function.
10006 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
10007 a namespace. Remove creation of dotted "SimpleName"s.
10008 (MemberAccess.DoResolve): Likewise.
10009 * decl.cs (DeclSpace.Cache): Make private.
10010 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
10011 (DeclSpace.FindType): Update.
10012 (DeclSpace.LookupType): Move here from RootContext. Return a
10013 FullNamedExpression.
10014 * namespace.cs (Namespace): Derive from FullNamedExpression
10015 so that it can be part of expression resolution.
10016 (Namespace.Lookup): Return an FullNamedExpression.
10017 (NamespaceEntry.LookupAlias): Lookup aliases only in current
10019 * rootcontext.cs (NamespaceLookup): Remove.
10020 (LookupType): Move to DeclSpace.
10021 * attribute.cs (CheckAttributeType): Update.
10022 * doc.cs (FindDocumentedType): Remove allowAlias argument.
10023 (FindDocumentedTypeNonArray): Likewise.
10025 2005-01-11 Raja R Harinath <rharinath@novell.com>
10027 Fix cs0509.cs, cs1632.cs.
10028 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
10029 is the same as IsInterface.
10030 (TypeContainer.GetClassBases): Likewise.
10031 * statement.cs (LabeledStatement.ig): New field.
10032 (LabeledStatement.LabelTarget): Save ILGenerator which created the
10034 (LabeledStatement.DoEmit): Check that the label was created with
10035 the same ILGenerator.
10037 2005-01-10 Marek Safar <marek.safar@seznam.cz>
10040 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
10041 accessors to its properties.
10043 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
10044 from accessors to property.
10046 2005-01-10 Marek Safar <marek.safar@seznam.cz>
10049 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
10050 only for overrides.
10052 2005-01-08 Miguel de Icaza <miguel@ximian.com>
10054 * attribute.cs: Check for null and empty strings.
10056 I have lost another battle to Paolo.
10058 2005-01-07 Marek Safar <marek.safar@seznam.cz>
10061 * class.cs (PropertyMethod): Set Parent field in ctors.
10062 (SetMethod.InternalParameters): Add unsafe switch hack.
10063 Override MarkForDuplicationCheck where it is appropriate.
10065 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
10066 It says whether container allows members with the same name.
10067 Base default is no.
10068 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
10069 Removed is_method parameter.
10071 2005-01-06 Duncan Mak <duncan@ximian.com>
10073 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
10074 because the previous change led to incorrect reporting of CS1032
10075 ("Cannot define/undefine preprocessor symbols after first token in
10076 file"). Instead of using `tokens_seen' as the only flag that
10077 triggers CS1040, introduce `comments_seen'. This new flag is used
10078 to signify having seen comments on the current line, so it is
10079 unset after a newline.
10081 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
10083 * doc.cs : When searching for a type, find nested type too.
10084 This fixes bug #71040.
10086 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
10089 - Warn missing member comment on those classes which also does not
10090 have doc comments. Fixed bug #71041.
10091 - Don't warn missing doc comment on default constructor.
10094 2005-01-06 Duncan Mak <duncan@ximian.com>
10096 * cs-tokenizer.cs (xtoken): After handling traditional C-style
10097 comments, set `tokens_seen' to true. This allows us to detect
10098 misplaced preprocessor directives (i.e. not at the beginning of
10099 the a line, nor after whitespaces). In that case, report error
10100 CS1040. This fixes bug #56460.
10102 * cs-parser.jay (interface_member_declaration): Add checks for
10103 IsExplicitImpl, and report CS0541 error if an interface member is
10104 defined as an explicit interface declaration.
10106 2005-01-06 Marek Safar <marek.safar@seznam.cz>
10109 * class.cs (PropertyMethod): Set Parent field in ctors.
10110 (SetMethod.InternalParameters): Add unsafe switch hack.
10112 * decl.cs (MemberCore.Parent): Cannot be readonly.
10114 2005-01-06 Raja R Harinath <rharinath@novell.com>
10116 * decl.cs (DeclSpace.ResolveType): Remove.
10117 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
10118 Merge in code from ...
10119 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
10120 * class.cs, enum.cs: Update to changes.
10122 2005-01-06 Miguel de Icaza <miguel@ximian.com>
10124 * anonymous.cs: Ensure that we init the scope of our parent if it
10125 has not been initialized yet.
10127 2004-12-30 Duncan Mak <duncan@ximian.com>
10129 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
10130 if field.FieldBuilder is null. Fixes #70758.
10132 * convert.cs: Fixed some typos and updated some of the comments.
10133 (ImplicitStandardConversionExists):
10134 (TryImplicitIntConversion): If `target_type' is an interface and
10135 the type of `ic' implements this interface, return true or a new
10136 BoxedCast instead of null. This fixes #70468.
10138 2004-12-29 Duncan Mak <duncan@ximian.com>
10140 * expression.cs (Argument.Emit): Check that Expr is
10141 IMemoryLocation before casting to it, and report CS1510 otherwise.
10145 2004-12-21 Ben Maurer <bmaurer@ximian.com>
10147 * statement.cs (Block.ThisVariable): remove the recursion here, to
10148 make the --profile more sane.
10150 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
10152 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
10153 assembly, by JB Evain.
10155 2004-12-17 Raja R Harinath <rharinath@novell.com>
10157 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
10158 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
10159 "parent" refers to enclosing type/class. "base" refers to superclass.
10161 2004-12-17 Raja R Harinath <rharinath@novell.com>
10163 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10164 Ensure that we only have GlobalAttributes.
10165 * attribute.cs (Attribute.Emit): Make non-virtual.
10166 (GlobalAttribute.Emit): Remove.
10167 (Attribute.Resolve): Make virtual.
10168 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
10169 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
10170 the argument. Don't create one.
10171 (Attribute.GetObsoleteAttribute): Likewise.
10172 (Attribute.GetClsCompliantAttributeValue): Likewise.
10173 * class.cs, decl.cs: Update to changes.
10175 2004-12-17 Marek Safar <marek.safar@seznam.cz>
10177 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
10179 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
10181 * statement.cs (Foreach.Resolve): Add error 186 report.
10183 2004-12-16 Marek Safar <marek.safar@seznam.cz>
10185 * expression.cs (Conditional.DoResolve): Add warning 429.
10187 * statement.cs (If.Resolve): Add warning 665.
10189 2004-12-16 Raja R Harinath <rharinath@novell.com>
10191 New invariant: RootContext.Tree.Types.NamespaceEntry == null
10192 except when in the parser, and in GlobalAttribute.
10193 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
10194 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
10195 RootContext.Tree.Types.NamespaceEntry once work is done.
10196 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
10197 and resets RootContext.Tree.Types.NamespaceEntry.
10199 2004-12-15 Marek Safar <marek.safar@seznam.cz>
10201 * cs-parser.jay: Don't create a block for every variable.
10203 2004-12-14 Miguel de Icaza <miguel@ximian.com>
10205 * location.cs: Provide extra information.
10207 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
10208 variables from the captured environment, it is the ldarg_0.
10210 2004-12-14 Marek Safar <marek.safar@seznam.cz>
10212 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
10215 * class.cs: Changed warning level for 169 to avoid developer
10216 displeasure from warning flooding. It will be changed back when they
10217 fix most of current BCL warnings.
10219 * RootContext.cs: Pushed default WarningLevel to 3.
10221 * statement.cs: Removed unused variable.
10223 2004-12-14 Marek Safar <marek.safar@seznam.cz>
10225 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
10226 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
10227 Add error 502 report.
10228 (StaticClass.DefineType): Add error 441 report.
10229 (Class.AllowedModifiersProp): New virtual property as temporary
10230 extension to AllowedModifiers.
10231 (Class.DefineType): Add error 418 report. Moved ModFlags check here
10232 to share implementation with StaticClass and don't call virtual
10235 * driver.cs (MainDriver): Add error 1558 test.
10237 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
10238 report. Moved error 36 test here.
10240 * statement.cs (Throw.Resolve): Add error 724 report.
10242 * typemanager.cs: Add out_attribute_type core type.
10244 2004-12-13 Marek Safar <marek.safar@seznam.cz>
10246 * class.cs (TypeContainer.VerifyClsCompliance): Add error
10248 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
10250 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
10253 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
10255 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
10256 Add error 3023 report.
10257 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
10259 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
10262 2004-12-12 John Luke <john.luke@gmail.com>
10264 * driver.cs (AddArgs): take -- into account when
10265 adding arguments, fixes bug 65710
10267 2004-12-12 Martin Baulig <martin@ximian.com>
10269 * expression.cs (Unary.TryReduceNegative): Added support for
10270 SByteConstant and ByteConstant.
10271 (Unary.Reduce): Check error values from TryReduceNegative().
10273 2004-12-10 Marek Safar <marek.safar@seznam.cz>
10275 * attributes.cs (Attribute.Resolve): Avoid multiple error report
10276 and report exception as error 182.
10278 2004-12-10 Raja R Harinath <rharinath@novell.com>
10280 * driver.cs (Main): Fix message when there are warnings.
10282 2004-12-09 Miguel de Icaza <miguel@ximian.com>
10284 * delegate.cs: Fixed my fix from yesterday, sorry about that.
10286 2004-12-09 Marek Safar <marek.safar@seznam.cz>
10288 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
10289 Reduced number of warnings.
10291 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
10293 2004-12-08 Miguel de Icaza <miguel@ximian.com>
10295 * driver.cs: Removed message.
10297 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
10299 2004-12-08 <vargaz@freemail.hu>
10301 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
10303 2004-12-08 Martin Baulig <martin@ximian.com>
10305 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
10306 instead of a CS3002 for properties and indexer.
10308 2004-12-08 Martin Baulig <martin@ximian.com>
10310 * decl.cs (MemberName.ToString): Make this work again.
10312 2004-12-08 Marek Safar <marek.safar@seznam.cz>
10314 * attribute.cs (Resolve): Add error 591 detection.
10316 * class.cs (FieldMember.Define): Add error 1547 detection.
10317 (Indexer.Define): Add error 620 detection.
10318 (Operator.Define): Add error 590 detection.
10320 * ecore.cs: Missing argument for error 79.
10322 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
10325 2004-12-07 Marek Safar <marek.safar@seznam.cz>
10328 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
10331 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
10333 * cs-parser.jay : handle doc comments on implicit/explicit operators.
10334 Some operator comments were suppressed.
10335 * doc.cs : Implicit/explicit operator name in doc comments are like
10336 "op_Explicit(type)~returnType", so added suffix handling.
10338 2004-12-07 Martin Baulig <martin@ximian.com>
10341 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
10342 (MemberCore.GetClsCompliantAttributeValue): Likewise.
10343 (DeclSpace.ec): New protected field; store the EmitContext here.
10344 (DeclSpace.EmitContext): New public property; moved here from
10346 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
10349 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
10350 (Enum.Emit): Don't create a new EmitContext.
10352 * delegate.cs (Delegate.DefineType): Always create the
10355 * iterators.cs (Iterators.DefineIterator): Create a new
10356 EmitContext and store it in `ec'.
10358 2004-08-24 Martin Baulig <martin@ximian.com>
10361 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
10362 this for accessibility checks.
10363 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
10364 IsNestedFamilyAccessible.
10365 (TypeManager.IsSubclassOf): New method, do what the name actually
10368 2004-12-06 Raja R Harinath <rharinath@novell.com>
10370 Fix crash on cs0657-17.cs.
10371 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10372 Use RootContext.Tree.Types, not 'new RootTypes ()'.
10373 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
10374 the case where the NamespaceEntry gets overwritten.
10376 2004-12-06 Marek Safar <marek.safar@seznam.cz>
10378 Fixed #69195, #56821
10379 * ecore.cs (ResolveBoolean): Tiny refactoring.
10381 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
10382 of right expression resolving when left is false constant and
10383 operator is LogicalAnd OR true constant and operator is LogicalOr.
10385 * statement.cs (ResolveUnreachable): Always reports warning.
10387 2004-12-05 Miguel de Icaza <miguel@ximian.com>
10389 * class.cs: Distinguish between 1721 and 1722 (just a little help
10390 for the programmer).
10392 2004-12-03 Miguel de Icaza <miguel@ximian.com>
10394 * delegate.cs: Only allow this on new versions of the language.
10396 2004-12-02 Duncan Mak <duncan@ximian.com>
10398 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
10400 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
10401 here as a static method. Take an additional bool out parameter
10402 `must_do_cs1540_check' for signaling to InstanceResolve.
10403 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
10404 member field from PropertyExpr class and made it an argument of
10405 the method instead.
10406 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
10407 check for MarshalByRefObject, and report CS0122 instead of CS1540.
10408 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
10409 and `remove_accessor' as well as InstanceResolve: report CS0122
10414 2004-12-03 Raja R Harinath <rharinath@novell.com>
10416 Fix test-327.cs, test-328.cs, and put in early infrastructure
10417 for eventually fixing #52697.
10418 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
10419 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
10420 from other methods.
10421 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
10422 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
10423 (VerifyUsing, error246): Update.
10424 * rootcontext.cs (RootContext.NamespaceLookup): Just use
10425 'NamespaceEntry.LookupNamespaceOrType'.
10427 2004-12-03 Martin Baulig <martin@ximian.com>
10429 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10430 method as our child, call AnonymousMethod.Compatible() on it.
10432 2004-12-03 Raja R Harinath <rharinath@novell.com>
10434 Disable XML documentation support in 'basic' profile.
10435 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
10436 Redirect XmlElement to System.Object.
10437 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
10438 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
10439 * mcs.exe.sources: Add doc-bootstrap.cs.
10440 * doc-bootstrap.cs: New file. Contains empty stub implementation
10443 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
10445 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
10446 comments are allowed.
10448 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10450 * delegate.cs: Add checks for subtypes in paramaters and return values
10451 in VerifyMethod () to add support for Covariance/Contravariance
10454 2004-12-02 Miguel de Icaza <miguel@ximian.com>
10456 * report.cs: Remove extra closing parenthesis.
10458 * convert.cs (Error_CannotImplicitConversion): If the name of the
10459 types are the same, provide some extra information.
10461 * class.cs (FieldBase): Use an unused bit field from the field to
10462 encode the `has_offset' property from the FieldMember. This saves
10463 a couple of Ks on bootstrap compilation.
10465 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10466 method as our child, return the AnonymousMethod resolved
10469 * expression.cs (New.DoResolve): Allow return values from
10470 NewDelegate to also include AnonymousMethods.
10474 2004-12-02 Marek Safar <marek.safar@seznam.cz>
10477 * attribute.cs (Resolve): Improved implementation of params
10478 attribute arguments.
10480 * support.cs (ParameterData): Add HasParams to be faster.
10482 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
10484 all things are for /doc support:
10486 * doc.cs: new file that supports XML documentation generation.
10487 * mcs.exe.sources: added doc.cs.
10489 Handle /doc command line option.
10490 Report error 2006 instead of 5 for missing file name for /doc.
10491 Generate XML documentation when required, after type resolution.
10493 Added support for picking up documentation (/// and /** ... */),
10494 including a new XmlCommentState enumeration.
10496 Added lines to fill Documentation element for field, constant,
10497 property, indexer, method, constructor, destructor, operator, event
10498 and class, struct, interface, delegate, enum.
10499 Added lines to warn incorrect comment.
10501 Added Documentation field (passed only when /doc was specified).
10503 Added DocComment, DocCommentHeader, GenerateDocComment() and
10504 OnGenerateDocComment() and some supporting private members for
10505 /doc feature to MemberCore.
10507 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
10509 Added overriden DocCommentHeader.
10511 Added overriden DocCommentHeader and GenerateDocComment().
10513 2004-12-01 Miguel de Icaza <miguel@ximian.com>
10515 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
10516 unwrapping the enumeration values, chain to
10517 DoConstantNumericPromotions again, so we can promote things to the
10518 fundamental types (takes care of enums that are bytes, sbytes).
10522 2004-12-01 Raja R Harinath <rharinath@novell.com>
10524 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
10525 Fix long-standing bug in type-lookup. Use FindType instead of
10526 LookupType when ec.ResolvingTypeTree.
10527 (Attribute.ResolveType, Attribute.Resolve)
10528 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
10530 (Attributes.Search): Remove internal version. Update.
10531 (Attributes.SearchMulti): Update.
10532 (Attributes.GetClsCompliantAttribute): Remove.
10533 (Attributes.GetIndexerNameAttribute): Remove.
10534 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
10535 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
10536 * class.cs (Indexer.Define): Likewise.
10538 2004-12-01 Marek Safar <marek.safar@seznam.cz>
10541 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
10542 MarshallByReference members access.
10544 * expression.cs: Use CheckMarshallByRefAccess;
10545 Better error CS0197 message.
10547 * report.cs: Print whole related error message.
10549 2004-11-30 Raja R Harinath <rharinath@novell.com>
10551 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
10552 the current directory to help debugging.
10554 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10556 * class (GetClassBases): Better error 60 report.
10557 (EventProperty): Disabled warning 67 detection.
10559 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10562 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
10564 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
10567 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10570 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
10572 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
10574 2004-11-26 Miguel de Icaza <miguel@ximian.com>
10576 * attribute.cs (Attribute.Resolve): Refine error reporting and
10577 report a cs0117 if the identifier does not exist, to distinguish
10578 from 0617 which is a miss-use of the actual identifier.
10580 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
10581 between cs0070 and cs0079.
10583 * class.cs (MemberBase.DoDefine): When reporting a wrong
10584 accessibility level, we use MethodCore to compare instead of
10585 Method (this was a regression in some refactoring effort).
10587 So now we correctly report cs0056 again.
10589 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
10590 testing the target_type (which was known to be object_type) and
10591 not the source type (which is anonymous_method).
10593 Fixed reporting of error cs1660.
10595 * expression.cs (UserCast.Source): Expose the underlying cast.
10597 * statement.cs (Switch.SwitchGoverningType): Sort the list of
10598 allowed types to find a match to int32 first (most common).
10600 In addition, it ignores any ImplicitUserConversions that did an
10601 internal implicit conversion (as the switch statement allows only
10602 one integral conversion to exist).
10604 * class.cs (PartialContainer.Create): rename `name' to
10605 `member_name' for clarity. Then replace the string calls with a
10606 call to MemberName.GetPartialName, as now using
10607 MemberName.ToString is an error (this is due to the side effects
10608 it had, that were fixed in the past).
10610 This will restore the error reporting on a number of partial class
10611 errors that were missusing this (and getting an exception as a
10612 results, which is now just a plain textual warning, because
10613 yyparse debug output would crash otherwise).
10615 2004-11-26 Raja R Harinath <rharinath@novell.com>
10617 * Makefile (PROGRAM_INSTALL_DIR): Remove.
10619 2004-11-25 Ben Maurer <bmaurer@ximian.com>
10621 * rootcontext.cs (LookupType): Make sure to cache lookups that
10622 don't give us a negative result. This saves about 5% of corlib
10625 2004-11-25 Miguel de Icaza <miguel@ximian.com>
10627 * report.cs (AbstractMessage.Print): messages are sent to stderr
10629 * class.cs (TypeContainer.GetClassBases): It is an error to have a
10630 non-interface in the list of interfaces (at this point, either
10631 parent was properly set, or a base class is being listed in the
10632 interfaces section).
10634 This flags error 1722, and resolves the crash from bug 69259.
10636 2004-11-25 Ben Maurer <bmaurer@ximian.com>
10638 * statement.cs (Using.EmitExpressionFinally): make this work right
10639 for valuetypes. Fixes 69926.
10641 2004-11-25 Miguel de Icaza <miguel@ximian.com>
10643 * const.cs (Const.ChangeType): Cope with the "0 literal can be
10644 converted to an enum" here, before we try to change the underlying
10645 type. This code exists, but it is a different code path than the
10646 one used while encoding constants.
10648 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
10649 old bug: when converting from the null literal to a pointer,
10650 return an EmptyCast, not the NullLiteral.
10652 This fixes #69921, the recent null_type changes probably made this
10653 bug more prominent.
10655 (ImplicitReferenceConversionExists): In addition, resynchronized
10656 the code here, so it matches the same code in
10657 ImplicitReferenceConversionExists for the `from any class-type S
10658 to any interface-type T'.
10661 2004-11-25 Marek Safar <marek.safar@seznam.cz>
10663 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
10665 2004-11-24 Miguel de Icaza <miguel@ximian.com>
10667 * cs-parser.jay: Use verbosity accordingly.
10669 2004-11-24 Marek Safar <marek.safar@seznam.cz>
10671 * expression.cs (Unary.ResolveOperator): Do not report warning;
10672 AddressOf reads from variable.
10674 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
10676 2004-11-24 Marek Safar <marek.safar@seznam.cz>
10680 * attribute.cs (Attributable): Removed CheckTargets.
10681 (Attributes.Emit): Explicit attribute targets are tested here.
10683 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
10684 not enabled for interfaces.
10686 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
10687 (GetAssemblyName): Ouch next bug there.
10689 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10691 * expression.cs: Error 275 added.
10693 2004-11-23 Marek Safar <marek.safar@seznam.cz>
10695 Fix bug #69177 (Implemented decimal constant support)
10697 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
10698 (BinaryFold): Add DecimalConstant.
10700 * const.cs (Define): Decimal constant
10702 (ChangeType): Add decimal type handling.
10703 (LookupConstantValue): Don't set value for decimal type but
10704 emit DecimalConstantAttribute. Needed for constant optimization.
10706 * constant.cs (ToDecimal): New method.
10707 (ConvertToDecimal): New method.
10708 (IntConstant): Implemented ConvertToDecimal.
10709 (DecimalConstant.Emit): Emit optimized version for decimals in
10712 * expression.cs (ResolveOperator): Changed order of constant
10713 reduction to work correctly with native types which have
10714 overloaded operators.
10715 (ResolveMemberAccess): Extract constant value from attribute
10718 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
10720 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
10721 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
10722 (ChangeType): Decimal is special.
10723 (TypeToCoreType): Add decimal type.
10725 2004-11-22 Marek Safar <marek.safar@seznam.cz>
10727 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
10730 2004-11-22 Marek Safar <marek.safar@seznam.cz>
10732 * class.cs (EventField.ApplyAttributeBuilder): Fix error
10735 2004-11-19 Marek Safar <marek.safar@seznam.cz>
10737 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
10739 * pending.cs (PendingImplementation): Grab only interfaces.
10741 2004-11-19 Marek Safar <marek.safar@seznam.cz>
10743 * statement.cs (ForeachHelperMethods): Add location member and
10744 error 202 detection.
10746 2004-11-19 Raja R Harinath <rharinath@novell.com>
10748 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
10749 automatically handled by executable.make.
10750 (PROGRAM): Make profile-specific.
10752 2004-11-18 Marek Safar <marek.safar@seznam.cz>
10754 * expression.cs (DoResolveBase): Fixed wrong warning for out
10757 2004-11-18 Martin Baulig <martin@ximian.com>
10759 Merged latest changes into gmcs. Please keep this comment in
10760 here, it makes it easier for me to see what changed in MCS since
10761 the last time I merged.
10763 2004-11-17 Raja R Harinath <rharinath@novell.com>
10765 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
10766 (TypeHandle.GetMemberCache): New.
10767 (TypeHandle.TypeHandle): Update.
10768 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
10769 (TypeManager.LookupParentInterfacesCache):
10770 Rename from LookupInterfaceCache. Optimize slightly.
10771 (TypeManager.MemberLookup_FindMembers): Update.
10772 * decl.cs (MemberCache.MemberCache): Set Container to null in the
10773 multi-type variant.
10774 (AddCacheContents): Rename from AddHashtable.
10775 * class.cs (TypeContainer.parent_container): Remove.
10776 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
10777 (TypeContainer.DoDefineMembers): Don't initialize it.
10778 Update to name changes.
10780 2004-11-17 Miguel de Icaza <miguel@ximian.com>
10782 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
10783 that factors the code to check access modifiers on override.
10785 (PropertyBase): Use the code here.
10787 Patch from Lluis S'anchez, fixes bug #69361.
10789 2004-11-15 Miguel de Icaza <miguel@ximian.com>
10791 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
10792 routine that is used to report the use of a captured variable
10793 whose address has been taken.
10795 There are two checks: one when variables are being captured and
10796 the other check is when the address of a variable is taken.
10798 (because an anonymous methods might be resolved before *or* after
10799 the address has been taken) and
10801 * expression.cs (Conditional.DoResolve): Remove the special
10802 casing that Martin added to trueExpr and falseExpr being both
10803 NullLiteral. We get the right behavior now just by introducing
10804 the null_type into the compiler.
10806 * convert.cs (ExplicitConversion): Change the code to use
10807 null_type instead of testing `expr is NullLiteral'.
10808 (ImplicitConversionStandard): use null_type too.
10809 (ImplicitReferenceConversionExists): use null_type too.
10810 (ImplicitReferenceConversion): use null_type too.
10812 * literal.cs: The type of `NullLiteral' is now null_type instead
10814 (Resolve): Set the type here.
10816 * typemanager.cs: Introduce null_type.
10818 2004-11-17 Martin Baulig <martin@ximian.com>
10820 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
10821 direction, like FindMembers() does. Fixes #69546, testcase is in
10824 2004-11-16 Martin Baulig <martin@ximian.com>
10826 This is based on a patch from Marek Safar, see bug #69082.
10827 Fixes bugs #63705 and #67130.
10829 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
10830 method; create a MemberCache for an interface type and cache the
10833 * decl.cs (IMemberContainer.ParentContainer): Removed.
10834 (IMemberContainer.ParentCache): New property.
10835 (MemberCache.SetupCacheForInterface): Removed.
10836 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
10837 to create a cache for an interface's "parent".
10839 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
10842 2004-11-16 Martin Baulig <martin@ximian.com>
10844 Merged back from gmcs; these changes already went into gmcs a
10845 couple of weeks ago.
10848 (TypeManager.AddUserType): Removed the `ifaces' argument.
10849 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
10851 (TypeManager.AddUserInterface): Removed.
10852 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
10854 (TypeManager.GetInterfaces): Likewise.
10855 (TypeManager.GetExplicitInterfaces): Likewise.
10857 * ecore.cs (TypeExpr.GetInterfaces): Removed.
10859 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
10860 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
10862 2004-11-14 Ben Maurer <bmaurer@ximian.com>
10864 * statement.cs: Avoid adding bools to a hashtable.
10866 2004-11-07 Miguel de Icaza <miguel@ximian.com>
10868 * expression.cs (Invocation.OverloadResolve): Flag error if we are
10869 calling an unsafe method from a safe location.
10871 2004-11-06 Marek Safar <marek.safar@seznam.cz>
10874 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
10876 2004-11-06 Miguel de Icaza <miguel@ximian.com>
10878 * namespace.cs (VerifyUsing): use GetPartialName instead of
10881 2004-11-05 Miguel de Icaza <miguel@ximian.com>
10883 * statement.cs (Return.Resolve): Fix regression in typo: if
10884 `in_exc', we have to request a NeedReturnLabel, this was a typo
10885 introduced in the anonymous method check-in. Fixes #69131.
10887 * Indexers were using the ShortName when defining themselves,
10888 causing a regression in the compiler bootstrap when applying the
10889 patch from 2004-11-02 (first part), now they use their full name
10890 and the bug is gone.
10892 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
10894 * driver.cs: Strip the path from the names of embedded resources. Fixes
10897 2004-11-04 Raja R Harinath <rharinath@novell.com>
10899 Fix error message regression: cs0104-2.cs.
10900 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
10901 (AliasEntry.Resolve): Update.
10902 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
10904 (RootContext.LookupType): Update.
10906 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
10908 * cs-parser.jay: Add support for handling accessor modifiers
10909 * class: Add support port accessor modifiers and error checking,
10910 define PropertyMethod.Define as virtual (not abstract anymore)
10911 * ecore.cs: Add checking for proeprties access with access modifiers
10912 * iterators.cs: Modify Accessor constructor call based in the modified
10914 2004-11-02 Ben Maurer <bmaurer@ximian.com>
10916 * expression.cs (StringConcat): Handle being called twice,
10917 as when we have a concat in a field init with more than two
10920 2004-11-02 Miguel de Icaza <miguel@ximian.com>
10922 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
10923 special case explicit implementations, we should always produce
10924 the .property or .event declaration.
10926 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
10927 since it will not return correct data if people use this
10928 unresolved in the presence of using statements (see test-313).
10930 * class.cs (MethodData.Define): If we are an explicit interface
10931 implementation, set the method name to the full name of the
10932 interface plus the name of the method.
10934 Notice that using the method.MethodName.GetFullName() does not
10935 work, as it will only contain the name as declared on the source
10936 file (it can be a shorthand in the presence of using statements)
10937 and not the fully qualifed type name, for example:
10941 class D : ICloneable {
10942 object ICloneable.Clone () {
10946 Would produce a method called `ICloneable.Clone' instead of
10947 `System.ICloneable.Clone'.
10949 * namespace.cs (Alias.Resolve): Use GetPartialName.
10951 2004-11-01 Marek Safar <marek.safar@seznam.cz>
10953 * cs-parser.jay: Add error 1055 report.
10955 2004-11-01 Miguel de Icaza <miguel@ximian.com>
10957 * assign.cs (Assign.DoResolve): Only do the transform of
10958 assignment into a New if the types are compatible, if not, fall
10959 through and let the implicit code deal with the errors and with
10960 the necessary conversions.
10962 2004-11-01 Marek Safar <marek.safar@seznam.cz>
10964 * cs-parser.jay: Add error 1031 report.
10966 * cs-tokenizer.cs: Add location for error 1038.
10968 2004-10-31 Marek Safar <marek.safar@seznam.cz>
10970 * cs-parser.jay: Add error 1016 report.
10972 2004-10-31 Marek Safar <marek.safar@seznam.cz>
10974 * cs-parser.jay: Add errors 1575,1611 report.
10976 2004-10-31 Marek Safar <marek.safar@seznam.cz>
10978 * cs-parser.jay: Add error 1001 report.
10980 2004-10-31 Marek Safar <marek.safar@seznam.cz>
10983 * attribute.cs (GetMarshal): Add method argument for
10984 caller identification.
10986 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
10987 agument for GetMarshal and RuntimeMissingSupport.
10989 2004-10-31 Marek Safar <marek.safar@seznam.cz>
10991 * attribute.cs (ExtractSecurityPermissionSet): Removed
10992 TypeManager.code_access_permission_type.
10994 * typemanager.cs: Removed TypeManager.code_access_permission_type.
10996 2004-10-27 Miguel de Icaza <miguel@ximian.com>
10998 * expression.cs (LocalVariableReference.DoResolveLValue): Check
10999 for obsolete use of a variable here. Fixes regression on errors
11000 cs0619-25 and cs0619-26.
11002 2004-10-27 Marek Safar <marek.safar@seznam.cz>
11004 Fix #62358, implemented security attribute encoding.
11006 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
11007 Tests permitted SecurityAction for assembly or other types.
11008 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
11009 data from SecurityPermissionAttribute to PermisionSet class.
11011 * class.cs (ApplyAttributeBuilder): Added special handling
11012 for System.Security.Permissions.SecurityAttribute based types.
11014 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
11015 special handling for System.Security.Permissions.SecurityAttribute
11018 * enum.cs (ApplyAttributeBuilder): Added special handling
11019 for System.Security.Permissions.SecurityAttribute based types.
11021 * parameter.cs (ApplyAttributeBuilder): Added special handling
11022 for System.Security.Permissions.SecurityAttribute based types.
11024 * rootcontext.cs: Next 2 core types.
11026 * typemanager.cs (TypeManager.security_permission_attr_type):
11027 Built in type for the SecurityPermission Attribute.
11028 (code_access_permission_type): Build in type.
11030 2004-10-17 Miguel de Icaza <miguel@ximian.com>
11032 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
11033 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
11034 all of this information into
11035 EmitContext.EmitCapturedVariableInstance.
11037 * codegen.cs (EmitCapturedVariableInstance): move here the
11038 funcionality of emitting an ldarg.0 in the presence of a
11039 remapping. This centralizes the instance emit code.
11041 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
11042 then emit a load of this: it means that we have reached the
11043 topmost ScopeInfo: the one that contains the pointer to the
11044 instance of the class hosting the anonymous method.
11046 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
11047 captures to the topmost CaptureContext.
11049 2004-10-12 Miguel de Icaza <miguel@ximian.com>
11051 * expression.cs (LocalVariableReference): Move the knowledge about
11052 the iterators into codegen's EmitCapturedVariableInstance.
11054 2004-10-11 Miguel de Icaza <miguel@ximian.com>
11056 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
11057 all code paths return a value from an anonymous method (it is the
11058 same as the 161 error, but for anonymous methods).
11060 2004-10-08 Miguel de Icaza <miguel@ximian.com>
11062 The introduction of anonymous methods in the compiler changed
11063 various ways of doing things in the compiler. The most
11064 significant one is the hard split between the resolution phase
11065 and the emission phases of the compiler.
11067 For instance, routines that referenced local variables no
11068 longer can safely create temporary variables during the
11069 resolution phase: they must do so from the emission phase,
11070 since the variable might have been "captured", hence access to
11071 it can not be done with the local-variable operations from the runtime.
11075 (Block.Flags): New flag `IsTopLevel' to indicate that this block
11076 is a toplevel block.
11078 (ToplevelBlock): A new kind of Block, these are the blocks that
11079 are created by the parser for all toplevel method bodies. These
11080 include methods, accessors and anonymous methods.
11082 These contain some extra information not found in regular blocks:
11083 A pointer to an optional CaptureContext (for tracking captured
11084 local variables and parameters). A pointer to the parent
11087 (Return.Resolve): Catch missmatches when returning a value from an
11088 anonymous method (error 1662).
11089 Invoke NeedReturnLabel from the Resolve phase instead of the emit
11092 (Break.Resolve): ditto.
11094 (SwitchLabel): instead of defining the labels during the
11095 resolution phase, we now turned the public ILLabel and ILLabelCode
11096 labels into methods called GetILLabelCode() and GetILLabel() that
11097 only define the label during the Emit phase.
11099 (GotoCase): Track the SwitchLabel instead of the computed label
11100 (its contained therein). Emit the code by using
11101 SwitchLabel.GetILLabelCode ().
11103 (LocalInfo.Flags.Captured): A new flag has been introduce to track
11104 whether the Local has been captured or not.
11106 (LocalInfo.IsCaptured): New property, used to tell whether the
11107 local has been captured.
11109 * anonymous.cs: Vastly updated to contain the anonymous method
11112 The main classes here are: CaptureContext which tracks any
11113 captured information for a toplevel block and ScopeInfo used to
11114 track the activation frames for various local variables.
11116 Each toplevel block has an optional capture context associated
11117 with it. When a method contains an anonymous method both the
11118 toplevel method and the anonymous method will create a capture
11119 context. When variables or parameters are captured, they are
11120 recorded on the CaptureContext that owns them, for example:
11124 MyDelegate d = delegate {
11129 Here `a' will be recorded as captured on the toplevel
11130 CapturedContext, the inner captured context will not have anything
11131 (it will only have data if local variables or parameters from it
11132 are captured in a nested anonymous method.
11134 The ScopeInfo is used to track the activation frames for local
11135 variables, for example:
11137 for (int i = 0; i < 10; i++)
11138 for (int j = 0; j < 10; j++){
11139 MyDelegate d = delegate {
11144 At runtime this captures a single captured variable `i', but it
11145 captures 10 different versions of the variable `j'. The variable
11146 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
11147 recorded on a child.
11149 The toplevel ScopeInfo will also track information like the `this'
11150 pointer if instance variables were referenced (this is necessary
11151 as the anonymous method lives inside a nested class in the host
11152 type of the method).
11154 (AnonymousMethod): Expanded to track the Toplevel, implement
11155 `AnonymousMethod.Compatible' to tell whether an anonymous method
11156 can be converted to a target delegate type.
11158 The routine now also produces the anonymous method content
11160 (AnonymousDelegate): A helper class that derives from
11161 DelegateCreation, this is used to generate the code necessary to
11162 produce the delegate for the anonymous method that was created.
11164 * assign.cs: API adjustments for new changes in
11165 Convert.ImplicitStandardConversionExists.
11167 * class.cs: Adjustments to cope with the fact that now toplevel
11168 blocks are of type `ToplevelBlock'.
11170 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
11171 insteda of standard blocks.
11173 Flag errors if params arguments are passed to anonymous methods.
11175 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
11176 `CurrentAnonymousMethod' which points to the current Anonymous
11177 Method. The variable points to the AnonymousMethod class that
11178 holds the code being compiled. It is set in the new EmitContext
11179 created for the anonymous method.
11181 (EmitContext.Phase): Introduce a variable and an enumeration to
11182 assist in enforcing some rules about when and where we are allowed
11183 to invoke certain methods (EmitContext.NeedsReturnLabel is the
11184 only one that enfonces this right now).
11186 (EmitContext.HaveCaptureInfo): new helper method that returns
11187 whether we have a CapturedContext initialized.
11189 (EmitContext.CaptureVariable): New method used to register that a
11190 LocalInfo must be flagged for capturing.
11192 (EmitContext.CapturedParameter): New method used to register that a
11193 parameters must be flagged for capturing.
11195 (EmitContext.CapturedField): New method used to register that a
11196 field must be flagged for capturing.
11198 (EmitContext.HaveCapturedVariables,
11199 EmitContext.HaveCapturedFields): Return whether there are captured
11200 variables or fields.
11202 (EmitContext.EmitMethodHostInstance): This is used to emit the
11203 instance for the anonymous method. The instance might be null
11204 (static methods), this (for anonymous methods that capture nothing
11205 and happen to live side-by-side with the current method body) or a
11206 more complicated expression if the method has a CaptureContext.
11208 (EmitContext.EmitTopBlock): Routine that drives the emission of
11209 code: it will first resolve the top block, then emit any metadata
11210 and then emit the code. The split is done so that we can extract
11211 any anonymous methods and flag any captured variables/parameters.
11213 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
11214 during this phase, the ILGenerator should not be used as labels
11215 and local variables declared here might not be accessible to any
11216 code that is part of an anonymous method.
11218 Exceptions to this include the temporary variables that are
11219 created by some statements internally for holding temporary
11222 (EmitContext.EmitMeta): New routine, in charge of emitting all the
11225 (EmitContext.TemporaryReturn): This method is typically called
11226 from the Emit phase, and its the only place where we allow the
11227 ReturnLabel to be defined other than the EmitMeta. The reason is
11228 that otherwise we would have to duplicate a lot of logic in the
11229 Resolve phases of various methods that today is on the Emit
11232 (EmitContext.NeedReturnLabel): This no longer creates the label,
11233 as the ILGenerator is not valid during the resolve phase.
11235 (EmitContext.EmitThis): Extended the knowledge in this class to
11236 work in anonymous methods in addition to iterators.
11238 (EmitContext.EmitCapturedVariableInstance): This emits whatever
11239 code is necessary on the stack to access the instance to a local
11240 variable (the variable will be accessed as a field).
11242 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
11243 EmitContext.EmitAddressOfParameter): Routines to support
11244 parameters (not completed at this point).
11246 Removals: Removed RemapLocal and RemapLocalLValue. We probably
11247 will also remove the parameters.
11249 * convert.cs (Convert): Define a `ConstantEC' which points to a
11250 null. This is just to prefity some code that uses
11251 ImplicitStandardConversion code and do not have an EmitContext
11254 The idea is to flag explicitly that at that point in time, it is
11255 known that the conversion will not trigger the delegate checking
11256 code in implicit conversions (which requires a valid
11259 Everywhere: pass new EmitContext parameter since
11260 ImplicitStandardConversionExists now requires it to check for
11261 anonymous method conversions.
11263 (Convert.ImplicitStandardConversionExists): If the type of an
11264 expression is the anonymous_method_type, and the type is a
11265 delegate, we invoke the AnonymousMethod.Compatible method to check
11266 whether an implicit conversion is possible.
11268 (Convert.ImplicitConversionStandard): Only do implicit method
11269 group conversions if the language level is not ISO_1.
11271 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
11272 MethodInfo for the Invoke method. used by Delegate and
11275 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
11276 method conversions if the target type is a delegate.
11278 Removed extra debugging nops.
11280 (LocalVariableReference): Turn the `local_info' into a public
11283 Add `prepared' field, the same hack used for FieldExprs to cope
11284 with composed assignments, as Local variables do not necessarily
11285 operate purely on the stack as they used to: they can be captured
11288 Add `temp' for a temporary result, like fields.
11290 Refactor DoResolve and DoResolveLValue into DoResolveBase.
11292 It now copes with Local variables that are captured and emits the
11293 proper instance variable to load it from a field in the captured
11296 (ParameterReference.DoResolveBase): During the resolve phase,
11297 capture parameters if we are in an anonymous method.
11299 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
11300 anonymous method, use the EmitContext helper routines to emit the
11301 parameter reference.
11303 * iterators.cs: Set RemapToProxy to true/false during the
11306 * parameters.cs (GetParameterByName): New helper method.
11308 * typemanager.cs (anonymous_method_type) a new type that
11309 represents an anonyous method. This is always an internal type,
11310 used as a fencepost to test against the anonymous-methodness of an
11313 2004-10-20 Marek Safar <marek.safar@seznam.cz>
11315 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
11317 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
11319 2004-10-18 Martin Baulig <martin@ximian.com>
11321 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
11322 `Type' directly, but call ResolveType() on it.
11323 (Catch.Resolve): Likewise.
11324 (Foreach.Resolve): Likewise.
11326 2004-10-18 Martin Baulig <martin@ximian.com>
11328 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
11329 `Type' directly, but call ResolveType() on it.
11330 (Probe.DoResolve): Likewise.
11331 (ArrayCreation.LookupType): Likewise.
11332 (TypeOf.DoResolve): Likewise.
11333 (SizeOf.DoResolve): Likewise.
11335 2004-10-18 Martin Baulig <martin@ximian.com>
11337 * expression.cs (Invocation.BetterFunction): Put back
11338 TypeManager.TypeToCoreType().
11340 2004-10-18 Raja R Harinath <rharinath@novell.com>
11342 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
11345 2004-10-18 Martin Baulig <martin@ximian.com>
11347 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
11348 `Type' directly, but call ResolveType() on it.
11350 2004-10-18 Martin Baulig <martin@ximian.com>
11352 * class.cs (FieldMember.Define): Don't access the TypeExpr's
11353 `Type' directly, but call ResolveType() on it.
11354 (MemberBase.DoDefine): Likewise.
11356 * expression.cs (New.DoResolve): Don't access the TypeExpr's
11357 `Type' directly, but call ResolveType() on it.
11358 (ComposedCast.DoResolveAsTypeStep): Likewise.
11360 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
11361 `Type' directly, but call ResolveType() on it.
11363 2004-10-17 John Luke <john.luke@gmail.com>
11365 * class.cs (Operator.GetSignatureForError): use CSharpName
11367 * parameter.cs (Parameter.GetSignatureForError): Returns
11368 correct name even if was not defined.
11370 2004-10-13 Raja R Harinath <rharinath@novell.com>
11373 * class.cs (TypeContainer.EmitContext): New property.
11374 (DefineNestedTypes): Create an emitcontext for each part.
11375 (MethodCore.DoDefineParameters): Use container's emitcontext.
11376 Pass type array to InternalParameters.
11377 (MemberBase.DoDefine): Use container's emitcontext.
11378 (FieldMember.Define): Likewise.
11379 (Event.Define): Likewise.
11380 (SetMethod.GetParameterInfo): Change argument to EmitContext.
11381 Pass type array to InternalParameters.
11382 (SetIndexerMethod.GetParameterInfo): Likewise.
11383 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
11384 * delegate.cs (Define): Pass emitcontext to
11385 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
11386 array to InternalParameters.
11387 * expression.cs (ParameterReference.DoResolveBase): Pass
11388 emitcontext to GetParameterInfo.
11389 (ComposedCast.DoResolveAsTypeStep): Remove check on
11390 ec.ResolvingTypeTree.
11391 * parameter.cs (Parameter.Resolve): Change argument to
11392 EmitContext. Use ResolveAsTypeTerminal.
11393 (Parameter.GetSignature): Change argument to EmitContext.
11394 (Parameters.ComputeSignature): Likewise.
11395 (Parameters.ComputeParameterTypes): Likewise.
11396 (Parameters.GetParameterInfo): Likewise.
11397 (Parameters.ComputeAndDefineParameterTypes): Likewise.
11398 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
11399 * support.cs (InternalParameters..ctor): Remove variant that takes
11401 * typemanager.cs (system_intptr_expr): New.
11402 (InitExpressionTypes): Initialize it.
11404 2004-10-12 Chris Toshok <toshok@ximian.com>
11406 * cs-parser.jay: fix location for try_statement and catch_clause.
11408 2004-10-11 Martin Baulig <martin@ximian.com>
11410 * report.cs: Don't make --fatal abort on warnings, we have
11411 -warnaserror for that.
11413 2004-10-07 Raja R Harinath <rharinath@novell.com>
11415 More DeclSpace.ResolveType avoidance.
11416 * decl.cs (MemberCore.InUnsafe): New property.
11417 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
11418 with newly created EmitContext.
11419 (FieldMember.Define): Likewise.
11420 * delegate.cs (Delegate.Define): Likewise.
11421 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
11422 only if normal name-lookup fails.
11423 (TypeExpr.DoResolve): Enable error-checking.
11424 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
11425 (SizeOf.DoResolve): Likewise.
11426 (ComposedCast.DoResolveAsTypeStep): Likewise.
11427 (StackAlloc.DoResolve): Likewise.
11428 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
11429 (Block.Unsafe): New property.
11430 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
11431 (Unsafe): Set 'unsafe' flag of contained block.
11432 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
11433 (Fixed.Resolve): Likewise.
11434 (Catch.Resolve): Likewise.
11435 (Using.ResolveLocalVariableDecls): Likewise.
11436 (Foreach.Resolve): Likewise.
11438 2004-10-05 John Luke <john.luke@gmail.com>
11440 * cs-parser.jay: add location to error CS0175
11442 2004-10-04 Miguel de Icaza <miguel@ximian.com>
11444 * ecore.cs (Expression.Constantity): Add support for turning null
11447 * const.cs (Const.Define): Allow constants to be reference types
11448 as long as the value is Null.
11450 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
11452 * namespace.cs (NamespaceEntry.Using): No matter which warning
11453 level is set, check if this namespace name has already been added.
11455 2004-10-03 Ben Maurer <bmaurer@ximian.com>
11457 * expression.cs: reftype [!=]= null should always use br[true,false].
11460 2004-10-03 Marek Safar <marek.safar@seznam.cz>
11463 * attribute.cs: Enum conversion moved to
11464 GetAttributeArgumentExpression to be applied to the all
11467 2004-10-01 Raja R Harinath <rharinath@novell.com>
11469 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
11470 * class.c (TypeContainer.DefineType): Flag error if
11471 base types aren't accessible due to access permissions.
11472 * decl.cs (DeclSpace.ResolveType): Move logic to
11473 Expression.ResolveAsTypeTerminal.
11474 (DeclSpace.ResolveTypeExpr): Thin layer over
11475 Expression.ResolveAsTypeTerminal.
11476 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
11477 Refactor code into NestedAccess. Use it.
11478 (DeclSpace.NestedAccess): New.
11479 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
11480 argument to silence errors. Check access permissions.
11481 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
11482 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
11483 (Cast.DoResolve): Likewise.
11484 (New.DoResolve): Likewise.
11485 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
11486 (TypeOf.DoResolve): Likewise.
11488 * expression.cs (Invocation.BetterConversion): Return the Type of
11489 the better conversion. Implement section 14.4.2.3 more faithfully.
11490 (Invocation.BetterFunction): Make boolean. Make correspondence to
11491 section 14.4.2.2 explicit.
11492 (Invocation.OverloadResolve): Update.
11493 (Invocation): Remove is_base field.
11494 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
11495 (Invocation.Emit): Likewise.
11497 2004-09-27 Raja R Harinath <rharinath@novell.com>
11499 * README: Update to changes.
11501 2004-09-24 Marek Safar <marek.safar@seznam.cz>
11503 * cs-parser.jay: Reverted 642 warning fix.
11505 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11508 * decl.cs (FindMemberWithSameName): Indexer can have more than
11511 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11513 * expression.cs (LocalVariableReference.DoResolveLValue):
11514 Do not report warning 219 for out values.
11515 (EmptyExpression.Null): New member to avoid extra allocations.
11517 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11519 * cs-parser.jay: Fix wrong warning 642 report.
11521 * cs-tokenizer.cs (CheckNextToken): New helper;
11522 Inspect next character if is same as expected.
11524 2004-09-23 Martin Baulig <martin@ximian.com>
11526 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
11527 (Convert.ImplicitReferenceConversionExists): Likewise.
11529 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11531 * class.cs (Operator.Define): Add error 448 and 559 report.
11533 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11535 * class.cs (MemberBase.IsTypePermitted): New protected
11536 method for checking error CS0610.
11538 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11540 * class.cs (TypeContainer.HasExplicitLayout): New property
11541 Returns whether container has StructLayout attribute set Explicit.
11542 (FieldMember): New abstract class for consts and fields.
11543 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
11544 (Field): Reuse FieldMember.
11546 * const.cs (Const): Reuse FieldMember.
11548 * rootcontext.cs: EmitConstants call moved to class.
11550 2004-09-22 Martin Baulig <martin@ximian.com>
11552 Thanks to Peter Sestoft for this bug report.
11554 * expression.cs (Conditional): If both the `trueExpr' and the
11555 `falseExpr' is a NullLiteral, return a NullLiteral.
11557 2004-09-22 Martin Baulig <martin@ximian.com>
11559 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
11560 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
11561 for the "get_Current" call.
11563 2004-09-22 Martin Baulig <martin@ximian.com>
11565 Marek and me just fixed one of our oldest bugs: #28562 :-)
11567 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
11569 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
11570 we're an EnumConstant, just return that.
11571 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
11572 an EnumConstant. In this case, we need to use GetValueAsEnumType()
11573 to get the value which'll actually be written into the attribute.
11574 However, we have to use GetValue() to access the attribute's value
11577 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11579 * constant.cs (Constant.IsNegative): New abstract property
11582 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
11583 (StackAlloc.DoResolve): Reused IsNegative.
11585 2004-09-21 Martin Baulig <martin@ximian.com>
11587 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
11588 if we're used in an iterator, we may be called from different
11591 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
11592 we actually have an exception block.
11594 2004-09-20 John Luke <jluke@cfl.rr.com>
11596 * class.cs, cs-parser.jay: Improve the error report for 1520:
11597 report the actual line where the error happens, not where the
11598 class was declared.
11600 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
11601 Pass location information that was available elsewhere.
11603 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
11605 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
11606 runtime to delay sign assemblies.
11608 2004-09-19 Miguel de Icaza <miguel@ximian.com>
11610 * cs-parser.jay: Do not report the stack trace, this is barely
11613 2004-08-22 John Luke <john.luke@gmail.com>
11615 * driver.cs : check that a resource id is not already used
11616 before adding it, report CS1508 if it is, bug #63637
11618 2004-09-19 Miguel de Icaza <miguel@ximian.com>
11620 * ecore.cs: Removed dead code.
11622 2004-09-18 Marek Safar <marek.safar@seznam.cz>
11624 * class.cs: Do not report warning CS0067 on the interfaces.
11626 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11628 * cs-parser.jay: Add error 504 report.
11630 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11632 * rootcontext.cs: WarningLevel is 4 by default now.
11634 * statement.cs (Fixed.Resolve): Do not null
11637 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11640 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
11641 deep search when property is not virtual.
11642 (PropertyExpr.ResolveAccessors): Make one call for both
11645 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11648 * statement.cs: Error 152 report constains also location.
11650 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11653 * const.cs: Explicitly set constant as static.
11655 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11658 * cs-parser.jay: Add error 1017 report.
11660 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11662 Fixed bug #59980, #64224
11663 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
11665 * typemanager.cs (IsSpecialMethod): Simplified
11667 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11669 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
11670 condition with better params.
11672 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11675 * attribute.cs (Resolve): Property has to have both
11678 2004-09-14 Martin Baulig <martin@ximian.com>
11680 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
11682 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11685 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
11686 called and is obsolete then this member suppress message
11687 when call is inside next [Obsolete] method or type.
11689 * expression.cs: Use TestObsoleteMethodUsage member.
11691 2004-09-14 Martin Baulig <martin@ximian.com>
11693 * cs-parser.jay: Sync a bit with the GMCS version.
11695 2004-09-14 Martin Baulig <martin@ximian.com>
11697 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
11698 (CSharpParser.yacc_verbose_flag): New public field.
11700 * genericparser.cs: Removed.
11702 2004-09-14 Raja R Harinath <rharinath@novell.com>
11704 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
11706 2004-09-13 Marek Safar <marek.safar@seznam.cz>
11708 * class.cs (MethodCore.CheckBase): Fix bug #65757.
11710 2004-09-10 Martin Baulig <martin@ximian.com>
11712 Backported my MemberName changes from GMCS into MCS.
11714 - we are now using a special `MemberName' class instead of using
11715 strings; in GMCS, the `MemberName' also contains the type
11718 - changed the grammar rules a bit:
11719 * the old `member_name' is now a `namespace_or_type_name':
11720 The rule is that we use `namespace_or_type_name' everywhere
11721 where we expect either a "member name" (GetEnumerator) or a
11722 "member name" with an explicit interface name
11723 (IEnumerable.GetEnumerator).
11724 In GMCS, the explicit interface name may include type arguments
11725 (IEnumerable<T>.GetEnumerator).
11726 * we use `member_name' instead of just `IDENTIFIER' for
11728 The rule is that we use `member_name' wherever a member may
11729 have type parameters in GMCS.
11731 * decl.cs (MemberName): New public class.
11732 (MemberCore.MemberName): New public readonly field.
11733 (MemberCore.ctor): Take a `MemberName' argument, not a string.
11734 (DeclSpace): Likewise.
11736 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
11737 * enum.cs (Enum.ctor): Likewise.
11739 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
11741 (AliasEntry.ctor): Take a MemberName, not an Expression.
11742 (AliasEntry.UsingAlias): Likewise.
11744 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
11745 (IMethodData.MemberName): Changed type from string to MemberName.
11746 (MemberBase.ExplicitInterfaceName): Likewise.
11747 (AbstractPropertyEventMethod.SetupName): Make this private.
11748 (AbstractPropertyEventMethod.ctor): Added `string prefix'
11749 argument; compute the member name here.
11750 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
11751 on the `member.MemberName' and the `prefix'.
11753 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
11755 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
11756 thus, we get a `MemberName' instead of a `string'. These
11757 declarations may have type parameters in GMCS.
11758 (interface_method_declaration, delegate_declaration): Likewise.
11759 (class_declaration, interface_declaration): Likewise.
11760 (method_header): Use `namespace_or_type_name' instead of
11761 `member_name'. We may be an explicit interface implementation.
11762 (property_declaration, event_declaration): Likewise.
11763 (member_name): This is now just an `IDENTIFIER', not a
11764 `namespace_or_type_name'.
11765 (type_name, interface_type): Removed.
11766 (namespace_or_type_name): Return a MemberName, not an Expression.
11767 (primary_expression): Use `member_name' instead of `IDENTIFIER';
11768 call GetTypeExpression() on the MemberName to get an expression.
11769 (IndexerDeclaration.interface_type): Changed type from string to
11771 (MakeName): Operate on MemberName's instead of string's.
11773 2004-09-13 Raja R Harinath <rharinath@novell.com>
11776 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
11777 (NamespaceEntry.Lookup): Add new argument to flag if we want the
11778 lookup to avoid symbols introduced by 'using'.
11779 * rootcontext.cs (NamespaceLookup): Update.
11781 2004-09-12 Marek Safar <marek.safar@seznam.cz>
11783 * class.cs (TypeContainer.DoDefineMembers): Do not call
11784 DefineDefaultConstructor for static classes.
11786 2004-09-12 Marek Safar <marek.safar@seznam.cz>
11788 * attribute.cs (Attribute.Resolve): Add error 653 report.
11790 * class.cs (Class.ApplyAttributeBuilder): Add error 641
11792 (Method.ApplyAttributeBuilder): Add error 685 report.
11793 (Operator.Define): Add error 564 report.
11795 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
11797 * expression.cs (Invocation.DoResolve): Add error
11798 245 and 250 report.
11800 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
11803 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11805 * class.cs (ConstructorInitializer.Resolve):
11806 Wrong error number (515->516).
11808 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11810 * class.cs (Indexer.Define): Add error 631 report.
11812 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11814 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
11816 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11818 * expression.cs (Probe.DoResolve): Add error CS0241 report.
11820 2004-09-10 Marek Safar <marek.safar@seznam.cz>
11822 * cs-parser.jay: Added error CS0241 report.
11824 2004-09-10 Raja R Harinath <rharinath@novell.com>
11826 * cs-parser.jay (fixed_statement): Introduce a scope for the
11827 declaration in the 'fixed' statement.
11829 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11831 * cs-parser.jay: Added CS0230 error report.
11833 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11835 * cs-parser.jay: Added errors CS0231 and CS0257 report.
11837 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11839 * expression.cs (Argument.Resolve): Added error CS0192 and
11842 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11844 C# 2.0 #pragma warning feature
11846 * cs-tokenizer.cs (PreProcessPragma): New method;
11847 Handles #pragma directive.
11849 * report.cs (WarningRegions): New class; Support
11850 class for #pragma warning directive. It tests whether
11851 warning is enabled for a given line.
11853 2004-09-08 Miguel de Icaza <miguel@ximian.com>
11855 * const.cs: Add more descriptive error report, tahnks to
11858 2004-09-08 Marek Safar <marek.safar@seznam.cz>
11860 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
11862 2004-09-07 Miguel de Icaza <miguel@ximian.com>
11864 * expression.cs: Apply patch from Ben: Remove dead code from
11865 ArrayCreation, and remove the TurnintoConstant call in const.cs,
11866 as that code just threw an exception anwyays.
11868 * const.cs: Remove the call to the turnintoconstant, for details
11871 * literal.cs: The type of the null-literal is the null type; So
11872 we use a placeholder type (literal.cs:System.Null, defined here)
11875 * expression.cs (Conditional.DoResolve): Remove some old code that
11876 is no longer needed, conversions have been fixed.
11878 (ArrayCreationExpression.DoResolve): Return false if we fail to
11879 resolve the inner expression.
11881 2004-09-07 Raja R Harinath <rharinath@novell.com>
11884 * cs-parser.jay (delegate_declaration): Record a delegate
11885 declaration as a type declaration.
11886 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
11888 2004-09-06 Miguel de Icaza <miguel@ximian.com>
11890 * parameter.cs: Do not crash if the type can not be resolved.
11892 * expression.cs: Report errors with unsafe pointers, fixes #64896
11894 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
11896 * expression.cs: Pointer arith always needs to do a conv.i
11897 if the operand is a long. fix 65320
11899 2004-09-04 Marek Safar <marek.safar@seznam.cz>
11901 Fixed cs0619-37.cs, cs0619-38.cs
11903 * enum.cs (GetObsoleteAttribute): Removed.
11905 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
11906 on Enum member is double staged. The first is tested member
11909 2004-09-04 Marek Safar <marek.safar@seznam.cz>
11911 Fixed #56986, #63631, #65231
11913 * class.cs: (TypeContainer.AddToMemberContainer): New method,
11914 adds member to name container.
11915 (TypeContainer.AddToTypeContainer): New method, adds type to
11917 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
11918 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
11919 AddOperator): Simplified by reusing AddToMemberContainer.
11920 (TypeContainer.UserDefinedStaticConstructor): Changed to property
11922 (Method.CheckForDuplications): Fixed implementation to test all
11924 (MemberBase): Detection whether member is explicit interface
11925 implementation is now in constructor.
11926 (MemberBase.UpdateMemberName): Handles IndexerName.
11927 (Accessor): Changed to keep also location information.
11928 (AbstractPropertyEventMethod): Is derived from MemberCore.
11929 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
11930 will be emited or not.
11931 (PropertyBase.AreAccessorsDuplicateImplementation):
11932 Tests whether accessors are not in collision with some method.
11933 (Operator): Is derived from MethodCore to simplify common
11936 * decl.cs (Flags.TestMethodDuplication): Test for duplication
11938 (DeclSpace.AddToContainer): Adds the member to defined_names
11939 table. It tests for duplications and enclosing name conflicts.
11941 * enum.cs (EnumMember): Clean up to reuse the base structures
11943 2004-09-03 Martin Baulig <martin@ximian.com>
11945 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
11946 into TypeContainer, to make partial classes work again.
11948 2004-09-03 Martin Baulig <martin@ximian.com>
11950 * rootcontext.cs (RootContext.V2): Removed.
11952 2004-03-23 Martin Baulig <martin@ximian.com>
11954 * expression.cs (Invocation.OverloadResolve): Added `bool
11955 may_fail' argument and use it instead of the Location.IsNull() hack.
11957 2004-09-03 Martin Baulig <martin@ximian.com>
11959 Merged latest changes into gmcs. Please keep this comment in
11960 here, it makes it easier for me to see what changed in MCS since
11961 the last time I merged.
11963 2004-09-03 Raja R Harinath <rharinath@novell.com>
11966 * expression.cs (BetterConversion): Don't allow either conversion
11967 to be null. Remove redundant implicit conversion test when 'q ==
11968 null' -- when this function is invoked, we already know that the
11969 implicit conversion exists.
11970 (BetterFunction): Assume that 'best' is non-null. Remove
11971 redundant reimplementation of IsApplicable when 'best' is null.
11972 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
11973 number of arguments.
11974 (IsAncestralType): Extract from OverloadResolve.
11975 (OverloadResolve): Make robust to the MethodGroupExpr being
11976 unsorted. Implement all the logic of Section 14.5.5.1, and
11977 support overloading of methods from multiple applicable types.
11978 Clean up logic somewhat. Don't pass null methods to BetterFunction.
11980 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
11981 (RealError, Warning): Append type of report to related symbol.
11983 2004-09-03 Marek Safar <marek.safar@seznam.cz>
11985 * enum.cs: Fixed CLS-Compliance checks for enum members.
11986 Error tests cs3008-8.cs, cs3014-8.cs
11988 2004-09-02 Marek Safar <marek.safar@seznam.cz>
11990 Fixed bug #62342, #63102
11991 * class.cs: ImplementIndexer uses member.IsExplicitImpl
11992 like ImplementMethod.
11994 2004-09-02 Marek Safar <marek.safar@seznam.cz>
11996 * attribute.cs (Attribute.GetAttributeArgumentExpression):
11999 2004-09-02 Martin Baulig <martin@ximian.com>
12001 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
12002 TypeManager.GetArgumentTypes() rather than calling GetParameters()
12005 2004-09-01 Marek Safar <marek.safar@seznam.cz>
12007 C# 2.0 Static classes implemented
12009 * class.cs (TypeContainer): instance_constructors,
12010 initialized_fields, initialized_static_fields,
12011 default_constructor, base_inteface_types are protected to be
12012 accessible from StaticClass.
12013 (TypeContainer.DefineDefaultConstructor): New virtual method
12014 for custom default constructor generating
12015 (StaticClass): New class to handle "Static classes" feature.
12017 * cs-parser.jay: Handle static keyword on class like instance
12020 * driver.cs: Added "/langversion" command line switch with two
12021 options (iso-1, default).
12023 2004-08-31 Marek Safar <marek.safar@seznam.cz>
12025 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
12027 2004-08-31 Miguel de Icaza <miguel@ximian.com>
12029 * delegate.cs: Style.
12031 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
12033 * delegate.cs: Add seperate instance expr field for miguel.
12035 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
12037 * PointerArithmetic (Resolve): make sure we are not doing
12038 pointer arith on void*. Also, make sure we are resolved
12039 by not setting eclass until resolve.
12041 All callers: Make sure that PointerArithmetic gets resolved.
12043 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
12045 * ArrayCreation (LookupType): If the type does not resolve
12046 to an array, give an error.
12048 2004-08-27 Marek Safar <marek.safar@seznam.cz>
12050 * statement.cs (Try.Resolve): Fixed bug #64222
12052 2004-08-27 Martin Baulig <martin@ximian.com>
12055 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
12058 2004-08-26 Marek Safar <marek.safar@seznam.cz>
12060 * ecore.cs (Constantify): Get underlying type via
12061 System.Enum.GetUnderlyingType to avoid StackOverflow on the
12062 Windows in special cases.
12064 2004-08-26 Marek Safar <marek.safar@seznam.cz>
12066 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
12067 for obtaining also private methods.
12068 (GetRemoveMethod): Used GetRemoveMethod (true)
12069 for obtaining also private methods.
12071 2004-08-24 Martin Baulig <martin@ximian.com>
12073 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
12074 MethodAttributes.HideBySig for operators.
12076 2004-08-23 Martin Baulig <martin@ximian.com>
12078 Back to the old error reporting system :-)
12080 * report.cs (Message): Removed.
12081 (Report.MessageData, ErrorData, WarningData): Removed.
12082 (Report.Error, Warning): Back to the old system.
12084 2004-08-23 Martin Baulig <martin@ximian.com>
12086 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
12088 * class.cs (TypeContainer.ParentContainer): New public virtual
12089 method; replaces the explicit interface implementation.
12090 (ClassPart.ParentContainer): Override.
12092 2004-08-23 Martin Baulig <martin@ximian.com>
12094 * statement.cs (Switch): Added support for constant switches; see
12095 #59428 or test-285.cs.
12097 2004-08-22 Marek Safar <marek.safar@seznam.cz>
12100 * statement.cs (GetEnumeratorFilter): Removed useless
12101 logic because C# specs is strict. GetEnumerator must be
12104 2004-08-22 Martin Baulig <martin@ximian.com>
12106 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12107 a switch and may break, reset the barrier. Fixes #59867.
12109 2004-08-22 Marek Safar <marek.safar@seznam.cz>
12111 CLS-Compliance speed up (~5% for corlib)
12113 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
12114 New method. Tests container for CLS-Compliant names
12116 * class.cs (TypeContainer.VerifyClsName): New method.
12117 Checks whether container name is CLS Compliant.
12118 (Constructor): Implements IMethodData.
12120 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
12121 low-case table for CLS Compliance test.
12122 (MemberCache.VerifyClsParameterConflict): New method.
12123 Checks method parameters for CS3006 error.
12125 * enum.cs (EnumMember): Is derived from MemberCore.
12126 (Enum.VerifyClsName): Optimized for better performance.
12128 2004-08-06 Marek Safar <marek.safar@seznam.cz>
12130 * report.cs: Renamed Error_T to Error and changed all
12133 2004-08-06 Marek Safar <marek.safar@seznam.cz>
12135 * class.cs (TypeContainer.IndexerArrayList): New inner class
12136 container for indexers.
12137 (TypeContainer.DefaultIndexerName): New constant for default
12138 indexer name. Replaced all "Item" with this constant.
12139 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
12141 * typemanager.cs (TypeManager.default_member_ctor): Cache here
12142 DefaultMemberAttribute constructor.
12144 2004-08-05 Martin Baulig <martin@ximian.com>
12146 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12149 2004-08-05 Marek Safar <marek.safar@seznam.cz>
12151 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
12152 multi platforms problem.
12154 * compiler.csproj: Included shared files.
12156 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12158 Fix bug 60333, 55971 in the more general way
12159 * attribute.cs (Attribute.GetAttributeArgumentExpression):
12160 Added arg_type argument for constant conversion.
12161 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
12163 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12166 * class.cs (TypeContainer ): New inner classes MethodArrayList,
12167 OperatorArrayList, MethodCoreArrayList for typecontainer
12168 containers. Changed class member types to these new types.
12169 (MethodArrayList.DefineMembers): Added test for CS0659.
12171 2004-08-04 Miguel de Icaza <miguel@ximian.com>
12173 * cfold.cs: Synchronize the folding with the code in expression.cs
12174 Binary.DoNumericPromotions for uint operands.
12176 * attribute.cs: Revert patch from Raja, it introduced a regression
12177 while building Blam-1.2.1 (hard to isolate a test case).
12179 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12183 (TypeContainer.Define): Renamed to DefineContainerMembers because of
12185 (MethodCore.parent_method): New member. The method we're overriding
12186 if this is an override method.
12187 (MethodCore.CheckBase): Moved from Method class and made common.
12188 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
12190 (MethodCore.CheckForDuplications): New abstract method. For custom
12191 member duplication search in a container
12192 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
12193 method and its return type.
12194 (Event.conflict_symbol): New member. Symbol with same name in the
12198 (MemberCache.FindMemberWithSameName): New method. The method
12199 is looking for conflict with inherited symbols.
12201 2004-08-04 Martin Baulig <martin@ximian.com>
12203 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
12205 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
12207 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12209 * report.cs (Message): New enum for better error, warning reference in
12211 (MessageData): New inner abstract class. It generally handles printing of
12212 error and warning messages.
12213 Removed unused Error, Warning, Message methods.
12215 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12217 Fix for cs0592-8.cs test
12219 (Attributable.ValidAttributeTargets): Made public.
12220 (Attribute.ExplicitTarget): New member for explicit target value.
12221 (Attribute.CheckTargets): Now we translate explicit attribute
12222 target to Target here.
12224 2004-08-03 Ben Maurer <bmaurer@ximian.com>
12226 * ecore.cs (MethodGroupExpr): new IsBase property.
12228 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
12230 * delegate.cs (DelegateCreation): store a MethodGroupExpr
12231 rather than an instance expr.
12233 (DelegateCreation.Emit): Use the method group rather than
12234 the instance expression. Also, if you have base.Foo as the
12235 method for a delegate, make sure to emit ldftn, not ldftnvirt.
12237 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
12239 (NewDelegate.DoResolve): Only check for the existance of Invoke
12240 if the method is going to be needed. Use MethodGroupExpr.
12242 (NewDelegate.Emit): Remove, DelegateCreation implements this.
12244 * expression.cs: For pointer arith., make sure to use
12245 the size of the type, not the size of the pointer to
12248 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12251 * class.cs (Class): Added error CS0502 test.
12253 2004-08-03 John Luke <jluke@cfl.rr.com>
12254 Raja R Harinath <rharinath@novell.com>
12257 * attribute.cs (Attribute.complained_before): New flag.
12258 (Attribute.ResolveType, Attribute.Resolve),
12259 (Attribute.DefinePInvokeMethod): Set it.
12260 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
12262 2004-08-03 Martin Baulig <martin@ximian.com>
12264 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
12265 use a user-defined operator; we still need to do numeric
12266 promotions in case one argument is a builtin type and the other
12267 one has an implicit conversion to that type. Fixes #62322.
12269 2004-08-02 Martin Baulig <martin@ximian.com>
12271 * statement.cs (LocalInfo.Flags): Added `IsThis'.
12272 (LocalInfo.IsThis): New public property.
12273 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
12275 2004-08-01 Martin Baulig <martin@ximian.com>
12277 * class.cs (TypeContainer.GetClassBases): Don't set the default
12278 here since we may get called from GetPartialBases().
12279 (TypeContainer.DefineType): If GetClassBases() didn't return a
12280 parent, use the default one.
12282 2004-07-30 Duncan Mak <duncan@ximian.com>
12284 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
12286 2004-07-30 Martin Baulig <martin@ximian.com>
12288 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
12290 * class.cs (SourceMethod): New public class, derive from the
12291 symbol writer's ISourceMethod.
12292 (Method): Use the new symbol writer API.
12294 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
12295 as argument and use the new symbol writer.
12298 (SourceFile): Implement the symbol writer's ISourceFile.
12299 (Location.SymbolDocument): Removed.
12300 (Location.SourceFile): New public property.
12302 * symbolwriter.cs: Use the new symbol writer API.
12304 2004-07-30 Raja R Harinath <rharinath@novell.com>
12306 * Makefile (install-local): Remove. Functionality moved to
12309 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
12311 * Makefile: Install mcs.exe.config file together with mcs.exe.
12312 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
12313 correct runtime version.
12315 2004-07-25 Martin Baulig <martin@ximian.com>
12318 (TypeContainer.RegisterOrder): Removed, this was unused.
12319 (TypeContainer, interface_order): Removed.
12320 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
12321 TypeContainer as argument since we can also be called with a
12322 `PartialContainer' for a partial class/struct/interface.
12323 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
12324 of checking whether we're an `Interface' - we could be a
12325 `PartialContainer'.
12326 (PartialContainer.Register): Override; call
12327 AddClass()/AddStruct()/AddInterface() on our parent.
12329 * cs-parser.jay (interface_member_declaration): Add things to the
12330 `current_container', not the `current_class'.
12332 * rootcontext.cs (RegisterOrder): The overloaded version which
12333 takes an `Interface' was unused, removed.
12335 * typemanager.cs (TypeManager.LookupInterface): Return a
12336 `TypeContainer', not an `Interface'.
12337 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
12338 contain a `PartialContainer' for an interface, so check it's
12339 `Kind' to figure out what it is.
12341 2004-07-25 Martin Baulig <martin@ximian.com>
12343 * class.cs (Class.DefaultTypeAttributes): New public constant.
12344 (Struct.DefaultTypeAttributes): Likewise.
12345 (Interface.DefaultTypeAttributes): Likewise.
12346 (PartialContainer.TypeAttr): Override this and add the
12347 DefaultTypeAttributes.
12349 2004-07-25 Martin Baulig <martin@ximian.com>
12351 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
12352 we can just use the `Parent' field instead.
12354 2004-07-25 Martin Baulig <martin@ximian.com>
12356 * class.cs (TypeContainer.Emit): Renamed to EmitType().
12358 2004-07-25 Martin Baulig <martin@ximian.com>
12360 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
12361 our parts before defining any methods.
12362 (TypeContainer.VerifyImplements): Make this virtual.
12363 (ClassPart.VerifyImplements): Override and call VerifyImplements()
12364 on our PartialContainer.
12366 2004-07-25 Martin Baulig <martin@ximian.com>
12368 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
12370 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
12371 argument, we can just use the `Parent' field instead.
12374 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
12375 (MemberBase.DoDefine): Likewise.
12377 2004-07-24 Martin Baulig <martin@ximian.com>
12379 * decl.cs (MemberCore.Parent): New public field.
12380 (DeclSpace.Parent): Moved to MemberCore.
12382 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
12383 (MemberBase.ctor): Added TypeContainer argument, pass it to our
12385 (FieldBase, Field, Operator): Likewise.
12386 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
12387 (EventField, Event): Likewise.
12389 2004-07-23 Martin Baulig <martin@ximian.com>
12391 * class.cs (PartialContainer): New public class.
12392 (ClassPart): New public class.
12393 (TypeContainer): Added support for partial classes.
12394 (TypeContainer.GetClassBases): Splitted some of the functionality
12395 out into GetNormalBases() and GetPartialBases().
12397 * cs-tokenizer.cs (Token.PARTIAL): New token.
12398 (Tokenizer.consume_identifier): Added some hacks to recognize
12399 `partial', but only if it's immediately followed by `class',
12400 `struct' or `interface'.
12402 * cs-parser.jay: Added support for partial clases.
12404 2004-07-23 Martin Baulig <martin@ximian.com>
12406 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
12407 a `DeclSpace' and also made it readonly.
12408 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
12409 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
12410 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
12412 * cs-parser.jay: Pass the `current_class', not the
12413 `current_container' (at the moment, this is still the same thing)
12414 to a new Method, Property, Event, Indexer or Constructor.
12416 2004-07-23 Martin Baulig <martin@ximian.com>
12418 * cs-parser.jay (CSharpParser): Added a new `current_class' field
12419 and removed the `current_interface' one.
12420 (struct_declaration, class_declaration, interface_declaration):
12421 Set `current_class' to the newly created class/struct/interface;
12422 set their `Bases' and call Register() before parsing their body.
12424 2004-07-23 Martin Baulig <martin@ximian.com>
12426 * class.cs (Kind): New public enum.
12427 (TypeContainer): Made this class abstract.
12428 (TypeContainer.Kind): New public readonly field.
12429 (TypeContainer.CheckDef): New public method; moved here from
12431 (TypeContainer.Register): New public abstract method.
12432 (TypeContainer.GetPendingImplementations): New public abstract
12434 (TypeContainer.GetClassBases): Removed the `is_class' and
12435 `is_iface' parameters.
12436 (TypeContainer.DefineNestedTypes): Formerly known as
12438 (ClassOrStruct): Made this class abstract.
12440 * tree.cs (RootTypes): New public type.
12442 2004-07-20 Martin Baulig <martin@ximian.com>
12444 * tree.cs (Tree.RecordNamespace): Removed.
12445 (Tree.Namespaces): Removed.
12447 * rootcontext.cs (RootContext.IsNamespace): Removed.
12449 * cs-parser.jay (namespace_declaration): Just create a new
12450 NamespaceEntry here.
12452 2004-07-20 Martin Baulig <martin@ximian.com>
12454 * statement.cs (ExceptionStatement): New abstract class. This is
12455 now used as a base class for everyone who's using `finally'.
12456 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
12457 our local variables before using them.
12459 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
12460 virtual method. This is used by Yield.Resolve() to "steal" an
12461 outer block's `finally' clauses.
12462 (FlowBranchingException): The .ctor now takes an ExceptionStatement
12465 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
12466 version which takes an ExceptionStatement. This version must be
12467 used to create exception branchings.
12470 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
12471 (Iterator.EmitMoveNext): Added exception support; protect the
12472 block with a `fault' clause, properly handle 'finally' clauses.
12473 (Iterator.EmitDispose): Run all the `finally' clauses here.
12475 2004-07-20 Martin Baulig <martin@ximian.com>
12477 * iterator.cs: This is the first of a set of changes in the
12478 iterator code. Match the spec more closely: if we're an
12479 IEnumerable, then GetEnumerator() must be called. The first time
12480 GetEnumerator() is called, it returns the current instance; all
12481 subsequent invocations (if any) must create a copy.
12483 2004-07-19 Miguel de Icaza <miguel@ximian.com>
12485 * expression.cs: Resolve the constant expression before returning
12488 2004-07-19 Martin Baulig <martin@ximian.com>
12490 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
12491 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
12492 the return type of the new EmitContext.
12494 2004-07-18 Martin Baulig <martin@ximian.com>
12496 * class.cs (Property.Define): Fix iterators.
12498 * iterators.cs (Iterator.Define): Moved the
12499 `container.AddInterator (this)' call here from the .ctor; only do
12500 it if we resolved successfully.
12502 2004-07-17 Miguel de Icaza <miguel@ximian.com>
12504 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
12505 `true' for preprocessing directives that we parse. The return
12506 value indicates whether we should return to regular tokenizing or
12507 not, not whether it was parsed successfully.
12509 In the past if we were in: #if false ... #line #endif, we would
12510 resume parsing after `#line'. See bug 61604.
12512 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
12513 building: IsEnumType should return true only for enums, not for
12514 enums or System.Enum itself. This fixes #61593.
12516 Likely what happened is that corlib was wrong: mcs depended on
12517 this bug in some places. The bug got fixed, we had to add the
12518 hack, which caused bug 61593.
12520 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
12521 that was a workaround for the older conditions.
12523 2004-07-16 Ben Maurer <bmaurer@ximian.com>
12525 * assign.cs: IAssignMethod has a new interface, as documented
12526 inline. All assignment code now uses this new api.
12528 * ecore.cs, expression.cs: All classes which implement
12529 IAssignMethod now use the new interface.
12531 * expression.cs (Invocation): add a hack to EmitCall so that
12532 IndexerAccess can be the target of a compound assignment without
12533 evaluating its arguments twice.
12535 * statement.cs: Handle changes in Invocation api.
12537 2004-07-16 Martin Baulig <martin@ximian.com>
12539 * iterators.cs: Rewrote this. We're now using one single Proxy
12540 class for both the IEnumerable and the IEnumerator interface and
12541 `Iterator' derives from Class so we can use the high-level API.
12543 * class.cs (TypeContainer.AddIterator): New method.
12544 (TypeContainer.DoDefineType): New protected virtual method, which
12545 is called from DefineType().
12546 (TypeContainer.DoDefineMembers): Call DefineType() and
12547 DefineMembers() on all our iterators.
12548 (TypeContainer.Emit): Call Emit() on all our iterators.
12549 (TypeContainer.CloseType): Call CloseType() on all our iterators.
12551 * codegen.cs (EmitContext.CurrentIterator): New public field.
12553 2004-07-15 Martin Baulig <martin@ximian.com>
12556 (TypeManager.not_supported_exception_type): New type.
12558 2004-07-14 Martin Baulig <martin@ximian.com>
12560 * iterators.cs: Use real error numbers.
12562 2004-07-14 Martin Baulig <martin@ximian.com>
12564 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
12565 requires this to be a System.Collection.IEnumerable and not a
12566 class implementing that interface.
12567 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
12569 2004-07-13 Marek Safar <marek.safar@seznam.cz>
12571 * class.cs: Fixed previous fix, it broke some error tests.
12573 2004-07-12 Martin Baulig <martin@ximian.com>
12575 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
12578 2004-07-09 Miguel de Icaza <miguel@ximian.com>
12580 * assign.cs (LocalTemporary): Add new argument: is_address,If
12581 `is_address' is true, then the value that we store is the address
12582 to the real value, and not the value itself.
12584 * ecore.cs (PropertyExpr): use the new local temporary
12585 stuff to allow us to handle X.Y += z (where X is a struct)
12587 2004-07-08 Martin Baulig <martin@ximian.com>
12589 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
12590 not always return, just like we're doing in Using.Resolve().
12592 2004-07-07 Miguel de Icaza <miguel@ximian.com>
12594 * cs-parser.jay (fixed_statement): flag this as Pinned.
12596 2004-07-06 Miguel de Icaza <miguel@ximian.com>
12598 * typemanager.cs (TypeManager): Removed MakePinned method, this
12599 mechanism is replaced with the .NET 2.x compatible mechanism of
12600 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
12602 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
12603 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
12604 `IsFixed' property which has a different meaning.
12606 2004-07-02 Raja R Harinath <rharinath@novell.com>
12608 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
12609 visible from inside a nested class, not just the names of the
12610 immediately enclosing class.
12611 Fix for bug #60730.
12613 2004-06-24 Raja R Harinath <rharinath@novell.com>
12615 * expression.cs (BetterConversion): Remove buggy special-case
12616 handling of "implicit constant expression conversions". At this
12617 point, we already know that the conversion is possible -- we're
12618 only checking to see which is better.
12620 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12622 * cs-parser.jay: Added error CS0210 test.
12624 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12626 * cs-parser.jay: Added error CS0134 test.
12628 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12631 * cs-parser.jay: Added error CS0145 test.
12633 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12635 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
12637 2004-06-23 Ben Maurer <bmaurer@ximian.com>
12639 * expression.cs (StackAlloc.Resolve): The argument may not
12640 be a constant; deal with this case.
12642 2004-06-23 Marek Safar <marek.safar@seznam.cz>
12644 * attribute.cs (IndexerName_GetIndexerName): Renamed to
12645 GetIndexerAttributeValue.
12646 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
12648 * class.cs (Indexer.Define): Added error tests for CS0415,
12651 2004-06-23 Miguel de Icaza <miguel@ximian.com>
12653 * attribute.cs (Attribute.Resolve): Keep field code in sync with
12656 2004-06-23 Martin Baulig <martin@ximian.com>
12658 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
12659 neither return nor throw, reset the barrier as well. Fixes #60457.
12661 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
12663 * class.cs : EventAttributes is now set to None by default.
12664 This fixes bug #60459.
12666 2004-06-18 Marek Safar <marek.safar@seznam.cz>
12669 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12670 Don't throw exception but return null (it's sufficient now).
12672 2004-06-18 Marek Safar <marek.safar@seznam.cz>
12674 * typemanager.cs (GetArgumentTypes): Faster implementation.
12676 2004-06-18 Martin Baulig <martin@ximian.com>
12678 * attribute.cs (Attribute.Resolve): Check whether we're an
12679 EmptyCast which a Constant child. Fixes #60333.
12681 2004-06-17 Ben Maurer <bmaurer@ximian.com>
12683 * statement.cs (EmitCollectionForeach): Account for the fact that
12684 not all valuetypes are in areas which we can take the address of.
12685 For these variables, we store to a temporary variable. Also, make
12686 sure that we dont emit a `callvirt' on a valuetype method.
12688 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12690 * expression.cs (StackAlloc.DoReSolve): Added test for
12691 negative parameter (CS0247).
12693 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12696 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
12698 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12701 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
12704 2004-06-14 Marek Safar <marek.safar@seznam.cz>
12706 Fix bug #58254 & cs1555.cs, cs1556.cs
12707 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
12709 2004-06-14 Marek Safar <marek.safar@seznam.cz>
12711 * cs-parser.jay: Added error CS1669 test for indexers.
12713 2004-06-11 Martin Baulig <martin@ximian.com>
12715 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
12716 call this twice: for params and varargs methods.
12718 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12721 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
12723 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12725 * attribute.cs (Attribute.GetValidTargets): Made public.
12728 (AbstractPropertyEventMethod): New class for better code sharing.
12729 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
12731 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
12733 2004-06-11 Raja R Harinath <rharinath@novell.com>
12736 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
12737 that the call to Resolve is part of a MemberAccess.
12738 (Expression.Resolve): Use it for SimpleName resolution.
12739 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
12740 Add 'intermediate' boolean argument.
12741 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
12742 error message when the SimpleName can be resolved ambiguously
12743 between an expression and a type.
12744 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
12746 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
12747 call on the left-side.
12749 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12752 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
12754 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12756 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
12758 2004-06-11 Martin Baulig <martin@ximian.com>
12760 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
12761 varargs methods if applicable.
12763 2004-06-11 Martin Baulig <martin@ximian.com>
12765 * expression.cs (Invocation.EmitCall): Don't use
12766 `method.CallingConvention == CallingConventions.VarArgs' since the
12767 method could also have `CallingConventions.HasThis'.
12769 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12771 * class.cs (Event.GetSignatureForError): Implemented.
12772 Fixed crash in error test cs3010.cs
12774 2004-06-10 Miguel de Icaza <miguel@ximian.com>
12776 * cs-tokenizer.cs: Change the way we track __arglist to be
12777 consistent with the other keywords.
12779 2004-06-09 Miguel de Icaza <miguel@ximian.com>
12781 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
12784 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
12786 * codegen.cs: Check that all referenced assemblies have a strongname
12787 before strongnaming the compiled assembly. If not report error CS1577.
12788 Fix bug #56563. Patch by Jackson Harper.
12789 * typemanager.cs: Added a method to return all referenced assemblies.
12790 Fix bug #56563. Patch by Jackson Harper.
12792 2004-06-08 Marek Safar <marek.safar@seznam.cz>
12795 (Method.ApplyAttributeBuilder): Moved and added conditional
12796 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
12799 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
12801 2004-06-08 Marek Safar <marek.safar@seznam.cz>
12804 * class.cs: (EventField.attribute_targets): Changed default target.
12806 2004-06-08 Martin Baulig <martin@ximian.com>
12808 * expression.cs (Invocation.EmitCall): Enable varargs methods.
12810 2004-06-08 Martin Baulig <martin@ximian.com>
12812 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
12814 2004-06-07 Martin Baulig <martin@ximian.com>
12816 Added support for varargs methods.
12818 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
12821 * cs-parser.jay: Added support for `__arglist'.
12823 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
12825 * expression.cs (Argument.AType): Added `ArgList'.
12826 (Invocation): Added support for varargs methods.
12827 (ArglistAccess): New public class.
12828 (Arglist): New public class.
12830 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
12832 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
12833 a method's top-level block if the method has varargs.
12835 * support.cs (ReflectionParameters, InternalParameters): Added
12836 support for varargs methods.
12838 2004-06-07 Miguel de Icaza <miguel@ximian.com>
12840 * class.cs: Provide location in indexer error report.
12842 * driver.cs: Use standard names.
12844 * namespace.cs: Catch the use of using after a namespace has been
12845 declared also on using aliases.
12847 2004-06-03 Raja R Harinath <rharinath@novell.com>
12850 * typemanager.cs (closure_private_ok, closure_invocation_type)
12851 (closure_qualifier_type, closure_invocation_assembly)
12852 (FilterWithClosure): Move to ...
12853 (Closure): New internal nested class.
12854 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
12855 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
12856 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
12857 (MemberLookup, MemberLookupFailed): Use it.
12858 * expression.cs (New.DoResolve): Treat the lookup for the
12859 constructor as being qualified by the 'new'ed type.
12860 (Indexers.GetIndexersForTypeOrInterface): Update.
12862 2004-06-03 Marek Safar <marek.safar@seznam.cz>
12865 (GetConditionalAttributeValue): New method. Returns
12866 condition of ConditionalAttribute.
12867 (SearchMulti): New method. Returns all attributes of type 't'.
12868 Use it when attribute is AllowMultiple = true.
12869 (IsConditionalMethodExcluded): New method.
12872 (Method.IsExcluded): Implemented. Returns true if method has conditional
12873 attribute and the conditions is not defined (method is excluded).
12874 (IMethodData): Extended interface for ConditionalAttribute support.
12875 (PropertyMethod.IsExcluded): Implemented.
12878 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
12881 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
12884 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
12886 * expression.cs (ArrayCreationExpression): Make this just an
12887 `expression'. It can't be a statement, so the code here was
12890 2004-06-02 Marek Safar <marek.safar@seznam.cz>
12893 * typemanager.cs (GetFullNameSignature): New method for
12896 2004-06-02 Marek Safar <marek.safar@seznam.cz>
12899 * class.cs (MemberBase.GetSignatureForError): New virtual method.
12900 Use this method when MethodBuilder is null.
12901 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
12902 Added test for error CS0626 (MONO reports error for this situation).
12903 (IMethodData.GetSignatureForError): Extended interface.
12905 2004-06-01 Marek Safar <marek.safar@seznam.cz>
12908 (AttributeTester.GetObsoleteAttribute): Returns instance of
12909 ObsoleteAttribute when type is obsolete.
12912 (TypeContainer.VerifyObsoleteAttribute): Override.
12913 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
12914 (MethodCode.VerifyObsoleteAttribute): Override.
12915 (MemberBase.VerifyObsoleteAttribute): Override.
12918 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
12919 and report proper error.
12922 Delegate.VerifyObsoleteAttribute): Override.
12925 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
12926 and report proper error.
12927 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
12930 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
12934 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
12935 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
12936 Added test for ObsoleteAttribute.
12939 (Catch): Derived from Statement.
12941 2004-06-01 Marek Safar <marek.safar@seznam.cz>
12943 Fixed bug #59071 & cs0160.cs
12945 * statement.cs (Try.Resolve): Check here whether order of catch
12946 clauses matches their dependencies.
12948 2004-05-31 Miguel de Icaza <miguel@ximian.com>
12950 * Reverted patch to namespace.cs (Use lookuptypedirect). This
12951 caused a regression: #59343. Referencing nested classes from an
12952 assembly stopped working.
12954 2004-05-31 Martin Baulig <martin@ximian.com>
12956 MCS is now frozen for beta 2.
12958 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
12960 * convert.cs: add a trivial cache for overload operator resolution.
12962 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
12964 * decl.cs: If possible, use lookuptypedirect here. We can only do
12965 this if there is no `.' after the namespace. Avoids using
12966 LookupType, which does lots of slow processing.
12967 (FindNestedType) New method, does what it says :-).
12968 * namespace.cs: use LookupTypeDirect.
12969 * rootcontext.cs: use membercache, if possible.
12970 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
12972 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
12975 According to the spec,
12977 In a member access of the form E.I, if E is a single identifier,
12978 and if the meaning of E as a simple-name (§7.5.2) is a constant,
12979 field, property, localvariable, or parameter with the same type as
12980 the meaning of E as a type-name (§3.8), then both possible
12981 meanings of E are permitted.
12983 We did not check that E as a simple-name had the same type as E as
12986 This trivial check gives us 5-7% on bootstrap time.
12988 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
12990 * expression.cs (Invocation.OverloadResolve): Avoid the
12991 use of hashtables and boxing here by allocating on demand.
12993 2004-05-30 Martin Baulig <martin@ximian.com>
12995 * rootcontext.cs (RootContext.LookupType): Don't cache things if
12996 we're doing a silent lookup. Don't try to lookup nested types in
12997 TypeManager.object_type (thanks to Ben Maurer).
12999 2004-05-30 Martin Baulig <martin@ximian.com>
13001 Committing a patch from Ben Maurer.
13003 * rootcontext.cs (RootContext.LookupType): Cache negative results.
13005 2004-05-29 Martin Baulig <martin@ximian.com>
13007 * class.cs (IMethodData.ShouldIgnore): New method.
13009 * typemanager.cs (TypeManager.MethodFlags): Don't take a
13010 `Location' argument, we don't need it anywhere. Use
13011 `IMethodData.ShouldIgnore ()' instead of
13012 `MethodData.GetMethodFlags ()'.
13013 (TypeManager.AddMethod): Removed.
13014 (TypeManager.AddMethod2): Renamed to AddMethod.
13016 2004-05-29 Martin Baulig <martin@ximian.com>
13018 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
13020 * convert.cs (Convert.ImplicitReferenceConversion): If we're
13021 converting from a class type S to an interface type and we already
13022 have an object on the stack, don't box it again. Fixes #52578.
13024 2004-05-29 Martin Baulig <martin@ximian.com>
13026 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
13027 Added support for `params' parameters. Fixes #59267.
13029 2004-05-29 Martin Baulig <martin@ximian.com>
13031 * literal.cs (NullPointer): Provide a private .ctor which sets
13032 `type' to TypeManager.object_type. Fixes #59048.
13034 2004-05-29 Martin Baulig <martin@ximian.com>
13036 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
13037 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
13039 * ecore.cs (EventExpr.instance_expr): Make the field private.
13041 2004-05-26 Marek Safar <marek.safar@seznam.cz>
13043 Fixed bug #50080 & cs0214-2.cs
13044 * expression.cs (Cast.DoResolve): Check unsafe context here.
13046 * statement.cs (Resolve.DoResolve): Likewise.
13048 2004-05-26 Martin Baulig <martin@ximian.com>
13050 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
13052 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
13053 (RootContext.LookupType): Pass down the `silent' flag.
13055 2004-05-25 Martin Baulig <martin@ximian.com>
13058 (MethodGroupExpr.IdenticalTypeName): New public property.
13059 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
13060 expression actually refers to a type.
13062 2004-05-25 Martin Baulig <martin@ximian.com>
13064 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
13065 for #56176 and made it actually work.
13067 2004-05-25 Martin Baulig <martin@ximian.com>
13069 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
13070 (FieldExpr, PropertyExpr): Override and implement
13071 CacheTemporaries. Fixes #52279.
13073 2004-05-25 Miguel de Icaza <miguel@ximian.com>
13075 * location.cs: In the new compiler listing a file twice is a
13076 warning, not an error.
13078 2004-05-24 Martin Baulig <martin@ximian.com>
13080 * enum.cs (Enum.DefineType): For the `BaseType' to be a
13081 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
13083 2004-05-24 Martin Baulig <martin@ximian.com>
13085 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
13086 walking the `using' list. Fixes #53921.
13088 2004-05-24 Martin Baulig <martin@ximian.com>
13090 * const.cs (Const.LookupConstantValue): Added support for
13091 EmptyCast's; fixes #55251.
13093 2004-05-24 Martin Baulig <martin@ximian.com>
13095 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
13096 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
13097 which does the CS0135 check. The reason is that we first need to
13098 check whether the variable actually exists.
13100 2004-05-24 Martin Baulig <martin@ximian.com>
13102 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
13103 than RootContext.LookupType() to find the explicit interface
13104 type. Fixes #58584.
13106 2004-05-24 Raja R Harinath <rharinath@novell.com>
13108 * Makefile: Simplify. Use executable.make.
13109 * mcs.exe.sources: New file. List of sources of mcs.exe.
13111 2004-05-24 Anders Carlsson <andersca@gnome.org>
13115 Use the invariant culture when doing String.Compare for CLS case
13118 2004-05-23 Martin Baulig <martin@ximian.com>
13120 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
13121 don't have any dots. Fixes #52622, added cs0246-8.cs.
13123 * namespace.cs (NamespaceEntry.Lookup): Likewise.
13125 2004-05-23 Marek Safar <marek.safar@seznam.cz>
13127 * class.cs (MemberBase.Define): Reuse MemberType member for
13128 resolved type. Other methods can use it too.
13130 2004-05-23 Martin Baulig <martin@ximian.com>
13132 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
13133 the variable also exists in the current block (otherwise, we need
13134 to report a CS0103). Fixes #58670.
13136 2004-05-23 Martin Baulig <martin@ximian.com>
13138 * flowanalysis.cs (Reachability.Reachable): Compute this
13139 on-the-fly rather than storing it as a field.
13141 2004-05-23 Martin Baulig <martin@ximian.com>
13143 * flowanalysis.cs (Reachability.And): Manually compute the
13144 resulting `barrier' from the reachability.
13146 2004-05-23 Marek Safar <marek.safar@seznam.cz>
13149 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
13150 instance of ObsoleteAttribute when symbol is obsolete.
13153 (IMethodData): Extended interface for ObsoleteAttribute support.
13155 2004-05-22 Marek Safar <marek.safar@seznam.cz>
13157 * attribute.cs: Fix bug #55970
13159 2004-05-22 Marek Safar <marek.safar@seznam.cz>
13163 (GetObsoleteAttribute): New method. Creates the instance of
13165 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
13166 ObsoleteAttribute when member is obsolete.
13167 (AttributeTester.Report_ObsoleteMessage): Common method for
13168 Obsolete error/warning reporting.
13171 (TypeContainer.base_classs_type): New member for storing parent type.
13174 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
13175 for this MemberCore.
13177 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13179 * attribute.cs, const.cs: Fix bug #58590
13181 2004-05-21 Martin Baulig <martin@ximian.com>
13183 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
13184 out parameters if the end of the method is unreachable. Fixes
13187 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13189 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
13190 Hari was right, why extra method.
13192 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13194 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
13196 2004-05-20 Martin Baulig <martin@ximian.com>
13198 Merged this back from gmcs to keep the differences to a minumum.
13200 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
13201 instead of a Declspace.
13202 (Attribute.ResolveType): Likewise.
13203 (Attributes.Search): Likewise.
13204 (Attributes.Contains): Likewise.
13205 (Attributes.GetClsCompliantAttribute): Likewise.
13207 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
13209 (MethodData.ApplyAttributes): Take an EmitContext instead of a
13212 2004-05-19 Marek Safar <marek.safar@seznam.cz>
13214 Fix bug #58688 (MCS does not report error when the same attribute
13217 * attribute.cs (Attribute.Emit): Distinction between null and default.
13219 2004-05-19 Raja R Harinath <rharinath@novell.com>
13221 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
13222 of a top-level attribute without an attribute target.
13223 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
13225 (Attribute.Conditional_GetConditionName),
13226 (Attribute.Obsolete_GetObsoleteMessage): Update.
13227 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
13228 part of ScanForIndexerName.
13229 (Attribute.CanIgnoreInvalidAttribute): New function.
13230 (Attribute.ScanForIndexerName): Move to ...
13231 (Attributes.ScanForIndexerName): ... here.
13232 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
13233 (Attributes.Search): New internal variant that can choose not to
13234 complain if types aren't resolved. The original signature now
13236 (Attributes.GetClsCompliantAttribute): Use internal variant, with
13237 complaints suppressed.
13238 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
13239 only if it not useful.
13240 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
13241 top-level for attributes that are shared between the assembly
13242 and a top-level class.
13243 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
13244 * class.cs: Update to reflect changes.
13245 (DefineIndexers): Fuse loops.
13246 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
13247 a couple more variants of attribute names.
13249 2004-05-18 Marek Safar <marek.safar@seznam.cz>
13251 Fix bug #52585 (Implemented explicit attribute declaration)
13254 (Attributable.ValidAttributeTargets): New abstract method. It gets
13255 list of valid attribute targets for explicit target declaration.
13256 (Attribute.Target): It holds target itself.
13257 (AttributeSection): Removed.
13258 (Attribute.CheckTargets): New method. It checks whether attribute
13259 target is valid for the current element.
13262 (EventProperty): New class. For events that are declared like
13263 property (with add and remove accessors).
13264 (EventField): New class. For events that are declared like field.
13267 * cs-parser.jay: Implemented explicit attribute target declaration.
13269 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
13270 Override ValidAttributeTargets.
13273 (ReturnParameter): Class for applying custom attributes on
13275 (ParameterAtribute): New class. Class for applying custom
13276 attributes on the parameter type.
13278 2004-05-17 Miguel de Icaza <miguel@ximian.com>
13280 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
13283 (Method): Allow UNSAFE here.
13285 * modifiers.cs: Support unsafe reporting.
13287 2004-05-17 Marek Safar <marek.safar@seznam.cz>
13289 * decl.cs: Fix bug #58478.
13291 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13293 * statement.cs: When checking for unreachable code on an EmptyStatement,
13294 set the location. Fixes bug #58488.
13296 2004-05-13 Miguel de Icaza <miguel@ximian.com>
13298 * driver.cs: Add -pkg handling.
13300 From Gonzalo: UseShelLExecute=false
13302 2004-05-12 Marek Safar <marek.safar@seznam.cz>
13305 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
13307 (Attribute.IsClsCompliaceRequired): Moved to base for better
13309 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
13310 when attribute is AttributeUsageAttribute.
13311 (Attribute.GetValidTargets): Simplified.
13312 (Attribute.GetAttributeUsage): New method returns AttributeUsage
13313 attribute for this type.
13314 (Attribute.ApplyAttributes): Method renamed to Emit and make
13316 (GlobalAttributeSection): New class for special handling of global
13317 attributes (assembly, module).
13318 (AttributeSection.Emit): New method.
13320 * class.cs: Implemented Attributable abstract methods.
13321 (MethodCore.LabelParameters): Moved to Parameter class.
13322 (Accessor): Is back simple class.
13323 (PropertyMethod): Implemented Attributable abstract class.
13324 (DelegateMethod): Implemented Attributable abstract class.
13325 (Event): New constructor for disctintion between normal Event
13326 and Event with accessors.
13328 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
13330 * codegen.cs, const.cs, decl.cs, delegate.cs:
13331 (CommonAssemblyModulClass): Implemented Attributable abstract class
13334 * enum.cs: Implement IAttributeSupport interface.
13335 (EnumMember): New class for emum members. Implemented Attributable
13339 (ParameterBase): Is abstract.
13340 (ReturnParameter): New class for easier [return:] attribute handling.
13342 * typemanager.cs: Removed builder_to_attr.
13344 2004-05-11 Raja R Harinath <rharinath@novell.com>
13347 * attribute.cs (Attribute.GetPositionalValue): New function.
13348 * class.cs (TypeContainer.VerifyMembers): New function.
13349 (TypeContainer.Emit): Use it.
13350 (ClassOrStruct): New base class for Class and Struct.
13351 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
13352 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
13354 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
13355 then each non-static field should have a FieldOffset attribute.
13356 Otherwise, none of the fields should have a FieldOffset attribute.
13357 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
13358 and FieldOffset attributes.
13359 * typemanager.cs (TypeManager.struct_layout_attribute_type)
13360 (TypeManager.field_offset_attribute_type): New core types.
13361 (TypeManager.InitCoreTypes): Initialize them.
13363 2004-05-11 Michal Moskal <malekith@pld-linux.org>
13365 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
13366 Return correct type.
13369 2004-05-09 Miguel de Icaza <miguel@ximian.com>
13371 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
13372 be implicitly converted to ulong.
13374 * expression.cs: The logic for allowing operator &, | and ^ worked
13375 was wrong, it worked before because we did not report an error in
13376 an else branch. Fixes 57895.
13378 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
13379 allow volatile fields to be reference types.
13381 2004-05-07 Miguel de Icaza <miguel@ximian.com>
13383 * driver.cs: Add support for /debug-
13385 2004-05-07 Raja R Harinath <rharinath@novell.com>
13387 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
13388 Add a 'complain' parameter to silence errors.
13389 (Attribute.Resolve): Update to changes. Put in sanity check to catch
13390 silently overlooked type-resolutions.
13391 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
13392 to reflect changes.
13393 (Attributes.Search): New function.
13394 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
13395 (Attributes.GetAttributeFullName): Remove hack.
13396 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
13397 Update to reflect changes.
13398 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13399 Use Attributes.Search instead of nested loops.
13401 2004-05-07 Marek Safar <marek.safar@seznam.cz>
13404 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
13405 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
13406 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
13408 * report.cs: (Report.Warning): Renamed to Warning_T because of
13409 parameter collision.
13411 2004-05-05 Raja R Harinath <rharinath@novell.com>
13413 * expression.cs (MemberAccess.ResolveMemberAccess):
13414 Exit with non-zero status after Report.Error.
13415 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
13417 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
13419 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
13421 * support.cs: Don't hang when the file is empty.
13423 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
13425 * support.cs: In SeekableStreamReader, compute the preamble size of the
13426 underlying stream. Position changes should take into account that initial
13429 2004-05-03 Todd Berman <tberman@sevenl.net>
13431 * driver.cs: remove unused GetSysVersion function.
13433 2004-05-03 Todd Berman <tberman@sevenl.net>
13435 * driver.cs: Remove the hack from saturday, as well as the hack
13436 from jackson (LoadAssemblyFromGac), also adds the CWD to the
13437 link_paths to get that bit proper.
13439 2004-05-01 Todd Berman <tberman@sevenl.net>
13441 * driver.cs: Try a LoadFrom before a Load, this checks the current
13442 path. This is currently a bug in mono that is be fixed, however, this
13443 provides a workaround for now. This will be removed when the bug
13446 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
13448 * CryptoConvert.cs: Updated to latest version. Fix issue with
13449 incomplete key pairs (#57941).
13451 2004-05-01 Todd Berman <tberman@sevenl.net>
13453 * driver.cs: Remove '.' from path_chars, now System.* loads properly
13456 2004-04-30 Jackson Harper <jackson@ximian.com>
13458 * codegen.cs: Open keys readonly.
13460 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13462 * typemanager.cs: don't report cyclic struct layout when a struct
13463 contains 2 or more fields of the same type. Failed for Pango.AttrShape
13464 which has 2 Pango.Rectangle fields.
13466 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
13468 * expression.cs: Handle IntPtr comparisons with IL code
13469 rather than a method call.
13471 2004-04-29 Martin Baulig <martin@ximian.com>
13473 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
13474 the list of PropertyInfo's in class hierarchy and find the
13475 accessor. Fixes #56013.
13477 2004-04-29 Martin Baulig <martin@ximian.com>
13479 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
13481 2004-04-29 Martin Baulig <martin@ximian.com>
13483 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13485 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
13487 2004-04-29 Martin Baulig <martin@ximian.com>
13489 * class.cs (ConstructorInitializer.Resolve): Check whether the
13490 parent .ctor is accessible. Fixes #52146.
13492 2004-04-29 Martin Baulig <martin@ximian.com>
13494 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13496 * statement.cs (Using.EmitLocalVariableDecls): Use
13497 TypeManager.idisposable_type, not typeof (IDisposable).
13498 (Foreach.EmitCollectionForeach): Added support for valuetypes.
13500 2004-04-29 Martin Baulig <martin@ximian.com>
13502 * class.cs (Event.Define): Don't emit the field and don't set
13503 RTSpecialName and SpecialName for events on interfaces. Fixes
13506 2004-04-29 Raja R Harinath <rharinath@novell.com>
13508 Refactor Attribute.ApplyAttributes.
13509 * attribute.cs (Attributable): New base class for objects that can
13510 have Attributes applied on them.
13511 (Attribute): Make AttributeUsage fields public.
13512 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
13513 (Attribute.IsInternalCall): New property.
13514 (Attribute.UsageAttr): Convert to a public read-only property.
13515 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
13516 (Attribute.ResolveType, Attribute.Resolve)
13517 (Attribute.ScanForIndexerName): Update to reflect changes.
13518 (Attribute.CheckAttributeTarget): Re-format.
13519 (Attribute.ApplyAttributes): Refactor, to various
13520 Attributable.ApplyAttributeBuilder methods.
13521 * decl.cs (MemberCore): Make Attributable.
13522 * class.cs (Accessor): Make Attributable.
13523 (MethodData.ApplyAttributes): Use proper attribute types, not
13525 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
13526 (TypeContainer.ApplyAttributeBuilder)
13527 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
13528 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
13529 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
13530 (Operator.ApplyAttributeBuilder): New factored-out methods.
13531 * const.cs (Const.ApplyAttributeBuilder): Likewise.
13532 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
13533 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
13534 * parameter.cs (ParameterBase): New Attributable base class
13535 that can also represent Return types.
13536 (Parameter): Update to the changes.
13538 2004-04-29 Jackson Harper <jackson@ximian.com>
13540 * driver.cs: Prefer the corlib system version when looking for
13541 assemblies in the GAC. This is still a hack, but its a better hack
13544 2004-04-29 Marek Safar <marek.safar@seznam.cz>
13546 * decl.cs, enum.cs: Improved error 3005 reporting.
13548 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
13549 (related_symbols): New private member for list of symbols
13550 related to reported error/warning.
13552 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
13554 2004-04-29 Martin Baulig <martin@ximian.com>
13556 * ecore.cs (Expression.Constantify): If we're an enum and
13557 TypeManager.TypeToCoreType() doesn't give us another type, use
13558 t.UnderlyingSystemType. Fixes #56178.
13560 2004-04-29 Martin Baulig <martin@ximian.com>
13562 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
13563 interfaces and for each interface, only add members directly
13564 declared in that interface. Fixes #53255.
13566 2004-04-28 Martin Baulig <martin@ximian.com>
13568 * expression.cs (ConditionalLogicalOperator): Use a temporary
13569 variable for `left' to avoid that we evaluate it more than once;
13572 2004-04-28 Martin Baulig <martin@ximian.com>
13574 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
13577 2004-04-28 Martin Baulig <martin@ximian.com>
13579 * statement.cs (LocalInfo.Resolve): Check whether the type is not
13582 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
13583 whether the type is not void (CS1547).
13585 2004-04-28 Martin Baulig <martin@ximian.com>
13587 * expression.cs (Unary.DoResolveLValue): Override this and report
13588 CS0131 for anything but Operator.Indirection.
13590 2004-04-28 Martin Baulig <martin@ximian.com>
13592 Committing a patch from Ben Maurer; see bug #50820.
13594 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13597 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13600 2004-04-28 Martin Baulig <martin@ximian.com>
13602 Committing a patch from Ben Maurer; see bug #50820.
13604 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13607 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13610 2004-04-28 Martin Baulig <martin@ximian.com>
13612 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
13613 (Block.AddLabel): Call DoLookupLabel() to only search in the
13616 2004-04-28 Martin Baulig <martin@ximian.com>
13618 * cfold.cs (ConstantFold.BinaryFold): Added special support for
13619 comparing StringConstants and NullLiterals in Equality and Inequality.
13621 2004-04-28 Jackson Harper <jackson@ximian.com>
13623 * driver.cs: Attempt to load referenced assemblies from the
13624 GAC. This is the quick and dirty version of this method that
13625 doesnt take into account versions and just takes the first
13626 canidate found. Will be good enough for now as we will not have more
13627 then one version installed into the GAC until I update this method.
13629 2004-04-28 Martin Baulig <martin@ximian.com>
13631 * typemanager.cs (TypeManager.CheckStructCycles): New public
13632 static method to check for cycles in the struct layout.
13634 * rootcontext.cs (RootContext.PopulateTypes): Call
13635 TypeManager.CheckStructCycles() for each TypeContainer.
13636 [Note: We only need to visit each type once.]
13638 2004-04-28 Martin Baulig <martin@ximian.com>
13640 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
13642 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
13643 success and added `out object value'. Use a `bool resolved' field
13644 to check whether we've already been called rather than
13645 `ConstantValue != null' since this breaks for NullLiterals.
13647 2004-04-28 Raja R Harinath <rharinath@novell.com>
13649 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
13650 setting of this flag, since the 'set' method may be non-public.
13652 2004-04-28 Raja R Harinath <rharinath@novell.com>
13654 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
13655 check on current_vector.Block.
13657 2004-04-27 Martin Baulig <martin@ximian.com>
13659 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
13660 a field initializer. Fixes #56459.
13662 2004-04-27 Martin Baulig <martin@ximian.com>
13664 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
13665 we're not attempting to use an indexer. Fixes #52154.
13667 2004-04-27 Martin Baulig <martin@ximian.com>
13669 * statement.cs (Return): Don't create a return label if we don't
13670 need it; reverts my change from January 20th. Thanks to Ben
13673 2004-04-27 Martin Baulig <martin@ximian.com>
13675 According to the spec, `goto' can only leave a nested scope, but
13678 * statement.cs (Block.LookupLabel): Only lookup in the current
13679 block, don't recurse into parent or child blocks.
13680 (Block.AddLabel): Check in parent and child blocks, report
13681 CS0140/CS0158 if we find a duplicate.
13682 (Block): Removed this indexer for label lookups.
13683 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
13684 this already does the error reporting for us.
13687 (FlowBranching.UsageVector.Block): New public variable; may be null.
13688 (FlowBranching.CreateSibling): Added `Block' argument.
13689 (FlowBranching.LookupLabel): New public virtual method. Lookup a
13690 label for the target of a `goto' and check whether we're not
13691 leaving a `finally'.
13693 2004-04-27 Martin Baulig <martin@ximian.com>
13695 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13696 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
13699 2004-04-27 Martin Baulig <martin@ximian.com>
13701 * statement.cs (Block.AddLabel): Also check for implicit blocks
13702 and added a CS0158 check.
13704 2004-04-27 Martin Baulig <martin@ximian.com>
13706 * flowanalysis.cs (FlowBranchingLoop): New class.
13707 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
13708 UsageVector's instead of an ArrayList.
13709 (FlowBranching.Label): Likewise.
13710 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
13711 (FlowBranching.AddBreakVector): New method.
13713 2004-04-27 Miguel de Icaza <miguel@ximian.com>
13715 * attribute.cs: Small regression fix: only convert the type if we
13716 the type is different, fixes System.Drawing build.
13718 2004-04-27 Martin Baulig <martin@ximian.com>
13720 * attribute.cs (Attribute.Resolve): If we have a constant value
13721 for a named field or property, implicity convert it to the correct
13724 2004-04-27 Raja R Harinath <rharinath@novell.com>
13726 * statement.cs (Block.Block): Implicit blocks share
13727 'child_variable_names' fields with parent blocks.
13728 (Block.AddChildVariableNames): Remove.
13729 (Block.AddVariable): Mark variable as "used by a child block" in
13730 every surrounding block.
13731 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
13732 been used in a child block, complain about violation of "Invariant
13733 meaning in blocks" rule.
13734 * cs-parser.jay (declare_local_variables): Don't use
13735 AddChildVariableNames.
13736 (foreach_statement): Don't create an implicit block: 'foreach'
13737 introduces a scope.
13739 2004-04-23 Miguel de Icaza <miguel@ximian.com>
13741 * convert.cs (ImplicitNumericConversion): 0 is also positive when
13742 converting from 0L to ulong. Fixes 57522.
13744 2004-04-22 Marek Safar <marek.safar@seznam.cz>
13746 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
13747 derived class hides via 'new' keyword field from base class (test-242.cs).
13748 TODO: Handle this in the more general way.
13750 * class.cs (CheckBase): Ditto.
13752 2004-04-22 Marek Safar <marek.safar@seznam.cz>
13754 * decl.cs (caching_flags): New member for storing cached values
13756 (MemberCore.Flags): New enum where bit flags for caching_flags
13758 (MemberCore.cls_compliance): Moved to caching_flags.
13759 (DeclSpace.Created): Moved to caching_flags.
13761 * class.cs: Use caching_flags instead of DeclSpace.Created
13763 2004-04-21 Miguel de Icaza <miguel@ximian.com>
13765 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
13766 if we are only a derived class, not a nested class.
13768 * typemanager.cs: Same as above, but do this at the MemberLookup
13769 level (used by field and methods, properties are handled in
13770 PropertyExpr). Allow for the qualified access if we are a nested
13773 2004-04-21 Marek Safar <marek.safar@seznam.cz>
13775 * class.cs: Refactoring.
13776 (IMethodData): New inteface; Holds links to parent members
13777 to avoid member duplication (reduced memory allocation).
13778 (Method): Implemented IMethodData interface.
13779 (PropertyBase): New inner classes for get/set methods.
13780 (PropertyBase.PropertyMethod): Implemented IMethodData interface
13781 (Event): New inner classes for add/remove methods.
13782 (Event.DelegateMethod): Implemented IMethodData interface.
13784 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
13785 EmitContext (related to class.cs refactoring).
13787 2004-04-21 Raja R Harinath <rharinath@novell.com>
13789 * delegate.cs (Delegate.VerifyApplicability): If the number of
13790 arguments are the same as the number of parameters, first try to
13791 verify applicability ignoring any 'params' modifier on the last
13795 2004-04-16 Raja R Harinath <rharinath@novell.com>
13797 * class.cs (TypeContainer.AddIndexer): Use
13798 'ExplicitInterfaceName' to determine if interface name was
13799 explicitly specified. 'InterfaceType' is not initialized at this time.
13800 (TypeContainer.DefineIndexers): Remove use of temporary list. The
13801 Indexers array is already in the required order. Initialize
13802 'IndexerName' only if there are normal indexers.
13803 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
13804 (TypeContainer.Emit): Emit DefaultMember attribute only if
13805 IndexerName is initialized.
13808 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
13810 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
13813 2004-04-15 Raja R Harinath <rharinath@novell.com>
13815 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
13819 * attribute.cs (Attribute.Resolve): Check for duplicate named
13823 2004-04-15 Miguel de Icaza <miguel@ximian.com>
13825 * iterators.cs (MarkYield): track whether we are in an exception,
13826 and generate code accordingly. Use a temporary value to store the
13827 result for our state.
13829 I had ignored a bit the interaction of try/catch with iterators
13830 since their behavior was not entirely obvious, but now it is
13831 possible to verify that our behavior is the same as MS .NET 2.0
13835 2004-04-14 Miguel de Icaza <miguel@ximian.com>
13837 * iterators.cs: Avoid creating temporaries if there is no work to
13840 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
13841 Enumerations, use TypeManager.EnumToUnderlying and call
13844 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
13847 (This.Emit): Use EmitContext.EmitThis to emit our
13850 (This.EmitAssign): Ditto.
13852 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
13853 codepaths, we will move all the functionality into
13856 (FieldExpr.EmitAssign): Ditto.
13858 This fixes several hidden bugs that I uncovered while doing a code
13859 review of this today.
13861 * codegen.cs (EmitThis): reworked so the semantics are more clear
13862 and also support value types "this" instances.
13864 * iterators.cs: Changed so that for iterators in value types, we
13865 do not pass the value type as a parameter.
13867 Initialization of the enumerator helpers is now done in the caller
13868 instead of passing the parameters to the constructors and having
13869 the constructor set the fields.
13871 The fields have now `assembly' visibility instead of private.
13873 2004-04-11 Miguel de Icaza <miguel@ximian.com>
13875 * expression.cs (Argument.Resolve): Check if fields passed as ref
13876 or out are contained in a MarshalByRefObject.
13878 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
13879 another compiler type.
13881 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
13883 * class.cs (Indexer.Define): use the new name checking method.
13884 Also, return false on an error.
13885 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
13886 (is_identifier_[start/part]_character): make static.
13888 2004-04-10 Miguel de Icaza <miguel@ximian.com>
13890 * expression.cs (Binary.ResolveOperator): Do no append strings
13891 twice: since we can be invoked more than once (array evaluation)
13892 on the same concatenation, take care of this here. Based on a fix
13893 from Ben (bug #56454)
13895 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
13897 * codegen.cs: Fix another case where CS1548 must be reported (when
13898 delay-sign isn't specified and no private is available #56564). Fix
13899 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
13900 error when MCS is used on the MS runtime and we need to delay-sign
13901 (which seems unsupported by AssemblyBuilder - see #56621).
13903 2004-04-08 Marek Safar <marek.safar@seznam.cz>
13905 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
13906 (TypeManager.ComputeNamespaces): Faster implementation for
13909 * compiler.csproj: Updated AssemblyName to mcs.
13911 2004-04-07 Miguel de Icaza <miguel@ximian.com>
13913 * rootcontext.cs: Add new types to the boot resolution.
13915 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
13916 MulticastDelegate is not allowed.
13918 * typemanager.cs: Add new types to lookup: System.TypedReference
13921 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
13922 check for TypedReference or ArgIterator, they are not allowed.
13924 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
13925 makes us properly catch 1510 in some conditions (see bug 56016 for
13928 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
13930 * CryptoConvert.cs: update from corlib version
13933 2004-04-05 Miguel de Icaza <miguel@ximian.com>
13935 * class.cs (Indexer.Define): Check indexername declaration
13937 2004-04-05 Marek Safar <marek.safar@seznam.cz>
13939 * attribute.cs (IsClsCompliant): Fixed problem with handling
13940 all three states (compliant, not-compliant, undetected).
13942 2004-03-30 Marek Safar <marek.safar@seznam.cz>
13944 * attribute.cs (Attribute): Location is now public.
13945 (Resolve): Store resolved arguments (pos_values) in attribute class.
13946 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
13947 (GetClsCompliantAttributeValue): New method that gets
13948 CLSCompliantAttribute value.
13949 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
13950 if exists else null.
13951 (AttributeTester): New class for CLS-Compliant verification routines.
13953 * class.cs (Emit): Add CLS-Compliant verification.
13954 (Method.GetSignatureForError): Implemented.
13955 (Constructor.GetSignatureForError): Implemented
13956 (Constructor.HasCompliantArgs): Returns if constructor has
13957 CLS-Compliant arguments.
13958 (Constructor.Emit): Override.
13959 (Construcor.IsIdentifierClsCompliant): New method; For constructors
13960 is needed to test only parameters.
13961 (FieldBase.GetSignatureForError): Implemented.
13962 (TypeContainer): New member for storing base interfaces.
13963 (TypeContainer.FindMembers): Search in base interfaces too.
13965 * codegen.cs (GetClsComplianceAttribute): New method that gets
13966 assembly or module CLSCompliantAttribute value.
13967 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
13969 (ModuleClass.Emit): Add error 3012 test.
13971 * const.cs (Emit): Override and call base for CLS-Compliant tests.
13973 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
13974 state for all decl types.
13975 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
13976 if CLS-Compliant tests are required.
13977 (IsClsCompliaceRequired): New method. Analyze whether code
13978 must be CLS-Compliant.
13979 (IsExposedFromAssembly): New method. Returns true when MemberCore
13980 is exposed from assembly.
13981 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
13982 value or gets cached value.
13983 (HasClsCompliantAttribute): New method. Returns true if MemberCore
13984 is explicitly marked with CLSCompliantAttribute.
13985 (IsIdentifierClsCompliant): New abstract method. This method is
13986 used to testing error 3005.
13987 (IsIdentifierAndParamClsCompliant): New method. Common helper method
13988 for identifier and parameters CLS-Compliant testing.
13989 (VerifyClsCompliance): New method. The main virtual method for
13990 CLS-Compliant verifications.
13991 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
13992 null. I don't know why is null (too many public members !).
13993 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
13994 and get value of first CLSCompliantAttribute that found.
13996 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
13997 (VerifyClsCompliance): Override and add extra tests.
13999 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
14000 clscheck- disable CLS-Compliant verification event if assembly is has
14001 CLSCompliantAttribute(true).
14003 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
14004 ApllyAttribute is now called in emit section as in the other cases.
14005 Possible future Emit integration.
14006 (IsIdentifierClsCompliant): New override.
14007 (VerifyClsCompliance): New override.
14008 (GetEnumeratorName): Returns full enum name.
14010 * parameter.cs (GetSignatureForError): Implemented.
14012 * report.cs (WarningData): New struct for Warning message information.
14013 (LocationOfPreviousError): New method.
14014 (Warning): New method. Reports warning based on the warning table.
14015 (Error_T): New method. Reports error based on the error table.
14017 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
14018 verifications are done here.
14020 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
14022 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
14023 CLSCompliantAttribute.
14024 (all_imported_types): New member holds all imported types from other
14026 (LoadAllImportedTypes): New method fills static table with exported types
14027 from all referenced assemblies.
14028 (Modules): New property returns all assembly modules.
14030 2004-03-30 Miguel de Icaza <miguel@ximian.com>
14032 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
14033 throwing a parser error.
14035 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
14036 which removes the hardcoded get_/set_ prefixes for properties, as
14037 IL allows for the properties to be named something else.
14041 * expression.cs: Do not override operand before we know if it is
14042 non-null. Fix 56207
14044 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
14046 * typemanager.cs: support for pinned variables.
14048 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
14050 * decl.cs, typemanager.cs: Avoid using an arraylist
14051 as a buffer if there is only one result set.
14053 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
14055 * expression.cs: Make sure you cant call a static method
14056 with an instance expression, bug #56174.
14058 2004-03-29 Miguel de Icaza <miguel@ximian.com>
14060 * class.cs (IsDuplicateImplementation): Improve error reporting to
14061 flag 663 (method only differs in parameter modifier).
14063 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
14064 in preprocessor directives.
14066 * location.cs (LookupFile): Allow for the empty path.
14068 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
14069 better approach for some of that patch, but its failing with the
14070 CharSet enumeration. For now try/catch will do.
14072 * typemanager.cs: Do not crash if a struct does not have fields.
14075 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
14077 * expression.cs: cs0213, cant fix a fixed expression.
14080 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
14082 * cs-parser.jay: detect invalid embeded statements gracefully.
14085 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
14087 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
14090 the invocation type may not be a subclass of the tye of the item/
14091 The type of the item must be a subclass of the invocation item.
14096 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
14098 * attribute.cs: Added methods to get a string and a bool from an
14099 attribute. Required to information from AssemblyKeyFileAttribute,
14100 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
14101 * codegen.cs: Modified AssemblyName creation to include support for
14102 strongnames. Catch additional exceptions to report them as CS1548.
14103 * compiler.csproj: Updated include CryptoConvert.cs.
14104 * compiler.csproj.user: Removed file - user specific configuration.
14105 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
14106 Mono.Security assembly. The original class is maintained and tested in
14107 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
14108 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
14109 like CSC 8.0 (C# v2) supports.
14110 * Makefile: Added CryptoConvert.cs to mcs sources.
14111 * rootcontext.cs: Added new options for strongnames.
14113 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
14115 * driver.cs: For --expect-error, report error code `2'
14116 if the program compiled with no errors, error code `1' if
14117 it compiled with an error other than the one expected.
14119 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
14121 * compiler.csproj: Updated for Visual Studio .NET 2003.
14122 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
14123 * compiler.sln: Updated for Visual Studio .NET 2003.
14125 2004-03-24 Ravi Pratap M <ravi@ximian.com>
14127 * expression.cs: Fix bug #47234. We basically need to apply the
14128 rule that we prefer the conversion of null to a reference type
14129 when faced with a conversion to 'object' (csc behaviour).
14131 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14133 * statement.cs: Shorter form for foreach, eliminates
14134 a local variable. r=Martin.
14136 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14138 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
14139 checks if we can use brtrue/brfalse to test for 0.
14140 * expression.cs: use the above in the test for using brtrue/brfalse.
14141 cleanup code a bit.
14143 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14145 * expression.cs: Rewrite string concat stuff. Benefits:
14147 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
14148 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
14149 rather than a concat chain.
14151 * typemanager.cs: Add lookups for more concat overloads.
14153 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14155 * expression.cs: Emit shorter il code for array init.
14172 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
14174 * statement.cs: Before, two switch blocks would be merged if the
14175 total size of the blocks (end_item - begin_item + 1) was less than
14176 two times the combined sizes of the blocks.
14178 Now, it will only merge if after the merge at least half of the
14183 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
14185 * class.cs : csc build fix for GetMethods(). See bug #52503.
14187 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
14189 * expression.cs: Make sure fp comparisons work with NaN.
14190 This fixes bug #54303. Mig approved this patch a long
14191 time ago, but we were not able to test b/c the runtime
14194 2004-03-19 Miguel de Icaza <miguel@ximian.com>
14196 * ecore.cs (TypExpr.GetHashCode): implement this overload.
14198 2004-03-19 Martin Baulig <martin@ximian.com>
14200 * class.cs (MemberCore.IsDuplicateImplementation): Report the
14201 error here and not in our caller.
14203 2004-03-19 Martin Baulig <martin@ximian.com>
14205 * interface.cs: Completely killed this file.
14206 (Interface): We're now a TypeContainer and live in class.cs.
14208 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
14209 argument; we're now also called for interfaces.
14210 (TypeContainer.DefineMembers): Allow this method being called
14212 (TypeContainer.GetMethods): New public method; formerly known as
14213 Interface.GetMethod(). This is used by PendingImplementation.
14214 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
14215 it's now private and non-static.
14216 (Interface): Moved this here; it's now implemented similar to
14218 (Method, Property, Event, Indexer): Added `bool is_interface'
14219 argument to their .ctor's.
14220 (MemberBase.IsInterface): New public field.
14222 * cs-parser.jay: Create normal Method, Property, Event, Indexer
14223 instances instead of InterfaceMethod, InterfaceProperty, etc.
14224 (opt_interface_base): Removed; we now use `opt_class_base' instead.
14225 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
14227 2004-03-19 Martin Baulig <martin@ximian.com>
14229 * class.cs (MethodCore.IsDuplicateImplementation): New private
14230 method which does the CS0111 checking.
14231 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
14232 Use IsDuplicateImplementation().
14234 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
14236 * decl.cs (FindMemberToOverride): New method to find the correct
14237 method or property to override in the base class.
14239 - Make Method/Property use the above method to find the
14240 version in the base class.
14241 - Remove the InheritableMemberSignatureCompare as it is now
14244 This patch makes large code bases much faster to compile, as it is
14245 O(n) rather than O(n^2) to do this validation.
14247 Also, it fixes bug 52458 which is that nested classes are not
14248 taken into account when finding the base class member.
14250 Reviewed/Approved by Martin.
14252 2004-03-17 Marek Safar <marek.safar@seznam.cz>
14254 * interface.cs: In all interface classes removed redundant
14255 member initialization.
14257 2004-03-16 Martin Baulig <martin@ximian.com>
14259 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
14261 2004-03-15 Miguel de Icaza <miguel@ximian.com>
14263 * decl.cs (DefineTypeAndParents): New helper method to define a
14264 type's containers before the type itself is defined; This is a
14265 bug exposed by the recent changes to Windows.Forms when an
14266 implemented interface was defined inside a class that had not been
14269 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
14271 (Check): Loop correctly to report errors modifiers
14272 (UNSAFE was not in the loop, since it was the same as TOP).
14274 * interface.cs: Every interface member now takes a ModFlags,
14275 instead of a "is_new" bool, which we set on the base MemberCore.
14277 Every place where we called "UnsafeOk" in the interface, now we
14278 call the proper member (InterfaceMethod.UnsafeOK) instead to get
14279 the unsafe settings from the member declaration instead of the
14280 container interface.
14282 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
14284 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
14285 `set_indexer_name' to the pending bits (one per type).
14287 We fixed a bug today that was picking the wrong method to
14288 override, since for properties the existing InterfaceMethod code
14289 basically ignored the method name. Now we make sure that the
14290 method name is one of the valid indexer names.
14292 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
14294 * support.cs (SeekableStreamReader): Keep track of stream byte
14295 positions and don't mix them with character offsets to the buffer.
14297 Patch from Gustavo Giráldez
14299 2004-03-15 Marek Safar <marek.safar@seznam.cz>
14301 * interface.cs (InterfaceSetGetBase): Removed double member
14302 initialization, base class does it as well.
14304 2004-03-13 Martin Baulig <martin@ximian.com>
14306 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
14307 when compiling corlib.
14309 2004-03-13 Miguel de Icaza <miguel@ximian.com>
14311 * convert.cs (ExplicitConversion): We were reporting an error on
14312 certain conversions (object_type source to a value type, when the
14313 expression was `null') before we had a chance to pass it through
14314 the user defined conversions.
14316 * driver.cs: Replace / and \ in resource specifications to dots.
14319 * class.cs: Add check for duplicate operators. Fixes 52477
14321 2004-03-11 Miguel de Icaza <miguel@ximian.com>
14323 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
14324 that are in the middle of the statements, not only at the end.
14327 * class.cs (TypeContainer.AddField): No longer set the
14328 `HaveStaticConstructor' flag, now we call it
14329 `UserDefineStaticConstructor' to diferentiate the slightly
14330 semantic difference.
14332 The situation is that we were not adding BeforeFieldInit (from
14333 Modifiers.TypeAttr) to classes that could have it.
14334 BeforeFieldInit should be set to classes that have no static
14339 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
14341 And most importantly Zoltan's comment:
14343 http://bugzilla.ximian.com/show_bug.cgi?id=44229
14345 "I think beforefieldinit means 'it's ok to initialize the type sometime
14346 before its static fields are used', i.e. initialization does not need
14347 to be triggered by the first access to the type. Setting this flag
14348 helps the JIT to compile better code, since it can run the static
14349 constructor at JIT time, and does not need to generate code to call it
14350 (possibly lots of times) at runtime. Unfortunately, mcs does not set
14351 this flag for lots of classes like String.
14353 csc sets this flag if the type does not have an explicit static
14354 constructor. The reasoning seems to be that if there are only static
14355 initalizers for a type, and no static constructor, then the programmer
14356 does not care when this initialization happens, so beforefieldinit
14359 This bug prevents the AOT compiler from being usable, since it
14360 generates so many calls to mono_runtime_class_init that the AOT code
14361 is much slower than the JITted code. The JITted code is faster,
14362 because it does not generate these calls if the vtable is type is
14363 already initialized, which is true in the majority of cases. But the
14364 AOT compiler can't do this."
14366 2004-03-10 Miguel de Icaza <miguel@ximian.com>
14368 * class.cs (MethodData.Emit): Refactor the code so symbolic
14369 information is generated for destructors; For some reasons we
14370 were taking a code path that did not generate symbolic information
14373 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
14375 * class.cs: Create a Constructor.CheckBase method that
14376 takes care of all validation type code. The method
14377 contains some code that was moved from Define.
14379 It also includes new code that checks for duplicate ctors.
14380 This fixes bug #55148.
14382 2004-03-09 Joshua Tauberer <tauberer@for.net>
14384 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
14385 a { ... }-style array creation invokes EmitStaticInitializers
14386 which is not good for reference-type arrays. String, decimal
14387 and now null constants (NullCast) are not counted toward
14388 static initializers.
14390 2004-03-05 Martin Baulig <martin@ximian.com>
14392 * location.cs (SourceFile.HasLineDirective): New public field;
14393 specifies whether the file contains or is referenced by a "#line"
14395 (Location.DefineSymbolDocuments): Ignore source files which
14396 either contain or are referenced by a "#line" directive.
14398 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
14400 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
14401 direct access to our parent, so check the method inline there.
14403 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
14405 * expression.cs (Invocation.EmitCall): Miguel's last commit
14406 caused a regression. If you had:
14411 In Foo the implict this would be null.
14413 2004-02-27 Miguel de Icaza <miguel@ximian.com>
14415 * expression.cs (Invocation.EmitCall): If the method is not
14416 virtual, do not emit a CallVirt to it, use Call.
14418 * typemanager.cs (GetFullNameSignature): Improve the method to
14419 cope with ".ctor" and replace it with the type name.
14421 * class.cs (ConstructorInitializer.Resolve): Now the method takes
14422 as an argument the ConstructorBuilder where it is being defined,
14423 to catch the recursive constructor invocations.
14425 2004-02-26 Miguel de Icaza <miguel@ximian.com>
14427 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
14428 routines to check if a type is an enumerable/enumerator allow
14429 classes that implement the IEnumerable or IEnumerator interfaces.
14431 * class.cs (Property, Operator): Implement IIteratorContainer, and
14432 implement SetYields.
14434 (Property.Define): Do the block swapping for get_methods in the
14435 context of iterators. We need to check if Properties also
14436 include indexers or not.
14438 (Operator): Assign the Block before invoking the
14439 OperatorMethod.Define, so we can trigger the Iterator code
14442 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
14443 Property and Operator classes are not created when we parse the
14444 declarator but until we have the block completed, so we use a
14445 singleton SimpleIteratorContainer.Simple to flag whether the
14446 SetYields has been invoked.
14448 We propagate this setting then to the Property or the Operator to
14449 allow the `yield' to function.
14451 2004-02-25 Marek Safar <marek.safar@seznam.cz>
14453 * codegen.cs: Implemented attribute support for modules.
14454 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
14455 Assembly/Module functionality.
14457 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
14458 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
14459 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
14461 2004-02-16 Marek Safar <marek.safar@seznam.cz>
14463 * interface.cs (FindMembers): The operation is performed on all base
14464 interfaces and not only on the first. It is required for future CLS Compliance patch.
14466 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
14468 * statement.cs, codegen.cs:
14469 This patch deals with patterns such as:
14471 public class List : IEnumerable {
14473 public MyEnumerator GetEnumerator () {
14474 return new MyEnumerator(this);
14477 IEnumerator IEnumerable.GetEnumerator () {
14481 public struct MyEnumerator : IEnumerator {
14486 Before, there were a few things we did wrong:
14487 1) we would emit callvirt on a struct, which is illegal
14488 2) we emited ldarg when we needed to emit ldarga
14489 3) we would mistakenly call the interface methods on an enumerator
14490 type that derived from IEnumerator and was in another assembly. For example:
14492 public class MyEnumerator : IEnumerator
14494 Would have the interface methods called, even if there were public impls of the
14495 method. In a struct, this lead to invalid IL code.
14497 2004-02-11 Marek Safar <marek.safar@seznam.cz>
14499 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
14502 * delegate.cs (Define): Fixed crash when delegate type is undefined.
14504 2004-02-11 Miguel de Icaza <miguel@ximian.com>
14506 * cs-parser.jay: Fix small regression: we were not testing V2
14507 compiler features correctly.
14509 * interface.cs: If the emit context is null, then create one
14511 2004-02-09 Marek Safar <marek.safar@seznam.cz>
14513 * decl.cs (GetSignatureForError): New virtual method to get full name
14514 for error messages.
14516 * attribute.cs (IAttributeSupport): New interface for attribute setting.
14517 Now it is possible to rewrite ApplyAttributes method to be less if/else.
14519 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
14520 Duplicated members and code in these classes has been removed.
14521 Better encapsulation in these classes.
14523 2004-02-07 Miguel de Icaza <miguel@ximian.com>
14525 * assign.cs (Assign.DoResolve): When dealing with compound
14526 assignments, there is a new rule in ECMA C# 2.4 (might have been
14527 there before, but it is documented here) that states that in:
14531 If b is of type int, and the `op' is a shift-operator, then the
14532 above is evaluated as:
14536 * expression.cs (Binary.ResolveOperator): Instead of testing for
14537 int/uint/long/ulong, try to implicitly convert to any of those
14538 types and use that in pointer arithmetic.
14540 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
14541 method to print information for from the type, not from the
14542 null-method we were given.
14544 2004-02-01 Duncan Mak <duncan@ximian.com>
14546 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
14547 parsing for cmd, fixes bug #53694.
14549 2004-02-04 Marek Safar <marek.safar@seznam.cz>
14551 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
14552 in the member name duplication tests. Property and operator name duplication
14553 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
14555 2004-02-03 Marek Safar <marek.safar@seznam.cz>
14557 * interface.cs (PopulateMethod): Fixed crash when interface method
14558 returns not existing type (error test cs0246-3.cs).
14560 2004-02-02 Ravi Pratap M <ravi@ximian.com>
14562 * cs-parser.jay (interface_accessors): Re-write actions to also
14563 store attributes attached to get and set methods. Fix spelling
14566 (inteface_property_declaration): Modify accordingly.
14568 (InterfaceAccessorInfo): New helper class to store information to pass
14569 around between rules that use interface_accessors.
14571 * interface.cs (Emit): Apply attributes on the get and set
14572 accessors of properties and indexers too.
14574 * attribute.cs (ApplyAttributes): Modify accordingly to use the
14575 right MethodBuilder when applying attributes to the get and set accessors.
14577 2004-01-31 Miguel de Icaza <miguel@ximian.com>
14579 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
14581 2004-01-26 Miguel de Icaza <miguel@ximian.com>
14583 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
14585 2004-01-25 Miguel de Icaza <miguel@ximian.com>
14587 * cs-parser.jay: Remove YIELD token, instead use the new grammar
14588 changes that treat `yield' specially when present before `break'
14589 or `return' tokens.
14591 * cs-tokenizer.cs: yield is no longer a keyword.
14593 2004-01-23 Marek Safar <marek.safar@seznam.cz>
14595 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
14596 setting for default constructors.
14597 For default constructors are almost every time set wrong Modifier. The
14598 generated IL code has been alright. But inside mcs this values was
14599 wrong and this was reason why several of my CLS Compliance tests
14602 2004-01-22 Martin Baulig <martin@ximian.com>
14604 * cs-parser.jay (namespace_or_type_name): Return an Expression,
14605 not a QualifiedIdentifier. This is what `type_name_expression'
14606 was previously doing.
14607 (type_name_expression): Removed; the code is now in
14608 `namespace_or_type_name'.
14609 (qualified_identifier): Removed, use `namespace_or_type_name'
14611 (QualifiedIdentifier): Removed this class.
14613 2004-01-22 Martin Baulig <martin@ximian.com>
14615 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
14616 not a string as alias name.
14618 2004-01-21 Miguel de Icaza <miguel@ximian.com>
14620 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
14621 #52730 bug, and instead compute correctly the need to use a
14622 temporary variable when requesting an address based on the
14623 static/instace modified of the field and the constructor.
14625 2004-01-21 Martin Baulig <martin@ximian.com>
14627 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
14628 class and namespace before looking up aliases. Fixes #52517.
14630 2004-01-21 Martin Baulig <martin@ximian.com>
14632 * flowanalysis.cs (UsageVector.Merge): Allow variables being
14633 assinged in a 'try'; fixes exception4.cs.
14635 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14636 * class.cs : Implemented parameter-less constructor for TypeContainer
14638 * decl.cs: Attributes are now stored here. New property OptAttributes
14640 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
14642 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
14644 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14646 * typemanager.cs (CSharpSignature): Now reports also inner class name.
14647 (CSharpSignature): New method for indexer and property signature.
14649 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14651 * pending.cs (IsVirtualFilter): Faster implementation.
14653 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14655 * typemanager.cs: Avoid inclusion of same assembly more than once.
14657 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14659 * cs-parser.jay: Fixed problem where the last assembly attribute
14660 has been applied also to following declaration (class, struct, etc.)
14662 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14664 * class.cs: Added error CS0538, CS0539 reporting.
14665 Fixed crash on Microsoft runtime when field type is void.
14667 * cs-parser.jay: Added error CS0537 reporting.
14669 * pending.cs: Added error CS0535 reporting.
14670 Improved error report for errors CS0536, CS0534.
14672 2004-01-20 Miguel de Icaza <miguel@ximian.com>
14674 Merge a few bits from the Anonymous Method MCS tree.
14676 * statement.cs (ToplevelBlock): New class for toplevel methods,
14677 will hold anonymous methods, lifted variables.
14679 * cs-parser.jay: Create toplevel blocks for delegates and for
14680 regular blocks of code.
14682 2004-01-20 Martin Baulig <martin@ximian.com>
14684 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
14685 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
14686 and `NeedExplicitReturn'; added `IsLastStatement'.
14687 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
14688 have a `ReturnLabel' or we're not unreachable.
14690 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
14691 child's reachability; don't just override ours with it. Fixes
14692 #58058 (lluis's example).
14693 (FlowBranching): Added public InTryOrCatch(), InCatch(),
14694 InFinally(), InLoop(), InSwitch() and
14695 BreakCrossesTryCatchBoundary() methods.
14697 * statement.cs (Return): Do all error checking in Resolve().
14698 Unless we are the last statement in a top-level block, always
14699 create a return label and jump to it.
14700 (Break, Continue): Do all error checking in Resolve(); also make
14701 sure we aren't leaving a `finally'.
14702 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
14703 statement in a top-level block.
14704 (Block.Flags): Added `IsDestructor'.
14705 (Block.IsDestructor): New public property.
14707 2004-01-20 Martin Baulig <martin@ximian.com>
14709 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
14711 2004-01-20 Martin Baulig <martin@ximian.com>
14713 * statement.cs (Statement.ResolveUnreachable): New public method.
14714 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
14715 (Block.Resolve): Resolve unreachable statements.
14717 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
14719 * expression.cs: We need to fix the case where we do
14720 not have a temp variable here.
14722 * assign.cs: Only expression compound assignments need
14723 temporary variables.
14725 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
14727 * flowanalysis.cs: Reduce memory allocation in a few ways:
14728 - A block with no variables should not allocate a bit
14730 - A method with no out parameters does not need any tracking
14731 for assignment of the parameters, so we need not allocate
14734 public readonly Type[] VariableTypes;
14735 public readonly string[] VariableNames;
14736 Are redundant. The data is already stored in the variable
14737 map, so we need not allocate another array for it.
14738 - We need to add alot of checks for if (params | locals) == null
14739 due to the first two changes.
14741 2004-01-18 Miguel de Icaza <miguel@ximian.com>
14743 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
14744 implement IMemoryLocation, we store a copy on a local variable and
14745 take the address of it. Patch from Benjamin Jemlich
14747 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
14748 to use a special "type_name_expression" rule which reduces the
14749 number of "QualifiedIdentifier" classes created, and instead
14750 directly creates MemberAccess expressions.
14752 2004-01-17 Miguel de Icaza <miguel@ximian.com>
14754 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
14755 that fixes #52853. Null literal assignment to ValueType
14757 * class.cs (MethodData.Emit): Instead of checking the name of the
14758 method to determine if its a destructor, create a new derived
14759 class from Method called Destructor, and test for that.
14761 * cs-parser.jay: Create a Destructor object instead of a Method.
14763 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
14767 2004-01-16 Miguel de Icaza <miguel@ximian.com>
14769 * expression.cs (Binary.ResolveOperator): Perform an implicit
14770 conversion from MethodGroups to their delegate types on the
14771 Addition operation.
14773 * delegate.cs: Introduce a new class DelegateCreation that is the
14774 base class for `NewDelegate' and `ImplicitDelegateCreation',
14775 factor some code in here.
14777 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
14778 conversion from MethodGroups to compatible delegate types.
14780 * ecore.cs (Expression.Resolve): Do not flag error 654
14781 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
14782 we allow conversions from MethodGroups to delegate types now.
14784 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
14785 assignments in v2 either.
14787 2004-01-10 Miguel de Icaza <miguel@ximian.com>
14789 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
14790 static read-only fields in ctors.
14792 Applied patch from Benjamin Jemlich
14794 * expression.cs (UnaryMutator): Avoid leaking local variables.
14796 2004-01-09 Miguel de Icaza <miguel@ximian.com>
14798 * cs-tokenizer.cs (IsCastToken): Allow the various native types
14799 here to return true, as they can be used like this:
14801 (XXX) int.MEMBER ()
14803 Fixed 49836 and all the other dups
14805 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
14807 * driver.cs: Implement /win32res and /win32icon.
14809 2004-01-08 Miguel de Icaza <miguel@ximian.com>
14811 * cs-parser.jay: Add a rule to improve error handling for the
14812 common mistake of placing modifiers after the type.
14814 2004-01-07 Miguel de Icaza <miguel@ximian.com>
14816 * cs-parser.jay (interface_event_declaration): Catch
14817 initialization of events on interfaces, and report cs0068
14819 * cs-parser.jay (interface_event_declaration): Catch
14820 initialization of events.
14822 * ecore.cs: Better report missing constructors.
14824 * expression.cs (Binary.ResolveOperator): My previous bug fix had
14825 the error reporting done in the wrong place. Fix.
14827 * expression.cs (Binary.ResolveOperator): Catch the
14828 operator + (E x, E y) error earlier, and later allow for implicit
14829 conversions in operator +/- (E e, U x) from U to the underlying
14832 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
14833 52596, if the container class is abstract, the default constructor
14834 is protected otherwise its public (before, we were always public).
14836 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
14839 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
14840 Jemlich that fixes bug #52597, MCS was generating invalid code for
14841 idisposable structs. Thanks to Ben for following up with this
14844 2004-01-06 Miguel de Icaza <miguel@ximian.com>
14846 * driver.cs: Allow assemblies without code to be generated, fixes
14849 2004-01-07 Nick Drochak <ndrochak@gol.com>
14851 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
14853 2004-01-05 Miguel de Icaza <miguel@ximian.com>
14855 * cs-parser.jay: Add rules to improve error reporting if fields or
14856 methods are declared at the namespace level (error 116)
14858 * Add rules to catch event add/remove
14860 2004-01-04 David Sheldon <dave-mono@earth.li>
14862 * expression.cs: Added matching ")" to error message for
14865 2004-01-03 Todd Berman <tberman@gentoo.org>
14867 * ecore.cs, attribute.cs:
14868 Applying fix from #52429.
14870 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
14872 * ecore.cs, expression.cs, statement.cs:
14873 Total rewrite of how we handle branching. We
14874 now handle complex boolean expressions with fewer
14875 jumps. As well if (x == 0) no longer emits a ceq.
14877 if (x is Foo) is much faster now, because we generate
14880 Overall, we get a pretty big improvement on our benchmark
14881 tests. The code we generate is smaller and more readable.
14883 I did a full two-stage bootstrap. The patch was reviewed
14884 by Martin and Miguel.
14886 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
14888 * cs-parser.jay: Make primary_expression not take a QI.
14889 we dont need this because the member_access rule covers
14890 us here. So we replace the rule with just IDENTIFIER.
14892 This has two good effects. First, we remove a s/r conflict.
14893 Second, we allocate many fewer QualifiedIdentifier objects.
14895 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
14897 * attribute.cs: Handle MarshalAs attributes as pseudo, and
14898 set the correct information via SRE. This prevents
14899 hanging on the MS runtime. Fixes #29374.
14901 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
14903 * convert.cs: correctly handle conversions to value types
14904 from Enum and ValueType as unboxing conversions.
14906 Fixes bug #52569. Patch by Benjamin Jemlich.
14908 2004-01-02 Ravi Pratap <ravi@ximian.com>
14910 * expression.cs (BetterConversion): Prefer int -> uint
14911 over int -> ulong (csc's behaviour). This fixed bug #52046.
14913 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
14915 * decl.cs (MemberCache.FindMembers): now returns a
14918 * typemanager.cs: In general, go with with ^^.
14919 (CopyNewMethods): take an IList.
14920 (RealMemberLookup): Only allocate an arraylist
14921 if we copy from two sets of methods.
14923 This change basically does two things:
14924 1) Fewer array lists allocated due to CopyNewMethods.
14925 2) the explicit cast in MemberList costed ALOT.
14927 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
14929 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
14930 a hashtable to avoid needless string allocations when an identifier is
14931 used more than once (the common case).
14933 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
14935 * pending.cs: MS's TypeBuilder.GetInterfaces ()
14936 is broken, it will not return anything. So, we
14937 have to use the information we have in mcs to
14940 * typemanager.cs: Add a cache for GetInterfaces,
14941 since this will now be used more often (due to ^^)
14943 (GetExplicitInterfaces) New method that gets the
14944 declared, not effective, interfaces on a type
14945 builder (eg, if you have interface IFoo, interface
14946 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
14949 This patch makes MCS able to bootstrap itself on
14952 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
14954 * expression.cs: Remove the Nop's that Miguel put
14957 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
14959 * report.cs, codegen.cs: Give the real stack trace to
14960 the error when an exception is thrown.
14962 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
14964 * decl.cs: only allocate hashtables for ifaces if
14967 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
14969 * expression.cs: fix the error from cs0121-2.cs
14970 (a parent interface has two child interfaces that
14971 have a function with the same name and 0 params
14972 and the function is called through the parent).
14974 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
14976 * class.cs, rootcontext.cs, typmanager.cs: do not
14979 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
14981 * codegen.cs: remove stack for the ec flow branching.
14982 It is already a linked list, so no need.
14984 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
14986 * Makefile: Allow custom profiler here.
14988 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
14990 * typemanager.cs (LookupType):
14991 - Use a static char [], because split takes
14992 a param array for args, so it was allocating
14994 - Do not store true in a hashtable, it boxes.
14996 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
14998 * flowanalysis.cs: bytify common enums.
15000 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
15002 * modifiers.cs: Add a new set of flags for the
15003 flags allowed on explicit interface impls.
15004 * cs-parser.jay: catch the use of modifiers in
15005 interfaces correctly.
15006 * class.cs: catch private void IFoo.Blah ().
15008 All related to bug #50572.
15010 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
15012 * decl.cs: Rewrite the consistant accessability checking.
15013 Accessability is not linear, it must be implemented in
15014 a tableish way. Fixes #49704.
15016 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
15018 * expression.cs: Handle negation in a checked context.
15019 We must use subtraction from zero. Fixes #38674.
15021 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
15023 * class.cs: Ignore static void main in DLLs.
15024 * rootcontext.cs: Handle the target type here,
15025 since we are have to access it from class.cs
15026 * driver.cs: account for the above.
15028 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
15030 * report.cs: Give line numbers and files if available.
15032 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
15034 * driver.cs: Implement /addmodule.
15036 * typemanager.cs: Change 'modules' field so it now contains Modules not
15039 2003-12-20 Martin Baulig <martin@ximian.com>
15041 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
15042 (FieldBase.IsAssigned): Removed this field.
15043 (FieldBase.SetAssigned): New public method.
15044 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
15046 2003-12-20 Martin Baulig <martin@ximian.com>
15048 * expression.cs (LocalVariableReference.DoResolve): Don't set
15049 `vi.Used' if we're called from DoResolveLValue().
15051 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
15052 returns the usage vector it just merged into the current one -
15053 pass this one to UsageWarning().
15054 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
15055 of the `EmitContext', don't call this recursively on our children.
15057 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
15059 * driver.cs: Implement /target:module.
15061 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
15063 * support.cs (CharArrayHashtable): New helper class.
15065 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
15066 char arrays, not strings, so we can avoid creating a string in
15067 consume_identifier if the identifier is a keyword.
15069 2003-12-16 Martin Baulig <martin@ximian.com>
15071 * statement.cs (LocalInfo.Assigned): Removed this property.
15072 (LocalInfo.Flags): Removed `Assigned'.
15073 (LocalInfo.IsAssigned): New public method; takes the EmitContext
15074 and uses flow analysis.
15075 (Block.UsageWarning): Made this method private.
15076 (Block.Resolve): Call UsageWarning() if appropriate.
15078 * expression.cs (LocalVariableReference.DoResolve): Always set
15079 LocalInfo.Used here.
15081 2003-12-13 Martin Baulig <martin@ximian.com>
15083 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
15084 any value here; we're now using flow analysis to figure out
15085 whether a statement/block returns a value.
15087 2003-12-13 Martin Baulig <martin@ximian.com>
15089 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
15091 (FlowBranching.MergeFinally): Don't call
15092 `branching.CheckOutParameters()' here, this is called in
15094 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
15095 when adding the `finally' vector.
15097 2003-12-13 Martin Baulig <martin@ximian.com>
15100 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
15101 actually work and also fix #48962.
15103 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
15105 * decl.cs: Do not check System.Object for nested types,
15106 since we know it does not have any. Big bang for buck:
15109 Run 1: 8.35 seconds
15110 Run 2: 8.32 seconds
15111 corlib: 17.99 seconds
15113 Run 1: 8.17 seconds
15114 Run 2: 8.17 seconds
15115 corlib: 17.39 seconds
15117 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
15119 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
15120 time we are returning 0 members, so we save alot here.
15122 2003-12-11 Martin Baulig <martin@ximian.com>
15124 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
15125 `MergeChild()', also just take the `FlowBranching' as argument;
15126 call Merge() on it and return the result.
15127 (FlowBranching.Merge): We don't need to do anything if we just
15130 2003-12-11 Martin Baulig <martin@ximian.com>
15132 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
15133 them in an `ArrayList' to reduce memory usage. Thanks to Ben
15134 Maurer for this idea.
15136 2003-12-11 Martin Baulig <martin@ximian.com>
15138 * flowanalysis.cs (MergeResult): This class is now gone; we now
15139 use the `UsageVector' for this. The reason for this is that if a
15140 branching just has one sibling, we don't need to "merge" them at
15141 all - that's the next step to do.
15142 (FlowBranching.Merge): We now return a `UsageVector' instead of a
15145 2003-12-11 Martin Baulig <martin@ximian.com>
15147 Reworked flow analyis and made it more precise and bug-free. The
15148 most important change is that we're now using a special `Reachability'
15149 class instead of having "magic" meanings of `FlowReturns'. I'll
15150 do some more cleanups and optimizations and also add some more
15151 documentation this week.
15153 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
15154 largely reworked this class.
15155 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
15156 the new `Reachability' class instead of having "magic" values here.
15157 (FlowBranching): We're now using an instance of `Reachability'
15158 instead of having separate `Returns', `Breaks' etc. fields.
15160 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
15161 based on flow analysis; ignore the return value of block.Emit ().
15163 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
15165 * driver.cs typemanager.cs: Find the mono extensions to corlib even
15166 if they are private.
15168 2003-12-09 Martin Baulig <martin@ximian.com>
15170 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
15171 call them directly on the UsageVector.
15173 2003-12-09 Martin Baulig <martin@ximian.com>
15175 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
15176 Changed return type from `FlowReturns' to `Reachability'.
15178 2003-12-09 Martin Baulig <martin@ximian.com>
15180 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
15181 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
15182 `Reachable' fields with a single `Reachability' one.
15184 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15186 * class.cs (FindMembers): Remove foreach's.
15191 Run 1: 8.74 seconds
15192 Run 2: 8.71 seconds
15195 Run 1: 8.64 seconds
15196 Run 2: 8.58 seconds
15199 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15204 This patch does a few things:
15205 1. EmptyStatement is now a singleton, so it is never reallocated.
15206 2. All blah is EmptyStatement constructs have been changed to
15207 blah == EmptyStatement.Value, which is much faster and valid
15208 now that EmptyStatement is a singleton.
15209 3. When resolving a block, rather than allocating a new array for
15210 the non-empty statements, empty statements are replaced with
15211 EmptyStatement.Value
15212 4. Some recursive functions have been made non-recursive.
15213 Mainly the performance impact is from (3), however (1) and (2) are needed for
15214 this to work. (4) does not make a big difference in normal situations, however
15215 it makes the profile look saner.
15220 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15221 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15222 Total memory allocated: 56397 KB
15225 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
15226 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
15227 Total memory allocated: 55666 KB
15229 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15231 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
15232 than the hashtable in a hashtable version
15234 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
15235 we always end up concating a string. This results in a huge perf
15236 loss, because many strings have to be tracked by the GC. In this
15237 patch, we first use a hashtable that works with two keys, so that
15238 the strings do not need to be concat'ed.
15242 Run 1: 8.74 seconds
15243 Run 2: 8.71 seconds
15246 Run 1: 8.65 seconds
15247 Run 2: 8.56 seconds
15249 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15251 * Makefile: Add a new target `do-time' that does a quick and simple
15252 profile, leaving easy to parse output.
15254 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
15256 * codegen.cs (Init): Create the dynamic assembly with
15257 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
15259 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
15261 * support.cs: Make the PtrHashtable use only one
15262 instance of its comparer.
15264 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
15266 * typemanager.cs: Fix lookup of GetNamespaces.
15268 2003-11-29 Miguel de Icaza <miguel@ximian.com>
15270 * expression.cs: Removed redundant line.
15272 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
15273 ArrayLists, use for loops with bounds.
15275 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
15278 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
15279 arraylists, use for loop with bounds.
15281 The above three changes give us a 0.071 second performance
15282 improvement out of 3.294 seconds down to 3.223. On my machine
15283 the above changes reduced the memory usage by 1,387 KB during
15284 compiler bootstrap.
15286 * cs-parser.jay (QualifiedIdentifier): New class used to represent
15287 QualifiedIdentifiers. Before we created a new string through
15288 concatenation, and mostly later on, the result would be
15289 manipulated by DecomposeQI through string manipulation.
15291 This reduced the compiler memory usage for bootstrapping from
15292 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
15293 compile times in 0.05 seconds.
15295 2003-11-28 Dick Porter <dick@ximian.com>
15297 * support.cs: Do string compares with the Invariant culture.
15305 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
15306 the comparison is done with the Invariant culture.
15308 2003-11-27 Miguel de Icaza <miguel@ximian.com>
15310 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
15311 GetEnumerator method.
15313 (ProbeCollectionType): Iterate starting at the most specific type
15314 upwards looking for a GetEnumerator
15316 * expression.cs: Shift count can be up to 31 for int/uint and 63
15319 2003-11-26 Miguel de Icaza <miguel@ximian.com>
15321 * statement.cs (Block.LookupLabel): Also look for the label on the
15322 children blocks. Use a hash table to keep track of visited
15325 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
15326 we actually did transform the other operand, otherwise fall back
15327 to the common codepath that casts to long.
15329 * cs-tokenizer.cs: Use the same code pattern as the int case.
15330 Maybe I should do the parsing myself, and avoid depending on the
15331 Parse routines to get this done.
15333 2003-11-25 Miguel de Icaza <miguel@ximian.com>
15335 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
15336 which fixes bug 51347. This time test it.
15338 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
15339 attributes for example can not tell the difference between these.
15340 The difference was only a syntax feature of the language.
15342 * attribute.cs: Apply attributes to delegates.
15344 * delegate.cs: Call the apply attributes method.
15346 2003-11-24 Miguel de Icaza <miguel@ximian.com>
15348 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
15349 comparing 0 vs Byte.MinValue, not the value
15351 (ImplicitConversionRequired): When reporting a conversion error,
15352 use error 31 to print out the constant error instead of the
15355 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
15356 which fixes bug 51347.
15358 2003-11-22 Miguel de Icaza <miguel@ximian.com>
15360 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
15361 which fixes the -warnaserror command line option.
15363 2003-11-21 Miguel de Icaza <miguel@ximian.com>
15365 * cfold.cs (DoNumericPromotions): During constant folding of
15366 additions on UIntConstant, special case intconstants with
15367 IntConstants like we do on the expression binary operator.
15369 2003-11-12 Miguel de Icaza <miguel@ximian.com>
15371 * convert.cs (ImplicitReferenceConversion): We were missing a case
15372 (System.Enum are not value types or class types, so we need to
15373 classify them separatedly).
15375 * driver.cs: We do not support error 2007.
15377 2003-11-12 Jackson Harper <jackson@ximian.com>
15379 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
15380 system directory. Also use the full file name so users can
15381 libraries names mscorlib-o-tron.dll in a non system dir.
15383 2003-11-10 Martin Baulig <martin@ximian.com>
15385 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
15386 (TypeManager.InitCoreTypes): Initialize them here, but instead of
15387 calling `ResolveType()' on them, directly assign their `Type'.
15389 2003-11-08 Martin Baulig <martin@ximian.com>
15391 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
15392 return value and the `out parent' parameter.
15393 (TypeContainer.DefineType): Moved the CS0644 check into
15394 GetClassBases(). Don't pass the interface types to the
15395 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
15396 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
15398 * ecore.cs (TypeExpr.IsAttribute): New property.
15399 (TypeExpr.GetInterfaces): New method.
15401 * interface.cs (Interface.GetInterfaceTypeByName): Return a
15402 TypeExpr instead of a Type.
15403 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
15404 (Interface.DefineType): Don't pass the interface types to the
15405 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
15406 them later and then call `TypeBulider.AddInterfaceImplementation()'.
15408 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
15409 instead of a `Type[]'.
15410 (TypeManager.RegisterBuilder): Likewise.
15411 (TypeManager.AddUserInterface): Likewise.
15412 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
15413 `Type[]' and also return a `TypeExpr[]'.
15414 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
15416 2003-11-08 Martin Baulig <martin@ximian.com>
15418 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
15421 2003-11-08 Martin Baulig <martin@ximian.com>
15423 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
15424 TypeManager.ResolveExpressionTypes().
15426 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
15427 instead of an Expression.
15428 (TypeExpr): This is now an abstract base class for `TypeExpression'.
15429 (TypeExpression): New public class; formerly known as `TypeExpr'.
15431 * expression.cs (ComposedCast): Derive from TypeExpr.
15433 * typemanager.cs (TypeManager.system_*_expr): These are now
15434 TypExpr's instead of Expression's.
15435 (TypeManager.ResolveExpressionTypes): New public static function;
15436 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
15439 2003-11-06 Miguel de Icaza <miguel@ximian.com>
15441 * expression.cs (New.DoResolve): Do not dereference value that
15442 might be a null return.
15444 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
15445 sure that the constant value has the right type. Fixes an
15446 unreported bug, similar to 50425.
15448 * const.cs (Const.LookupConstantValue): Call
15449 ImplicitStandardConversionExists before doing a conversion to
15450 avoid havng the TypeManager.ChangeType do conversions.
15452 Reduced the number of casts used
15454 (Const.ChangeType): New routine to enable reuse of the constant
15455 type changing code from statement.
15457 * typemanager.cs (ChangeType): Move common initialization to
15458 static global variables.
15462 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
15463 every value type to go through, even if it was void. Fix that.
15465 * cs-tokenizer.cs: Use is_identifier_start_character on the start
15466 character of the define, and the is_identifier_part_character for
15467 the rest of the string.
15469 2003-11-05 Miguel de Icaza <miguel@ximian.com>
15471 * expression.cs (UnaryMutator.EmitCode): When I updated
15472 LocalVariableReference.DoResolve, I overdid it, and dropped an
15473 optimization done on local variable references.
15475 2003-11-04 Miguel de Icaza <miguel@ximian.com>
15477 * ecore.cs: Convert the return from Ldlen into an int.
15479 2003-10-20 Miguel de Icaza <miguel@ximian.com>
15481 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
15482 the accessibility, this is a special case for toplevel non-public
15483 classes (internal for instance).
15485 2003-10-20 Nick Drochak <ndrochak@gol.com>
15487 * ecore.cs: Fix typo and build. Needed another right paren.
15489 2003-10-19 Miguel de Icaza <miguel@ximian.com>
15491 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
15492 `internal' case regular and protected, but not allowing protected
15493 to be evaluated later. Bug 49840
15495 2003-10-15 Miguel de Icaza <miguel@ximian.com>
15497 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
15498 to kb.Nlast, and not the kb.nFirst to isolate the switch
15501 Extract the underlying type, so enumerations of long/ulong are
15502 treated like long/ulong.
15504 2003-10-14 Miguel de Icaza <miguel@ximian.com>
15506 * expression.cs (New): Overload the meaning of RequestedType to
15507 track the possible creation of the NewDelegate type, since
15508 DoResolve is invoked more than once for new constructors on field
15511 See bugs: #48800 and #37014
15513 * cs-parser.jay (declare_local_constants): Take an arraylist
15514 instead of a single constant.
15516 (local_constant_declaration): It should take a
15517 constant_declarators, not a constant_declarator. Fixes 49487
15519 * convert.cs: Fix error report.
15521 2003-10-13 Jackson Harper <jackson@ximian.com>
15523 * typemanager.cs (TypeToCoreType): Add float and double this fixes
15526 2003-10-09 Martin Baulig <martin@ximian.com>
15528 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
15530 (MethodCore.DoDefineParameters): Removed the TypeContainer
15531 argument; use the DeclSpace which was passed to the .ctor instead.
15532 (MethodCore.CheckParameter): Take a DeclSpace instead of a
15533 TypeContainer; we only need a DeclSpace here.
15535 2003-10-09 Martin Baulig <martin@ximian.com>
15537 * class.cs (MethodData): Added additional `DeclSpace ds' argument
15539 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
15540 EmitContext's .ctor.
15542 2003-10-09 Martin Baulig <martin@ximian.com>
15544 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
15545 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
15546 AsAccessible(), moved them as well.
15548 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
15550 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
15552 * cs-parser.jay : Renamed yyName to yyNames related to jay.
15554 2003-10-07 Miguel de Icaza <miguel@ximian.com>
15556 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
15557 generation for >=, as spotted by Paolo, bug 48679.
15558 Patch from David Waite.
15560 * cs-tokenizer.cs: Add handling for #pragma.
15562 * cs-parser.jay: Allow for both yield and yield return in the
15563 syntax. The anti-cobolization of C# fight will go on!
15565 * class.cs (TypeBuilder.DefineType): Catch error condition here
15566 (Parent.DefineType erroring out and returning null).
15568 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15569 coping with enumerations variables, we were mistakenly processing
15570 them as a regular value type instead of built-in types. Fixes the
15573 * typemanager.cs (IsBuiltinOrEnum): New method.
15575 2003-09-30 Miguel de Icaza <miguel@ximian.com>
15577 * cs-parser.jay: Upgrade: yield now needs the return clause.
15579 2003-09-19 Martin Baulig <martin@ximian.com>
15581 * decl.cs (MemberCache.SetupCacheForInterface): Take a
15582 `MemberCache parent' argument. Normally, an interface doesn't
15583 have a parent type except System.Object, but we use this in gmcs
15584 for generic type parameters.
15586 2003-09-18 Martin Baulig <martin@ximian.com>
15588 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
15589 on `type.IsInterface'; don't check whether the type has a parent
15590 to determine whether it's an interface.
15592 2003-09-15 Martin Baulig <martin@ximian.com>
15594 * class.cs (TypeContainer.DefineType): Added an error flag to
15595 avoid reporting duplicate CS0146's ("class definition is
15598 * driver.cs (Driver.MainDriver): Abort if
15599 RootContext.ResolveTree() reported any errors.
15601 2003-09-07 Martin Baulig <martin@ximian.com>
15603 * report.cs (Error, Warning): Added overloaded versions which take
15604 a `params object[] args' and call String.Format().
15606 2003-09-07 Martin Baulig <martin@ximian.com>
15608 * decl.cs (DeclSpace..ctor): Don't call
15609 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
15610 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
15611 (DeclSpace.RecordDecl): New method.
15613 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
15615 2003-09-02 Ravi Pratap <ravi@ximian.com>
15617 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
15618 value attributes to be applied to ParameterBuilders.
15620 * class.cs (MethodCore.LabelParameters): Make static and more
15621 generic so that it can be used from other places - like interface
15622 methods, for instance.
15624 * interface.cs (Interface.Emit): Call LabelParameters before
15625 emitting attributes on the InterfaceMethod.
15627 2003-08-26 Martin Baulig <martin@ximian.com>
15629 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
15630 resolving aliases; fixes #47927.
15632 2003-08-26 Martin Baulig <martin@ximian.com>
15634 * statement.cs (Using.DoResolve): This is internally emitting a
15635 try/finally clause, so we need to set ec.NeedExplicitReturn if we
15636 do not always return. Fixes #47681.
15638 2003-08-26 Martin Baulig <martin@ximian.com>
15640 * decl.cs (MemberCore): Moved WarningNotHiding(),
15641 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
15643 (AdditionResult): Make this nested in DeclSpace.
15644 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
15645 argument; call NamespaceEntry.Define() unless we're nested in a
15648 * namespace.cs (Namespace.DefineName): New public function. This
15649 is called from DeclSpace's .ctor to add
15650 (Namespace.Lookup): Include DeclSpaces in the lookup.
15652 * class.cs (Operator): Derive from MemberBase, not MemberCore.
15654 * const.cs (Const): Derive from MemberBase, not MemberCore.
15656 2003-08-25 Martin Baulig <martin@ximian.com>
15658 * convert.cs (Convert.ExplicitReferenceConversion): When
15659 converting from an interface type to a class, unbox if the target
15660 type is a struct type. Fixes #47822.
15662 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15664 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
15667 2003-08-22 Martin Baulig <martin@ximian.com>
15669 * class.cs (TypeManager.DefineType): When defining a nested type,
15670 call DefineType() on our parent; fixes #47801.
15672 2003-08-22 Martin Baulig <martin@ximian.com>
15674 * class.cs (MethodData.Define): While checking if a method is an
15675 interface implementation, improve the test a bit more to fix #47654.
15677 2003-08-22 Martin Baulig <martin@ximian.com>
15679 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
15680 correctly; fixes #47722.
15682 2003-08-22 Martin Baulig <martin@ximian.com>
15684 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
15685 LocalVariableReference, ensure it's not read-only. Fixes #47536.
15687 * statement.cs (Fixed.DoResolve): Make all variables read-only.
15689 2003-08-22 Martin Baulig <martin@ximian.com>
15691 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
15692 can only be assigned in static constructors. Fixes #47161.
15694 2003-08-22 Martin Baulig <martin@ximian.com>
15696 Rewrote and improved the flow analysis code.
15698 * flowbranching.cs (FlowBranching): Make this class abstract.
15699 (FlowBranching.CreateBranching): New static function to create a
15700 new flow branching.
15701 (FlowBranchingBlock, FlowBranchingException): New classes.
15702 (FlowBranching.UsageVector.Type): New public readonly field.
15703 (FlowBranching.UsageVector.Breaks): Removed the setter.
15704 (FlowBranching.UsageVector.Returns): Removed the setter.
15705 (FlowBranching.UsageVector): Added Break(), Return(),
15706 NeverReachable() and Throw() methods to modify the reachability.
15707 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
15708 done by FlowBranching.Merge().
15709 (FlowBranching.UsageVector.MergeChild): New method; merges the
15710 merge result into the current vector.
15711 (FlowBranching.Merge): New abstract method to merge a branching.
15713 2003-08-12 Martin Baulig <martin@ximian.com>
15715 * expression.cs (Indirection.CacheTemporaries): Create the
15716 LocalTemporary with the pointer type, not its element type.
15718 2003-08-10 Miguel de Icaza <miguel@ximian.com>
15720 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
15721 token was a keyword or not.
15723 Add `error' options where an IDENTIFIER was expected; Provide
15724 CheckToken and CheckIdentifierToken convenience error reporting
15727 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
15729 * decl.cs: Rename `NamespaceEntry Namespace' public field into
15730 NameSpaceEntry NameSpaceEntry.
15732 (LookupInterfaceOrClass): Avoid creating a full qualified name
15733 from namespace and name: avoid doing lookups when we know the
15734 namespace is non-existant. Use new Tree.LookupByNamespace which
15735 looks up DeclSpaces based on their namespace, name pair.
15737 * driver.cs: Provide a new `parser verbose' to display the
15738 exception thrown during parsing. This is turned off by default
15739 now, so the output of a failure from mcs is more graceful.
15741 * namespace.cs: Track all the namespaces defined in a hashtable
15744 (IsNamespace): New method
15746 2003-08-09 Miguel de Icaza <miguel@ximian.com>
15748 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
15749 we know that we need to concatenate (full typename can never be
15754 * statement.cs: Use a bitfield; Do not initialize to null things
15755 which are done by the constructor by default.
15757 * cs-parser.jay: bug fix, parameter was 4, not 3.
15759 * expression.cs: Just use the property;
15761 * statement.cs: No need for GetVariableInfo method.
15763 2003-08-08 Martin Baulig <martin@ximian.com>
15765 * flowanalysis.cs (FlowReturns): This is now nested in the
15766 `FlowBranching' class.
15767 (MyBitVector): Moved this here from statement.cs.
15768 (FlowBranching.SiblingType): New enum type.
15769 (FlowBranching.CreateSibling): Added `SiblingType' argument.
15771 2003-08-07 Martin Baulig <martin@ximian.com>
15773 * flowanalysis.cs (FlowBranchingType): This is now nested in the
15774 `FlowBranching' class and called `BranchingType'.
15776 2003-08-07 Martin Baulig <martin@ximian.com>
15778 * flowanalysis.cs: Moved all the control flow analysis code into
15781 2003-08-07 Martin Baulig <martin@ximian.com>
15783 * assign.cs (Assign.DoResolve): `target' must either be an
15784 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
15787 2003-08-07 Miguel de Icaza <miguel@ximian.com>
15789 * expression.cs (BinaryMethod): This kind of expression is created by the
15790 Binary class if it determines that the operator has to be handled
15793 (BinaryDelegate): This kind of expression is created if we are
15794 dealing with a + or - operator on delegates.
15796 (Binary): remove method, argumetns, and DelegateOperator: when
15797 dealing with methods,
15799 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
15801 * statement.cs (Block): use bitfields for the three extra booleans
15802 we had in use. Remove unused topblock parameter.
15804 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
15806 * assign.cs: Drop extra unneeded tests.
15808 2003-08-06 Miguel de Icaza <miguel@ximian.com>
15810 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
15812 * statement.cs (Foreach): Use VariableStorage instead of
15815 * codegen.cs (VariableStorage): New class used by clients that
15816 require a variable stored: locals or fields for variables that
15817 need to live across yield.
15819 Maybe provide a convenience api for EmitThis+EmitLoad?
15821 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
15824 2003-08-05 Miguel de Icaza <miguel@ximian.com>
15826 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
15827 RemapParameterLValue): New methods that are used to turn a
15828 precomputed FieldInfo into an expression like this:
15832 The idea is to use this instead of making LocalVariableReference
15833 have more than one meaning.
15835 * cs-parser.jay: Add error production to BASE.
15837 * ecore.cs: Deal with TypeManager.GetField returning null, which
15838 is now a valid return value.
15840 (FieldExprNoAddress): New expression for Fields whose address can
15843 * expression.cs (LocalVariableReference): During the resolve
15844 phases, create new expressions if we are in a remapping context.
15845 Remove code that dealt with remapping here.
15847 (ParameterReference): same.
15849 (ProxyInstance): New expression, like the `This' expression, but
15850 it is born fully resolved. We know what we are doing, so remove
15851 the errors that are targeted to user-provided uses of `this'.
15853 * statement.cs (Foreach): our variable is now stored as an
15854 Expression; During resolution, follow the protocol, dont just
15855 assume it will return this.
15857 2003-08-06 Martin Baulig <martin@ximian.com>
15859 * support.cs (SeekableStreamReader.cs): New public class.
15861 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
15862 SeekableStreamReader instead of the normal StreamReader.
15864 2003-08-04 Martin Baulig <martin@ximian.com>
15866 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
15867 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
15868 deambiguate casts and delegate invocations.
15869 (parenthesized_expression): Use the new tokens to ensure this is
15870 not a cast of method invocation.
15872 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
15873 when reading a `)' and Deambiguate_CloseParens () was previously
15876 * expression.cs (ParenthesizedExpression): New class. This is
15877 just used for the CS0075 test.
15878 (Binary.DoResolve): Check for CS0075.
15880 2003-07-29 Ravi Pratap <ravi@ximian.com>
15882 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
15883 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
15884 reference comparison.
15886 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
15887 examine the ReturnType for equality - this is necessary in the
15888 cases of implicit and explicit operators whose signature also
15889 includes the return type.
15891 2003-07-26 Miguel de Icaza <miguel@ximian.com>
15893 * namespace.cs: Cache the result of the namespace computation,
15894 instead of computing it every time.
15896 2003-07-24 Miguel de Icaza <miguel@ximian.com>
15898 * decl.cs: Use a global arraylist that we reuse over invocations
15899 to avoid excesive memory consumption. Reduces memory usage on an
15900 mcs compile by one meg (45 average).
15902 * typemanager.cs (LookupTypeReflection): In .NET pointers are
15903 private, work around that.
15905 2003-07-23 Miguel de Icaza <miguel@ximian.com>
15907 * literal.cs (IntLiteral): Define Zero and One static literals.
15909 * cs-parser.jay (integer_literal): use static literals to reduce
15910 memory usage for the most used literals (0, 1 and -1). 211kb
15911 reduced in memory usage.
15913 Replace all calls to `new ArrayList' with `new
15914 ArrayList(4)' which is a good average number for most allocations,
15915 and also requires only 16 bytes of memory for its buffer by
15918 This reduced MCS memory usage in seven megabytes for the RSS after
15921 2003-07-28 Ravi Pratap <ravi@ximian.com>
15923 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
15924 handle params methods the correct way by forming only one
15925 applicable set with params and normal methods in them. Earlier we
15926 were looking at params methods only if we found no normal methods
15927 which was not the correct thing to do.
15929 (Invocation.BetterFunction): Take separate arguments indicating
15930 when candidate and the best method are params methods in their
15933 This fixes bugs #43367 and #46199.
15935 * attribute.cs: Documentation updates.
15937 (CheckAttribute): Rename to CheckAttributeTarget.
15938 (GetValidPlaces): Rename to GetValidTargets.
15940 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
15941 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
15945 2003-07-28 Martin Baulig <martin@ximian.com>
15947 * class.cs (TypeContainer.DefineMembers): Use the base type's full
15948 name when looking up the base class of a nested class. Fixes #46977.
15950 2003-07-26 Martin Baulig <martin@ximian.com>
15952 * expression.cs (Indexers.Indexer): New nested struct; contains
15953 getter, setter and the indexer's type.
15954 (Indexers.Properties): This is now an ArrayList of
15955 Indexers.Indexer's.
15956 (IndexerAccess.DoResolveLValue): Correctly set the type if the
15957 indexer doesn't have any getters.
15959 * assign.cs (Assign.DoResolve): Also do the implicit conversions
15960 for embedded property and indexer assignments.
15962 2003-07-26 Martin Baulig <martin@ximian.com>
15964 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
15965 preprocessor directive is not the first non-whitespace character
15968 2003-07-26 Martin Baulig <martin@ximian.com>
15970 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
15971 namespace parsing, follow the spec more closely.
15973 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
15974 NamespaceEntry.Lookup().
15976 2003-07-25 Martin Baulig <martin@ximian.com>
15978 * MethodCore.cs (OverridesSomething): New public field; it's set
15979 from TypeContainer.DefineMembers if this method overrides
15980 something (which doesn't need to be a method). Fix #39462.
15982 2003-07-25 Ravi Pratap <ravi@ximian.com>
15984 * typemanager.cs (GetMembers): Ensure that the list of members is
15985 reversed. This keeps things in sync.
15987 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
15988 find an AttributeUsage attribute.
15990 * expression.cs (Invocation.OverloadResolve): Perform the check
15991 which disallows Invoke to be directly called on a Delegate.
15993 (Error_InvokeOnDelegate): Report error cs1533.
15995 2003-07-25 Martin Baulig <martin@ximian.com>
15997 * expression.cs (Indexers.GetIndexersForType): Only look in the
15998 interface hierarchy if the requested type is already an
15999 interface. Fixes #46788 while keeping #46502 fixed.
16001 2003-07-25 Martin Baulig <martin@ximian.com>
16003 * class.cs (TypeContainer.DefineMembers): Check whether all
16004 readonly fields have been assigned and report warning CS0649 if
16007 * statement.cs (LocalInfo.IsFixed): Always return true if this is
16010 2003-07-24 Ravi Pratap <ravi@ximian.com>
16012 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
16013 returned from GetMethods to make things consistent with the
16014 assumptions MCS makes about ordering of methods.
16016 This should comprehensively fix bug #45127 and it does :-)
16018 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
16019 ordering is actually reverse.
16021 * Clean up some debug messages I left lying around.
16023 * interface.cs (Populate*): Get rid of code which emits attributes
16024 since the stage in which we emit attributes is the 'Emit' stage,
16025 not the define stage.
16027 (Emit): Move attribute emission for interface members here.
16029 2003-07-22 Ravi Pratap <ravi@ximian.com>
16031 * expression.cs (Invocation.OverloadResolve): Follow the spec more
16032 closely: we eliminate methods in base types when we have an
16033 applicable method in a top-level type.
16035 Please see section 14.5.5.1 for an exact description of what goes
16038 This fixes bug #45127 and a host of other related to corlib compilation.
16040 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
16041 array is the method corresponding to the top-level type (this is
16042 because of the changes made to icall.c) so we change this
16045 (MethodGroupExpr.Name): This too.
16047 * typemanager.cs (GetElementType): New method which does the right
16048 thing when compiling corlib.
16050 * everywhere: Make use of the above in the relevant places.
16052 2003-07-22 Martin Baulig <martin@ximian.com>
16054 * cs-parser.jay (invocation_expression): Moved
16055 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
16056 `cast_expression', but create a InvocationOrCast which later
16057 resolves to either an Invocation or a Cast.
16059 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
16060 method; call this before EmitStatement() to make sure that this
16061 expression can be used as a statement.
16063 * expression.cs (InvocationOrCast): New class; resolves to either
16064 an Invocation or a Cast.
16066 * statement.cs (StatementExpression): Call ResolveStatement() on
16067 the ExpressionStatement before emitting it.
16069 2003-07-21 Martin Baulig <martin@ximian.com>
16071 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
16072 `ref' and `out' attributes match; fixes #46220.
16073 (MemberAccess.ResolveMemberAccess): You can't reference a type
16074 through an expression; fixes #33180.
16075 (Indexers.GetIndexersForType): Don't return the indexers from
16076 interfaces the class implements; fixes #46502.
16078 2003-07-21 Martin Baulig <martin@ximian.com>
16080 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
16081 CS0661 checks; fixes bug #30442.
16083 2003-07-21 Martin Baulig <martin@ximian.com>
16085 * decl.cs (AdditionResult): Added `Error'.
16087 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
16089 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
16090 makes cs0031.cs actually work.
16092 2003-07-20 Martin Baulig <martin@ximian.com>
16094 * namespace.cs: Fixed that bug which caused a crash when compiling
16095 the debugger's GUI.
16097 2003-07-20 Miguel de Icaza <miguel@ximian.com>
16099 * typemanager.cs (LookupTypeReflection): Never expose types which
16100 are NotPublic, NestedPrivate, NestedAssembly, or
16101 NestedFamANDAssem. We used to return these, and later do a check
16102 that would report a meaningful error, but the problem is that we
16103 would not get the real match, if there was a name override.
16105 2003-07-18 Miguel de Icaza <miguel@ximian.com>
16107 * namespace.cs (Namespace, Name): Do not compute the namespace
16108 name dynamically, compute it in the constructor. This reduced
16109 memory usage by 1697 KB.
16111 * driver.cs: Use --pause to pause at the end.
16113 2003-07-17 Peter Williams <peter@newton.cx>
16115 * Makefile: Change the name of the test target so that it doesn't
16116 conflict with the recursive test target.
16118 2003-07-17 Miguel de Icaza <miguel@ximian.com>
16120 * expression.cs (LocalVariableReference.Emit, EmitAssign,
16121 AddressOf): Do not use EmitThis, that was wrong, use the actual
16124 2003-07-15 Miguel de Icaza <miguel@ximian.com>
16126 * class.cs (MethodData.Define): While checking if a method is an
16127 interface implementation, improve the test: If we are not public
16128 (use new test here: use the computed MethodAttributes directly,
16129 instead of the parsed modifier flags) check if the `implementing'
16130 method comes from an interface or not.
16132 * pending.cs (VerifyPendingMethods): Slightly better error
16135 * makefile: add test target that does the mcs bootstrap.
16137 2003-07-16 Ravi Pratap <ravi@ximian.com>
16139 * interface.cs (Define): Do nothing here since there are no
16140 members to populate etc. Move the attribute emission out of here
16141 since this was just totally the wrong place to put it. Attribute
16142 application happens during the 'Emit' phase, not in the 'Define'
16145 (Emit): Add this method and move the attribute emission here
16147 * rootcontext.cs (EmitCode): Call the Emit method on interface
16150 2003-07-14 Ravi Pratap M <ravi@ximian.com>
16152 * expression.cs (OverloadResolve): Report error only if Location
16153 is not 'Null' which means that there was a probe going on.
16155 2003-07-14 Martin Baulig <martin@ximian.com>
16157 * expression.cs (ConditionalLogicalOperator): New public class to
16158 implement user defined conditional logical operators.
16159 This is section 14.11.2 in the spec and bug #40505.
16161 2003-07-14 Martin Baulig <martin@ximian.com>
16163 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
16165 2003-07-14 Martin Baulig <martin@ximian.com>
16167 * codegen.cs (EmitContext.InFixedInitializer): New public field.
16169 * ecore.cs (IVariable.VerifyFixed): New interface method.
16171 * expression.cs (Unary.ResolveOperator): When resolving the `&'
16172 operator, check whether the variable is actually fixed. Fixes bug
16173 #36055. Set a variable definitely assigned when taking its
16174 address as required by the spec.
16176 * statement.cs (LocalInfo.IsFixed): New field.
16177 (LocalInfo.MakePinned): Set `IsFixed' to true.
16179 2003-07-14 Ravi Pratap M <ravi@ximian.com>
16181 * attribute.cs (Attribute.Resolve): While doing a Member lookup
16182 for .ctors, ensure that we only ask for members declared in the
16183 attribute type (BindingFlags.DeclaredOnly).
16187 * expression.cs (Error_WrongNumArguments): Report error 1501
16188 correctly the way CSC does.
16190 2003-07-13 Martin Baulig <martin@ximian.com>
16192 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
16193 lookup on the fully qualified name, to make things like "X.X" work
16194 where "X.X" is a fully qualified type name, but we also have a
16195 namespace "X" in the using list. Fixes #41975.
16197 2003-07-13 Martin Baulig <martin@ximian.com>
16199 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
16200 function. If we're a CompoundAssign, we need to create an embedded
16201 CompoundAssign, not an embedded Assign.
16202 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
16205 2003-07-13 Martin Baulig <martin@ximian.com>
16207 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
16208 work to fix bug #46088.
16210 2003-07-13 Ravi Pratap <ravi@ximian.com>
16212 * class.cs (Operator.Emit): Do not emit attributes here - it is
16213 taken care of by the Method class that we delegate too. This takes
16214 care of bug #45876.
16216 2003-07-10 Martin Baulig <martin@ximian.com>
16218 * expression.cs (TypeOfVoid): New class.
16219 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
16221 2003-07-10 Martin Baulig <martin@ximian.com>
16223 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
16226 2003-07-10 Martin Baulig <martin@ximian.com>
16228 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
16229 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
16231 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
16233 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
16235 2003-07-10 Martin Baulig <martin@ximian.com>
16237 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
16238 of decimal. Fixes #42850.
16240 NOTE: I also fixed the created byte blob, but this doesn't work on
16241 the MS runtime and csc never produces any byte blobs for decimal
16244 2003-07-10 Martin Baulig <martin@ximian.com>
16246 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
16247 structs; fixes #32068.
16248 (Block.AddChildVariableNames): Fixed #44302.
16250 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16252 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
16254 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16256 * attribute.cs: And this test is onger needed.
16258 2003-07-08 Martin Baulig <martin@ximian.com>
16260 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
16261 inaccessible types. Fixes #36313.
16263 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
16265 * namespace.cs (NamespaceEntry): Create implicit entries for all
16266 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
16267 implicit entries for N1.N2 and N1.
16269 2003-07-08 Martin Baulig <martin@ximian.com>
16271 Rewrote the handling of namespaces to fix a lot of the issues
16272 wrt. `using' aliases etc.
16274 * namespace.cs (Namespace): Splitted this class into a
16275 per-assembly `Namespace' and a per-file `NamespaceEntry'.
16277 * typemanager.cs (TypeManager.IsNamespace): Removed.
16278 (TypeManager.ComputeNamespaces): Only compute namespaces from
16279 loaded assemblies here, not the namespaces from the assembly we're
16280 currently compiling.
16282 2003-07-08 Martin Baulig <martin@ximian.com>
16284 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
16286 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16288 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
16291 I thought about the memory savings here, but LookupTypeReflection
16292 is used under already very constrained scenarios. Compiling
16293 corlib or mcs only exposes one hit, so it would not really reduce
16294 any memory consumption.
16296 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16298 * typemanager.cs: fixes bug #45889 by only adding public types from
16299 other assemblies to the list of known types.
16301 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16303 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
16304 on the type we resolved.
16306 2003-07-05 Martin Baulig <martin@ximian.com>
16308 * pending.cs (PendingImplementation.ParentImplements): Don't
16309 create the proxy if the parent is abstract.
16311 * class.cs (TypeContainer.DefineIndexers): Process explicit
16312 interface implementations first. Fixes #37714.
16314 2003-07-04 Miguel de Icaza <miguel@ximian.com>
16316 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
16317 defined recursively; but since we modify the input parameters
16318 (left is set to `this' temporarily), we reset this value if the
16319 left_is_explicit is false, which gives the original semantics to
16322 * literal.cs (NullPointer): new class used to represent a null
16323 literal in a pointer context.
16325 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
16326 type is a pointer, use a NullPointer object instead of a
16327 NullLiteral. Closes 43687
16329 (ExplicitConversion): Convert pointer values using
16330 the conv opcode to the proper type.
16332 * ecore.cs (New): change ValueTypeVariable property into a method,
16333 that returns whether the valuetype is suitable for being used.
16335 * expression.cs (Binary.DoNumericPromotions): Only return if we
16336 the int constant was a valid uint, and we can return both left and
16337 right as uints. If not, we continue processing, to trigger the
16338 type conversion. This fixes 39018.
16340 * statement.cs (Block.EmitMeta): During constant resolution, set
16341 the CurrentBlock property on the emitcontext, so that we resolve
16342 constants propertly.
16344 2003-07-02 Martin Baulig <martin@ximian.com>
16346 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
16347 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
16349 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
16350 than emitting it here.
16352 * statement.cs: Fixed some more flow analysis bugs.
16354 2003-07-02 Martin Baulig <martin@ximian.com>
16356 * class.cs (MethodData.Define): When implementing interface
16357 methods, set Final unless we're Virtual.
16359 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
16360 check work for interface methods.
16362 2003-07-01 Martin Baulig <martin@ximian.com>
16364 * ecore.cs (EmitContext.This): Replaced this property with a
16365 GetThis() method which takes a Location argument. This ensures
16366 that we get the correct error location for a CS0188.
16368 2003-07-01 Miguel de Icaza <miguel@ximian.com>
16370 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
16371 ImplicitStandardConversion.
16373 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
16375 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
16377 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
16380 2003-06-30 Miguel de Icaza <miguel@ximian.com>
16382 * class.cs (Constructor.Define): Turn off initlocals for unsafe
16385 (MethodData.Define): Turn off initlocals for unsafe methods.
16387 2003-06-29 Miguel de Icaza <miguel@ximian.com>
16389 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
16390 complete; Fixes #37521.
16392 * delegate.cs: Use Modifiers.TypeAttr to compute the
16393 TypeAttributes, instead of rolling our own. This makes the flags
16394 correct for the delegates.
16396 2003-06-28 Miguel de Icaza <miguel@ximian.com>
16398 * class.cs (Constructor.Define): Set the private flag for static
16399 constructors as well.
16401 * cs-parser.jay (statement_expression): Set the return value to
16402 null, to avoid a crash when we catch an error.
16404 2003-06-24 Miguel de Icaza <miguel@ximian.com>
16406 * cs-parser.jay: Applied patch from Jackson that adds support for
16407 extern and unsafe modifiers to destructor declarations.
16409 * expression.cs: Report error 21 if the user is trying to index a
16412 * driver.cs: Add an error message, suggested by the bug report.
16414 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
16415 if we do not have a ": this ()" constructor initializer. Fixes 45149
16417 2003-06-14 Miguel de Icaza <miguel@ximian.com>
16419 * namespace.cs: Add some information to reduce FAQs.
16421 2003-06-13 Miguel de Icaza <miguel@ximian.com>
16423 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
16424 underlying enumeration types. Fixes #43915.
16426 * expression.cs: Treat ushort/short as legal values to be used in
16427 bitwise operations.
16429 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
16431 * delegate.cs: transfer custom attributes for paramenters from
16432 the delegate declaration to Invoke and BeginInvoke.
16434 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
16436 * attribute.cs: handle custom marshalers and emit marshal info
16439 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
16441 * makefile.gnu: Added anonymous.cs to the compiler sources.
16443 2003-05-28 Miguel de Icaza <miguel@ximian.com>
16445 * iterators.cs: Change the name of the proxy class to include two
16448 * cs-parser.jay: Update grammar to include anonymous methods.
16450 * anonymous.cs: new file.
16452 2003-05-27 Miguel de Icaza <miguel@ximian.com>
16454 * class.cs (Field.Define): Add missing test for pointers and
16457 2003-05-27 Ravi Pratap <ravi@ximian.com>
16459 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
16460 we use the stobj opcode.
16462 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
16463 since it wasn't the correct fix.
16465 It still is puzzling that we are required to use stobj for IntPtr
16466 which seems to be a ValueType.
16468 2003-05-26 Miguel de Icaza <miguel@ximian.com>
16470 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
16471 during regular simple name resolution. Now, the trick is that
16472 instead of returning for processing the simplename, we do a
16473 TypeManager.LookupType (ie, a rooted lookup as opposed to a
16474 contextual lookup type). If a match is found, return that, if
16475 not, return for further composition.
16477 This fixes long-standing 30485.
16479 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16480 using the address to initialize an object, do an Stobj instead of
16481 using the regular Stelem.
16483 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
16484 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
16485 Because if we are a BaseIndexerAccess that value will be true.
16488 * statement.cs (GotoCase.Resolve): Return after reporting an
16489 error, do not attempt to continue.
16491 * expression.cs (PointerArithmetic.Emit): If our operand is a
16492 long, convert our constants to match the operand before
16493 multiplying. Convert to I type before adding. Fixes 43670.
16495 2003-05-14 Ravi Pratap <ravi@ximian.com>
16497 * enum.cs (ImplicitConversionExists) : Rename to
16498 ImplicitEnumConversionExists to remove ambiguity.
16500 * ecore.cs (NullCast): New type of cast expression class which
16501 basically is very similar to EmptyCast with the difference being
16502 it still is a constant since it is used only to cast a null to
16504 (eg. (string) null)
16506 * convert.cs (ImplicitReferenceConversion): When casting a null
16507 literal, we return a NullCast.
16509 * literal.cs (NullLiteralTyped): Remove - I don't see why this
16510 should be around anymore.
16512 The renaming (reported was slightly wrong). Corrections:
16514 ConvertImplicitStandard -> ImplicitConversionStandard
16515 ConvertExplicitStandard -> ExplicitConversionStandard
16517 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
16518 before passing them in !
16520 * convert.cs (ImplicitConversionStandard): When comparing for
16521 equal expr and target types, ensure that expr is not a
16524 In general, we must not be checking (expr_type ==
16525 target_type) in the top level conversion methods
16526 (ImplicitConversion, ExplicitConversion etc). This checking is
16527 done in the methods that they delegate to.
16529 2003-05-20 Miguel de Icaza <miguel@ximian.com>
16531 * convert.cs: Move Error_CannotConvertType,
16532 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
16533 ImplicitNumericConversion, ImplicitConversionExists,
16534 ImplicitUserConversionExists, StandardConversionExists,
16535 FindMostEncompassedType, FindMostSpecificSource,
16536 FindMostSpecificTarget, ImplicitUserConversion,
16537 ExplicitUserConversion, GetConversionOperators,
16538 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
16539 TryImplicitIntConversion, Error_CannotConvertImplicit,
16540 ConvertImplicitRequired, ConvertNumericExplicit,
16541 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
16542 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
16545 Perform the following renames:
16547 StandardConversionExists -> ImplicitStandardConversionExists
16548 ConvertImplicit -> ImplicitConversion
16549 ConvertImplicitStandard -> ImplicitStandardConversion
16550 TryImplicitIntConversion -> ImplicitIntConversion
16551 ConvertImplicitRequired -> ImplicitConversionRequired
16552 ConvertNumericExplicit -> ExplicitNumericConversion
16553 ConvertReferenceExplicit -> ExplicitReferenceConversion
16554 ConvertExplicit -> ExplicitConversion
16555 ConvertExplicitStandard -> ExplicitStandardConversion
16557 2003-05-19 Martin Baulig <martin@ximian.com>
16559 * statement.cs (TypeInfo.StructInfo): Made this type protected.
16560 (TypeInfo): Added support for structs having structs as fields.
16562 * ecore.cs (FieldExpr): Implement IVariable.
16563 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
16564 VariableInfo for the field.
16566 2003-05-18 Martin Baulig <martin@ximian.com>
16568 * expression.cs (This.DoResolve): Report a CS0027 if we're
16569 emitting a field initializer.
16571 2003-05-18 Martin Baulig <martin@ximian.com>
16573 * expression.cs (This.ResolveBase): New public function.
16574 (This.DoResolve): Check for CS0188.
16576 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
16579 * ecore.cs (MethodGroupExpr.DoResolve): Set the
16580 `instance_expression' to null if we don't have any non-static
16583 2003-05-18 Martin Baulig <martin@ximian.com>
16585 Reworked the way how local variables and parameters are handled by
16586 the flow analysis code.
16588 * statement.cs (TypeInfo, VariableMap): New public classes.
16589 (VariableInfo): New public class. This is now responsible for
16590 checking whether a variable has been assigned. It is used for
16591 parameters and local variables.
16592 (Block.EmitMeta): Take the InternalParameters as argument; compute
16593 the layout of the flow vectors here.
16594 (Block.LocalMap, Block.ParameterMap): New public properties.
16595 (FlowBranching): The .ctor doesn't get the InternalParameters
16596 anymore since Block.EmitMeta() now computes the layout of the flow
16598 (MyStructInfo): This class is now known as `StructInfo' and nested
16599 in `TypeInfo'; we don't access this directly anymore.
16601 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
16602 property and removed IsAssigned(), IsFieldAssigned(),
16603 SetAssigned() and SetFieldAssigned(); we now call them on the
16604 VariableInfo so we don't need to duplicate this code everywhere.
16606 * expression.cs (ParameterReference): Added `Block block' argument
16608 (LocalVariableReference, ParameterReference, This): The new
16609 VariableInfo class is now responsible for all the definite
16612 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
16613 IsParameterAssigned, SetParameterAssigned): Removed.
16615 2003-05-18 Martin Baulig <martin@ximian.com>
16617 * typemanager.cs (InitCoreTypes): Try calling
16618 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
16619 the 3-args-version. Corlib now also needs our `void_type'.
16620 (GetMethod): Added overloaded version which takes an optional
16621 `bool report_errors' to allow lookups of optional methods.
16623 2003-05-12 Martin Baulig <martin@ximian.com>
16625 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
16626 only used for locals and not for parameters.
16628 2003-05-12 Miguel de Icaza <miguel@ximian.com>
16630 * support.cs (InternalParameters.ParameterType): Return the
16631 ExternalType of the parameter.
16633 * parameter.cs (Parameter.ExternalType): drop the two arguments,
16636 2003-05-11 Miguel de Icaza <miguel@ximian.com>
16638 * class.cs (MethodData.Define): Do not set the `newslot' on
16639 interface members, if they are also flagged as "override".
16641 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
16642 better code for ++i and i++. This only works for static fields
16643 and local variables.
16645 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
16646 want to pull the DeclSpace out of the builder_to_declspace instead
16647 of the TypeBuilder (like in TypeContainer.FindMembers).
16649 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
16650 instead of LookupTypeContainer. Fixes the crash on .NET for
16651 looking up interface members.
16653 * const.cs: Create our own emit context during the Definition
16654 stage, so that constants are evaluated in the proper context, when
16655 a recursive definition happens.
16657 2003-05-11 Martin Baulig <martin@ximian.com>
16659 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
16660 new block for a switch section.
16661 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
16662 the adding/lookup in the switch block. Fixes #39828.
16664 2003-05-09 Miguel de Icaza <miguel@ximian.com>
16666 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
16667 functionality: I needed to convert the data after I had performed
16668 the add/sub operation into the operands type size.
16670 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
16671 pass the type for the box operation, otherwise the resulting
16672 object would have been of type object.
16674 (BoxedCast): Add constructor to specify the type to box as.
16676 2003-05-07 Miguel de Icaza <miguel@ximian.com>
16678 * iterators.cs: I was reusing the `count' variable inadvertently,
16679 take steps to not allow this to happen.
16681 2003-05-06 Miguel de Icaza <miguel@ximian.com>
16683 * attribute.cs (Attribute.Resolve): Params attributes are encoded
16684 by creating an array at the point where the params starts and
16685 putting all those arguments there, then adjusting the size of the
16688 2003-05-05 Miguel de Icaza <miguel@ximian.com>
16690 * expression.cs (New.AddressOf): Implement interface
16691 IMemoryLocation. This is used when the `new' operator is used in
16692 the context of an invocation to a method on a value type.
16694 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
16697 * namespace.cs: Also check the using aliases here.
16699 * driver.cs: Move the test for using validity after the types have
16700 been entered, so we do a single pass that also includes the using
16703 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
16704 in the regular case. CreateSiblingForFinally is doing extra
16707 * attribute.cs (GetAttributeArgumentExpression): Store the result
16708 on an out value, and use the return value to indicate failure
16709 instead of using null (which is a valid return for Constant.GetValue).
16711 * statement.cs: Perform the analysis flow for the increment
16712 portion after the statement, because this will be the real flow of
16713 execution. Fixes #42385
16715 * codegen.cs (EmitContext.EmitArgument,
16716 EmitContext.EmitStoreArgument): New helper functions when the
16717 RemapToProxy flag is set.
16719 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
16722 Add support for remapping parameters.
16724 * iterators.cs: Propagate parameter values; Store parameter
16725 values in the proxy classes.
16727 2003-05-04 Miguel de Icaza <miguel@ximian.com>
16729 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
16730 need a proxy reference; I do not know what I was thinking
16732 * cs-parser.jay (constructor_initializer): catch another error,
16733 and display nice message.
16735 (field_declaration): catch void field declaration
16736 to flag a better error.
16738 * class.cs (MemberBase.CheckBase): Report an error instead of a
16739 warning if a new protected member is declared in a struct.
16740 (Field.Define): catch the error of readonly/volatile.
16742 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
16744 (FieldExpr.AddressOf): ditto. Catch error where the address of a
16745 volatile variable is taken
16747 2003-05-02 Miguel de Icaza <miguel@ximian.com>
16749 * statement.cs (Fixed.Resolve): Report an error if we are not in
16752 2003-05-01 Miguel de Icaza <miguel@ximian.com>
16754 * typemanager.cs: reuse the code that handles type clashes for
16755 delegates and enumerations.
16757 * class.cs (Report28): Always report.
16759 * expression.cs (EncodeAsAttribute): Allow nulls here.
16761 2003-04-28 Miguel de Icaza <miguel@ximian.com>
16763 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
16764 the functionality for testing whether an expression is valid for
16765 an attribute here. Also handle the case of arrays of elements
16768 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
16769 encoding a linear array into an array of objects that are suitable
16770 to be passed to an CustomAttributeBuilder.
16772 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
16774 * ecore.cs: (FieldExpr): Handle field remapping here.
16776 * iteratators.cs: Pass the instance variable (if the method is an
16777 instance method) to the constructors, so we can access the field
16778 variables on the class.
16780 TODO: Test this with structs. I think the THIS variable on
16781 structs might have to be a pointer, and not a refenrece
16783 2003-04-27 Miguel de Icaza <miguel@ximian.com>
16785 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
16786 local variables to fields in a proxy class.
16788 * iterators.cs (PopulateProxy): Rename our internal fields to
16790 Create a <THIS> field if we are an instance method, so we can
16791 reference our parent container variables.
16792 (MapVariable): Called back from the EmitContext code to enter a
16793 new variable to field mapping into the proxy class (we just create
16797 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
16798 for using the remapped locals to fields.
16800 I placed the code here, because that gives the same semantics to
16801 local variables, and only changes the Emit code.
16803 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
16804 statements inside iterators.
16805 (VariableInfo): Add a FieldBuilder for the cases when we are
16806 remapping local variables to fields in a proxy class
16808 * ecore.cs (SimpleNameResolve): Avoid testing two times for
16809 current_block != null.
16811 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
16812 not cope with strings, as it has been moved to the
16813 TableSwitchEmit. Fixed bug in switch generation.
16815 * expression.cs (New.DoResolve): Provide more context for the user
16816 when reporting an error.
16818 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
16821 * expression.cs (MemberAccess.DoResolve): When we get a type back,
16822 check the permissions for it. Note than in a type-resolution
16823 context the check was already present in DeclSpace.ResolveType,
16824 but was missing from the MemberAccess.
16826 (ArrayCreation.CheckIndices): warn if the user has
16827 more nested levels of expressions, but there are no more
16828 dimensions specified. Avoids crash on bug 41906.
16830 2003-04-26 Miguel de Icaza <miguel@ximian.com>
16832 * statement.cs (Block): replace Implicit bool, for a generic
16834 New flag: `Unchecked'. This is used during the EmitMeta phase
16835 (which is out-of-line with the regular Resolve/Emit process for a
16836 statement, as this is done ahead of time, but still gets a chance
16837 to call constant resolve).
16839 (Block.Flags): new enum for adding a new flag.
16841 (Block.EmitMeta): track the state of unchecked.
16843 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
16844 to enable constant resolution to work there as well.
16846 2003-04-22 Miguel de Icaza <miguel@ximian.com>
16848 * typemanager.cs (ienumerable_type): Also look up
16849 System.Collections.IEnumerable.
16851 2003-04-21 Miguel de Icaza <miguel@ximian.com>
16853 TODO: Test more than one conditional per method.
16855 * class.cs (Indexer.Define): Report the location where the user is
16856 referencing the unsupported feature.
16858 (MethodData): Overload the use of `conditionals' to
16859 minimize the creation of needless ArrayLists. This saves roughly
16860 212kb on my machine.
16862 (Method): Implement the new IIteratorContainer interface.
16863 (Method.SetYields): Implement the method by setting the ModFlags
16864 to contain METHOD_YIELDS.
16866 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
16867 which just got set to null.
16869 * iterators.cs: New file.
16871 (Yield, YieldBreak): New statements.
16873 * statement.cs (Return.Resolve): Flag an error if we are used in
16874 an iterator method.
16876 * codegen.cs (InIterator): New flag set if the code is being
16877 compiled in an iterator method.
16879 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
16880 internal modifier, and we just use it to avoid adding extra
16881 fields, as this is seldom used.
16883 * cs-parser.jay: Add yield_statement (yield and yield break).
16885 * driver.cs: New flag -v2 to turn on version 2 features.
16887 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
16888 hashtable when v2 is enabled.
16890 2003-04-20 Miguel de Icaza <miguel@ximian.com>
16892 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
16893 there is already a namespace defined with this name.
16895 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
16896 people upgraded their corlibs.
16898 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
16899 always use fully qualified types, no need to use the compiler
16902 (TypeManager.IsNamespace): Use binarysearch.
16904 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
16905 AddDelegate): I did not quite use the new IsValid API properly: I
16906 have to pass the short-name and the fullname. I was passing only
16907 the basename instead of the fullname sometimes.
16909 (TypeContainer.DefineType): call NamespaceClash.
16911 * interface.cs (Interface.DefineType): use NamespaceClash before
16914 * delegate.cs (Delegate.DefineType): use NamespaceClash before
16917 * enum.cs: (Enum.DefineType): use NamespaceClash before
16920 * typemanager.cs (: 3-line patch that gives us some tasty 11%
16921 speed increase. First, use the negative_hits cache when we get a
16922 negative. Second, add the type with its full original name
16923 instead of the new . and + encoded name (reflection uses + to
16924 separate type from a nested type). Use LookupTypeReflection
16925 directly which bypasses the type->name hashtable (that we already
16926 know does not contain the type.
16928 * decl.cs (DeclSpace.ResolveTypeExpr): track the
16929 location/container type.
16931 * driver.cs: When passing utf8, use directly the UTF8Encoding.
16933 2003-04-19 Miguel de Icaza <miguel@ximian.com>
16935 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
16937 * delegate.cs (NewDelegate.Resolve): Test whether an instance
16938 method is being referenced in the method group from a static
16939 context, and report error 120 if so.
16941 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
16944 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
16945 is created, we create the A namespace).
16947 * cs-parser.jay: A namespace also introduces a DeclarationFound.
16950 2003-04-18 Miguel de Icaza <miguel@ximian.com>
16952 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
16953 invocation to ModuleBuilder.GetType with the same values will
16954 return a new type instance, so we need to cache its return
16957 * expression.cs (Binary.ResolveOperator): Only allow the compare
16958 operators on enums if they are of the same type.
16960 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
16961 types of ValueType on their own case. Before we were giving them
16962 the same treatment as objects.
16964 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
16965 fullname. Short name is used to compare against container name.
16966 Fullname is used to check against defined namespace names.
16968 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
16969 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
16971 (Method.CheckBase): Call parent.
16972 (MemberBase.CheckBase): Check for protected members on sealed
16974 (PropertyBase.CheckBase): Call parent.
16975 (Field.Define): Call parent.
16977 * report.cs: Negative error codes are now mapped to 8000 - code,
16978 so that the display is render more nicely.
16980 * typemanager.cs: Do not use try/catch, instead report a regular
16983 (GetPointerType, GetReferenceType): These methods provide
16984 mechanisms to obtain the T* and T& from a T. We had the code
16985 previously scattered around the code base, and it also used
16986 TypeManager.LookupType that would go through plenty of caches.
16987 This one goes directly to the type source.
16989 In some places we did the Type.GetType followed by
16990 ModuleBuilder.GetType, but not in others, so this unifies the
16991 processing as well.
16993 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
16994 statements now that we have namespace information.
16996 * typemanager.cs (IsNamespace): New method, returns whether the
16997 string presented is a namespace or not.
16999 (ComputeNamespaces): New public entry point, computes the list of
17000 available namespaces, using the GetNamespaces API call in Mono, or
17001 the slower version in MS.NET.
17003 Now before we start the semantic analysis phase, we have a
17004 complete list of namespaces including everything that the user has
17007 Deleted old code to cache namespaces in .nsc files.
17009 2003-04-17 Miguel de Icaza <miguel@ximian.com>
17011 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
17012 class/struct location definition Location for the implicit
17013 constructor location.
17015 (Operator.Define): Use the location of the operator for the
17016 implicit Method definition.
17018 (Constructor.Emit): use the constructor location for the implicit
17019 base initializer constructor.
17021 * ecore.cs: Remove ITypeExpression. This interface is now gone,
17022 and the Expression class now contains two new methods:
17024 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
17025 isolate type lookup from the rest of the resolution process.
17027 Since we use Expressions to hold type definitions due to the way
17028 we parse the input we have historically overloaded Resolve to
17029 perform the Type lookups if a special flag is passed. Now this is
17030 eliminated and two methods take their place.
17032 The differences in the two methods between xStep and xTerminal is
17033 that xStep is involved in our current lookup system that uses
17034 SimpleNames to compose a name, while xTerminal is used just to
17035 catch the case where the simplename lookup failed.
17037 2003-04-16 Miguel de Icaza <miguel@ximian.com>
17039 * expression.cs (ResolveMemberAccess): Remove redundant code.
17040 TypeExpr expressions are always born fully resolved.
17042 * interface.cs (PopulateMethod): Do not lookup the types twice.
17043 We were doing it once during SemanticAnalysis and once during
17046 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
17047 in local variable type definitions, were being returned as a
17048 SimpleName (we decomposed everything into a string), that is
17049 because primary_expression was being used instead of a type in the
17050 grammar (reduce/reduce conflicts).
17052 The part that was wrong is that we converted the expression into a
17053 string (an oversimplification in one hand, compounded with primary
17054 expressions doing string concatenation).
17060 Would return "A.B.C[]" as a SimpleName. This stopped things like
17061 using clauses from working on this particular context. And a type
17062 was being matched directly against "A.B.C[]".
17064 We now use the correct approach, and allow for ComposedCast to be
17065 part of the unary expression. So the "A.B.C []" become a composed
17066 cast of "A.B.C" (as a nested group of MemberAccess with a
17067 SimpleName at the end) plus the rank composition "[]".
17071 2003-04-10 Miguel de Icaza <miguel@ximian.com>
17073 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
17074 for the access level checking.
17076 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
17077 `TypeContainer container', because I kept getting confused when I
17078 was debugging this code.
17080 * expression.cs (Indexers): Instead of tracking getters/setters,
17081 we now track them in parallel. We create one arraylist less, but
17082 most importantly it is possible now for the LValue code to find a
17083 matching get for a set.
17085 (IndexerAccess.DoResolveLValue): Update the code.
17086 GetIndexersForType has been modified already to extract all the
17087 indexers from a type. The code assumed it did not.
17089 Also make the code set the correct return type for the indexer.
17090 This was fixed a long time ago for properties, but was missing for
17091 indexers. It used to be void_type.
17093 (Binary.Emit): Test first for doubles instead of
17094 floats, as they are more common.
17096 (Binary.EmitBranchable): Use the .un version of the branch opcodes
17097 when dealing with floats and the <=, >= operators. This fixes bug
17100 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
17101 to load the array value by emitting a load on the foreach variable
17102 type. This was incorrect.
17104 We now emit the code to load an element using the the array
17105 variable type, and then we emit the conversion operator.
17109 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
17111 * attribute.cs: Avoid allocation of ArrayLists in the common case.
17113 2003-04-09 Miguel de Icaza <miguel@ximian.com>
17115 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
17116 test for protection before we test for signatures.
17118 (MethodSignature.ToString): implement.
17120 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
17121 to the case where we reduced into a LongConstant.
17123 * decl.cs (CheckAccessLevel): If the type is an array, we can not
17124 depend on whether the information is acurrate, because the
17125 Microsoft runtime will always claim that the array type is public,
17126 regardless of the real state.
17128 If the type is a pointer, another problem happens: the type is
17129 reported as non-public in Microsoft.
17131 In both cases we have to call CheckAccessLevel recursively with
17132 the underlying type as the argument to be tested.
17134 2003-04-08 Miguel de Icaza <miguel@ximian.com>
17136 * assign.cs (Assign.Emit): If we are dealing with a compound
17137 assignment expression, we should use the code path that stores the
17138 intermediate result in a temporary value. This fixes #40903.
17140 *expression.cs (Indirection.ToString): Provide ToString method for
17143 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
17145 * class.cs: Null out fields holding references to Block objects so
17146 they can be garbage collected.
17148 * expression.cs (OverloadResolve): Remove unused local.
17150 2003-04-07 Martin Baulig <martin@ximian.com>
17152 * codegen.cs (EmitContext.CurrentFile): New public field.
17153 (EmitContext.Mark): Use the CurrentFile to check whether the
17154 location is in the correct file.
17155 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
17157 2003-04-07 Martin Baulig <martin@ximian.com>
17159 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
17161 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
17162 location. [FIXME: The location argument which gets passed to this
17163 method is sometimes wrong!]
17165 2003-04-07 Nick Drochak <ndrochak@gol.com>
17167 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
17169 2003-04-07 Miguel de Icaza <miguel@ximian.com>
17171 * expression.cs (Indirection.EmitAssign): We were using the
17172 temporary, but returning immediately instead of continuing the
17175 2003-04-06 Martin Baulig <martin@ximian.com>
17177 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
17178 if it's a nested child, but also deriving from the outer class.
17181 * typemanager.cs (IsNestedChildOf): Make this work if it's a
17182 nested child, but also deriving from the outer class. See
17184 (FilterWithClosure): We may access private members of the outer
17185 class if we're a nested child and deriving from the outer class.
17186 (RealMemberLookup): Only set `closure_private_ok' if the
17187 `original_bf' contained BindingFlags.NonPublic.
17189 2003-04-05 Martin Baulig <martin@ximian.com>
17191 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
17193 2003-04-02 Miguel de Icaza <miguel@ximian.com>
17195 * class.cs (Event.Define): Do not allow abstract events to have
17198 2003-04-01 Miguel de Icaza <miguel@ximian.com>
17200 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
17201 block in event declarations.
17203 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
17204 value type, get its address.
17206 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
17207 leaving a class on the stack instead of a boolean value (int
17208 0/1). Change the code so we compare against null, and then the
17209 result against zero.
17211 * class.cs (TypeContainer.GetClassBases): We were checking for the
17212 parent class being sealed too late.
17214 * expression.cs (Binary.Emit): For <= and >= when dealing with
17215 floating point values, use cgt.un and clt.un instead of cgt and
17218 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
17220 * statement.cs: Apply the same optimization as MS: skip the
17221 GetEnumerator returning an IEnumerator, and use the one returning a
17222 CharEnumerator instead. This allows us to avoid the try-finally block
17225 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
17227 * cs-parser.jay: Attributes cannot be applied to
17228 namespaces. Fixes #40473
17230 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17233 (Add*): check if the name is valid using the full name for constants,
17234 fields, properties and events.
17236 2003-03-28 Miguel de Icaza <miguel@ximian.com>
17238 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
17239 char constants to be part of the enumeration.
17241 * expression.cs (Conditional.DoResolve): Add support for operator
17242 true. Implements the missing functionality from 14.12
17244 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
17245 operator true/false as required by the spec.
17247 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
17248 implicit conversion to boolean.
17250 * statement.cs (Statement.ResolveBoolean): A boolean expression is
17251 also one where the type implements `operator true'.
17253 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
17254 get an expression that will invoke operator true based on an
17257 (GetConversionOperators): Removed the hack that called op_True
17260 (Expression.ResolveBoolean): Move this from Statement.
17262 2003-03-17 Miguel de Icaza <miguel@ximian.com>
17264 * ecore.cs (FieldExpr): do not allow initialization of initonly
17265 fields on derived classes
17267 2003-03-13 Martin Baulig <martin@ximian.com>
17269 * statement.cs (Block.Emit): Call ig.BeginScope() and
17270 ig.EndScope() when compiling with debugging info; call
17271 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
17273 2003-03-08 Miguel de Icaza <miguel@ximian.com>
17275 * expression.cs (Indexers): Do not construct immediately, allow
17276 for new members to be appended as we go. Fixes 38143
17278 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17280 * expression.cs: save/restore context when resolving an unchecked
17283 2003-03-05 Miguel de Icaza <miguel@ximian.com>
17285 * cfold.cs: Catch division by zero in modulus operator during
17288 2003-03-03 Miguel de Icaza <miguel@ximian.com>
17290 * interface.cs (Interface.DefineMembers): Avoid defining members
17293 2003-02-27 Miguel de Icaza <miguel@ximian.com>
17295 * driver.cs: handle the +/- options for -noconfig
17297 * statement.cs (Unckeched.Resolve): Also track the state of
17298 unchecked in the Resolve phase.
17300 2003-02-27 Martin Baulig <martin@ximian.com>
17302 * ecore.cs (Expression.MemberLookup): Don't create a
17303 MethodGroupExpr for something which is not a method. Fixes #38291.
17305 2003-02-25 Miguel de Icaza <miguel@ximian.com>
17307 * class.cs (MemberBase.CheckParameters): Also check that the type
17308 is unmanaged if it is a pointer.
17310 * expression.cs (SizeOf.Resolve): Add location information.
17312 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
17313 a managed type is declared.
17315 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
17316 parameter modifiers as well. Fixes bug 38606
17318 * class.cs: Very sad. Am backing out the speed up changes
17319 introduced by the ArrayList -> Array in the TypeContainer, as they
17320 were not actually that much faster, and introduced a bug (no error
17321 reports on duplicated methods).
17323 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
17324 source first, this will guarantee that we have a valid expression
17325 before calling in lower levels functions that will require a
17326 resolved object. Then use this original_source in the
17327 target.ResolveLValue instead of the original source that was
17330 Another change. Use target.Resolve instead of LValueResolve.
17331 Although we are resolving for LValues, we will let the Assign code
17332 take care of that (it will be called again from Resolve). This
17333 basically allows code like this:
17335 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
17336 class Y { void A (X x) { x [0] += o; }
17338 The problem was that the indexer was trying to resolve for
17339 set_Item (idx, object o) and never finding one. The real set_Item
17340 was set_Item (idx, X). By delaying the process we get the right
17345 2003-02-23 Martin Baulig <martin@ximian.com>
17347 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
17348 while calling DoEmit ().
17350 * codegen.cs (EmitContext.Mark): Don't mark locations in other
17351 source files; if you use the #line directive inside a method, the
17352 compiler stops emitting line numbers for the debugger until it
17353 reaches the end of the method or another #line directive which
17354 restores the original file.
17356 2003-02-23 Martin Baulig <martin@ximian.com>
17358 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
17360 2003-02-23 Martin Baulig <martin@ximian.com>
17362 * statement.cs (Block.AddChildVariableNames): We need to call this
17363 recursively, not just for our immediate children.
17365 2003-02-23 Martin Baulig <martin@ximian.com>
17367 * class.cs (Event.Define): Always make the field private, like csc does.
17369 * typemanager.cs (TypeManager.RealMemberLookup): Make events
17370 actually work, fixes bug #37521.
17372 2003-02-23 Miguel de Icaza <miguel@ximian.com>
17374 * delegate.cs: When creating the various temporary "Parameters"
17375 classes, make sure that we call the ComputeAndDefineParameterTypes
17376 on those new parameters (just like we do with the formal ones), to
17377 allow them to be resolved in the context of the DeclSpace.
17379 This fixes the bug that Dick observed in Bugzilla #38530.
17381 2003-02-22 Miguel de Icaza <miguel@ximian.com>
17383 * expression.cs (ResolveMemberAccess): When resolving a constant,
17384 do not attempt to pull a constant if the value was not able to
17385 generate a valid constant.
17387 * const.cs (LookupConstantValue): Do not report more errors than required.
17389 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17391 * expression.cs: fixes bug #38328.
17393 2003-02-18 Miguel de Icaza <miguel@ximian.com>
17395 * class.cs: Changed all the various members that can be part of a
17396 class from being an ArrayList to be an Array of the right type.
17397 During the DefineType type_list, interface_list, delegate_list and
17398 enum_list are turned into types, interfaces, delegates and enums
17401 And during the member population, indexer_list, event_list,
17402 constant_list, field_list, instance_constructor_list, method_list,
17403 operator_list and property_list are turned into their real arrays.
17405 Although we could probably perform this operation earlier, for
17406 good error reporting we need to keep the lists and remove the
17407 lists for longer than required.
17409 This optimization was triggered by Paolo profiling the compiler
17410 speed on the output of `gen-sample-program.pl' perl script.
17412 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
17413 not crash in methods like MemberLookupFailed that use this field.
17415 This problem arises when the compiler fails to resolve a type
17416 during interface type definition for example.
17418 2003-02-18 Miguel de Icaza <miguel@ximian.com>
17420 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
17421 inherit from System.Object, so we have to stop at null, not only
17422 when reaching System.Object.
17424 2003-02-17 Miguel de Icaza <miguel@ximian.com>
17426 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
17427 DeclaredOnly because the parent indexer might have had a different
17428 name, but did not loop until the top of the hierarchy was reached.
17430 The problem this one fixes is 35492: when a class implemented an
17431 indexer from an interface, we were getting the interface method
17432 (which was abstract) and we were flagging an error (can not invoke
17435 This also keeps bug 33089 functioning, and test-148 functioning.
17437 * typemanager.cs (IsSpecialMethod): The correct way of figuring
17438 out if a method is special is to see if it is declared in a
17439 property or event, or whether it is one of the predefined operator
17440 names. This should fix correctly #36804.
17442 2003-02-15 Miguel de Icaza <miguel@ximian.com>
17444 The goal here is to remove the dependency on EmptyCast.Peel ().
17445 Killing it completely.
17447 The problem is that currently in a number of places where
17448 constants are expected, we have to "probe" for an EmptyCast, and
17449 Peel, which is not the correct thing to do, as this will be
17450 repetitive and will likely lead to errors.
17452 The idea is to remove any EmptyCasts that are used in casts that
17453 can be reduced to constants, so we only have to cope with
17456 This bug hunt was triggered by Bug 37363 and the desire to remove
17457 the duplicate pattern where we were "peeling" emptycasts to check
17458 whether they were constants. Now constants will always be
17461 * ecore.cs: Use an enumconstant here instead of wrapping with
17464 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
17465 throwing me off. By handling this we can get rid of a few hacks.
17467 * statement.cs (Switch): Removed Peel() code.
17469 2003-02-14 Miguel de Icaza <miguel@ximian.com>
17471 * class.cs: Location information for error 508
17473 * expression.cs (New.DoResolve): Add a guard against double
17474 resolution of an expression.
17476 The New DoResolve might be called twice when initializing field
17477 expressions (see EmitFieldInitializers, the call to
17478 GetInitializerExpression will perform a resolve on the expression,
17479 and later the assign will trigger another resolution
17481 This leads to bugs (#37014)
17483 * delegate.cs: The signature for EndInvoke should contain any ref
17484 or out parameters as well. We were not doing this in the past.
17486 * class.cs (Field.Define): Do not overwrite the type definition
17487 inside the `volatile' group. Turns out that volatile enumerations
17488 were changing the type here to perform a validity test, which
17491 2003-02-12 Miguel de Icaza <miguel@ximian.com>
17493 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
17494 and structs, we do not want to load the instance variable
17496 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
17497 enum_type has to be handled like an object reference (implicit
17498 conversions exists from this to object), but the regular IsClass
17499 and IsValueType tests will never return true for this one.
17501 Also we use TypeManager.IsValueType instead of type.IsValueType,
17502 just for consistency with the rest of the code (this is only
17503 needed if we ever use the construct exposed by test-180.cs inside
17504 corlib, which we dont today).
17506 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
17508 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
17511 2003-02-09 Martin Baulig <martin@ximian.com>
17513 * namespace.cs (Namespace..ctor): Added SourceFile argument.
17514 (Namespace.DefineNamespaces): New static public method; this is
17515 called when we're compiling with debugging to add all namespaces
17516 to the symbol file.
17518 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
17519 pass it to the Namespace's .ctor.
17521 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
17522 and MethodBase arguments; pass the namespace ID to the symwriter;
17523 pass the MethodBase instead of the token to the symwriter.
17524 (SymbolWriter.DefineNamespace): New method to add a namespace to
17527 2003-02-09 Martin Baulig <martin@ximian.com>
17529 * symbolwriter.cs: New file. This is a wrapper around
17530 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
17531 methods here in near future.
17533 2003-02-09 Martin Baulig <martin@ximian.com>
17535 * codegen.cs (EmitContext.Mark): Just pass the arguments to
17536 ILGenerator.MarkSequencePoint() which are actually used by the
17539 2003-02-09 Martin Baulig <martin@ximian.com>
17541 * location.cs (SourceFile): New public sealed class. This
17542 contains the name and an index which is used in the location's token.
17543 (Location): Reserve an appropriate number of bits in the token for
17544 the source file instead of walking over that list, this gives us a
17545 really huge performance improvement when compiling with debugging.
17547 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
17548 `SourceFile' argument instead of a string.
17549 (Driver.ProcessFile): Add all the files via Location.AddFile(),
17550 but don't parse/tokenize here, we need to generate the list of all
17551 source files before we do that.
17552 (Driver.ProcessFiles): New static function. Parses/tokenizes all
17555 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
17556 instead of a string.
17558 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
17561 2003-02-09 Martin Baulig <martin@ximian.com>
17563 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
17564 filename on `#line default'.
17566 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
17568 * statement.cs: don't clear the pinned var when the fixed statement
17569 returns from the method (fixes bug#37752).
17571 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
17573 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
17576 2003-02-07 Martin Baulig <martin@ximian.com>
17578 * driver.cs: Removed the `--debug-args' command line argument.
17580 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
17581 automatically by the AsssemblyBuilder.
17582 (CodeGen.InitializeSymbolWriter): We don't need to call any
17583 initialization function on the symbol writer anymore. This method
17584 doesn't take any arguments.
17586 2003-02-03 Miguel de Icaza <miguel@ximian.com>
17588 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
17589 from referenced assemblies as well.
17591 2003-02-02 Martin Baulig <martin@ximian.com>
17593 * class.cs (MethodData.Emit): Generate debugging info for external methods.
17595 2003-02-02 Martin Baulig <martin@ximian.com>
17597 * class.cs (Constructor.Emit): Open the symbol writer before
17598 emitting the constructor initializer.
17599 (ConstructorInitializer.Emit): Call ec.Mark() to allow
17600 single-stepping through constructor initializers.
17602 2003-01-30 Miguel de Icaza <miguel@ximian.com>
17604 * class.cs: Handle error 549: do not allow virtual methods in
17607 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
17609 * decl.cs: Check access levels when resolving types
17611 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
17613 * statement.cs: Add parameters and locals set in catch blocks that might
17614 return to set vector
17616 2003-01-29 Miguel de Icaza <miguel@ximian.com>
17618 * class.cs (Operator): Set the SpecialName flags for operators.
17620 * expression.cs (Invocation.DoResolve): Only block calls to
17621 accessors and operators on SpecialName methods.
17623 (Cast.TryReduce): Handle conversions from char constants.
17626 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
17628 * statement.cs: small memory and time optimization in FlowBranching.
17630 2003-01-28 Pedro Mart <yoros@wanadoo.es>
17632 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
17633 problem that the last fix but in the other sid (Set).
17635 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
17636 access when there is no indexer in the hierarchy.
17638 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
17640 * class.cs: Combine some if statements.
17642 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17644 * driver.cs: fixed bug #37187.
17646 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
17648 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
17649 any indexer, it's needed to build a list with all the indexers in the
17650 hierarchy (AllGetters), else we have problems. Fixes #35653.
17652 2003-01-23 Miguel de Icaza <miguel@ximian.com>
17654 * class.cs (MethodData.Define): It is wrong for an interface
17655 implementation to be static in both cases: explicit and implicit.
17656 We were only handling this in one case.
17658 Improve the if situation there to not have negations.
17660 * class.cs (Field.Define): Turns out that we do not need to check
17661 the unsafe bit on field definition, only on usage. Remove the test.
17663 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17665 * driver.cs: use assembly.Location instead of Codebase (the latest
17666 patch made mcs fail when using MS assemblies).
17668 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
17670 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
17671 get the path to *corlib.dll.
17673 2003-01-21 Nick Drochak <ndrochak@gol.com>
17677 * typemanager.cs: Remove compiler warnings
17679 2003-01-20 Duncan Mak <duncan@ximian.com>
17681 * AssemblyInfo.cs: Bump the version number to 0.19.
17683 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17685 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
17687 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
17689 * class.cs (Constructor::Emit): Emit debugging info for constructors.
17691 2003-01-17 Miguel de Icaza <miguel@ximian.com>
17693 * cs-parser.jay: Small fix: we were not comparing the constructor
17694 name correctly. Thanks to Zoltan for the initial pointer.
17696 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
17698 * cs-tokenizer.cs: Set file name when specified with #line
17700 2003-01-15 Miguel de Icaza <miguel@ximian.com>
17702 * cs-parser.jay: Only perform the constructor checks here if we
17703 are named like the class; This will help provider a better
17704 error. The constructor path is taken when a type definition is
17705 not found, but most likely the user forgot to add the type, so
17706 report that rather than the constructor error.
17708 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
17710 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
17713 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17715 * cs-parser.jay: Add cleanup call.
17717 2003-01-13 Duncan Mak <duncan@ximian.com>
17719 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
17720 consistent with other methods.
17722 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17724 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
17726 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
17728 * attribute.cs: only set GuidAttr to true when we have a
17731 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17735 * typemanager.cs: fixes to allow mcs compile corlib with the new
17736 Type.IsSubclassOf fix.
17738 2003-01-08 Miguel de Icaza <miguel@ximian.com>
17740 * expression.cs (LocalVariableReference.DoResolve): Classify a
17741 constant as a value, not as a variable. Also, set the type for
17744 * cs-parser.jay (fixed_statement): take a type instead of a
17745 pointer_type, so we can produce a better error message later.
17747 * statement.cs (Fixed.Resolve): Flag types that are not pointers
17750 (For.DoEmit): Make inifinite loops have a
17751 non-conditional branch back.
17753 (Fixed.DoEmit): First populate the pinned variables, then emit the
17754 statement, then clear the variables. Before I was emitting the
17755 code once for each fixed piece.
17758 2003-01-08 Martin Baulig <martin@ximian.com>
17760 * statement.cs (FlowBranching.MergeChild): A break in a
17761 SWITCH_SECTION does not leave a loop. Fixes #36155.
17763 2003-01-08 Martin Baulig <martin@ximian.com>
17765 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
17766 lives in the same number space than `param_map'. Fixes #36154.
17768 2003-01-07 Miguel de Icaza <miguel@ximian.com>
17770 * cs-parser.jay (constructor_declaration): Set the
17771 Constructor.ModFlags before probing for it. This makes the
17772 compiler report 514, 515 and 132 (the code was there, but got
17775 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
17776 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
17777 (GotoCase.Resolve): Set `Returns' to ALWAYS.
17779 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
17781 * enum.cs: create the enum static fields using the enum type.
17783 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
17785 * class.cs: don't try to create the ParamBuilder for the return
17786 type if it's not needed (and handle it breaking for the ms runtime
17789 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
17791 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
17793 2002-12-29 Miguel de Icaza <miguel@ximian.com>
17795 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
17796 the command. This showed up while compiling the JANET source
17797 code, which used \r as its only newline separator.
17799 2002-12-28 Miguel de Icaza <miguel@ximian.com>
17801 * class.cs (Method.Define): If we are an operator (because it
17802 reuses our code), then set the SpecialName and HideBySig. #36128
17804 2002-12-22 Miguel de Icaza <miguel@ximian.com>
17806 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
17807 exception, report error 120 `object reference required'.
17809 * driver.cs: Add --pause option, used during to measure the size
17810 of the process as it goes with --timestamp.
17812 * expression.cs (Invocation.DoResolve): Do not allow methods with
17813 SpecialName to be invoked.
17815 2002-12-21 Miguel de Icaza <miguel@ximian.com>
17817 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
17818 number before adding it.
17820 2002-12-21 Ravi Pratap <ravi@ximian.com>
17822 * ecore.cs (StandardImplicitConversion): When in an unsafe
17823 context, we allow conversion between void * to any other pointer
17824 type. This fixes bug #35973.
17826 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
17828 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
17829 is not thrown when extensionless outputs are used
17831 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17833 * rootcontext.cs: fixed compilation of corlib.
17835 2002-12-19 Miguel de Icaza <miguel@ximian.com>
17837 * attribute.cs (Attributes.Contains): Add new method.
17839 * class.cs (MethodCore.LabelParameters): if the parameter is an
17840 `out' parameter, check that no attribute `[In]' has been passed.
17842 * enum.cs: Handle the `value__' name in an enumeration.
17844 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
17846 * decl.cs: Added special case to allow overrides on "protected
17849 2002-12-18 Ravi Pratap <ravi@ximian.com>
17851 * attribute.cs (Attributes.AddAttributeSection): Rename to this
17852 since it makes much more sense.
17854 (Attributes.ctor): Don't require a Location parameter.
17856 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
17858 * attribute.cs (ApplyAttributes): Remove extra Location parameters
17859 since we already have that information per attribute.
17861 * everywhere : make appropriate changes.
17863 * class.cs (LabelParameters): Write the code which actually
17864 applies attributes to the return type. We can't do this on the MS
17865 .NET runtime so we flag a warning in the case an exception is
17868 2002-12-18 Miguel de Icaza <miguel@ximian.com>
17870 * const.cs: Handle implicit null conversions here too.
17872 2002-12-17 Ravi Pratap <ravi@ximian.com>
17874 * class.cs (MethodCore.LabelParameters): Remove the extra
17875 Type [] parameter since it is completely unnecessary. Instead
17876 pass in the method's attributes so that we can extract
17877 the "return" attribute.
17879 2002-12-17 Miguel de Icaza <miguel@ximian.com>
17881 * cs-parser.jay (parse): Use Report.Error to flag errors instead
17882 of ignoring it and letting the compile continue.
17884 * typemanager.cs (ChangeType): use an extra argument to return an
17885 error condition instead of throwing an exception.
17887 2002-12-15 Miguel de Icaza <miguel@ximian.com>
17889 * expression.cs (Unary.TryReduce): mimic the code for the regular
17890 code path. Perform an implicit cast in the cases where we can
17891 implicitly convert to one of the integral types, and then reduce
17892 based on that constant. This fixes bug #35483.
17894 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17896 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
17898 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17900 * namespace.cs: fixed bug #35489.
17902 2002-12-12 Miguel de Icaza <miguel@ximian.com>
17904 * class.cs: Remove some dead code.
17906 * cs-parser.jay: Estimate the number of methods needed
17907 (RootContext.MethodCount);
17909 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
17910 numbers instead of StringBuilders.
17912 * support.cs (PtrHashtable): Add constructor with initial size;
17913 We can now reduce reallocations of the method table.
17915 2002-12-10 Ravi Pratap <ravi@ximian.com>
17917 * attribute.cs (ApplyAttributes): Keep track of the emitted
17918 attributes on a per-target basis. This fixes bug #35413.
17920 2002-12-10 Miguel de Icaza <miguel@ximian.com>
17922 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
17923 default to the Windows 1252 encoding.
17925 (UnixParseOption): Support version, thanks to Alp for the missing
17928 * AssemblyInfo.cs: Add nice assembly information.
17930 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
17933 * cs-parser.jay: Allow a trailing comma before the close bracked
17934 in the attribute_section production.
17936 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
17937 address of the instance was being taken, I will take this out,
17938 because we take the address of the object immediately here.
17940 2002-12-09 Ravi Pratap <ravi@ximian.com>
17942 * typemanager.cs (AreMultipleAllowed): Take care of the most
17943 obvious case where attribute type is not in the current assembly -
17946 2002-12-08 Miguel de Icaza <miguel@ximian.com>
17948 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
17949 definitions, instead of doing that afterwards.
17951 Also we use a nice little hack, depending on the constructor, we
17952 know if we are a "composed" name or a simple name. Hence, we
17953 avoid the IndexOf test, and we avoid
17955 * codegen.cs: Add code to assist in a bug reporter to track down
17956 the source of a compiler crash.
17958 2002-12-07 Ravi Pratap <ravi@ximian.com>
17960 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
17961 types have been emitted for a given element and flag an error
17962 if something which does not have AllowMultiple set is used more
17965 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
17966 attribute types and their corresponding AllowMultiple properties
17968 (AreMultipleAllowed): Check the property for a given type.
17970 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
17971 property in the case we have a TypeContainer.
17973 (Attributes.AddAttribute): Detect duplicates and just skip on
17974 adding them. This trivial fix catches a pretty gross error in our
17975 attribute emission - global attributes were being emitted twice!
17977 Bugzilla bug #33187 is now fixed.
17979 2002-12-06 Miguel de Icaza <miguel@ximian.com>
17981 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
17982 instead of pp_and).
17984 * expression.cs (Binary.ResolveOperator): I can only use the
17985 Concat (string, string, string) and Concat (string, string,
17986 string, string) if the child is actually a concatenation of
17989 2002-12-04 Miguel de Icaza <miguel@ximian.com>
17991 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
17992 context where we need a 2-character lookahead.
17994 * pending.cs (PendingImplementation): Rework so we can keep track
17995 of interface types all the time, and flag those which were
17996 implemented by parents as optional.
17998 2002-12-03 Miguel de Icaza <miguel@ximian.com>
18000 * expression.cs (Binary.ResolveOperator): Use
18001 String.Concat(string,string,string) or
18002 String.Concat(string,string,string,string) when possible.
18004 * typemanager: More helper methods.
18007 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
18009 * pending.cs: remove the bogus return from GetMissingInterfaces()
18010 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
18012 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18014 * namespace.cs: avoid duplicated 'using xxx' being added to
18015 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
18016 when we get more than one 'using' statement for the same namespace.
18017 Report a CS0105 warning for it.
18019 2002-11-30 Miguel de Icaza <miguel@ximian.com>
18021 * cs-tokenizer.cs (consume_identifier): use read directly, instead
18022 of calling getChar/putback, uses internal knowledge of it.
18024 (xtoken): Reorder tokenizer so most common patterns are checked
18025 first. This reduces the compilation time in another 5% (from 8.11s
18026 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
18028 The parsing time is 22% of the compilation in mcs, and from that
18029 64% is spent on the tokenization process.
18031 I tried using a binary search for keywords, but this is slower
18032 than the hashtable. Another option would be to do a couple of
18035 * Not use a StringBuilder, instead use an array of chars,
18036 with a set value. Notice that this way we could catch
18037 the 645 error without having to do it *afterwards*.
18039 * We could write a hand-parser to avoid the hashtable
18040 compares altogether.
18042 The identifier consumption process takes 37% of the tokenization
18043 time. Another 15% is spent on is_number. 56% of the time spent
18044 on is_number is spent on Int64.Parse:
18046 * We could probably choose based on the string length to
18047 use Int32.Parse or Int64.Parse and avoid all the 64-bit
18050 Another 3% is spend on wrapping `xtoken' in the `token' function.
18052 Handle 0xa0 as whitespace (#34752)
18054 2002-11-26 Miguel de Icaza <miguel@ximian.com>
18056 * typemanager.cs (IsCLRType): New routine to tell whether a type
18057 is one of the builtin types.
18059 Maybe it needs to use TypeCodes to be faster. Maybe we could use
18060 typecode in more places instead of doing pointer comparissions.
18061 We could leverage some knowledge about the way the typecodes are
18064 New code to cache namespaces in assemblies, it is currently not
18065 invoked, to be used soon.
18067 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
18069 * expression.cs (Binary.ResolveOperator): specially handle
18070 strings, and do not perform user-defined operator overloading for
18073 2002-11-24 Miguel de Icaza <miguel@ximian.com>
18075 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
18076 internalcall as it is a pretty simple operation; Avoid whenever
18077 possible to call Char.IsLetter.
18079 (consume_identifier): Cut by half the number of
18080 hashtable calls by merging the is_keyword and GetKeyword behavior.
18082 Do not short-circuit, because if we do, we
18083 report errors (ie, #if false && true would produce an invalid
18087 2002-11-24 Martin Baulig <martin@ximian.com>
18089 * expression.cs (Cast.TryReduce): If we're in checked syntax,
18090 check constant ranges and report a CS0221. Fixes #33186.
18092 2002-11-24 Martin Baulig <martin@ximian.com>
18094 * cs-parser.jay: Make this work for uninitialized variable
18095 declarations in the `for' initializer. Fixes #32416.
18097 2002-11-24 Martin Baulig <martin@ximian.com>
18099 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
18100 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
18102 2002-11-24 Martin Baulig <martin@ximian.com>
18104 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
18105 argument; if true, we also check for user-defined conversions.
18106 This is only needed if both arguments are of a user-defined type.
18107 Fixes #30443, added test-175.cs.
18108 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
18110 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
18112 2002-11-24 Martin Baulig <martin@ximian.com>
18114 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
18115 function to get the store opcode.
18116 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
18117 only emit the Ldelema if the store opcode is Stobj. You must run
18118 both test-34 and test-167 to test this. Fixes #34529.
18120 2002-11-23 Martin Baulig <martin@ximian.com>
18122 * ecore.cs (Expression.MemberLookup): Added additional
18123 `qualifier_type' argument which is used when we're being called
18124 from MemberAccess.DoResolve() and null if we're called from a
18126 (Expression.MemberLookupFailed): New method to report errors; this
18127 does the CS1540 check and reports the correct error message.
18129 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
18130 argument for the CS1540 check and redone the way how we're dealing
18131 with private members. See the comment in the source code for details.
18132 (FilterWithClosure): Reverted this back to revision 1.197; renamed
18133 `closure_start_type' to `closure_qualifier_type' and check whether
18134 it's not null. It was not this filter being broken, it was just
18135 being called with the wrong arguments.
18137 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
18138 and pass it the correct `qualifier_type'; this also does the error
18141 2002-11-22 Miguel de Icaza <miguel@ximian.com>
18143 * expression.cs (Invocation.EmitParams): If the we are dealing
18144 with a non-built-in value type, load its address as well.
18146 (ArrayCreation): Use a a pretty constant instead
18147 of the hardcoded value 2. Use 6 instead of 2 for the number of
18148 static initializers.
18150 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
18151 because they are not really value types, just glorified integers.
18153 * driver.cs: Do not append .exe, the CSC compiler does not do it.
18155 * ecore.cs: Remove redundant code for enumerations, make them use
18156 the same code path as everything else, fixes the casting issue
18157 with enumerations in Windows.Forms.
18159 * attribute.cs: Do only cast to string if it is a string, the
18160 validation happens later.
18162 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
18163 people upgrade their corlibs.
18165 * ecore.cs: Oops, enumerations were not following the entire code path
18167 2002-11-21 Miguel de Icaza <miguel@ximian.com>
18169 * typemanager.cs (FilterWithClosure): Commented out the test for
18170 1540 in typemanager.cs, as it has problems when accessing
18171 protected methods from a parent class (see test-174.cs).
18173 * attribute.cs (Attribute.ValidateGuid): new method.
18174 (Attribute.Resolve): Use above.
18176 2002-11-19 Miguel de Icaza <miguel@ximian.com>
18178 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
18180 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
18181 handling for enumerations, as we only needed the TypeContainer
18182 functionality to begin with (this is required for the fix below to
18183 work for enums that reference constants in a container class for
18186 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
18188 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
18189 a valid TypeBuilder to perform lookups on.o
18191 * class.cs (InheritableMemberSignatureCompare): Use true in the
18192 call to GetGetMethod and GetSetMethod, because we are comparing
18193 the signature, and we need to get the methods *even* if they are
18196 (PropertyBase.CheckBase): ditto.
18198 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
18199 GotoCase.Resolve): Use Peel on EmpytCasts.
18201 * ecore.cs (EmptyCast): drop child, add Peel method.
18203 2002-11-17 Martin Baulig <martin@ximian.com>
18205 * ecore.cs (EmptyCast.Child): New public property.
18207 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
18208 label resolved to an EmptyCast. Fixes #34162.
18209 (GotoCase.Resolve): Likewise.
18210 (Block.EmitMeta): Likewise.
18212 2002-11-17 Martin Baulig <martin@ximian.com>
18214 * expression.cs (Invocation.BetterConversion): Prefer int over
18215 uint; short over ushort; long over ulong for integer literals.
18216 Use ImplicitConversionExists instead of StandardConversionExists
18217 since we also need to check for user-defined implicit conversions.
18218 Fixes #34165. Added test-173.cs.
18220 2002-11-16 Martin Baulig <martin@ximian.com>
18222 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
18223 with the `true' and `false' literals. Fixes #33151.
18225 2002-11-16 Martin Baulig <martin@ximian.com>
18227 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
18228 October 22nd; don't do the cs1540 check for static members.
18230 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
18231 now using our own filter here and doing the cs1540 check again.
18233 2002-11-16 Martin Baulig <martin@ximian.com>
18235 * support.cs (InternalParameters): Don't crash if we don't have
18236 any fixed parameters. Fixes #33532.
18238 2002-11-16 Martin Baulig <martin@ximian.com>
18240 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
18241 when looking up static methods to make this work on Windows.
18244 2002-11-16 Martin Baulig <martin@ximian.com>
18246 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
18247 a setter rather than using PropertyInfo.CanWrite.
18249 2002-11-15 Nick Drochak <ndrochak@gol.com>
18251 * class.cs: Allow acces to block member by subclasses. Fixes build
18254 2002-11-14 Martin Baulig <martin@ximian.com>
18256 * class.cs (Constructor.Emit): Added the extern/block check.
18259 2002-11-14 Martin Baulig <martin@ximian.com>
18261 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
18262 iteration while looking for indexers, this is needed because the
18263 indexer may have a different name in our base classes. Fixed the
18264 error reporting (no indexers at all, not get accessor, no
18265 overloaded match). Fixes bug #33089.
18266 (IndexerAccess.DoResolveLValue): Likewise.
18268 2002-11-14 Martin Baulig <martin@ximian.com>
18270 * class.cs (PropertyBase.CheckBase): Make this work for multiple
18271 indexers. Fixes the first part of bug #33089.
18272 (MethodSignature.InheritableMemberSignatureCompare): Added support
18275 2002-11-13 Ravi Pratap <ravi@ximian.com>
18277 * attribute.cs (Attribute.Resolve): Catch the
18278 NullReferenceException and report it since it isn't supposed to
18281 2002-11-12 Miguel de Icaza <miguel@ximian.com>
18283 * expression.cs (Binary.EmitBranchable): Also handle the cases for
18284 LogicalOr and LogicalAnd that can benefit from recursively
18285 handling EmitBranchable. The code now should be nice for Paolo.
18287 2002-11-08 Miguel de Icaza <miguel@ximian.com>
18289 * typemanager.cs (LookupType): Added a negative-hit hashtable for
18290 the Type lookups, as we perform quite a number of lookups on
18291 non-Types. This can be removed once we can deterministically tell
18292 whether we have a type or a namespace in advance.
18294 But this might require special hacks from our corlib.
18298 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
18299 and double which avoids a conversion from an integer to a double.
18301 * expression.cs: tiny optimization, avoid calling IsConstant,
18302 because it effectively performs the lookup twice.
18304 2002-11-06 Miguel de Icaza <miguel@ximian.com>
18306 But a bogus return here to keep the semantics of the old code
18307 until the Mono runtime is fixed.
18309 * pending.cs (GetMissingInterfaces): New method used to remove all
18310 the interfaces that are already implemented by our parent
18311 classes from the list of pending methods.
18313 * interface.cs: Add checks for calls after ResolveTypeExpr.
18315 2002-11-05 Miguel de Icaza <miguel@ximian.com>
18317 * class.cs (Class.Emit): Report warning 67: event not used if the
18318 warning level is beyond 3.
18320 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
18321 being a NullLiteral.
18323 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
18326 * class.cs (TypeContainer.GetClassBases): Cover a missing code
18327 path that might fail if a type can not be resolved.
18329 * expression.cs (Binary.Emit): Emit unsigned versions of the
18332 * driver.cs: use error 5.
18334 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
18336 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
18338 2002-11-01 Miguel de Icaza <miguel@ximian.com>
18340 * cs-parser.jay (switch_section): A beautiful patch from Martin
18341 Baulig that fixed 33094.
18343 2002-10-31 Miguel de Icaza <miguel@ximian.com>
18345 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
18346 Check whether the base is abstract and report an error if so.
18348 * expression.cs (IndexerAccess.DoResolveLValue,
18349 IndexerAccess.DoResolve): ditto.
18351 (Invocation.DoResolve): ditto.
18353 (Invocation.FullMethodDesc): Improve the report string.
18355 * statement.cs (Block): Eliminate IsVariableDefined as it is
18356 basically just a wrapper for GetVariableInfo.
18358 * ecore.cs (SimpleName): Use new
18360 * support.cs (ReflectionParamter.ParameterType): We unwrap the
18361 type, as we return the actual parameter ref/unref state on a
18364 2002-10-30 Miguel de Icaza <miguel@ximian.com>
18366 * support.cs: Return proper flags REF/OUT fixing the previous
18369 * expression.cs: Reverted last patch, that was wrong. Is_ref is
18370 not used to mean `ref' but `ref or out' in ParameterReference
18372 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
18373 full type signature instead of calling TypeManger.CSharpName
18376 * support.cs (InternalParameters.ParameterDesc): Do not compare
18377 directly to the modflags, because REF/OUT will actually be bitsets
18380 * delegate.cs (VerifyMethod): Check also the modifiers.
18382 * cs-tokenizer.cs: Fix bug where floating point values with an
18383 exponent where a sign was missing was ignored.
18385 * driver.cs: Allow multiple assemblies to be specified in a single
18388 2002-10-28 Miguel de Icaza <miguel@ximian.com>
18390 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
18391 because identifiers after a parenthesis would end up in this kind
18392 of production, and we needed to desamiguate it for having casts
18395 (UserDefinedType *) xxx
18397 2002-10-24 Miguel de Icaza <miguel@ximian.com>
18399 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
18400 we should set on the Bindingflags.NonPublic, but not turn on
18401 private_ok. private_ok controls whether a Private member is
18402 returned (this is chekced on the filter routine), while the
18403 BindingFlags.NonPublic just controls whether private/protected
18404 will be allowed. This fixes the problem part of the problem of
18405 private properties being allowed to be used in derived classes.
18407 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
18408 so we can call the children DoResolveLValue method (this will
18409 properly signal errors on lvalue assignments to base properties)
18411 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
18412 getter are null, and we have a property info, we know that this
18413 happened because the lookup failed, so we report an error 122 for
18414 protection level violation.
18416 We also silently return if setter and getter are null in the
18417 resolve functions, this condition only happens if we have flagged
18418 the error before. This is the other half of the problem.
18420 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
18421 not have accessibility information, that is why we were returning
18422 true in the filter function in typemanager.cs.
18424 To properly report 122 (property is inaccessible because of its
18425 protection level) correctly, we report this error in ResolveAccess
18426 by failing if both the setter and the getter are lacking (ie, the
18429 DoResolve and DoLResolve have been modified to check for both
18430 setter/getter being null and returning silently, the reason being
18431 that I did not want to put the knowledge about this error in upper
18434 int old = Report.Errors;
18435 x = new PropertyExpr (...);
18436 if (old != Report.Errors)
18441 So the property expr is returned, but it is invalid, so the error
18442 will be flagged during the resolve process.
18444 * class.cs: Remove InheritablePropertySignatureCompare from the
18445 class, as we no longer depend on the property signature to compute
18446 whether it is possible to implement a method or not.
18448 The reason is that calling PropertyInfo.GetGetMethod will return
18449 null (in .NET, in Mono it works, and we should change this), in
18450 cases where the Get Method does not exist in that particular
18455 class X { public virtual int A { get { return 1; } } }
18457 class Z : Y { public override int A { get { return 2; } } }
18459 Would fail in Z because the parent (Y) would not have the property
18460 defined. So we avoid this completely now (because the alternative
18461 fix was ugly and slow), and we now depend exclusively on the
18464 (PropertyBase.CheckBase): Use a method-base mechanism to find our
18465 reference method, instead of using the property.
18467 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
18468 routines are gone now.
18470 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
18471 names, they were incorrectly named.
18473 * cs-tokenizer.cs: Return are more gentle token on failure.
18475 * pending.cs (PendingImplementation.InterfaceMethod): This routine
18476 had an out-of-sync index variable, which caused it to remove from
18477 the list of pending methods the wrong method sometimes.
18479 2002-10-22 Miguel de Icaza <miguel@ximian.com>
18481 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
18482 CanWrite, because those refer to this particular instance of the
18483 property, and do not take into account the fact that we can
18484 override single members of a property.
18486 Constructor requires an EmitContext. The resolution process does
18487 not happen here, but we need to compute the accessors before,
18488 because the resolution does not always happen for properties.
18490 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
18491 subclass, before we did not update this flag, but we did update
18494 (GetAccessors): Drop this routine, as it did not work in the
18495 presence of partially overwritten set/get methods.
18497 Notice that this broke the cs1540 detection, but that will require
18500 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18504 * driver.cs: issue a warning instead of an error if we don't support
18505 debugging for the platform. Also ignore a couple of errors that may
18506 arise when trying to write the symbols. Undo my previous patch.
18508 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18510 * driver.cs: ignore /debug switch except for Unix platforms.
18512 2002-10-23 Nick Drochak <ndrochak@gol.com>
18514 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
18516 2002-10-21 Miguel de Icaza <miguel@ximian.com>
18518 * driver.cs: Do not make mcs-debug conditional, so we do not break
18519 builds that use it.
18521 * statement.cs (UsageVector.MergeChildren): I would like Martin to
18522 review this patch. But basically after all the children variables
18523 have been merged, the value of "Breaks" was not being set to
18524 new_breaks for Switch blocks. I think that it should be set after
18525 it has executed. Currently I set this to the value of new_breaks,
18526 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
18527 conservative, but I do not understand this code very well.
18529 I did not break anything in the build, so that is good ;-)
18531 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
18533 2002-10-20 Mark Crichton <crichton@gimp.org>
18535 * cfold.cs: Fixed compile blocker. Really fixed it this time.
18537 2002-10-20 Nick Drochak <ndrochak@gol.com>
18539 * cfold.cs: Fixed compile blocker.
18541 2002-10-20 Miguel de Icaza <miguel@ximian.com>
18543 * driver.cs: I was chekcing the key, not the file.
18545 2002-10-19 Ravi Pratap <ravi@ximian.com>
18547 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
18548 message that we were generating - we just need to silently return
18551 2002-10-19 Miguel de Icaza <miguel@ximian.com>
18553 * class.cs (Event.Define): Change my previous commit, as this
18554 breaks the debugger. This is a temporary hack, as it seems like
18555 the compiler is generating events incorrectly to begin with.
18557 * expression.cs (Binary.ResolveOperator): Added support for
18558 "U operator - (E x, E y)"
18560 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
18563 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
18564 init-only variables, but this path did not take into account that
18565 there might be also instance readonly variables. Correct this
18568 This fixes bug 32253
18570 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
18573 * driver.cs: Change the extension for modules to `netmodule'
18575 * cs-parser.jay: Improved slightly the location tracking for
18576 the debugger symbols.
18578 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
18579 modifiers that were specified instead of the hardcoded value
18580 (FamAndAssem). This was basically ignoring the static modifier,
18581 and others. Fixes 32429.
18583 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
18584 fixed a bug in the process (32476)
18586 * expression.cs (ArrayAccess.EmitAssign): Patch from
18587 hwang_rob@yahoo.ca that fixes bug 31834.3
18589 2002-10-18 Miguel de Icaza <miguel@ximian.com>
18591 * driver.cs: Make the module extension .netmodule.
18593 2002-10-16 Miguel de Icaza <miguel@ximian.com>
18595 * driver.cs: Report an error if the resource file is not found
18596 instead of crashing.
18598 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
18599 false, like Emit does.
18601 2002-10-16 Nick Drochak <ndrochak@gol.com>
18603 * typemanager.cs: Remove unused private member. Also reported mcs
18604 bug to report this as a warning like csc.
18606 2002-10-15 Martin Baulig <martin@gnome.org>
18608 * statement.cs (Statement.Emit): Made this a virtual method; emits
18609 the line number info and calls DoEmit().
18610 (Statement.DoEmit): New protected abstract method, formerly knows
18611 as Statement.Emit().
18613 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
18615 2002-10-11 Miguel de Icaza <miguel@ximian.com>
18617 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
18618 have fixed a remaining problem: not every AddXXXX was adding a
18619 fully qualified name.
18621 Now everyone registers a fully qualified name in the DeclSpace as
18622 being defined instead of the partial name.
18624 Downsides: we are slower than we need to be due to the excess
18625 copies and the names being registered this way.
18627 The reason for this is that we currently depend (on the corlib
18628 bootstrap for instance) that types are fully qualified, because
18629 we dump all the types in the namespace, and we should really have
18630 types inserted into the proper namespace, so we can only store the
18631 basenames in the defined_names array.
18633 2002-10-10 Martin Baulig <martin@gnome.org>
18635 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
18636 from bug #31834, see the bug report for a testcase which is
18639 2002-10-10 Martin Baulig <martin@gnome.org>
18641 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
18642 flow analysis code for this.
18644 * statement.cs (Do, While, For): Tell the flow analysis code about
18646 (FlowBranching.UsageVector): Added support for infinite loops.
18647 (Block.Resolve): Moved the dead code elimination here and use flow
18650 2002-10-09 Miguel de Icaza <miguel@ximian.com>
18652 * class.cs (Field.Define): Catch cycles on struct type
18655 * typemanager.cs (IsUnmanagedtype): Do not recursively check
18656 fields if the fields are static. We only need to check instance
18659 * expression.cs (As.DoResolve): Test for reference type.
18661 * statement.cs (Using.ResolveExpression): Use
18662 ConvertImplicitRequired, not ConvertImplicit which reports an
18664 (Using.ResolveLocalVariableDecls): ditto.
18666 * expression.cs (Binary.ResolveOperator): Report errors in a few
18667 places where we had to.
18669 * typemanager.cs (IsUnmanagedtype): Finish implementation.
18671 2002-10-08 Miguel de Icaza <miguel@ximian.com>
18673 * expression.cs: Use StoreFromPtr instead of extracting the type
18674 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
18676 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
18677 an enumeration value to a System.Enum, but System.Enum is not a
18678 value type, but an class type, so we need to box.
18680 (Expression.ConvertExplicit): One codepath could return
18681 errors but not flag them. Fix this. Fixes #31853
18683 * parameter.cs (Resolve): Do not allow void as a parameter type.
18685 2002-10-06 Martin Baulig <martin@gnome.org>
18687 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
18688 if it's a class type and not a struct. Fixes #31815.
18690 2002-10-06 Martin Baulig <martin@gnome.org>
18692 * statement.cs: Reworked the flow analysis code a bit to make it
18693 usable for dead code elimination.
18695 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18697 * cs-parser.jay: allow empty source files. Fixes bug #31781.
18699 2002-10-04 Miguel de Icaza <miguel@ximian.com>
18701 * expression.cs (ComposedCast.DoResolveType): A quick workaround
18702 to fix the test 165, will investigate deeper.
18704 2002-10-04 Martin Baulig <martin@gnome.org>
18706 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
18707 finally blocks actually work.
18708 (Try.Resolve): We don't need to create a sibling for `finally' if
18709 there is no finally block.
18711 2002-10-04 Martin Baulig <martin@gnome.org>
18713 * class.cs (Constructor.Define): The default accessibility for a
18714 non-default constructor is private, not public.
18716 2002-10-04 Miguel de Icaza <miguel@ximian.com>
18718 * class.cs (Constructor): Make AllowedModifiers public, add
18721 * cs-parser.jay: Perform the modifiers test here, as the
18722 constructor for the Constructor class usually receives a zero
18723 because of the way we create it (first we create, later we
18724 customize, and we were never checking the modifiers).
18726 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
18727 is a version of LookupTypeReflection that includes the type-name
18728 cache. This can be used as a fast path for functions that know
18729 the fully qualified name and are only calling into *.GetType() to
18730 obtain a composed type.
18732 This is also used by TypeManager.LookupType during its type
18735 (LookupType): We now also track the real type name, as sometimes
18736 we can get a quey for the real type name from things like
18737 ComposedCast. This fixes bug 31422.
18739 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
18740 complete type fullname, it does not have to go through the type
18741 resolution system to obtain the composed version of the type (for
18742 obtaining arrays or pointers).
18744 (Conditional.Emit): Use the EmitBoolExpression to
18745 generate nicer code, as requested by Paolo.
18747 (ArrayCreation.CheckIndices): Use the patch from
18748 hwang_rob@yahoo.ca to validate the array initializers.
18750 2002-10-03 Miguel de Icaza <miguel@ximian.com>
18752 * class.cs (ConstructorInitializer.Emit): simplify code by using
18753 Invocation.EmitCall, and at the same time, fix the bugs in calling
18754 parent constructors that took variable arguments.
18756 * ecore.cs (Expression.ConvertNumericExplicit,
18757 Expression.ImplicitNumericConversion): Remove the code that
18758 manually wrapped decimal (InternalTypeConstructor call is now gone
18761 * expression.cs (Cast.TryReduce): Also handle decimal types when
18762 trying to perform a constant fold on the type.
18764 * typemanager.cs (IsUnmanagedtype): Partially implemented.
18766 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
18767 that only turned off an error report, and did nothing else.
18769 2002-10-02 Miguel de Icaza <miguel@ximian.com>
18771 * driver.cs: Handle and ignore /fullpaths
18773 2002-10-01 Miguel de Icaza <miguel@ximian.com>
18775 * expression.cs (Binary.ResolveOperator): Catch the case where
18776 DoNumericPromotions returns true,
18778 (Binary.DoNumericPromotions): Simplify the code, and the tests.
18780 2002-09-27 Miguel de Icaza <miguel@ximian.com>
18782 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
18785 2002-09-26 Miguel de Icaza <miguel@ximian.com>
18787 * ecore.cs (ConvertNumericExplicit): It is not enough that the
18788 conversion exists, but it is also required that the conversion be
18789 performed. This manifested in "(Type64Enum) 2".
18791 * class.cs (TypeManager.AddMethod): The fix is not to change
18792 AddEnum, because that one was using a fully qualified name (every
18793 DeclSpace derivative does), but to change the AddMethod routine
18794 that was using an un-namespaced name. This now correctly reports
18795 the duplicated name.
18797 Revert patch until I can properly fix it. The issue
18798 is that we have a shared Type space across all namespaces
18799 currently, which is wrong.
18801 Options include making the Namespace a DeclSpace, and merge
18802 current_namespace/current_container in the parser.
18804 2002-09-25 Miguel de Icaza <miguel@ximian.com>
18806 * cs-parser.jay: Improve error reporting when we get a different
18807 kind of expression in local_variable_type and
18808 local_variable_pointer_type.
18810 Propagate this to avoid missleading errors being reported.
18812 * ecore.cs (ImplicitReferenceConversion): treat
18813 TypeManager.value_type as a target just like object_type. As
18818 Is valid, and needs to result in the int 1 being boxed before it
18819 is assigned to the value type v.
18821 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
18822 to validate the enumeration name.
18824 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
18825 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
18826 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
18828 * ecore.cs (TryImplicitIntConversion): When doing an
18829 implicit-enumeration-conversion, check if the type is 64-bits and
18830 perform a conversion before passing to EnumConstant.
18832 2002-09-23 Miguel de Icaza <miguel@ximian.com>
18834 * decl.cs (Error_AmbiguousTypeReference); New routine used to
18835 report ambiguous type references. Unlike the MS version, we
18836 report what the ambiguity is. Innovation at work ;-)
18838 (DeclSpace.FindType): Require a location argument to
18839 display when we display an ambiguous error.
18841 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
18843 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
18845 * expression.cs (EmitDynamicInitializers): Apply patch from
18846 hwang_rob@yahoo.ca that fixes the order in which we emit our
18849 2002-09-21 Martin Baulig <martin@gnome.org>
18851 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
18852 delegate takes no arguments.
18854 2002-09-20 Miguel de Icaza <miguel@ximian.com>
18856 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
18859 * expression.cs: Extract the underlying type.
18861 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
18863 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
18865 2002-09-19 Miguel de Icaza <miguel@ximian.com>
18867 * class.cs (TypeContainer.DefineType): We can not use the nice
18868 PackingSize with the size set to 1 DefineType method, because it
18869 will not allow us to define the interfaces that the struct
18872 This completes the fixing of bug 27287
18874 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
18875 means also structs. This fixes part of the problem.
18876 (Expresion.ImplicitReferenceConversionExists): ditto.
18878 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
18879 error if there were no errors reported during the type lookup
18880 process, to avoid duplicates or redundant errors. Without this
18881 you would get an ambiguous errors plus a type not found. We have
18882 beaten the user enough with the first error.
18884 (DeclSparce.FindType): Emit a warning if we have an ambiguous
18887 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
18888 during the resolution process, stop the lookup, this avoids
18889 repeated error reports (same error twice).
18891 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
18893 * typemanager.cs (LookupType): Redo the type lookup code to match
18894 the needs of System.Reflection.
18896 The issue is that System.Reflection requires references to nested
18897 types to begin with a "+" sign instead of a dot. So toplevel
18898 types look like: "NameSpace.TopLevelClass", and nested ones look
18899 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
18902 2002-09-19 Martin Baulig <martin@gnome.org>
18904 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
18905 says that a method always returns or always throws an exception,
18906 don't report the CS0161.
18908 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
18909 set `Returns = new_returns'.
18911 2002-09-19 Martin Baulig <martin@gnome.org>
18913 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
18914 to an enum constant, check for a CS0176.
18916 2002-09-18 Miguel de Icaza <miguel@ximian.com>
18918 * class.cs (TypeContainer.CheckPairedOperators): Now we check
18919 for operators that must be in pairs and report errors.
18921 * ecore.cs (SimpleName.DoResolveType): During the initial type
18922 resolution process, when we define types recursively, we must
18923 check first for types in our current scope before we perform
18924 lookups in the enclosing scopes.
18926 * expression.cs (MakeByteBlob): Handle Decimal blobs.
18928 (Invocation.VerifyArgumentsCompat): Call
18929 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
18930 I thought we were supposed to always call this, but there are a
18931 few places in the code where we dont do it.
18933 2002-09-17 Miguel de Icaza <miguel@ximian.com>
18935 * driver.cs: Add support in -linkres and -resource to specify the
18936 name of the identifier.
18938 2002-09-16 Miguel de Icaza <miguel@ximian.com>
18940 * ecore.cs (StandardConversionExists): Sync with the conversion
18941 code: allow anything-* to void* conversions.
18943 (FindMostSpecificSource): Use an Expression argument
18944 instead of a Type, because we might be handed over a Literal which
18945 gets a few more implicit conversions that plain types do not. So
18946 this information was being lost.
18948 Also, we drop the temporary type-holder expression when not
18951 2002-09-17 Martin Baulig <martin@gnome.org>
18953 * class.cs (PropertyBase.CheckBase): Don't check the base class if
18954 this is an explicit interface implementation.
18956 2002-09-17 Martin Baulig <martin@gnome.org>
18958 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
18959 different `IndexerName' attributes.
18961 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
18962 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
18963 virtual CommonResolve().
18965 2002-09-16 Miguel de Icaza <miguel@ximian.com>
18967 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
18968 and convert that to the UnderlyingType.
18970 * statement.cs (Foreach.Resolve): Indexers are just like variables
18971 or PropertyAccesses.
18973 * cs-tokenizer.cs (consume_string): Track line numbers and columns
18974 inside quoted strings, we were not doing this before.
18976 2002-09-16 Martin Baulig <martin@gnome.org>
18978 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
18979 resolve it. This is needed for the definite assignment check of the
18980 instance expression, fixes bug #29846.
18981 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
18983 2002-09-16 Nick Drochak <ndrochak@gol.com>
18985 * parameter.cs: Fix compile error. Cannot reference static member
18986 from an instance object. Is this an mcs bug?
18988 2002-09-14 Martin Baulig <martin@gnome.org>
18990 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
18991 multiple times. Fixes bug #30295, added test-166.cs.
18993 2002-09-14 Martin Baulig <martin@gnome.org>
18995 * statement.cs (Block.Emit): Don't emit unreachable code.
18996 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
18997 `break' statements.
18998 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
19000 2002-09-14 Martin Baulig <martin@gnome.org>
19002 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
19005 2002-09-14 Martin Baulig <martin@gnome.org>
19007 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
19008 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
19009 be false on the ms runtime.
19011 2002-09-13 Martin Baulig <martin@gnome.org>
19013 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
19014 the CS0038 error message.
19016 2002-09-12 Miguel de Icaza <miguel@ximian.com>
19018 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
19019 constant inside, return it.
19021 2002-09-12 Martin Baulig <martin@gnome.org>
19023 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
19024 implicit conversion can be done between enum types.
19026 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
19027 check whether an implicit conversion to the current enum's UnderlyingType
19028 exists and report an error if not.
19030 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
19031 without debugging support.
19033 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
19034 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
19036 2002-09-12 Martin Baulig <martin@gnome.org>
19038 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
19040 * ecore.cs (IMemberExpr.DeclaringType): New property.
19041 (SimpleName.SimpleNameResolve): Check whether we're accessing a
19042 nonstatic member of an outer type (CS0038).
19044 2002-09-11 Miguel de Icaza <miguel@ximian.com>
19046 * driver.cs: Activate the using-error detector at warning level
19047 4 (at least for MS-compatible APIs).
19049 * namespace.cs (VerifyUsing): Small buglett fix.
19051 * pending.cs (PendingImplementation): pass the container pointer.
19053 * interface.cs (GetMethods): Allow for recursive definition. Long
19054 term, I would like to move every type to support recursive
19055 definitions, not the current ordering mechanism that we have right
19058 The situation is this: Attributes are handled before interfaces,
19059 so we can apply attributes to interfaces. But some attributes
19060 implement interfaces, we will now handle the simple cases
19061 (recursive definitions will just get an error).
19063 * parameter.cs: Only invalidate types at the end if we fail to
19066 2002-09-09 Martin Baulig <martin@gnome.org>
19068 * ecore.cs (PropertyExpr.Emit): Also check for
19069 TypeManager.system_int_array_get_length so this'll also work when
19070 compiling corlib. Fixes #30003.
19072 2002-09-09 Martin Baulig <martin@gnome.org>
19074 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
19075 and throw an exception if we can't get the type's size. Fixed #30040,
19078 2002-09-09 Martin Baulig <martin@gnome.org>
19080 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
19082 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
19083 context. Fixes bug #30027.
19085 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
19086 virtual functions. Fixes bug #30043, added test-164.cs.
19088 2002-09-08 Ravi Pratap <ravi@ximian.com>
19090 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
19092 2002-09-08 Nick Drochak <ndrochak@gol.com>
19094 * driver.cs: Use an object to get the windows codepage since it's not a
19097 2002-09-08 Miguel de Icaza <miguel@ximian.com>
19099 * statement.cs (For.Emit): for infinite loops (test == null)
19100 return whether there is a break inside, not always "true".
19102 * namespace.cs (UsingEntry): New struct to hold the name of the
19103 using definition, the location where it is defined, and whether it
19104 has been used in a successful type lookup.
19106 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
19111 2002-09-06 Ravi Pratap <ravi@ximian.com>
19113 * attribute.cs : Fix incorrect code which relied on catching
19114 a NullReferenceException to detect a null being passed in
19115 where an object was expected.
19117 2002-09-06 Miguel de Icaza <miguel@ximian.com>
19119 * statement.cs (Try): flag the catch variable as assigned
19121 * expression.cs (Cast): Simplified by using ResolveType instead of
19122 manually resolving.
19124 * statement.cs (Catch): Fix bug by using ResolveType.
19126 2002-09-06 Ravi Pratap <ravi@ximian.com>
19128 * expression.cs (BetterConversion): Special case for when we have
19129 a NullLiteral as the argument and we have to choose between string
19130 and object types - we choose string the way csc does.
19132 * attribute.cs (Attribute.Resolve): Catch the
19133 NullReferenceException and report error #182 since the Mono
19134 runtime no more has the bug and having this exception raised means
19135 we tried to select a constructor which takes an object and is
19138 2002-09-05 Ravi Pratap <ravi@ximian.com>
19140 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
19141 message (1502, 1503) when we can't locate a method after overload
19142 resolution. This is much more informative and closes the bug
19145 * interface.cs (PopulateMethod): Return if there are no argument
19146 types. Fixes a NullReferenceException bug.
19148 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
19149 expressions too. Previously we were checking only in one place for
19150 positional arguments leaving out named arguments.
19152 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
19153 type to the enum type is not allowed. Remove code corresponding to
19156 (ConvertNumericExplicit): Allow explicit conversions from
19157 the underlying type to enum type. This precisely follows the spec
19158 and closes a bug filed by Gonzalo.
19160 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19163 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
19165 2002-09-03 Miguel de Icaza <miguel@ximian.com>
19167 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
19168 it was important that we stored the right value after the
19169 reduction in `converted'.
19171 2002-09-04 Martin Baulig <martin@gnome.org>
19173 * location.cs (Location.SymbolDocument): Use full pathnames for the
19176 2002-08-30 Miguel de Icaza <miguel@ximian.com>
19178 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
19179 of the expression resolve mechanism, because that will catch the
19180 SimpleName error failures.
19182 (Conditional): If we can not resolve the
19183 expression, return, do not crash.
19185 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19188 (location): display token name instead of its number.
19190 2002-08-28 Martin Baulig <martin@gnome.org>
19192 * expression.cs (Binary.ResolveOperator): Don't silently return
19193 but return an error if an operator cannot be applied between two
19196 2002-08-28 Martin Baulig <martin@gnome.org>
19198 * class.cs (Constructor.Define): Set the permission attributes
19199 correctly instead of making all constructors public.
19201 2002-08-28 Martin Baulig <martin@gnome.org>
19203 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
19204 for private members before reporting a CS0103; if we find anything,
19207 2002-08-28 Martin Baulig <martin@gnome.org>
19209 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
19210 to check whether `closure_start_type == closure_invocation_type',
19211 we also need to check whether `m.DeclaringType == closure_invocation_type'
19212 before bypassing the permission checks. We might be accessing
19213 protected/private members from the base class.
19214 (TypeManager.RealMemberLookup): Only set private_ok if private
19215 members were requested via BindingFlags.NonPublic.
19217 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
19219 * expression.cs (MemberAccess.ResolveMemberAccess): Set
19220 MethodGroupExpr.IsExplicitImpl if appropriate.
19221 (Invocation.DoResolve): Don't report the CS0120 for explicit
19222 interface implementations.
19224 2002-08-27 Martin Baulig <martin@gnome.org>
19226 * expression.cs (Invocation.DoResolve): If this is a static
19227 method and we don't have an InstanceExpression, we must report
19230 2002-08-25 Martin Baulig <martin@gnome.org>
19232 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
19233 `==' between a valuetype and an object.
19235 2002-08-25 Miguel de Icaza <miguel@ximian.com>
19237 * ecore.cs (TypeExpr): Provide a ToString method.
19239 2002-08-24 Martin Baulig <martin@gnome.org>
19241 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
19242 now called proggie.dbg and it's a binary file.
19244 2002-08-23 Martin Baulig <martin@gnome.org>
19246 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
19248 2002-08-23 Martin Baulig <martin@gnome.org>
19250 * struct.cs (MyStructInfo.ctor): Make this work with empty
19251 structs; it's not allowed to use foreach() on null.
19253 2002-08-23 Martin Baulig <martin@gnome.org>
19255 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
19256 writer the full pathname of the generated assembly.
19258 2002-08-23 Martin Baulig <martin@gnome.org>
19260 * statements.cs (FlowBranching.UsageVector.MergeChildren):
19261 A `finally' block never returns or breaks; improved handling of
19264 2002-08-23 Martin Baulig <martin@gnome.org>
19266 * statement.cs (Throw.Resolve): Allow `throw null'.
19268 2002-08-23 Martin Baulig <martin@gnome.org>
19270 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
19271 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
19272 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
19273 MemberLookup would return a wrong event if this is an explicit
19274 interface implementation and the class has an event with the same
19277 2002-08-23 Martin Baulig <martin@gnome.org>
19279 * statement.cs (Block.AddChildVariableNames): New public method.
19280 (Block.AddChildVariableName): Likewise.
19281 (Block.IsVariableNameUsedInChildBlock): Likewise.
19282 (Block.AddVariable): Check whether a variable name has already
19283 been used in a child block.
19285 * cs-parser.jay (declare_local_variables): Mark all variable names
19286 from the current block as being used in a child block in the
19289 2002-08-23 Martin Baulig <martin@gnome.org>
19291 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
19292 find the symbol writer.
19294 * driver.cs: csc also allows the arguments to /define being
19295 separated by commas, not only by semicolons.
19297 2002-08-23 Martin Baulig <martin@gnome.org>
19299 * interface.cs (Interface.GetMembers): Added static check for events.
19301 2002-08-15 Martin Baulig <martin@gnome.org>
19303 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
19304 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
19306 * ecore.cs (Expression.MemberLookup): Added documentation and explained
19307 why the MethodData.EmitDestructor() change was necessary.
19309 2002-08-20 Martin Baulig <martin@gnome.org>
19311 * class.cs (TypeContainer.FindMembers): Added static check for events.
19313 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
19315 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
19316 use Type.GetEvents(), not Type.FindMembers().
19318 2002-08-20 Martin Baulig <martin@gnome.org>
19320 * decl.cs (MemberCache): Added a special method cache which will
19321 be used for method-only searched. This ensures that a method
19322 search will return a MethodInfo with the correct ReflectedType for
19325 2002-08-20 Martin Baulig <martin@gnome.org>
19327 * decl.cs (DeclSpace.FindMembers): Made this public.
19329 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19331 * delegate.cs: fixed build on windows.
19332 [FIXME: Filed as bug #29150: MCS must report these errors.]
19334 2002-08-19 Ravi Pratap <ravi@ximian.com>
19336 * ecore.cs (StandardConversionExists): Return a false
19337 if we are trying to convert the void type to anything else
19338 since that is not allowed.
19340 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
19341 we flag error 70 in the event an event is trying to be accessed
19342 directly from outside the declaring type.
19344 2002-08-20 Martin Baulig <martin@gnome.org>
19346 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
19347 MemberCache from typemanager.cs to decl.cs.
19349 2002-08-19 Martin Baulig <martin@gnome.org>
19351 * class.cs (TypeContainer): Implement IMemberContainer.
19352 (TypeContainer.DefineMembers): Create the MemberCache.
19353 (TypeContainer.FindMembers): Do better BindingFlags checking; only
19354 return public members if BindingFlags.Public was given, check
19355 whether members are static.
19357 2002-08-16 Martin Baulig <martin@gnome.org>
19359 * decl.cs (DeclSpace.Define): Splitted this in Define and
19360 DefineMembers. DefineMembers is called first and initializes the
19363 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
19364 DefineMembers() on all our DeclSpaces.
19366 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
19367 but call DefineMembers() on all nested interfaces. We call their
19368 Define() in our new Define() function.
19370 * interface.cs (Interface): Implement IMemberContainer.
19371 (Interface.Define): Moved all code except the attribute stuf to
19373 (Interface.DefineMembers): Initialize the member cache.
19375 * typemanager.cs (IMemberFinder): Removed this interface, we don't
19376 need this anymore since we can use MemberCache.FindMembers directly.
19378 2002-08-19 Martin Baulig <martin@gnome.org>
19380 * typemanager.cs (MemberCache): When creating the cache for an
19381 interface type, add all inherited members.
19382 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
19383 to `out bool used_cache' and documented it.
19384 (TypeManager.MemberLookup): If we already used the cache in the first
19385 iteration, we don't need to do the interfaces check.
19387 2002-08-19 Martin Baulig <martin@gnome.org>
19389 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
19390 here from IMemberFinder and don't implement this interface anymore.
19391 (DeclSpace.MemberCache): Moved here from IMemberFinder.
19393 * typemanager.cs (IMemberFinder): This interface is now only used by
19394 classes which actually support the member cache.
19395 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
19396 since we only put DeclSpaces into this Hashtable.
19397 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
19398 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
19400 2002-08-16 Martin Baulig <martin@gnome.org>
19402 * typemanager.cs (ICachingMemberFinder): Removed.
19403 (IMemberFinder.MemberCache): New property.
19404 (TypeManager.FindMembers): Merged this with RealFindMembers().
19405 This function will never be called from TypeManager.MemberLookup()
19406 so we can't use the cache here, just the IMemberFinder.
19407 (TypeManager.MemberLookup_FindMembers): Check whether the
19408 IMemberFinder has a MemberCache and call the cache's FindMembers
19410 (MemberCache): Rewrote larger parts of this yet another time and
19411 cleaned it up a bit.
19413 2002-08-15 Miguel de Icaza <miguel@ximian.com>
19415 * driver.cs (LoadArgs): Support quoting.
19417 (Usage): Show the CSC-like command line arguments.
19419 Improved a few error messages.
19421 2002-08-15 Martin Baulig <martin@gnome.org>
19423 * typemanager.cs (IMemberContainer.Type): New property.
19424 (IMemberContainer.IsInterface): New property.
19426 The following changes are conditional to BROKEN_RUNTIME, which is
19427 defined at the top of the file.
19429 * typemanager.cs (MemberCache.MemberCache): Don't add the base
19430 class'es members, but add all members from TypeHandle.ObjectType
19431 if we're an interface.
19432 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
19433 is the current type.
19434 (MemberCache.CacheEntry.Container): Removed this field.
19435 (TypeHandle.GetMembers): Include inherited members.
19437 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19439 * typemanager.cs: fixed compilation and added a comment on a field that
19442 2002-08-15 Martin Baulig <martin@gnome.org>
19444 * class.cs (ConstructorInitializer.Resolve): In the
19445 Expression.MemberLookup call, use the queried_type as
19448 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
19449 declared' attribute, it's always true.
19450 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
19451 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
19452 temporary wrapper for FindMembers which tells MemberLookup whether
19453 members from the base classes are included in the return value.
19454 This will go away soon.
19455 (TypeManager.MemberLookup): Use this temporary hack here; once the
19456 new MemberCache is completed, we don't need to do the DeclaredOnly
19457 looping here anymore since the MemberCache will take care of this.
19458 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
19459 (MemberCache): When creating the MemberCache for a class, get
19460 members from the current class and all its base classes.
19461 (MemberCache.CacheEntry.Container): New field. This is a
19462 temporary hack until the Mono runtime is fixed to distinguish
19463 between ReflectedType and DeclaringType. It allows us to use MCS
19464 with both the MS runtime and the unfixed Mono runtime without
19465 problems and without accecting performance.
19466 (MemberCache.SearchMembers): The DeclaredOnly looping from
19467 TypeManager.MemberLookup is now done here.
19469 2002-08-14 Martin Baulig <martin@gnome.org>
19471 * statement.cs (MyStructInfo.MyStructInfo): Don't call
19472 Type.GetFields on dynamic types but get the fields from the
19473 corresponding TypeContainer.
19474 (MyStructInfo.GetStructInfo): Added check for enum types.
19476 * typemanager.cs (MemberList.IsSynchronized): Implemented.
19477 (MemberList.SyncRoot): Implemented.
19478 (TypeManager.FilterWithClosure): No need to check permissions if
19479 closure_start_type == closure_invocation_type, don't crash if
19480 closure_invocation_type is null.
19482 2002-08-13 Martin Baulig <martin@gnome.org>
19484 Rewrote TypeContainer.FindMembers to use a member cache. This
19485 gives us a speed increase of about 35% for the self-hosting MCS
19486 build and of about 15-20% for the class libs (both on GNU/Linux).
19488 * report.cs (Timer): New class to get enhanced profiling. This
19489 whole class is "TIMER" conditional since it remarkably slows down
19492 * class.cs (MemberList): New class. This is an IList wrapper
19493 which we're now using instead of passing MemberInfo[]'s around to
19494 avoid copying this array unnecessarily.
19495 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
19496 (ICachingMemberFinder, IMemberContainer): New interface.
19497 (TypeManager.FilterWithClosure): If `criteria' is null, the name
19498 has already been checked, otherwise use it for the name comparision.
19499 (TypeManager.FindMembers): Renamed to RealMemberFinder and
19500 provided wrapper which tries to use ICachingMemberFinder.FindMembers
19501 if possible. Returns a MemberList, not a MemberInfo [].
19502 (TypeHandle): New class, implements IMemberContainer. We create
19503 one instance of this class per type, it contains a MemberCache
19504 which is used to do the member lookups.
19505 (MemberCache): New class. Each instance of this class contains
19506 all members of a type and a name-based hash table.
19507 (MemberCache.FindMembers): This is our new member lookup
19508 function. First, it looks up all members of the requested name in
19509 the hash table. Then, it walks this list and sorts out all
19510 applicable members and returns them.
19512 2002-08-13 Martin Baulig <martin@gnome.org>
19514 In addition to a nice code cleanup, this gives us a performance
19515 increase of about 1.4% on GNU/Linux - not much, but it's already
19516 half a second for the self-hosting MCS compilation.
19518 * typemanager.cs (IMemberFinder): New interface. It is used by
19519 TypeManager.FindMembers to call FindMembers on a TypeContainer,
19520 Enum, Delegate or Interface.
19521 (TypeManager.finder_to_member_finder): New PtrHashtable.
19522 (TypeManager.finder_to_container): Removed.
19523 (TypeManager.finder_to_delegate): Removed.
19524 (TypeManager.finder_to_interface): Removed.
19525 (TypeManager.finder_to_enum): Removed.
19527 * interface.cs (Interface): Implement IMemberFinder.
19529 * delegate.cs (Delegate): Implement IMemberFinder.
19531 * enum.cs (Enum): Implement IMemberFinder.
19533 * class.cs (TypeContainer): Implement IMemberFinder.
19535 2002-08-12 Martin Baulig <martin@gnome.org>
19537 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
19539 2002-08-12 Martin Baulig <martin@gnome.org>
19541 * ecore.cs (ITypeExpression): New interface for expressions which
19543 (TypeExpression): Renamed to TypeLookupExpression.
19544 (Expression.DoResolve): If we're doing a types-only lookup, the
19545 expression must implement the ITypeExpression interface and we
19546 call DoResolveType() on it.
19547 (SimpleName): Implement the new ITypeExpression interface.
19548 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
19549 hack, the situation that we're only looking up types can't happen
19550 anymore when this method is called. Moved the type lookup code to
19551 DoResolveType() and call it.
19552 (SimpleName.DoResolveType): This ITypeExpression interface method
19553 is now doing the types-only lookup.
19554 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
19555 (ResolveFlags): Added MaskExprClass.
19557 * expression.cs (MemberAccess): Implement the ITypeExpression
19559 (MemberAccess.DoResolve): Added support for a types-only lookup
19560 when we're called via ITypeExpression.DoResolveType().
19561 (ComposedCast): Implement the ITypeExpression interface.
19563 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
19564 Expression.Resolve() with ResolveFlags.Type instead.
19566 2002-08-12 Martin Baulig <martin@gnome.org>
19568 * interface.cs (Interface.Define): Apply attributes.
19570 * attribute.cs (Attribute.ApplyAttributes): Added support for
19571 interface attributes.
19573 2002-08-11 Martin Baulig <martin@gnome.org>
19575 * statement.cs (Block.Emit): Only check the "this" variable if we
19576 do not always throw an exception.
19578 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
19579 whether the property has a set accessor.
19581 2002-08-11 Martin Baulig <martin@gnome.org>
19583 Added control flow analysis support for structs.
19585 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
19586 with control flow analysis turned off.
19587 (IVariable): New interface.
19588 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
19589 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
19590 (FieldExpr.DoResolve): Resolve the instance expression with flow
19591 analysis turned off and do the definite assignment check after the
19592 resolving when we know what the expression will resolve to.
19594 * expression.cs (LocalVariableReference, ParameterReference):
19595 Implement the new IVariable interface, only call the flow analysis
19596 code if ec.DoFlowAnalysis is true.
19597 (This): Added constructor which takes a Block argument. Implement
19598 the new IVariable interface.
19599 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
19600 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
19601 This does the definite assignment checks for struct members.
19603 * class.cs (Constructor.Emit): If this is a non-static `struct'
19604 constructor which doesn't have any initializer, call
19605 Block.AddThisVariable() to tell the flow analysis code that all
19606 struct elements must be initialized before control returns from
19609 * statement.cs (MyStructInfo): New public class.
19610 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
19611 argument to this indexer. If non-zero, check an individual struct
19612 member, not the whole struct.
19613 (FlowBranching.CheckOutParameters): Check struct members.
19614 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
19615 overloaded versions of these methods which take an additional
19616 `int field_idx' argument to check struct members.
19617 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
19618 overloaded versions of these methods which take an additional
19619 `string field_name' argument to check struct member.s
19620 (VariableInfo): Implement the IVariable interface.
19621 (VariableInfo.StructInfo): New public property. Returns the
19622 MyStructInfo instance of the variable if it's a struct or null.
19623 (Block.AddThisVariable): New public method. This is called from
19624 Constructor.Emit() for non-static `struct' constructor which do
19625 not have any initializer. It creates a special variable for the
19626 "this" instance variable which will be checked by the flow
19627 analysis code to ensure that all of the struct's fields are
19628 initialized before control returns from the constructor.
19629 (UsageVector): Added support for struct members. If a
19630 variable/parameter is a struct with N members, we reserve a slot
19631 in the usage vector for each member. A struct is considered fully
19632 initialized if either the struct itself (slot 0) or all its
19633 members are initialized.
19635 2002-08-08 Martin Baulig <martin@gnome.org>
19637 * driver.cs (Driver.MainDriver): Only report an error CS5001
19638 if there were no compilation errors.
19640 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
19641 `UnsafeContext' property to determine whether the parent is in
19642 unsafe context rather than checking the parent's ModFlags:
19643 classes nested in an unsafe class are unsafe as well.
19645 2002-08-08 Martin Baulig <martin@gnome.org>
19647 * statement.cs (UsageVector.MergeChildren): Distinguish between
19648 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
19649 we return. Added test17() and test18() to test-154.cs.
19651 2002-08-08 Martin Baulig <martin@gnome.org>
19653 * typemanager.cs (TypeManager.FilterWithClosure): If we have
19654 Family access, make sure the invoking type isn't a subclass of the
19655 queried type (that'd be a CS1540).
19657 * ecore.cs (Expression.MemberLookup): Added overloaded version of
19658 this method which takes an additional `Type invocation_type'.
19660 * expression.cs (BaseAccess.DoResolve): Use the base type as
19661 invocation and query type.
19662 (MemberAccess.DoResolve): If the lookup failed and we're about to
19663 report a CS0122, try a lookup with the ec.ContainerType - if this
19664 succeeds, we must report a CS1540.
19666 2002-08-08 Martin Baulig <martin@gnome.org>
19668 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
19669 (MethodGroupExpr): Implement the IMemberExpr interface.
19671 * expression (MemberAccess.ResolveMemberAccess): No need to have
19672 any special code for MethodGroupExprs anymore, they're now
19675 2002-08-08 Martin Baulig <martin@gnome.org>
19677 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
19678 Family, FamANDAssem and FamORAssem permissions.
19679 (TypeManager.IsSubclassOrNestedChildOf): New public method.
19681 2002-08-08 Martin Baulig <martin@gnome.org>
19683 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
19684 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
19687 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
19689 * driver.cs: implemented /resource option to embed managed resources.
19691 2002-08-07 Martin Baulig <martin@gnome.org>
19693 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
19694 (FieldBase.HasFieldInitializer): New public property.
19695 (FieldBase.GetInitializerExpression): New public method. Resolves and
19696 returns the field initializer and makes sure it is only resolved once.
19697 (TypeContainer.EmitFieldInitializers): Call
19698 FieldBase.GetInitializerExpression to get the initializer, this ensures
19699 that it isn't resolved multiple times.
19701 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
19702 the resolving process (SimpleName/MemberLookup) that we're currently
19703 emitting a field initializer (which must not access any instance members,
19704 this is an error CS0236).
19706 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
19707 argument, if the `IsFieldInitializer' flag is set, we must report and
19708 error CS0236 and not an error CS0120.
19710 2002-08-07 Martin Baulig <martin@gnome.org>
19712 * ecore.cs (IMemberExpr): New public interface.
19713 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
19714 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
19715 if the expression is an IMemberExpr.
19717 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
19718 to be null, implicitly default to `this' if we're non-static in
19719 this case. Simplified the code a lot by using the new IMemberExpr
19720 interface. Also fixed bug #28176 here.
19722 2002-08-06 Martin Baulig <martin@gnome.org>
19724 * cs-parser.jay (SimpleLookup): Removed. We need to create
19725 ParameterReferences during semantic analysis so that we can do a
19726 type-only search when resolving Cast, TypeOf and SizeOf.
19727 (block): Pass the `current_local_parameters' to the Block's
19730 * class.cs (ConstructorInitializer): Added `Parameters parameters'
19731 argument to the constructor.
19732 (ConstructorInitializer.Resolve): Create a temporary implicit
19733 block with the parameters.
19735 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
19736 references here if we aren't doing a type-only search.
19738 * statement.cs (Block): Added constructor which takes a
19739 `Parameters parameters' argument.
19740 (Block.Parameters): New public property.
19742 * support.cs (InternalParameters.Parameters): Renamed `parameters'
19743 to `Parameters' and made it public readonly.
19745 2002-08-06 Martin Baulig <martin@gnome.org>
19747 * ecore.cs (Expression.Warning): Made this public as well.
19749 * report.cs (Report.Debug): Print the contents of collections.
19751 2002-08-06 Martin Baulig <martin@gnome.org>
19753 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
19754 used to tell Resolve() which kinds of expressions it may return.
19755 (Expression.Resolve): Added overloaded version of this method which
19756 takes a `ResolveFlags flags' argument. This can be used to tell
19757 Resolve() which kinds of expressions it may return. Reports a
19759 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
19760 ResolveFlags.SimpleName.
19761 (Expression.Error118): Added overloaded version of this method which
19762 takes a `ResolveFlags flags' argument. It uses the flags to determine
19763 which kinds of expressions are allowed.
19765 * expression.cs (Argument.ResolveMethodGroup): New public method.
19766 Resolves an argument, but allows a MethodGroup to be returned.
19767 This is used when invoking a delegate.
19769 * TODO: Updated a bit.
19771 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19773 Fixed compilation with csc.
19775 * ecore.cs: Expression.Error made public. Is this correct? Should
19776 Warning be made public too?
19778 * expression.cs: use ea.Location instead of ea.loc.
19779 [FIXME: Filed as bug #28607: MCS must report these errors.]
19781 2002-08-06 Martin Baulig <martin@gnome.org>
19783 * ecore.cs (Expression.loc): Moved the location here instead of
19784 duplicating it in all derived classes.
19785 (Expression.Location): New public property.
19786 (Expression.Error, Expression.Warning): Made them non-static and
19787 removed the location argument.
19788 (Expression.Warning): Added overloaded version which takes an
19789 `int level' argument.
19790 (Expression.Error118): Make this non-static and removed the
19791 expression and location arguments.
19792 (TypeExpr): Added location argument to the constructor.
19794 * expression.cs (StaticCallExpr): Added location argument to
19796 (Indirection, PointerArithmetic): Likewise.
19797 (CheckedExpr, UnCheckedExpr): Likewise.
19798 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
19799 (StringPtr): Likewise.
19802 2002-08-05 Martin Baulig <martin@gnome.org>
19804 * expression.cs (BaseAccess.DoResolve): Actually report errors.
19806 * assign.cs (Assign.DoResolve): Check whether the source
19807 expression is a value or variable.
19809 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
19810 while resolving the corresponding blocks.
19812 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
19813 an error, don't silently return null.
19815 * statement.cs (Block.AddVariable): Do the error reporting here
19816 and distinguish between CS0128 and CS0136.
19817 (Block.DoResolve): Report all unused labels (warning CS0164).
19818 (LabeledStatement): Pass the location to the constructor.
19819 (LabeledStatement.HasBeenReferenced): New property.
19820 (LabeledStatement.Resolve): Set it to true here.
19822 * statement.cs (Return.Emit): Return success even after reporting
19823 a type mismatch error (CS0126 or CS0127), this is what csc does and
19824 it avoids confusing the users with any consecutive errors.
19826 2002-08-05 Martin Baulig <martin@gnome.org>
19828 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
19830 * const.cs (Const.LookupConstantValue): Catch circular definitions.
19832 * expression.cs (MemberAccess.DoResolve): Silently return if an
19833 error has already been reported.
19835 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
19836 error has already been reported.
19838 2002-08-05 Martin Baulig <martin@gnome.org>
19840 * statement.cs (UsageVector): Only initialize the `parameters'
19841 vector if we actually have any "out" parameters.
19843 2002-08-05 Martin Baulig <martin@gnome.org>
19845 * expression.cs (Binary.ResolveOperator): When combining delegates,
19846 they must have the same type.
19848 2002-08-05 Martin Baulig <martin@gnome.org>
19850 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
19851 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
19852 work with the ms runtime and we also don't need it: if we're a
19853 PropertyBuilder and not in the `indexer_arguments' hash, then we
19854 are a property and not an indexer.
19856 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
19857 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
19858 since the latter one doesn't work with the ms runtime.
19860 2002-08-03 Martin Baulig <martin@gnome.org>
19862 Fixed bugs #27998 and #22735.
19864 * class.cs (Method.IsOperator): New public field.
19865 (Method.CheckBase): Report CS0111 if there's already a method
19866 with the same parameters in the current class. Report CS0508 when
19867 attempting to change the return type of an inherited method.
19868 (MethodData.Emit): Report CS0179 if a method doesn't have a body
19869 and it's not marked abstract or extern.
19870 (PropertyBase): New abstract base class for Property and Indexer.
19871 (PropertyBase.CheckBase): Moved here from Property and made it work
19873 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
19874 the same so we can reuse it there.
19875 (Property, Indexer): Derive from PropertyBase.
19876 (MethodSignature.inheritable_property_signature_filter): New delegate
19877 to find properties and indexers.
19879 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
19880 argument and improved error reporting.
19882 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
19883 EmptyReadOnlyParameters and made it a property.
19885 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
19886 version of this method which takes a `PropertyInfo indexer'.
19887 (TypeManager.RegisterIndexer): New method.
19889 * class.cs: Added myself as author of this file :-)
19891 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19893 * class.cs: fixed compilation on windoze.
19895 2002-08-03 Martin Baulig <martin@gnome.org>
19897 * interface.cs (Interface.GetInterfaceBases): Check whether all
19898 base interfaces are at least as accessible than the current one.
19900 * class.cs (TypeContainer.GetClassBases): Check whether base types
19901 are at least as accessible than the current type.
19902 (TypeContainer.AsAccessible): Implemented and made non-static.
19903 (MemberBase.CheckParameters): Report errors if the accessibility
19906 * delegate.cs (Delegate.Delegate): The default visibility is
19907 internal for top-level types and private for nested types.
19908 (Delegate.Define): Report errors if the accessibility checks fail.
19910 * enum.cs (Enum.Enum): The default visibility is internal for
19911 top-level types and private for nested types.
19912 (Enum.DefineType): Compute the correct visibility.
19914 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
19915 function which takes a `bool is_toplevel' instead of a TypeContainer.
19917 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
19920 2002-08-02 Martin Baulig <martin@gnome.org>
19922 * expression.cs (LocalVariableReferenc): Added constructor which
19923 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
19924 (LocalVariableReference.IsReadOnly): New property.
19925 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
19926 variable is readonly, use our own readonly flag to do this; you can
19927 use the new constructor to get a writable reference to a read-only
19930 * cs-parser.jay (foreach_statement, using_statement): Get a writable
19931 reference to the local variable.
19933 2002-08-01 Miguel de Icaza <miguel@ximian.com>
19935 * rootcontext.cs (ResolveCore): Also include System.Exception
19937 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
19938 we reach an EmptyStatement.
19940 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
19943 * expression.cs (Binary.ResolveOperator): Check error result in
19946 use brtrue/brfalse directly and avoid compares to null.
19948 2002-08-02 Martin Baulig <martin@gnome.org>
19950 * class.cs (TypeContainer.Define): Define all nested interfaces here.
19951 Fixes bug #28407, added test-155.cs.
19953 2002-08-01 Martin Baulig <martin@gnome.org>
19955 * class.cs (Event.EmitDefaultMethod): Make this work with static
19956 events. Fixes #28311, added verify-3.cs.
19958 2002-08-01 Martin Baulig <martin@gnome.org>
19960 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
19961 `is_disposable' fields.
19962 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
19963 `hm.is_disposable' if we're using the collection pattern.
19964 (Foreach.EmitCollectionForeach): Use the correct type for the
19965 enumerator's local variable, only emit the try/finally block if
19966 necessary (fixes #27713).
19968 2002-08-01 Martin Baulig <martin@gnome.org>
19970 * ecore.cs (Expression.report118): Renamed to Error118 and made
19973 * statement.cs (Throw.Resolve): Check whether the expression is of
19974 the correct type (CS0118) and whether the type derives from
19975 System.Exception (CS0155).
19976 (Catch.Resolve): New method. Do the type lookup here and check
19977 whether it derives from System.Exception (CS0155).
19978 (Catch.CatchType, Catch.IsGeneral): New public properties.
19980 * typemanager.cs (TypeManager.exception_type): Added.
19982 2002-07-31 Miguel de Icaza <miguel@ximian.com>
19984 * driver.cs: Updated About function.
19986 2002-07-31 Martin Baulig <martin@gnome.org>
19988 Implemented Control Flow Analysis.
19990 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
19991 (EmitContext.CurrentBranching): Added.
19992 (EmitContext.StartFlowBranching): Added.
19993 (EmitContext.EndFlowBranching): Added.
19994 (EmitContext.KillFlowBranching): Added.
19995 (EmitContext.IsVariableAssigned): Added.
19996 (EmitContext.SetVariableAssigned): Added.
19997 (EmitContext.IsParameterAssigned): Added.
19998 (EmitContext.SetParameterAssigned): Added.
19999 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
20000 Added control flow analysis stuff here.
20002 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
20003 resolve the expression as lvalue.
20004 (LocalVariableReference.DoResolve): Check whether the variable has
20005 already been assigned.
20006 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
20007 the parameter as assigned here.
20008 (ParameterReference.DoResolve): Check whether the parameter has already
20010 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
20011 expression as lvalue.
20013 * statement.cs (FlowBranching): New class for the flow analysis code.
20014 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
20015 (LabeledStatement.IsDefined): New public property.
20016 (LabeledStatement.AddUsageVector): New public method to tell flow
20017 analyis that the label may be reached via a forward jump.
20018 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
20020 (VariableInfo.Number): New public field. This is used by flow analysis
20021 to number all locals of a block.
20022 (Block.CountVariables): New public property. This is the number of
20023 local variables in this block (including the locals from all parent
20025 (Block.EmitMeta): Number all the variables.
20027 * statement.cs: Added flow analysis support to all classes.
20029 2002-07-31 Martin Baulig <martin@gnome.org>
20031 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
20032 To get debugging messages, compile mcs with /define:MCS_DEBUG and
20033 then use this argument.
20035 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
20037 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
20038 use this to specify /define options.
20040 2002-07-29 Martin Baulig <martin@gnome.org>
20042 * statement.cs (Fixed): Moved all code that does variable lookups
20043 and resolvings from Emit to Resolve.
20045 * statement.cs (For): Moved all code that does variable lookups
20046 and resolvings from Emit to Resolve.
20048 * statement.cs (Using): Moved all code that does variable lookups
20049 and resolvings from Emit to Resolve.
20051 2002-07-29 Martin Baulig <martin@gnome.org>
20053 * attribute.cs (Attribute.Resolve): Explicitly catch a
20054 System.NullReferenceException when creating the
20055 CustromAttributeBuilder and report a different warning message.
20057 2002-07-29 Martin Baulig <martin@gnome.org>
20059 * support.cs (ParameterData.ParameterName): Added method to
20060 get the name of a parameter.
20062 * typemanager.cs (TypeManager.IsValueType): New public method.
20064 2002-07-29 Martin Baulig <martin@gnome.org>
20066 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
20067 is a flag which specifies that it's either ref or out.
20068 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
20069 the out parameter to `out Parameter.Modifier mod', also set the
20070 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
20072 * support.cs (InternalParameters.ParameterModifier): Distinguish
20073 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20074 Parameter.Modifier.ISBYREF flag if it's either ref or out.
20076 * expression.cs (Argument.GetParameterModifier): Distinguish
20077 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20078 Parameter.Modifier.ISBYREF flag if it's either ref or out.
20080 2002-07-29 Martin Baulig <martin@gnome.org>
20082 * expression.cs (ParameterReference.ParameterReference): Added
20083 `Location loc' argument to the constructor.
20085 * cs-parser.jay: Pass location to ParameterReference.
20087 2002-07-28 Miguel de Icaza <miguel@ximian.com>
20089 * statement.cs (Try): Initialize the location.
20091 * cs-parser.jay: pass location to Try.
20093 * expression.cs (Unary.Reduce): Change the prototype to return
20094 whether a constant fold could be performed or not. The result is
20095 returned in an out parameters. In the case of Indirection and
20096 AddressOf, we want to perform the full tests.
20098 2002-07-26 Miguel de Icaza <miguel@ximian.com>
20100 * statement.cs (Statement.Emit): Flag dead code.
20102 2002-07-27 Andrew Birkett <andy@nobugs.org>
20104 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
20106 2002-07-27 Martin Baulig <martin@gnome.org>
20108 * class.cs (MethodData.Define): Put back call to
20109 TypeManager.AddMethod(), accidentally commented this out.
20111 * report.cs (Debug): New public method to print debugging information,
20112 this is `[Conditional ("DEBUG")]'.
20114 2002-07-26 Martin Baulig <martin@gnome.org>
20116 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
20117 (switch_statement): Push the current_block to the switch_stack and
20118 pop it again when we're done with the switch.
20119 (switch_section): The new block is a child of the current_block.
20120 Fixes bug #24007, added test-152.cs.
20122 2002-07-27 Martin Baulig <martin@gnome.org>
20124 * expression.cs (Invocation.EmitArguments): When calling a varargs
20125 function with only its fixed arguments, we need to pass an empty
20128 2002-07-27 Martin Baulig <martin@gnome.org>
20130 Mono 0.13 has been released.
20132 2002-07-25 Miguel de Icaza <miguel@ximian.com>
20134 * driver.cs: Rename --resource to --linkres, because that is what
20135 we do currently, we dont support --resource yet.
20137 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
20139 2002-07-25 Martin Baulig <martin@gnome.org>
20141 * class.cs (MethodData): New public class. This is a `method builder'
20142 class for a method or one accessor of a Property/Indexer/Event.
20143 (MethodData.GetMethodFlags): Moved here from MemberBase.
20144 (MethodData.ApplyAttributes): Likewise.
20145 (MethodData.ApplyObsoleteAttribute): Likewise.
20146 (MethodData.ApplyConditionalAttribute): Likewise.
20147 (MethodData.ApplyDllImportAttribute): Likewise.
20148 (MethodData.CheckAbstractAndExternal): Likewise.
20149 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
20150 (MethodData.Emit): Formerly known as Method.Emit().
20151 (MemberBase): Moved everything which was specific to a single
20152 accessor/method to MethodData.
20153 (Method): Create a new MethodData and call Define() and Emit() on it.
20154 (Property, Indexer, Event): Create a new MethodData objects for each
20155 accessor and call Define() and Emit() on them.
20157 2002-07-25 Martin Baulig <martin@gnome.org>
20159 Made MethodCore derive from MemberBase to reuse the code from there.
20160 MemberBase now also checks for attributes.
20162 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
20163 (MemberBase.GetMethodFlags): Moved here from class Method and marked
20165 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
20166 `CallingConventions cc' and `Attributes opt_attrs' arguments.
20167 (MemberBase.ApplyAttributes): New virtual method; applies the
20168 attributes to a method or accessor.
20169 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
20170 (MemberBase.ApplyConditionalAttribute): Likewise.
20171 (MemberBase.ApplyDllImportAttribute): Likewise.
20172 (MemberBase.CheckAbstractAndExternal): Likewise.
20173 (MethodCore.ParameterTypes): This is now a property instead of a
20174 method, it's initialized from DoDefineParameters().
20175 (MethodCore.ParameterInfo): Removed the set accessor.
20176 (MethodCore.DoDefineParameters): New protected virtual method to
20177 initialize ParameterTypes and ParameterInfo.
20178 (Method.GetReturnType): We can now simply return the MemberType.
20179 (Method.GetMethodFlags): Override the MemberBase version and add
20180 the conditional flags.
20181 (Method.CheckBase): Moved some code from Define() here, call
20182 DoDefineParameters() here.
20183 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
20184 here to avoid some larger code duplication.
20185 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
20186 ensure that abstract and external accessors don't declare a body.
20188 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
20189 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
20190 lookup in the attribute's parent classes, so we need to abort as soon
20191 as we found the first match.
20192 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
20193 the attribute has no arguments.
20195 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
20198 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20200 * cs-parser.jay: reverted previous patch.
20202 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20204 * cs-parser.jay: fixed bug #22119.
20206 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20208 * attribute.cs: fixed compilation. The error was:
20209 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
20210 be assigned to before control leaves the current method."
20211 [FIXME: Filed as bug #28186: MCS must report this error.]
20213 2002-07-25 Martin Baulig <martin@gnome.org>
20215 * attribute.cs (Attribute.Conditional_GetConditionName): New static
20216 method to pull the condition name ouf of a Conditional attribute.
20217 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
20218 the obsolete message and error flag out of an Obsolete attribute.
20220 * class.cs (Method.GetMethodFlags): New public method to get the
20221 TypeManager.MethodFlags for this method.
20222 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
20224 (Method.Define): Get and apply the Obsolete and Conditional attributes;
20225 if we're overriding a virtual function, set the new private variable
20226 `parent_method'; call the new TypeManager.AddMethod().
20228 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
20229 the MethodBuilder and the Method in a PtrHashtable.
20230 (TypeManager.builder_to_method): Added for this purpose.
20231 (TypeManager.MethodFlags): Added IsObsoleteError.
20232 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
20233 Obsolete and Conditional arguments in MethodBuilders. If we discover
20234 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
20235 the message from the attribute.
20237 2002-07-24 Martin Baulig <martin@gnome.org>
20239 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
20240 preprocessor directives, ensure that the argument to #define/#undef is
20241 exactly one identifier and that it's actually an identifier.
20243 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
20246 2002-07-24 Martin Baulig <martin@gnome.org>
20248 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
20249 initialize it to TypeManager.object_type in the constructor.
20250 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
20251 of the `hm.get_current' method if we're using the collection pattern.
20252 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
20253 for the explicit conversion to make it work when we're using the collection
20254 pattern and the `Current' property has a different return type than `object'.
20257 2002-07-24 Martin Baulig <martin@gnome.org>
20259 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
20260 does not match, but don't report any errors. This method is called in
20261 order for all methods in a MethodGroupExpr until a matching method is
20262 found, so we don't want to bail out if the first method doesn't match.
20263 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
20264 matches, report the 123. Fixes #28070.
20266 2002-07-24 Martin Baulig <martin@gnome.org>
20268 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
20269 TypeManager.TypeToCoreType() to the top of the method so the
20270 following equality checks will work. Fixes #28107.
20272 2002-07-24 Martin Baulig <martin@gnome.org>
20274 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
20275 operand is of type uint, and the other operand is of type sbyte,
20276 short or int, the operands are converted to type long." -
20277 Actually do what this comment already told us. Fixes bug #28106,
20280 2002-07-24 Martin Baulig <martin@gnome.org>
20282 * class.cs (MethodBase): New abstract class. This is now a base
20283 class for Property, Indexer and Event to avoid some code duplication
20284 in their Define() and DefineMethods() methods.
20285 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
20286 generic methods for Define() and DefineMethods().
20287 (FieldBase): Derive from MemberBase, not MemberCore.
20288 (Property): Derive from MemberBase, not MemberCore.
20289 (Property.DefineMethod): Moved all the code from this method to the
20290 new MethodBase.DefineAccessor(), just call it with appropriate
20292 (Property.Define): Call the new Property.DoDefine(), this does some
20293 sanity checks and we don't need to duplicate the code everywhere.
20294 (Event): Derive from MemberBase, not MemberCore.
20295 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
20296 accessors, this will also make them work with interface events.
20297 (Indexer): Derive from MemberBase, not MemberCore.
20298 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
20299 (Indexer.Define): Use the new MethodBase functions.
20301 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
20302 argument to the constructor.
20303 (Interface.FindMembers): Added support for interface events.
20304 (Interface.PopluateEvent): Implemented.
20306 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
20308 2002-07-22 Miguel de Icaza <miguel@ximian.com>
20310 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
20311 but this is required to check for a method name being the same as
20312 the containing class.
20316 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20318 * interface.cs: initialize variable.
20320 2002-07-23 Martin Baulig <martin@gnome.org>
20322 Implemented the IndexerName attribute in interfaces.
20324 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
20325 name if this is an explicit interface implementation.
20326 (Indexer.InterfaceIndexerName): New public variable. If we're
20327 implementing an interface indexer, this is the IndexerName in that
20328 interface. Otherwise, it's the IndexerName.
20329 (Indexer.DefineMethod): If we're implementing interface indexer,
20330 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
20331 and Pending.ImplementIndexer methods.
20332 (Indexer.Define): Also define the PropertyBuilder if we're
20333 implementing an interface indexer and this is neither an explicit
20334 interface implementation nor do the IndexerName match the one in
20337 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
20338 If a method is defined here, then we always need to create a proxy
20339 for it. This is used when implementing interface indexers.
20340 (Pending.IsInterfaceIndexer): New public method.
20341 (Pending.ImplementIndexer): New public method.
20342 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
20343 This is used when implementing interface indexers to define a proxy
20345 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
20346 define a proxy if necessary.
20348 * interface.cs (Interface.IndexerName): New public variable.
20349 (Interface.PopulateIndexer): Set the IndexerName.
20350 (Interface.DefineIndexers): New private method. Populate all the
20351 indexers and make sure their IndexerNames match.
20353 * typemanager.cs (IndexerPropertyName): Added support for interface
20356 2002-07-22 Martin Baulig <martin@gnome.org>
20358 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
20359 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
20360 ret if HasReturnLabel.
20361 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
20364 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
20365 and set the ec.LoopBeginTryCatchLevel.
20366 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
20367 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
20368 the current ec.TryCatchLevel, the branch goes out of an exception
20369 block. In this case, we need to use Leave and not Br.
20371 2002-07-22 Martin Baulig <martin@gnome.org>
20373 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
20374 block unless the block does not always return or it is contained in
20375 another try { ... } catch { ... } block. Fixes bug #26506.
20376 Added verify-1.cs to the test suite.
20378 2002-07-22 Martin Baulig <martin@gnome.org>
20380 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
20381 then we do not always return. Fixes bug #24985.
20383 2002-07-22 Martin Baulig <martin@gnome.org>
20385 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
20386 lookup on a per-class level; ie. walk up the class hierarchy until we
20387 found at least one applicable method, then choose the best among them.
20388 Fixes bug #24463 and test-29.cs.
20390 2002-07-22 Martin Baulig <martin@gnome.org>
20392 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
20393 return types of the methods. The return type is not part of the
20394 signature and we must not check it to make the `new' modifier work.
20395 Fixes bug #27999, also added test-147.cs.
20396 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
20398 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
20399 on the method's return type.
20401 2002-07-21 Martin Baulig <martin@gnome.org>
20403 * assign.cs: Make this work if the rightmost source is a constant and
20404 we need to do an implicit type conversion. Also adding a few more tests
20405 to test-38.cs which should have caught this.
20407 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
20408 target in the makefile for this. The makefile.gnu is primarily intended
20409 for end-users who don't want to debug the compiler.
20411 2002-07-21 Martin Baulig <martin@gnome.org>
20413 * assign.cs: Improved the Assign class so it can now handle embedded
20414 assignments (X = Y = Z = something). As a side-effect this'll now also
20415 consume less local variables. test-38.cs now passes with MCS, added
20416 a few new test cases to that test.
20418 2002-07-20 Martin Baulig <martin@gnome.org>
20420 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
20421 instructions. Fixes bug #27977, also added test-146.cs.
20423 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20425 * cs-tokenizer.cs: fixed getHex ().
20427 2002-07-19 Martin Baulig <martin@gnome.org>
20429 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
20430 not Type.GetType() to lookup the array type. This is needed when
20431 we're constructing an array of a user-defined type.
20432 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
20433 single-dimensional arrays, but also for single-dimensial arrays of
20436 2002-07-19 Martin Baulig <martin@gnome.org>
20438 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
20439 this function is called, it's not allowed to share LocalBuilders
20440 among ILGenerators.
20442 2002-07-19 Martin Baulig <martin@gnome.org>
20444 * expression.cs (Argument.Resolve): Report an error 118 when trying
20445 to pass a type as argument.
20447 2002-07-18 Martin Baulig <martin@gnome.org>
20449 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
20450 Conv_R_Un for the signed `long' type.
20452 2002-07-15 Miguel de Icaza <miguel@ximian.com>
20454 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
20455 `expr' for the temporary result, as that will fail if we do
20456 multiple resolves on the same expression.
20458 2002-07-05 Miguel de Icaza <miguel@ximian.com>
20460 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
20461 ec.TypeContainer for looking up aliases.
20463 * class.cs (TypeContainer): Remove LookupAlias from here.
20465 * decl.cs (DeclSpace); Move here.
20467 2002-07-01 Miguel de Icaza <miguel@ximian.com>
20469 * class.cs (FindMembers): Only call filter if the constructor
20470 bulider is not null.
20472 Also handle delegates in `NestedTypes' now. Now we will perform
20473 type lookups using the standard resolution process. This also
20476 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
20477 This uses Expressions (the limited kind that can be parsed by the
20478 tree) instead of strings.
20480 * expression.cs (ComposedCast.ToString): Implement, used to flag
20481 errors since now we have to render expressions.
20483 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
20486 * ecore.cs (SimpleName.ToString): ditto.
20488 * cs-parser.jay: Instead of using strings to assemble types, use
20489 Expressions to assemble the type (using SimpleName, ComposedCast,
20490 MemberAccess). This should fix the type lookups in declarations,
20491 because we were using a different code path for this.
20493 * statement.cs (Block.Resolve): Continue processing statements
20494 even when there is an error.
20496 2002-07-17 Miguel de Icaza <miguel@ximian.com>
20498 * class.cs (Event.Define): Also remove the `remove' method from
20499 the list of pending items.
20501 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
20502 generate more compact code.
20504 2002-07-17 Martin Baulig <martin@gnome.org>
20506 * const.cs (Const.LookupConstantValue): Add support for constant
20507 `unchecked' and `checked' expressions.
20508 Also adding test case test-140.cs for this.
20510 2002-07-17 Martin Baulig <martin@gnome.org>
20512 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
20513 check whether mi.ReturnType implements the IEnumerator interface; the
20514 `==' and the IsAssignableFrom() will fail in this situation.
20516 2002-07-16 Ravi Pratap <ravi@ximian.com>
20518 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
20521 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20523 * expression.cs: fixed bug #27811.
20525 2002-07-14 Miguel de Icaza <miguel@ximian.com>
20527 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
20528 Molaro: when we are a ref, the value already contains a pointer
20529 value, do not take the address of it.
20531 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
20532 * removed mb-parser.jay and mb-tokenizer.cs
20534 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20536 * expression.cs: check against the building corlib void type.
20538 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
20540 * ecore.cs: fix for valuetype static readonly fields: when
20541 initializing them, we need their address, not the address of a copy.
20543 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
20545 * typemanager.cs: register also enum_type in corlib.
20547 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20549 * class.cs: allow calling this (but not base) initializers in structs.
20551 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
20553 * ecore.cs: make sure we compare against the building base types
20556 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
20558 * typemanager.cs: fix TypeToCoreType() to handle void and object
20559 (corlib gets no more typerefs after this change).
20561 2002-07-12 Miguel de Icaza <miguel@ximian.com>
20563 * expression.cs (ArrayCreation.EmitArrayArguments): use
20564 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
20566 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
20567 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
20568 array indexes, the runtime actually forbids them.
20570 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
20571 for array arguments here.
20573 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
20574 instead of the default for ValueTypes.
20576 (New.DoEmit): Use IsValueType instead of
20577 IsSubclassOf (value_type)
20578 (New.DoResolve): ditto.
20579 (Invocation.EmitCall): ditto.
20581 * assign.cs (Assign): ditto.
20583 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
20584 Statements *are* currently doing part of their resolution during
20587 Expressions do always resolve during resolve, but statements are
20588 only required to propagate resolution to their children.
20590 2002-07-11 Miguel de Icaza <miguel@ximian.com>
20592 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
20594 (LoadAssembly): Do not add the dll if it is already specified
20596 (MainDriver): Add the System directory to the link path at the end,
20597 after all the other -L arguments.
20599 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
20600 wrong opcode for loading bytes and bools (ldelem.i1 instead of
20601 ldelem.u1) and using the opposite for sbytes.
20603 This fixes Digger, and we can finally run it.
20605 * driver.cs (UnixParseOption): Move the option parsing here.
20606 (CSCParseOption): Implement CSC-like parsing of options.
20608 We now support both modes of operation, the old Unix way, and the
20609 new CSC-like way. This should help those who wanted to make cross
20610 platform makefiles.
20612 The only thing broken is that /r:, /reference: and /lib: are not
20613 implemented, because I want to make those have the same semantics
20614 as the CSC compiler has, and kill once and for all the confussion
20615 around this. Will be doing this tomorrow.
20617 * statement.cs (Unsafe.Resolve): The state is checked during
20618 resolve, not emit, so we have to set the flags for IsUnsfe here.
20620 2002-07-10 Miguel de Icaza <miguel@ximian.com>
20622 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
20623 not catch the Error_ObjectRefRequired in SimpleName (as it is
20624 possible to have a class/instance variable name that later gets
20625 deambiguated), we have to check this here.
20627 2002-07-10 Ravi Pratap <ravi@ximian.com>
20629 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
20630 make static and put into Expression.
20632 (Event.Define): Register the private field of the event with the
20633 TypeManager so that GetFieldFromEvent can get at it.
20635 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
20636 keep track of the private field associated with an event which
20639 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
20642 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
20644 2002-07-10 Miguel de Icaza <miguel@ximian.com>
20646 * expression.cs (Binary.EmitBranchable): this routine emits the
20647 Binary expression in a branchable context. This basically means:
20648 we need to branch somewhere, not just get the value on the stack.
20650 This works together with Statement.EmitBoolExpression.
20652 * statement.cs (Statement.EmitBoolExpression): Use
20655 2002-07-09 Miguel de Icaza <miguel@ximian.com>
20657 * statement.cs (For): Reduce the number of jumps in loops.
20659 (For): Implement loop inversion for the For statement.
20661 (Break): We can be breaking out of a Try/Catch controlled section
20662 (foreach might have an implicit try/catch clause), so we need to
20663 use Leave instead of Br.
20665 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
20666 now). If the instace expression supports IMemoryLocation, we use
20667 the AddressOf method from the IMemoryLocation to extract the
20668 address instead of emitting the instance.
20670 This showed up with `This', as we were emitting the instance
20671 always (Emit) instead of the Address of This. Particularly
20672 interesting when This is a value type, as we dont want the Emit
20673 effect (which was to load the object).
20675 2002-07-08 Miguel de Icaza <miguel@ximian.com>
20677 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
20679 * statement.cs (Checked): Set the CheckedState during the resolve
20680 process too, as the ConvCast operations track the checked state on
20681 the resolve process, and not emit.
20683 * cs-parser.jay (namespace_member_declaration): Flag that we have
20684 found a declaration when we do. This is used to flag error 1529
20686 * driver.cs: Report ok when we display the help only.
20688 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
20690 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
20692 2002-07-04 Miguel de Icaza <miguel@ximian.com>
20694 * cs-tokenizer.cs (define): We also have to track locally the
20695 defines. AllDefines is just used for the Conditional Attribute,
20696 but we also need the local defines for the current source code.
20698 2002-07-03 Miguel de Icaza <miguel@ximian.com>
20700 * statement.cs (While, For, Do): These loops can exit through a
20701 Break statement, use this information to tell whether the
20702 statement is the last piece of code.
20704 (Break): Flag that we break.
20706 * codegen.cs (EmitContexts): New `Breaks' state variable.
20708 2002-07-03 Martin Baulig <martin@gnome.org>
20710 * class.cs (TypeContainer.MethodModifiersValid): Allow override
20711 modifiers in method declarations in structs. Otherwise, you won't
20712 be able to override things like Object.Equals().
20714 2002-07-02 Miguel de Icaza <miguel@ximian.com>
20716 * class.cs (Method, Property, Indexer): Do not allow the public
20717 modifier to be used in explicit interface implementations.
20719 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
20720 override modifiers in method declarations in structs
20722 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
20724 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
20725 integer or real overflow, report an error
20727 2002-07-02 Martin Baulig <martin@gnome.org>
20729 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
20730 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
20731 to tell the runtime about our newly created System.Object and
20732 System.ValueType types.
20734 2002-07-02 Miguel de Icaza <miguel@ximian.com>
20736 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
20737 struct instead of Ldarg/Starg.
20739 2002-07-02 Martin Baulig <martin@gnome.org>
20741 * expression.cs (Indirection.Indirection): Call
20742 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
20744 2002-07-02 Martin Baulig <martin@gnome.org>
20746 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
20747 ValueType, call TypeManager.TypeToCoreType() on it.
20748 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
20749 the OpCodes.Newarr argument.
20751 2002-07-02 Martin Baulig <martin@gnome.org>
20753 * expression.cs (Invocation.EmitCall): When compiling corlib,
20754 replace all calls to the system's System.Array type to calls to
20755 the newly created one.
20757 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
20758 System.Array methods.
20759 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
20760 from the system's System.Array type which must be replaced.
20762 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
20764 * typemanager.cs: load unverifiable_code_ctor so we can build
20765 corlib using the correct type. Avoid using GetTypeCode() with
20767 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
20768 TypeManager.object_type to allow building corlib.
20770 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
20772 * ecore.cs: handle System.Enum separately in LoadFromPtr().
20774 2002-07-01 Martin Baulig <martin@gnome.org>
20776 * class.cs: Make the last change actually work, we need to check
20777 whether `ifaces != null' to avoid a crash.
20779 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20781 * class.cs: when we build structs without fields that implement
20782 interfaces, we need to add the interfaces separately, since there is
20783 no API to both set the size and add the interfaces at type creation
20786 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20788 * expression.cs: the dimension arguments to the array constructors
20789 need to be converted if they are a long.
20791 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
20793 * class.cs: don't emit ldarg.0 if there is no parent constructor
20794 (fixes showstopper for corlib).
20796 2002-06-29 Martin Baulig <martin@gnome.org>
20798 MCS now compiles corlib on GNU/Linux :-)
20800 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
20801 ie. check for MethodImplOptions.InternalCall.
20803 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
20804 and TypeManager.attribute_type are null, so we must explicitly check
20805 whether parent is not null to find out whether it's an attribute type.
20806 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
20807 and SetBuilder, not only if the property is neither abstract nor external.
20808 This is necessary to set the MethodImplOptions on the accessor methods.
20809 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
20810 SetBuilder, see Property.Emit().
20812 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
20813 populate "System.Object", "System.ValueType" and "System.Attribute" since
20814 they've already been populated from BootCorlib_PopulateCoreTypes().
20816 2002-06-29 Martin Baulig <martin@gnome.org>
20818 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
20819 is the NullLiteral, we also need to make sure that target_type is not
20822 2002-06-29 Martin Baulig <martin@gnome.org>
20824 * rootcontext.cs (RootContext.ResolveCore): We must initialize
20825 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
20826 before calling BootstrapCorlib_ResolveDelegate ().
20828 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20830 * statement.cs: fixed build-breaker. All tests passed ok.
20832 2002-06-27 Martin Baulig <martin@gnome.org>
20834 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
20835 for System.Decimal when compiling corlib.
20837 2002-06-27 Martin Baulig <martin@gnome.org>
20839 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
20840 switch blocks which contain nothing but a default clause.
20842 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
20844 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
20846 2002-06-27 Martin Baulig <martin@gnome.org>
20848 * ecore.cs (PropertyExpr.PropertyExpr): Call
20849 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
20851 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
20852 is already a TypeBuilder.
20854 2002-06-27 Martin Baulig <martin@gnome.org>
20856 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
20857 `target_type == TypeManager.array_type', not IsAssignableFrom() in
20858 the "from an array-type to System.Array" case. This makes it work
20859 when compiling corlib.
20861 2002-06-27 Martin Baulig <martin@gnome.org>
20863 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
20864 non-static PropertyExpr, set its InstanceExpression. This makes
20865 the `ICollection.Count' property work in System/Array.cs.
20867 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
20869 * driver.cs: Made error handling more consistent. Errors now
20870 tracked by Report class, so many methods which used to return int
20871 now return void. Main() now prints success/failure and
20872 errors/warnings message.
20874 Renamed '--probe' compiler argument to '--expect-error'. Removed
20875 the magic number return values (123 and 124). Now, if the
20876 expected error occurs, the compiler exits with success (exit value
20877 0). If the compilation completes without seeing that particular
20878 error, the compiler exits with failure (exit value 1). The
20879 makefile in mcs/errors has been changed to handle the new behaviour.
20881 * report.cs: Made 'expected error' number a property and renamed
20882 it from 'Probe' to 'ExpectedError'.
20884 * genericparser.cs: Removed error handling support, since it is
20885 now all done by Report class.
20887 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
20888 class, so parse() no longer returns an int.
20890 * namespace.cs: Use Report.Error instead of GenericParser.error
20892 2002-06-22 Miguel de Icaza <miguel@ximian.com>
20894 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
20895 TypeContainer.AddOperator): At the front of the list put the
20896 explicit implementations, so they get resolved/defined first.
20898 2002-06-21 Miguel de Icaza <miguel@ximian.com>
20900 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
20901 interface type is implemented by this TypeContainer. Used during
20902 explicit interface implementation.
20904 (Property.Define, Indexer.Define, Method.Define): Validate that
20905 the given interface in the explicit implementation is one of the
20906 base classes for the containing type.
20908 Also if we are explicitly implementing an interface, but there is
20909 no match in the pending implementation table, report an error.
20911 (Property.Define): Only define the property if we are
20912 not explicitly implementing a property from an interface. Use the
20913 correct name also for those properties (the same CSC uses,
20914 although that is really not needed).
20916 (Property.Emit): Do not emit attributes for explicitly implemented
20917 properties, as there is no TypeBuilder.
20919 (Indexer.Emit): ditto.
20921 Hiding then means that we do not really *implement* a pending
20922 implementation, which makes code fail.
20924 2002-06-22 Martin Baulig <martin@gnome.org>
20926 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
20927 the return value of Object.GetType(). [FIXME: we need to do this whenever
20928 we get a type back from the reflection library].
20930 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
20932 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
20934 2002-06-20 Miguel de Icaza <miguel@ximian.com>
20936 * attribute.cs: Return null if we can not look up the type.
20938 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
20939 the interface types found.
20941 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
20942 interface types found.
20944 * typemanager.cs (GetInterfaces): Make this routine returns alll
20945 the interfaces and work around the lame differences between
20946 System.Type and System.Reflection.Emit.TypeBuilder in the results
20947 result for GetInterfaces.
20949 (ExpandInterfaces): Given an array of interface types, expand and
20950 eliminate repeated ocurrences of an interface. This expands in
20951 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
20954 2002-06-21 Martin Baulig <martin@gnome.org>
20956 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
20959 2002-06-21 Martin Baulig <martin@gnome.org>
20961 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
20962 and called with one of the core types, return the corresponding typebuilder for
20965 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
20968 2002-06-21 Martin Baulig <martin@gnome.org>
20970 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
20971 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
20972 (Expression.ConvertReferenceExplicit): Likewise.
20974 * expression.cs (ElementAccess.DoResolve): Likewise.
20975 (ElementAccess.DoResolveLValue): Likewise.
20977 2002-06-10 Martin Baulig <martin@gnome.org>
20979 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
20980 add the "value" parameter to the parameter list.
20982 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
20985 2002-06-19 Miguel de Icaza <miguel@ximian.com>
20987 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
20988 the argument to an int, uint, long or ulong, per the spec. Also
20989 catch negative constants in array creation.
20991 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
20993 * class.cs: do not allow the same interface to appear twice in
20994 the definition list.
20996 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
20998 * ecore.cs: don't use ldlen with System.Array.
21000 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
21002 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
21004 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
21006 * modifiers.cs: produce correct field attributes for protected
21007 internal. Easy fix so miguel can work on ther harder stuff:-)
21009 2002-06-18 Miguel de Icaza <miguel@ximian.com>
21011 * pending.cs: New file. Move the code from class.cs here.
21012 Support clearning the pending flag for all methods (when not doing
21013 explicit interface implementation).
21015 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
21017 * rootcontext.cs: added a couple more types needed to bootstrap.
21019 2002-06-17 Miguel de Icaza <miguel@ximian.com>
21021 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
21022 constructor in the type, instead of any constructor in the type
21023 hierarchy. Thanks to Paolo for finding this bug (it showed up as
21024 a bug in the Mono runtime when applying the params attribute).
21026 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
21027 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
21029 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
21031 * expression.cs (Unary.ResolveOperator): Use TypeManager
21032 to resolve the type.
21034 2002-06-13 Ravi Pratap <ravi@ximian.com>
21036 * cs-parser.jay (enum_member_declaration): Pass in the attributes
21039 * enum.cs (AddEnumMember): Add support to store the attributes associated
21040 with each member too.
21042 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
21043 field builders too - this takes care of the enum member case.
21045 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
21047 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
21048 address-of operator on both value types and pointers.
21050 2002-06-10 Martin Baulig <martin@gnome.org>
21052 * interface.cs (Interface.PopulateIndexer): Add the indexer's
21053 PropertyBuilder to the `property_builders' list.
21055 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
21056 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
21057 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
21058 find any indexers which are inherited from an interface.
21060 2002-06-09 Martin Baulig <martin@gnome.org>
21062 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
21063 the same type as the constant if necessary. There's also a test-130.cs
21066 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
21068 * typemanager.cs (TypeManager.ChangeType): Previously known as
21069 Enum.ChangeEnumType().
21071 2002-06-09 Martin Baulig <martin@gnome.org>
21073 * expression.cs (Cast.TryReduce): Added support for consts.
21075 2002-06-08 Ravi Pratap <ravi@ximian.com>
21077 * class.cs (Accessor): Hold attributes information so we can pass
21080 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
21081 Modify to pass in attributes attached to the methods.
21083 (add_accessor_declaration, remove_accessor_declaration): Ditto.
21085 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
21086 to handle the Accessor kind :-)
21088 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
21090 2002-06-08 Martin Baulig <martin@gnome.org>
21092 * expression.cs (Unary.TryReduceNegative): Added support for
21095 2002-06-08 Martin Baulig <martin@gnome.org>
21097 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
21098 name can't be found in the `defined_names' - the caller will do a
21099 MemberLookup in this case and thus find methods in System.Enum
21100 such as Enum.IsDefined().
21102 2002-06-08 Martin Baulig <martin@gnome.org>
21104 * enum.cs (Enum.ChangeEnumType): This is a custom version of
21105 Convert.ChangeType() which works with TypeBuilder created types.
21106 (Enum.LookupEnumValue, Enum.Define): Use it here.
21108 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
21109 `TypeBuilder.BaseType != null' check.
21110 (TypeContainer.FindMembers): Only lookup parent members if we
21111 actually have a parent.
21112 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
21113 (ConstructorInitializer.Resolve): Likewise.
21115 * interface.cs (Interface.FindMembers): Added
21116 `TypeBuilder.BaseType != null' check.
21118 * rootcontext.cs (RootContext.ResolveCore): Added
21119 "System.Runtime.CompilerServices.IndexerNameAttribute" to
21120 classes_second_stage.
21122 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
21123 debug_type and trace_type when compiling with --nostdlib.
21125 2002-06-07 Martin Baulig <martin@gnome.org>
21127 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
21128 (AddField): Set it to true when adding a non-static field.
21129 (DefineType): Use `have_nonstatic_fields' to find out whether we
21130 have non-static fields, not `Fields != null'.
21132 2002-06-02 Miguel de Icaza <miguel@ximian.com>
21134 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
21135 dereferencing a null on the static-field code path)
21137 2002-05-30 Martin Baulig <martin@gnome.org>
21139 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
21140 to take command line arguments. Use reflection to call the new
21141 custom `Initialize' function on the symbol writer and pass it the
21142 command line arguments.
21144 * driver.cs (--debug-args): New command line argument to pass command
21145 line arguments to the symbol writer.
21147 2002-05-28 Miguel de Icaza <miguel@ximian.com>
21149 * assign.cs (DoResolve): Forgot to do the implicit conversion to
21150 the target type for indexers and properties. Thanks to Joe for
21153 2002-05-27 Miguel de Icaza <miguel@ximian.com>
21155 * typemanager.cs (MethodFlags): returns the method flags
21156 (Obsolete/ShouldIgnore) that control warning emission and whether
21157 the invocation should be made, or ignored.
21159 * expression.cs (Invocation.Emit): Remove previous hack, we should
21160 not do this on matching a base type, we should do this based on an attribute
21162 Only emit calls to System.Diagnostics.Debug and
21163 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
21164 on the command line.
21166 * rootcontext.cs: Global settings for tracing and debugging.
21168 * cs-tokenizer.cs (define): New utility function to track
21169 defines. Set the global settings for TRACE and DEBUG if found.
21171 2002-05-25 Ravi Pratap <ravi@ximian.com>
21173 * interface.cs (Populate*): Pass in the TypeContainer as well as
21174 the DeclSpace as parameters so that we can create EmitContexts and
21175 then use that to apply attributes etc.
21177 (PopulateMethod, PopulateEvent, PopulateProperty)
21178 (PopulateIndexer): Apply attributes everywhere.
21180 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
21183 (ApplyAttributes): Update accordingly.
21185 We now apply interface attributes for all members too.
21187 2002-05-26 Miguel de Icaza <miguel@ximian.com>
21189 * class.cs (Indexer.Define); Correctly check if we are explicit
21190 implementation (instead of checking the Name for a ".", we
21191 directly look up if the InterfaceType was specified).
21193 Delay the creation of the PropertyBuilder.
21195 Only create the PropertyBuilder if we are not an explicit
21196 interface implementation. This means that explicit interface
21197 implementation members do not participate in regular function
21198 lookups, and hence fixes another major ambiguity problem in
21199 overload resolution (that was the visible effect).
21201 (DefineMethod): Return whether we are doing an interface
21204 * typemanager.cs: Temporary hack until we get attributes in
21205 interfaces (Ravi is working on that) and we get IndexerName
21206 support in interfaces.
21208 * interface.cs: Register the indexers as properties.
21210 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
21211 warning, I have verified that this is a bug in the .NET runtime
21212 (JavaScript suffers of the same problem).
21214 * typemanager.cs (MemberLookup): When looking up members for
21215 interfaces, the parent of an interface is the implicit
21216 System.Object (so we succeed in searches of Object methods in an
21217 interface method invocation. Example: IEnumerable x; x.ToString
21220 2002-05-25 Miguel de Icaza <miguel@ximian.com>
21222 * class.cs (Event): Events should also register if they do
21223 implement the methods that an interface requires.
21225 * typemanager.cs (MemberLookup); use the new GetInterfaces
21228 (GetInterfaces): The code used to lookup interfaces for a type is
21229 used in more than one place, factor it here.
21231 * driver.cs: Track the errors at the bottom of the file, we kept
21234 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
21235 instance if the method we are calling is static!
21237 2002-05-24 Miguel de Icaza <miguel@ximian.com>
21239 * attribute.cs (ApplyAttributes): Make this function filter out
21240 the IndexerName attribute (as that attribute in reality is never
21241 applied) and return the string constant for the IndexerName
21244 * class.cs (TypeContainer.Emit): Validate that all the indexers
21245 have the same IndexerName attribute, and if so, set the
21246 DefaultName attribute on the class.
21248 * typemanager.cs: The return value might contain other stuff (not
21249 only methods). For instance, consider a method with an "Item"
21250 property and an Item method.
21252 * class.cs: If there is a problem with the parameter types,
21255 2002-05-24 Ravi Pratap <ravi@ximian.com>
21257 * ecore.cs (ImplicitConversionExists): Wrapper function which also
21258 looks at user defined conversion after making a call to
21259 StandardConversionExists - we need this for overload resolution.
21261 * expression.cs : Update accordingly the various method calls.
21263 This fixes 2 bugs filed against implicit user defined conversions
21265 2002-05-22 Miguel de Icaza <miguel@ximian.com>
21267 * statement.cs: Track the result of the assignment.
21269 2002-05-21 Miguel de Icaza <miguel@ximian.com>
21271 * expression.cs (MemberAccess): Improved error reporting for
21272 inaccessible members.
21274 2002-05-22 Martin Baulig <martin@gnome.org>
21276 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
21277 itself with debugging support.
21279 2002-05-22 Martin Baulig <martin@gnome.org>
21281 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
21282 Removed, this isn't needed anymore.
21284 2002-05-20 Martin Baulig <martin@gnome.org>
21286 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
21287 be underlying type for an enum.
21289 2002-05-20 Miguel de Icaza <miguel@ximian.com>
21291 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
21292 that splits out the loading of just the core types.
21294 * rootcontext.cs (ResolveCore): Split the struct resolution in
21295 two, so we can load the enumeration underlying types before any
21298 * expression.cs (Is): Bandaid until we fix properly Switch (see
21299 bug #24985 for details).
21301 * typemanager.cs (ImplementsInterface): The hashtable will contain
21302 a null if there are no interfaces implemented.
21304 2002-05-18 Miguel de Icaza <miguel@ximian.com>
21306 * cs-parser.jay (indexer_declarator): It is fine to have array
21309 2002-05-17 Miguel de Icaza <miguel@ximian.com>
21311 * typemanager.cs: (RegisterBuilder): New function used to register
21312 TypeBuilders that implement interfaces. Since
21313 TypeBuilder.GetInterfaces (as usual) does not work with lame
21315 (AddUserType): register interfaces.
21317 (ImplementsInterface): Use the builder_to_ifaces hash if we are
21318 dealing with TypeBuilder. Also, arrays are showing up as
21319 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
21320 methods can not be invoked on them!
21322 * ecore.cs (ExplicitReferenceConversionExists): Made public.
21323 (ImplicitReferenceConversionExists): Split out from
21324 StandardConversionExists.
21326 * expression.cs (As): We were only implementing one of the three
21327 cases for the as operator. We now implement them all.
21328 (Is): Implement the various other cases for Is as well.
21330 * typemanager.cs (CACHE): New define used to control if we want or
21331 not the FindMembers cache. Seems to have a negative impact on
21332 performance currently
21334 (MemberLookup): Nested types have full acess to
21335 enclosing type members
21337 Remove code that coped with instance/static returns for events, we
21338 now catch this in RealFindMembers.
21340 (RealFindMembers): only perform static lookup if the instance
21341 lookup did not return a type or an event.
21343 2002-05-17 Miguel de Icaza <miguel@ximian.com>
21345 * assign.cs (CompoundAssign): We pass more semantic information
21346 now to Compound Assignments than we did before: now we have all
21347 the information at hand, and now we resolve the target *before* we
21348 do the expression expansion, which allows the "CacheValue" method
21349 to have the effect we intended (before, a [x] += 1 would generate
21350 two differen ArrayAccess expressions from the ElementAccess,
21351 during the resolution process).
21353 (CompoundAssign.DoResolve): Resolve target and original_source here.
21355 2002-05-16 Miguel de Icaza <miguel@ximian.com>
21357 * expression.cs (ArrayAccess): dropped debugging information.
21359 * typemanager.cs: Small bug fix: I was always returning i_members,
21360 instead of one of i_members or s_members (depending on which had
21363 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
21364 method is invoked before any code generation takes place, and it
21365 is a mechanism to inform that the expression will be invoked more
21366 than once, and that the method should use temporary values to
21367 avoid having side effects
21369 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
21371 * ecore.cs (Expression.CacheTemporaries): Provide empty default
21374 * expression.cs (Indirection, ArrayAccess): Add support for
21375 CacheTemporaries in these two bad boys.
21377 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
21378 ldobj or ldind_ref.
21379 (StoreFromPtr): Handle stobj as well.
21381 * expression.cs (UnaryMutator): Share more code.
21383 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
21384 down: I was not tracking the Filter function as well, which
21385 was affecting the results of the cache.
21387 2002-05-15 Miguel de Icaza <miguel@ximian.com>
21389 * attribute.cs: Remove the hack to handle the CharSet property on
21392 2002-05-14 Miguel de Icaza <miguel@ximian.com>
21394 * attribute.cs (DoResolve): More uglyness, we now only try to
21395 resolve the attribute partially, to extract the CharSet
21396 information (only if we are a StructLayout attribute). Otherwise
21398 (GetExtraTypeInfo): Add some code to conditionally kill in the
21399 future this. I am more and more convinced that the .NET
21400 framework has special code to handle the attribute setting on
21403 * expression.cs (IsParamsMethodApplicable): Revert my previous
21404 foreach change here, it was wrong.
21406 2002-05-13 Miguel de Icaza <miguel@ximian.com>
21408 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
21409 (pp_expr): do not abort on unknown input, just return.
21410 (eval): abort if there are pending chars.
21412 * attribute.cs (Attribute.Resolve): Positional parameters are
21413 optional. Deal with that case.
21415 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
21416 the Ansi/Unicode/Auto information for the type.
21418 (TypeContainer.DefineType): instantiate the EmitContext here, as
21419 we will be using it during the type definition (to resolve
21420 attributes) and during the emit phase.
21422 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
21423 to pull type information out of the attributes
21425 (Attribute.Resolve): track the constructor builder, and allow for
21426 multiple invocations (structs and classes will use this).
21428 * ecore.cs (MemberLookupFinal): new version with all the
21429 parameters customizable.
21431 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
21432 constructors. Return if the result value is null (as the error
21433 would have been flagged already by MemberLookupFinal)
21435 Do not allow instances of abstract classes or interfaces to be
21438 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
21439 We have to compare the assembly property here when dealing with
21440 FamANDAssem and Assembly access modifiers, because we might be
21441 creating an assembly from *modules* (that means that we are not
21442 getting TypeBuilders for types defined in other modules that are
21443 part of this assembly).
21445 (Method.Emit): If the method is marked abstract and has a body,
21448 (TypeContainer.DefineMembers): If both the defined member and the
21449 parent name match are methods, then do not emit any warnings: let
21450 the Method.Define routine take care of flagging warnings. But if
21451 there is a mismatch (method overrides something else, or method is
21452 overriwritten by something, then emit warning).
21454 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
21455 set to null, this means `do not check for the return type on the
21458 (Method.Define): set the return type for the method signature to
21459 null, so that we get methods with the same name and parameters and
21460 different return types. This is used to flag warning 114 (you are
21461 hiding a method, and you probably want to use the new/override
21464 * typemanager.cs (MemberLookup): Implemented proper access
21465 control, closing a long standing set of bug reports. The problem
21466 was that the Framework only has two bits: Public and NonPublic,
21467 and NonPublic includes private and protected methods, but we need
21468 to enforce the FamANDAssem, FamOrAssem and Family.
21470 2002-05-11 Miguel de Icaza <miguel@ximian.com>
21472 * statement.cs (GotoCase): Return true: Ammounts to giving up
21473 knowledge on whether we return or not, and letting the other case
21474 be responsible for it.
21476 2002-05-10 Miguel de Icaza <miguel@ximian.com>
21478 * driver.cs: Do not load directories for each file processed, only
21479 do it if there is a pattern.
21481 * ecore.cs: Report readonly assigns here as well, as we might have
21482 been resolved only by MemberAccess.
21484 (SimpleName.SimpleNameResolve): Also be useful for LValue
21485 resolution. We need this to propagate assign to local readonly variables
21487 * typemanager.cs: Use a ptrhashtable for the criteria, because we
21488 do not want to reuse potential criteria memory.
21490 * class.cs (MyEventBuilder): Set reflected_type;
21492 * ecore.cs (Constantify): Added support for constifying bools.
21494 (RootContext.LookupType): Added a cache for values looked up in
21495 the declaration space.
21497 * typemanager.cs (FindMembers): Now is a front-end to
21498 RealFindMembers, and provides a two-level hashtable-based cache to
21501 15% performance improvement: from 22.5 to 19.2 seconds.
21503 * expression.cs (IsParamsMethodApplicable): use foreach.
21504 (Invocation.DoResolve): ditto.
21505 (New.DoResolve): ditto.
21506 (ArrayCreation.DoResolve): ditto.
21508 * ecore.cs (FindMostEncompassingType): use foreach.
21510 * delegate.cs (NewDelegate.DoResolve): Use foreach
21512 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
21513 (RemoveMethods): use foreach.
21515 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
21516 nested foreach statements instead of for, and also break out of
21517 the inner loop once a match is found.
21519 (Invocation.OverloadResolve): Use foreach, simplify the code.
21521 2002-05-08 Miguel de Icaza <miguel@ximian.com>
21523 * cfold.cs (BinaryFold): During an enumeration evaluation context,
21524 we actually unwrap the expression to allow for extra information
21527 * expression.cs: Use Shr_Un on unsigned operations.
21529 2002-05-08 Ravi Pratap <ravi@ximian.com>
21531 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
21532 applicable operators was not being considered correctly. This closes
21533 the bug Miguel reported.
21535 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
21537 * attribute.cs: check that the type derives from System.Attribute
21538 and report the correct error in that case (moved the duplicate code to
21539 its own method, too).
21541 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
21543 * attribute.cs: lookup attribute type name as the spec says: first the
21544 bare attribute name and then name + "Attribute" (nant compiles with
21545 mcs after this fix).
21547 2002-05-07 Miguel de Icaza <miguel@ximian.com>
21549 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
21550 Because of the way we parse things, we should try to see if a
21551 UIntConstant can fit in an integer.
21553 2002-05-07 Ravi Pratap <ravi@ximian.com>
21555 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
21556 when we are in an explicit context.
21558 (ConvertReferenceExplicit): When converting from Iface type S to Class
21559 T make sure the rules are implemented as an OR.
21561 * parameter.cs (ParameterType): Make it a property for now although the
21562 purpose really isn't anything immediate.
21564 * expression.cs (Is*Applicable): Do better checking on the parameter type
21565 of a ref/out parameter. The ones from the system assemblies are already
21566 marked with the correct type so we don't need to do any correction.
21568 * ecore.cs (StandardConversionExists): Conversion from Interface types to
21569 the object type is standard too so include that.
21571 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21573 * ecore.cs (StandardConversionExists): Augment with missing code:
21574 deal with IntConstant, LongConstants and Enumerations.
21576 * assign.cs: Report the error, instead of failing silently
21578 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
21579 typecontainer that they are declared, because the
21580 typecontainer/namespace will have the list of using clauses that
21581 need to be applied.
21583 Assembly Attributes were escaping the normal registration
21586 (EmitCode): Apply attributes within an EmitContext that represents
21587 the container they were declared on.
21589 * cs-parser.jay: Track bases for structs. How did I get this wrong?
21591 2002-05-06 Ravi Pratap <ravi@ximian.com>
21593 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
21594 Revamp completely - make much cleaner as we now operate only
21597 (FindMostSpecificSource, FindMostSpecificTarget): New methods
21598 to implement the logic detailed in the spec more correctly.
21600 (UserDefinedConversion): Update accordingly.
21602 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21604 * statement.cs: Return flow analysis information up.
21606 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
21609 (token): Do not consume an extra character before calling
21612 2002-05-06 Piers Haken <piersh@friskit.com>
21614 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
21616 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21618 * class.cs (Constructor.Emit): Set the IsStatic flag in the
21619 EmitContext during the instance constructor initializer
21620 resolution, to stop access to instance variables.
21622 This is mandated by the spec, last paragraph of the `constructor
21623 initializers' section.
21625 2002-05-05 Miguel de Icaza <miguel@ximian.com>
21627 * cs-parser.jay, class.cs (Accessor): new class used to represent
21628 an accessor (get or set). In the past we used `null' to represent
21629 a missing accessor. But this is ambiguous because there was no
21630 way to tell in abstract indexers/properties if one of them was
21633 Now there is a way of addressing that.
21635 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
21636 instead of FindMembers.
21638 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
21639 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
21641 * attribute.cs: Treat indexers and properties as the same in terms
21642 of applying attributes
21644 * ecore.cs (FindMostEncompassedType): Use statically initialized
21645 EmptyExpressions()s like we do elsewhere to avoid creating useless
21646 objects (and we take this out of the tight loop).
21648 (GetConversionOperators): Move the code to extract the actual
21649 operators to a separate routine to clean things up.
21651 2002-05-04 Miguel de Icaza <miguel@ximian.com>
21653 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
21654 events are always registered FieldBuilders.
21656 * class.cs (FieldBase): New class shared by Fields
21658 * delegate.cs: If we are a toplevel delegate, use our full name.
21659 If we are a nested delegate, then only use our tail name.
21661 2002-05-02 Ravi Pratap <ravi@ximian.com>
21663 * expression.cs (IsApplicable): Ensure that we add the "&" to
21664 ref/out types before comparing it with the type of the argument.
21666 (IsParamsMethodApplicable): Ditto.
21668 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
21671 * delegate.cs : Handle the case when we have more than one applicable
21672 method. Flag an error only when we finish checking all.
21674 2002-05-02 Miguel de Icaza <miguel@ximian.com>
21676 * expression.cs: Add support for boolean static initializers.
21678 2002-05-01 Miguel de Icaza <miguel@ximian.com>
21680 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
21682 * parameter.cs (ComputeParameterTypes,
21683 ComputeAndDefineParameterTypes): Better error handling: now we
21684 clear the `types' cache if we fail during any of the type lookups.
21685 We also return the status code correctly to our caller
21687 * delegate.cs: If we fail to define a delegate, abort the extra
21690 * expression.cs (Binary.ResolveOperator): for
21691 operator==(object,object) and operator !=(object, object) we also
21692 have to verify that there is an implicit conversion from one to
21695 (ArrayAccess.DoResolve): Array Access can operate on
21698 2002-04-30 Miguel de Icaza <miguel@ximian.com>
21700 * assign.cs (CompoundAssign): A new class used as a "flag" that
21701 the assignment actually is happening as part of a compound
21702 assignment operator.
21704 During compound assignment, a few new rules exist to enable things
21711 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
21712 to the type of x) if y is implicitly convertible to the type of x,
21713 and the operator is a builtin operator and the return type of the
21714 operator is explicitly convertible to the type of x.
21716 * rootcontext.cs: Reset warning level to 2. 4 catches various
21717 "interesting" features in mcs, we must clean this up at some
21718 point, but currently am trying to kill other bugs ;-)
21720 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
21721 in container classes as well.
21723 * expression.cs (Binary.ResolveOperator): Handle string case
21724 before anything else (as operator overloading does emit an error
21725 before doing anything else).
21727 This code could go away when we move to a table driven model, but
21728 i could not come up with a good plan last night.
21730 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
21732 * typemanager.cs (CSharpName): reimplementation using regex.
21733 * class.cs: added null check for fields in Emit
21734 * rootcontext.cs: set warninglevel to 4
21736 2002-04-29 Miguel de Icaza <miguel@ximian.com>
21738 * typemanager.cs (CSharpName): reimplemented with Lupus
21741 2002-04-28 Miguel de Icaza <miguel@ximian.com>
21743 * statement.cs (If): correclty implement Resolve, because we were
21744 not catching sem errors in there. The same process is needed
21746 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
21749 (Statement.Warning_DeadCodeFound): Factorize code.
21750 (While): Report dead code here too.
21752 (Statement): Added Resolve virtual method to allow
21753 for resolution split from the emit code.
21755 2002-04-26 Miguel de Icaza <miguel@ximian.com>
21757 * statement.cs (EmitBoolExpression): No longer try to resolve the
21759 (MakeBoolean): New utility function that resolve, implicitly
21760 converts to boolean and tags the expression.
21763 (If, Do): Implement dead code elimination.
21764 (While): Implement loop inversion
21766 (Do, While, For, If): Resolve the expression prior to calling our
21769 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
21772 - added method Report28 (warning: program has more than one entry point)
21773 - added method IsEntryPoint, implements paragraph 10.1 of the spec
21774 - modified method Method.Define, the part at the end of the method
21776 * rootcontext.cs: added static public Location EntryPointLocation;
21778 * ../errors/cs0028.cs : Add test case for the above warning.
21781 - modified method CSharpName to allow arrays of primitive type to
21782 be printed nicely (e.g. instead of System.Int32[][] it now prints
21784 - added method CSharpSignature: returns the signature of a method
21785 in string format to be used in reporting errors, warnings, etc.
21787 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
21790 2002-04-26 Ravi Pratap <ravi@ximian.com>
21792 * delegate.cs (Define): Fix extremely silly bug where I was
21793 setting the type of the 'object' parameter of the BeginInvoke
21794 method to System.IAsyncResult instead of System.Object ;-)
21796 2002-04-26 Miguel de Icaza <miguel@ximian.com>
21798 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
21801 (Constructor.Emit): return if we fail to initialize the
21802 constructor. Another door closed!
21804 * expression.cs (New.DoResolve): Improve error message (from -6 to
21805 1501). Use DeclaredOnly lookup to find the exact constructor.
21807 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
21808 loop. This is useful.
21810 * cs-parser.jay: Adjust the default parameters so that destructors
21811 have the proper signature.
21813 2002-04-26 Martin Baulig <martin@gnome.org>
21815 * driver.cs (LoadAssembly): If `assembly' contains any characters
21816 which are only valid in path names and not in assembly names
21817 (currently slash, backslash and point), use Assembly.LoadFrom ()
21818 instead of Assembly.Load () on the `assembly' (before iteration
21819 over the link_paths).
21821 2002-04-26 Martin Baulig <martin@gnome.org>
21823 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
21825 2002-04-25 Miguel de Icaza <miguel@ximian.com>
21827 * class.cs (Property): use the new typemanager.MemberLookup
21829 (TypeContainer.MemberLookup): Implement using the
21830 TypeManager.MemberLookup now.
21832 * typemanager.cs: Make MemberLookup a function of the TypeManager,
21833 and return MemberInfos, so that these can be used without an
21834 EmitContext (what we had before).
21836 2002-04-24 Miguel de Icaza <miguel@ximian.com>
21838 * expression.cs: Fix the case where the argument to params if the
21839 type of the params. I omitted handling this before. Fixed
21841 2002-04-22 Miguel de Icaza <miguel@ximian.com>
21843 * driver.cs: Call BootCorlib_PopulateCoreType
21845 * class.cs (Property.CheckBase): Check for properties only, not
21848 * interface.cs: Temporary hack: try/catch around the
21849 CustomAttributeBuilder, because I am getting an exception that I
21852 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
21853 types whose definitions are required to be there (attributes are
21854 defined before standard types).
21856 Compute definitions as we boot the various types, as they are used
21857 immediately (value_type class will need object_type, but if we do
21858 not initialize object_type, we will pass a null, which will let
21859 the runtime pick the System.Object from the existing corlib, which
21860 is not what we want).
21862 2002-04-22 Patrik Torstensson <totte@labs2.com>
21864 * cs-tokenizer.cs: fixed a number of trim() issues.
21866 2002-04-22 Ravi Pratap <ravi@ximian.com>
21868 * expression.cs (Argument.Type): Ensure that we return the correct
21869 type when we have out or ref parameters [in which case we
21872 2002-04-22 Miguel de Icaza <miguel@ximian.com>
21874 * class.cs (Property, Indexer): Allow extern modifier in there.
21876 * typemanager.cs (InitBaseTypes): Initializes object_type and
21877 value_type, since those will be used early on during the bootstrap
21878 process to compile corlib.
21880 (InitCoreTypes): Move code from here to InitBaseTypes.
21882 2002-04-21 Miguel de Icaza <miguel@ximian.com>
21884 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
21885 single-dimension arrays as using the ldlen opcode.
21887 Daniel Lewis discovered this optimization.
21889 * typemanager.cs: Add signature for System.Array::get_Length
21891 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21893 * statement.cs: report the error when the foreach does not apply to an
21894 array nor a collection.
21896 2002-04-19 Miguel de Icaza <miguel@ximian.com>
21898 * expression.cs: Add implicit conversions to the operator ~.
21900 * constant.cs (DecimalConstant.Emit): Emit decimal value.
21902 * typemanager.cs: Locate the decimal constructor.
21904 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21906 * attribute.cs: use the new property of TypeOf.
21907 * expression.cs: added 'get' property around typearg.
21909 These changes fix a build breaker reported by NickD. Is this the
21910 correct way to fix? If not, please, revert my changes and make it
21913 2002-04-17 Miguel de Icaza <miguel@ximian.com>
21915 * attribute.cs: Add support for typeof in attribute invocations.
21916 I am not sure that this is right though.
21918 2002-04-14 Duncan Mak <duncan@ximian.com>
21920 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
21921 Binary.Operator.Division case.
21923 2002-04-13 Ravi Pratap <ravi@ximian.com>
21925 * class.cs (DefineType): Ensure that we do a proper check on
21926 attribute types and also register it with the TypeManager.
21928 (TypeContainer.Targets): The default for attribute types is
21929 AttributeTargets.All.
21931 * attribute.cs (ApplyAttributes): Registering the attribute type
21932 is done elsewhere, not when we discover we have a Usage attribute.
21934 2002-04-12 Ravi Pratap <ravi@ximian.com>
21936 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
21937 and get rid of is_delegate parameter.
21939 * everywhere : update.
21941 2002-04-12 Ravi Pratap <ravi@ximian.com>
21943 * cs-parser.jay (compilation_unit): Revamp completely to use
21944 some new ideas that I got from Rhys' grammar to solve the problems
21945 with assembly level attributes.
21947 (outer_declaration): New grammar production.
21949 (attribute_sections): Add.
21951 (opt_attributes): Base on attribute_sections
21953 (namespace_declaration): Allow opt_attributes to tackle the case
21954 when we have assembly level attributes - we are clever in this
21957 * attribute.cs (ApplyAttributes): Do not worry about assembly
21958 attributes in the non-global context.
21960 * rootcontext.cs (AddGlobalAttributes): Go back to using this
21961 instead of SetGlobalAttributes.
21963 * class.cs, rootcontext.cs : Ensure we define and generate
21964 attribute types before anything else.
21966 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
21967 and flag the new error -20 for the case when the attribute type
21968 does not have valid targets specified. csc does not catch this.
21970 * ../errors/errors.txt : update for error # -20
21972 2002-04-11 Ravi Pratap <ravi@ximian.com>
21974 * support.cs (InternalParameters.ParameterModifier): Do some null
21975 checking and return sane values.
21977 * class.cs (Method.Define): If we are a PInvoke method, ensure
21978 that we are static and extern. Report error # 601
21980 * ../errors/cs0601.cs : Add test case for the above error.
21982 2002-04-07 Ravi Pratap <ravi@ximian.com>
21984 * rootcontext.cs (attribute_types): We need to keep type of
21985 all attribute types separately and emit code for them first.
21987 (RegisterAttribute) : Implement.
21989 * class.cs (DefineType): Check if the current Type is a custom
21990 attribute type and register it accordingly.
21992 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
21993 adding the first attribute twice and rename to
21995 (SetGlobalAttributes): this.
21997 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
22000 * attribute.cs (ApplyAttributes): Take an additional argument telling us
22001 if we are processing global arguments. Hmm, I am unsure of this.
22003 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22005 * expression.cs: added static array of strings to avoid calling
22006 Enum.ToString () for Operator in Binary. Significant recover of
22009 2002-04-10 Miguel de Icaza <miguel@ximian.com>
22011 * class.cs (FindMembers): Allow the Builders of the various
22012 members to be null. If they are skip them. This only happens
22013 during the PInvoke declaration.
22015 2002-04-09 Miguel de Icaza <miguel@ximian.com>
22017 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
22018 failure, so we do not keep going afterwards.
22020 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
22021 wanted to pass `false' as the `is_delegate' argument. If this is
22022 the case, why not use delegate_type == null to mean `is_delegate =
22023 false' and anything else as is_delegate = true.
22025 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
22027 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
22028 code for the section, not the beginning of the tests.
22030 2002-04-08 Miguel de Icaza <miguel@ximian.com>
22032 * cfold.cs: Handle operator + (Enum x, Underlying x)
22034 * expression.cs (Binary): same. Warn about errors where we have
22035 Enum/Enum in operator + as well.
22037 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
22040 - added support for switch(bool)
22041 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
22042 - add TableSwitchEmit() to handle table-based switch statements
22044 2002-04-05 Ravi Pratap <ravi@ximian.com>
22046 * expression.cs (Invocation.OverloadResolve): Factor out code which
22047 does parameter compatibility checking with arguments so that we can
22048 re-use the code even from Delegate.VerifyApplicability
22050 (VerifyArgumentsCompat): Move above code here.
22052 * delegate.cs (VerifyApplicability): Get rid of duplicate code
22053 and instead make a call to the above method.
22055 2002-03-31 Ravi Pratap <ravi@ximian.com>
22057 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
22058 We use it to keep track of classes which are attribute types.
22060 2002-04-02 Miguel de Icaza <miguel@ximian.com>
22062 * delegate.cs (Delegate.Define): Correctly define the types in the
22063 presence of fixed and array parameters.
22065 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
22068 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
22069 include NonPublic after the first iteration.
22071 * class.cs (Indexer.CheckBase): Only check if both parents are
22074 * cs-parser.jay (accessor_body): If empty, set to null.
22076 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
22077 same code path here to resolve constants names that we did have in
22078 MemberAccess.DoResolve. There is too much code duplicated here.
22080 2002-04-01 Miguel de Icaza <miguel@ximian.com>
22082 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
22084 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
22087 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
22088 tokens, numbers and strings.
22090 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
22093 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
22094 asyncronous parameters and the regular parameters.
22096 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
22097 specify the target directory.
22099 * expression.cs: (This.DoResolve): Simplify
22100 (As.Emit): Optimize, do not generate IsInst if the expression is
22101 always of the given type.
22103 (Is.DoResolve): Bug fix, we were reporting both always/never for
22106 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
22107 creating too many unnecessary arrays.
22109 2002-03-31 Miguel de Icaza <miguel@ximian.com>
22111 * class.cs (EmitFieldInitializer): Use Assign expression to assign
22112 fields instead of rolling our own initializer. Takes care of all
22113 implicit conversions, and drops unnecessary static checks/argument.
22115 2002-03-31 Dick Porter <dick@ximian.com>
22117 * driver.cs: use the GetDirectories() return values properly, and
22118 use "/" as path separator.
22120 2002-03-30 Miguel de Icaza <miguel@ximian.com>
22122 * expression.cs (Unary): Optimize - - expr into expr.
22123 (Binary): Optimize a + (-b) into a -b.
22125 * codegen.cs (CodeGen): Made all methods static.
22127 2002-03-29 Miguel de Icaza <miguel@ximian.com>
22131 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
22132 TypeBuilder property.
22134 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
22137 * tree.cs: Removed the various RecordXXXX, and replaced with a
22138 single RecordDecl. Removed all the accessor methods, and just
22139 left a single access point Type
22141 * enum.cs: Rename DefineEnum to DefineType.
22143 * decl.cs: New abstract method `DefineType' used to unify the
22144 Defines for Enumerations, Interfaces, TypeContainers and
22147 (FindType): Moved LookupInterfaceOrClass here. Moved the
22148 LookupBaseClasses method that used to live in class.cs and
22149 interface.cs here, and renamed to FindType.
22151 * delegate.cs: Implement DefineType. Take advantage of the
22152 refactored pattern for locating the parent builder without taking
22153 the parent_builder argument (which we know does not work if we are
22154 nested, and triggering a toplevel definition).
22156 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22158 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
22159 accessibility of a member has changed during override and report
22162 * class.cs (Method.Define, Property.Define): Only complain on
22163 overrides if the method is private, any other accessibility is
22164 fine (and since we just checked the permission is the same, we are
22167 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
22168 and elif are processed always. The other pre-processing
22169 directives are only processed if we are "taking" the path
22171 2002-03-29 Martin Baulig <martin@gnome.org>
22173 * class.cs (Method.Emit): Only emit symbolic debugging info if the
22174 current location is not Null.
22176 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
22177 a separate method so we can profile it.
22179 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
22180 `span.Seconds' are just seconds, but no minutes or hours.
22181 (MainDriver): Profile the CodeGen.SaveSymbols calls.
22183 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22185 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
22186 Remove the gratuitous set of Final:
22188 // If an interface implementation, then we can set Final.
22189 if (((flags & MethodAttributes.Abstract) == 0) &&
22190 implementing.DeclaringType.IsInterface)
22191 flags |= MethodAttributes.Final;
22193 I do not know what I was smoking when I used that.
22196 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
22197 step into fixing the name resolution issues for delegates and
22198 unifying the toplevel name resolution.
22200 2002-03-28 Martin Baulig <martin@gnome.org>
22202 * class.cs (Method.Emit): If we have a symbol writer, call its
22203 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
22204 tell it about the current method.
22206 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
22207 writer that we're going to emit the first byte of IL code for a new
22208 statement (a new source line).
22209 (EmitContext.EmitTopBlock): If we have a symbol writer, call
22210 EmitContext.Mark() before emitting any code.
22212 * location.cs (SymbolDocument): Return null when we're Null.
22214 * statement.cs (Statement): Moved the `Location loc' variable here.
22215 (Statement.EmitBoolExpression): If we have a symbol writer, call
22216 ec.Mark() before emitting any code to tell it that we're at the
22217 beginning of a new statement.
22218 (StatementExpression): Added `Location' argument to the constructor.
22219 (Block): Added public readonly variable `StartLocation' and public
22220 variable `EndLocation'. The latter is to be set using SetEndLocation().
22221 (Block): Added constructor which takes a start and end location.
22222 (Block.SetEndLocation): New method. This sets the end location.
22223 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
22224 local variables we create.
22225 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
22226 each statement and do also mark the begin and end of the block.
22228 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
22229 tell it the current lexer.Location, use Location.Null for the end of the
22231 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
22232 current block, set its end location using SetEndLocation().
22233 (statement_expression): StatementExpression constructor now takes the
22234 lexer.Location as additional argument.
22235 (for_statement, declare_local_variables): Likewise.
22236 (declare_local_variables): When creating a new implicit block, use the
22237 new Block constructor and pass it the lexer.Location.
22239 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22241 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
22242 members also on the parent interfaces recursively.
22244 2002-03-27 Miguel de Icaza <miguel@ximian.com>
22246 * report.cs: Use new formats, since Gonzalo finished the missing
22249 * expression.cs (Binary.ResolveOperator): added missing operator|
22250 operator& and operator^ for bool/bool.
22252 * cs-parser.jay: CheckDef now takes a Location argument that is
22253 used to report errors more precisly (instead of reporting the end
22254 of a definition, we try to track something which is a lot closer
22255 to the source of the problem).
22257 * cs-tokenizer.cs: Track global token use, so we can properly flag
22258 the use of #define/#undef after the first token has been seen.
22260 Also, rename the reportXXXX to Error_DescriptiveName
22262 * decl.cs (DeclSpace.IsTopLevel): Move property here from
22263 TypeContainer, so that Enum and Interface can use this too.
22265 * class.cs (TypeContainer.LookupInterfaceOrClass,
22266 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
22267 `builder' argument. Typically this was used to pass the parent
22268 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
22271 The problem is that a nested class could trigger the definition of
22272 a toplevel class, and the builder would be obviously wrong in that
22275 So we drop this argument, and we compute dynamically the
22276 TypeBuilder/ModuleBuilder (the correct information was available
22277 to us anyways from DeclSpace.Parent)
22279 * interface.cs (Interface.DefineInterface): Drop builder
22280 parameter cleanup like class.cs
22282 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
22285 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
22288 (Try.Emit): Propagate the returns value from the statement.
22290 (Return.Emit): Even if we are leavning
22292 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
22294 * modifiers.cs: Fix the computation of MethodAttributes flags.
22296 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
22298 * driver.cs: allow compilation of files that start with '/'.
22299 Add a default case when checking the argument of --target.
22301 2002-03-25 Miguel de Icaza <miguel@ximian.com>
22303 * interface.cs: Implement the same search algorithm for types in
22304 the interface code.
22306 * delegate.cs: Do not allow multiple definition.
22308 * Recovered ChangeLog that got accidentally amputated
22310 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
22312 * rootcontext.cs: Load manually enum to allow core classes to
22313 contain enumerations.
22315 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
22316 Update to new static methods in TypeManager.
22318 * typemanager.cs (GetMethod, GetConstructor): Use our
22319 implementation of FindMembers to find the members, since during
22320 corlib compilation, the types are TypeBuilders and GetMethod and
22321 GetConstructor do not work.
22323 Make all methods in TypeManager static.
22325 (InitCodeHelpers): Split the functionality from
22326 the InitCodeTypes function.
22328 * driver.cs: Call InitCodeHelpers after we have populated the
22331 * cs-parser.jay (delegate_declaration): we did not used to compute
22332 the delegate name correctly for void delegates.
22334 2002-03-24 Miguel de Icaza <miguel@ximian.com>
22336 * rootcontext.cs (RootContext): Init the interface_resolve_order
22337 and type_container_resolve_order always.
22339 (ResolveCore, BootstrapCorlib_ResolveClass,
22340 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
22341 compiler when compiling with --nostdlib
22343 * class.cs (TypeContainer.DefineType): Check that our parent is
22344 not null. This test is most important when we are bootstraping
22347 * codegen.cs: Split out the symbol writing code.
22349 2002-03-25 Martin Baulig <martin@gnome.org>
22351 * driver.cs (-g): Made -g an alias for --debug.
22353 2002-03-24 Martin Baulig <martin@gnome.org>
22355 * codegen.cs (SymbolWriter): New public variable. Returns the
22356 current symbol writer.
22357 (CodeGen): Added `bool want_debugging_support' argument to the
22358 constructor. If true, tell the ModuleBuild that we want debugging
22359 support and ask it for the ISymbolWriter.
22360 (Save): If we have a symbol writer, call it's Close() method after
22361 saving the assembly.
22363 * driver.c (--debug): New command line argument to create a
22364 debugger information file.
22366 * location.cs (SymbolDocument): New public property. Returns an
22367 ISymbolDocumentWriter object for the current source file or null
22368 if we don't have a symbol writer.
22370 2002-03-21 Miguel de Icaza <miguel@ximian.com>
22372 * driver.cs (LoadAssembly): Correctly return when all the paths
22373 have been tried and not before.
22375 * statement.cs (Switch.Emit): return the actual coverage for this
22376 statement (returns/not-returns)
22378 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
22379 switch of the statement if we are the last switch section. That
22380 kills two problems: try/catch problems (we used to emit an empty
22381 nop at the end) and switch statements where all branches would
22384 2002-03-19 Miguel de Icaza <miguel@ximian.com>
22386 * driver.cs: Add default assemblies (the equivalent to the
22387 Microsoft CSC.RSP file)
22389 * cs-tokenizer.cs: When updating `cols and setting it to zero,
22390 also update tokens_seen and set it to false.
22392 * driver.cs: Implement --recurse for Mike.
22394 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
22395 correctly splitting out the paths.
22397 2002-03-18 Miguel de Icaza <miguel@ximian.com>
22399 * interface.cs (Interface.PopulateProperty): Instead of using
22400 `parent' as the declaration space for the set parameters, use
22403 * support.cs (InternalParameters): InternalParameters constructor
22404 takes a DeclSpace instead of a TypeContainer.
22406 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
22407 types are being initialized, load the address of it before calling
22410 (New): Provide a mechanism to disable the generation of local
22411 value type temporaries when the caller will be providing us with
22412 an address to store it.
22414 (ArrayCreation.EmitDynamicInitializers): Use it.
22416 2002-03-17 Miguel de Icaza <miguel@ximian.com>
22418 * expression.cs (Invocation.EmitArguments): Only probe for array
22419 property if there is more than one argument. Sorry about that.
22421 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
22422 empty param arrays.
22424 * class.cs (Method.LabelParameters): Fix incorrect code path that
22425 prevented the `ParamArrayAttribute' from being applied to the
22428 2002-03-16 Miguel de Icaza <miguel@ximian.com>
22430 * support.cs (ReflectionParameters): Correctly compute whether the
22431 last argument is a params array. Fixes the problem with
22434 * typemanager.cs: Make the assemblies array always be non-null
22435 (empty, but non-null)
22437 * tree.cs (RecordDecl): New function that abstracts the recording
22438 of names. This reports error 101, and provides a pointer to the
22439 previous declaration. Fixes a crash in the compiler.
22441 * cs-parser.jay (constructor_declaration): Update to new grammar,
22442 and provide a constructor_body that can be empty.
22444 2002-03-15 Miguel de Icaza <miguel@ximian.com>
22446 * driver.cs: Add support for --resources.
22448 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
22449 Make all types for the various array helper methods be integer.
22451 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
22452 CheckState to ConvCast.
22454 (ConvCast): Now it takes a `checked' state argument, to avoid
22455 depending on the emit context for the conversion, and just using
22456 the resolve time setting.
22458 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
22459 instead of Invocation.EmitArguments. We do not emit the original
22460 arguments, instead we emit those which have been converted to
22461 unsigned int expressions.
22463 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
22465 * codegen.cs: ditto.
22467 * expression.cs (LocalVariableReference): Drop the use of the
22468 Store function that depended on the variable index.
22470 * statement.cs (VariableInfo): Drop the `Idx' property from this
22471 class, as this is not taking into account the indexes for
22472 temporaries tat we generate during the execution, getting the
22475 * class.cs: First emit class initializers, then call the parent
22478 * expression.cs (Binary): Fix opcode emision.
22479 (UnaryMutator.EmitCode): Support checked code generation
22481 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
22482 matches for events for both the Static and Instance scans,
22483 pointing to the same element. Fix that.
22485 2002-03-14 Miguel de Icaza <miguel@ximian.com>
22487 * rootcontext.cs (ResolveTree): Always set the
22488 interface_resolve_order, because nested interfaces will be calling
22491 * class.cs (GetInterfaceOrClass): Track the same resolution
22492 process used by TypeManager.LookupType. This fixes the nested
22493 type lookups in class declarations (separate path from
22496 (TypeContainer.DefineType): Also define nested interfaces.
22497 (TypeContainer.RegisterOrder): New public function used to
22498 register the order in which child interfaces need to be closed.
22500 Nested interfaces need to be closed after their parents have been
22503 * interface.cs (InterfaceAttr): Put all the logic for computing
22504 the interface attribute here.
22506 (DefineInterface): Register our interface order with the
22507 RootContext or with the TypeContainer depending on the case.
22509 2002-03-12 Miguel de Icaza <miguel@ximian.com>
22511 * cs-parser.jay: rework foreach statement to work with the new
22512 changes to the policy on SimpleNames.
22514 * report.cs: support Stacktrace on warnings as well.
22516 * makefile: drop --unsafe and /unsafe from the compile.
22518 2002-03-13 Ravi Pratap <ravi@ximian.com>
22520 * ecore.cs (StandardConversionExists): Modify to take an Expression
22521 as the first parameter. Ensure we do null -> reference type conversion
22524 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
22525 temporary Expression objects.
22527 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
22529 * interface.cs: workaround bug in method overloading resolution
22530 (there is already a bugzilla bug for it).
22532 2002-03-12 Miguel de Icaza <miguel@ximian.com>
22534 We could also solve this problem by having a separate path for
22535 performing type lookups, instead of DoResolve, we could have a
22536 ResolveType entry point, and only participating pieces of the
22537 production (simplename, deref, array) would implement this.
22539 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
22540 signal SimpleName to only resolve type names and not attempt to
22541 resolve anything else.
22543 * expression.cs (Cast): Set the flag.
22545 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
22547 * class.cs: Only report 108 if there is no `new' modifier.
22549 * cs-parser.jay: rework foreach statement to work with the new
22550 changes to the policy on SimpleNames.
22552 * report.cs: support Stacktrace on warnings as well.
22554 * makefile: drop --unsafe and /unsafe from the compile.
22556 2002-03-11 Miguel de Icaza <miguel@ximian.com>
22558 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22559 lookups here, instead of doing that at parse time. This means
22560 that our grammar will not introduce `LocalVariableReferences' as
22561 expressions at this point. That solves the problem of code like
22565 static void Main ()
22569 This is only half the fix. The full fix requires parameters to
22570 also be handled in this way.
22572 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
22573 makes the use more obvious of the DeclSpace. The
22574 ec.TypeContainer.TypeBuilder is now only used to pull the
22575 TypeBuilder for it.
22577 My theory is that I can get rid of the TypeBuilder completely from
22578 the EmitContext, and have typecasts where it is used (from
22579 DeclSpace to where it matters).
22581 The only pending problem is that the code that implements Aliases
22582 is on TypeContainer, and probably should go in DeclSpace.
22584 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22585 lookups here, instead of doing that at parse time. This means
22586 that our grammar will not introduce `LocalVariableReferences' as
22587 expressions at this point. That solves the problem of code like
22591 static void Main ()
22595 This is only half the fix. The full fix requires parameters to
22596 also be handled in this way.
22598 * class.cs (Property.DefineMethod): When implementing an interface
22599 method, set newslot, when implementing an abstract method, do not
22600 set the flag (before we tried never setting it, or always setting
22601 it, which is the difference).
22602 (Indexer.DefineMethod): same.
22603 (Method.DefineMethod): same.
22605 * ecore.cs: Only set the status used flag if we get back a Field.
22607 * attribute.cs: Temporary hack, so Paolo can keep working.
22609 2002-03-08 Ravi Pratap <ravi@ximian.com>
22611 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
22612 the unmanaged type in the case we have a MarshalAs attribute.
22614 (Resolve): Handle the case when we are parsing the special MarshalAs
22615 attribute [we need to store the unmanaged type to use later]
22617 * typemanager.cs (marshal_as_attr_type): Built in type for the
22618 MarshalAs Attribute.
22620 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
22621 on parameters and accordingly set the marshalling info.
22623 2002-03-09 Miguel de Icaza <miguel@ximian.com>
22625 * class.cs: Optimizing slightly by removing redundant code after
22626 we switched to the `NoTypes' return value.
22627 (Property.DefineMethod): use NoTypes here too.
22629 This fixes the bug I introduced in my last batch of changes.
22631 2002-03-05 Ravi Pratap <ravi@ximian.com>
22633 * tree.cs (RecordEnum): Add. We now keep track of enums too.
22635 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
22636 Enums since those are types too.
22638 * cs-parser.jay (enum_declaration): Record enums as we parse them.
22640 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
22641 thanks to a call during the lookup process.
22643 2002-03-07 Miguel de Icaza <miguel@ximian.com>
22645 * statement.cs (Foreach): Lots of work to accomodate a particular
22646 kind of foreach statement that I had not kept in mind. It is
22647 possible to have foreachs on classes that provide a GetEnumerator
22648 method that return objects that implement the "pattern" for using
22649 a foreach, there is no need to support GetEnumerator
22652 This is needed to compile nant.
22654 * decl.cs: Only report 114 if the member is not `Finalize' and if
22655 the warning level is at least 2.
22657 * class.cs: Moved the compare function from Method to
22660 (MethodSignature.InheritableMemberSignatureCompare): Add new
22661 filter function that is used to extract inheritable methods from a
22664 (Method.Define): Use the new `inheritable_method_signature_filter'
22667 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
22670 2002-03-06 Miguel de Icaza <miguel@ximian.com>
22672 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
22674 * cs-parser.jay: Add opt_semicolon to the interface declaration.
22676 * expression.cs: Pass location information to
22677 ConvertImplicitStandard.
22679 * class.cs: Added debugging code to track return values from
22682 2002-03-05 Miguel de Icaza <miguel@ximian.com>
22684 * expression.cs (Is.DoResolve): If either side of the `is' is an
22685 interface, do not flag the warning.
22687 * ecore.cs (ImplicitReferenceConversion): We need a separate test
22690 * report.cs: Allow for --fatal to be used with --probe.
22692 * typemanager.cs (NoTypes): Move the definition for the empty Type
22695 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
22697 (TypeContainer.DefineProxy): New function used to proxy to parent
22698 implementations when implementing interfaces.
22699 (TypeContainer.ParentImplements): used to lookup if our parent
22700 implements a public function that is required by an interface.
22701 (TypeContainer.VerifyPendingMethods): Hook this up.
22703 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
22704 `modules' and `assemblies' arraylists into arrays. We only grow
22705 these are the very early start up of the program, so this improves
22706 the speedof LookupType (nicely measured).
22708 * expression.cs (MakeByteBlob): Replaced unsafe code with
22709 BitConverter, as suggested by Paolo.
22711 * cfold.cs (ConstantFold.Binary): Special case: perform constant
22712 folding of string concatenation, but if either side is a string,
22713 and the other is not, then return null, and let the runtime use
22714 the concatenation on the string plus the object (using
22715 `Object.ToString').
22717 2002-03-04 Miguel de Icaza <miguel@ximian.com>
22719 Constant Folding has been implemented now.
22721 * expression.cs (Unary.Reduce): Do not throw an exception, catch
22722 the error instead on types that are not supported in one's
22725 * constant.cs (Constant and all children): New set of functions to
22726 perform implict and explicit conversions.
22728 * ecore.cs (EnumConstant): Implement the new functions to perform
22729 conversion by proxying to the child expression.
22731 * codegen.cs: (ConstantCheckState): Constant evaluation has its
22732 own separate setting that can not be turned off from the command
22733 line using --unchecked or --checked and is only controlled using
22734 the checked/unchecked statements and expressions. This setting is
22735 used by the constant folder to flag errors.
22737 * expression.cs (CheckedExpr, UncheckedExpr): Set the
22738 ConstantCheckState as well.
22740 During Resolve, they also have to flag the state, because the
22741 constant folder runs completely in the Resolve phase.
22743 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
22746 2002-03-01 Miguel de Icaza <miguel@ximian.com>
22748 * cfold.cs: New file, this file contains the constant folder.
22750 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
22751 argument to track whether we are using the resulting address to
22752 load or store a value and provide better error messages.
22754 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
22755 new AddressOf arguments.
22757 * statement.cs (Foreach.EmitCollectionForeach): Update
22759 * expression.cs (Argument.Emit): Call AddressOf with proper
22760 arguments to track usage.
22762 (New.DoEmit): Call AddressOf with new arguments.
22764 (Unary.Emit): Adjust AddressOf call.
22766 2002-03-01 Ravi Pratap <ravi@ximian.com>
22768 * cs-parser.jay (member_access): Change the case for pre-defined types
22769 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
22772 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
22775 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
22776 essentially like methods and apply attributes like MethodImplOptions to them too.
22778 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
22781 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
22782 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
22785 * Update code everywhere accordingly.
22787 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
22789 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
22791 2002-02-28 Ravi Pratap <ravi@ximian.com>
22793 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
22794 try performing lookups against those instead of jumping straight into using
22795 the 'using' clauses.
22797 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
22799 (LookupType): Perform lookups in implicit parents too.
22801 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
22802 sequence as RootContext.LookupType.
22804 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
22805 the various cases of namespace lookups into this method.
22807 2002-03-01 Miguel de Icaza <miguel@ximian.com>
22809 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
22810 in positional arguments)
22812 * class.cs (Operator): Update the AllowedModifiers to contain
22815 * cs-parser.jay: Update operator declaration to allow for the
22816 operator body to be empty.
22818 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
22821 2002-02-27 Miguel de Icaza <miguel@ximian.com>
22823 * class.cs (Method.Emit): Label parameters.
22825 * driver.cs: Return 1 or 0 as the program exit code.
22827 2002-02-26 Miguel de Icaza <miguel@ximian.com>
22829 * expression.cs: Special case the `null' object when trying to
22830 auto-compute the type, as anything can be explicitly converted to
22833 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
22834 spotting this Paolo.
22836 (Expression.ImplicitNumericConversion): Perform comparissions of
22837 the type using the underlying type in the case of an enumeration
22838 rather than using the enumeration type for the compare.
22840 Cope with the underlying == type case, which is not possible to
22843 (Expression.ConvertNumericExplicit): Perform comparissions of
22844 the type using the underlying type in the case of an enumeration
22845 rather than using the enumeration type for the compare.
22847 * driver.cs: If the user does not supply an extension, assume .exe
22849 * cs-parser.jay (if_statement): Rewrote so that we can track the
22850 location for the if statement.
22852 * expression.cs (Binary.ConstantFold): Only concat strings when
22853 the operation is "+", not everything ;-)
22855 * statement.cs (Statement.EmitBoolExpression): Take a location
22857 (If, While, Do): Track location.
22859 * expression.cs (Binary.ResolveOperator): In the object + string
22860 case, I was missing a call to ConvertImplicit
22862 2002-02-25 Ravi Pratap <ravi@ximian.com>
22864 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
22865 Location arguments. Ensure we use RootContext.LookupType to do our work
22866 and not try to do a direct Type.GetType and ModuleBuilder.GetType
22868 * interface.cs (PopulateMethod): Handle the type of the parameter being
22871 * expression.cs (Invocation.BetterFunction): Handle the case when we
22872 have a params method with no fixed arguments and a call is made with no
22875 2002-02-25 Miguel de Icaza <miguel@ximian.com>
22877 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
22878 the verbatim-string-literal
22880 * support.cs (InternalParameters.ParameterModifier): handle null
22882 (InternalParameters.ParameterType): ditto.
22884 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
22885 duplicating the name of the variable parameter.
22886 (GetParameterByName): Fix bug where we were not looking up array
22887 paramters if they were the only present (thanks Paolo!).
22888 (GetParameterInfo): We only have an empty set of types if both
22889 fixed and array are set to null.
22890 (GetParameterInfo-idx): Handle FixedParameter == null
22892 * cs-parser.jay: Handle the case where there is no catch
22893 statements (missing null test).
22895 2002-02-22 Miguel de Icaza <miguel@ximian.com>
22897 * driver.cs (MainDriver): Be conservative on our command line
22900 Catch DirectoryNotFoundException when calling GetFiles.
22902 (SplitPathAndPattern): Used to split the input specification into
22903 a path and a pattern that we can feed to Directory.GetFiles.
22905 2002-02-21 Miguel de Icaza <miguel@ximian.com>
22907 * statement.cs (Fixed): Implement the last case of the Fixed
22908 statement (string handling).
22910 * expression.cs (StringPtr): New class used to return a char * to
22911 a string; Used by the Fixed statement.
22913 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
22915 * expression.cs (Binary.ResolveOperator): Remove redundant
22916 MemberLookup pn parent type.
22917 Optimize union call, we do not need a union if the types are the same.
22918 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
22921 Specialize the use of MemberLookup everywhere, instead of using
22922 the default settings.
22924 (StackAlloc): Implement stackalloc keyword.
22926 * cs-parser.jay: Add rule to parse stackalloc.
22928 * driver.cs: Handle /h, /help, /?
22930 * expression.cs (MakeByteBlob): Removed the hacks we had in place
22931 before we supported unsafe code.
22933 * makefile: add --unsafe to the self compilation of mcs.
22935 2002-02-20 Miguel de Icaza <miguel@ximian.com>
22937 * expression.cs (PointerArithmetic): New class that is used to
22938 perform pointer arithmetic.
22939 (Binary.Resolve): Handle pointer arithmetic
22940 Handle pointer comparission.
22941 (ArrayPtr): Utility expression class that is used to take the
22942 address of an array.
22944 (ElementAccess): Implement array access for pointers
22946 * statement.cs (Fixed): Implement fixed statement for arrays, we
22947 are missing one more case before we are done.
22949 * expression.cs (Indirection): Implement EmitAssign and set the
22950 ExprClass to Variable. This allows pointer dereferences to be
22951 treated as variables, and to have values assigned to them.
22953 * ecore.cs (Expression.StoreFromPtr): New utility function to
22954 store values dereferencing.
22956 2002-02-20 Ravi Pratap <ravi@ximian.com>
22958 * expression.cs (Binary.ResolveOperator): Ensure that we are
22959 not trying to operate on a void type - this fixes the reported
22962 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
22963 the parent implementation is sealed.
22965 * ../errors/cs0239.cs : Add.
22967 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
22969 * typemanager.cs (unverifiable_code_type): Corresponds to
22970 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
22971 which have unsafe code in them.
22973 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
22976 2002-02-19 Miguel de Icaza <miguel@ximian.com>
22978 * cs-tokenizer.cs: Add support for @"litreal strings"
22980 Make tokenizer accept pre-processor directives
22981 on any column (remove the old C-like limitation).
22983 * rootcontext.cs (EmitCode): Emit any global attributes.
22984 (AddGlobalAttributes): Used to keep track of assembly attributes.
22986 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
22988 * cs-parser.jay: Add support for global attributes.
22990 2002-02-17 Miguel de Icaza <miguel@ximian.com>
22992 * expression.cs (Indirection): New helper class. Unary will
22993 create Indirection classes to be able to implement the
22994 IMemoryLocation interface on it.
22996 2002-02-16 Miguel de Icaza <miguel@ximian.com>
22998 * cs-parser.jay (fixed_statement): reference the right statement.
23000 * statement.cs (Fixed.Emit): Finish implementing the fixed
23001 statement for the &x case.
23003 2002-02-14 Miguel de Icaza <miguel@ximian.com>
23005 * class.cs (Property.Define, Method.Define): Remove newslot when
23008 * modifiers.cs: My use of NewSlot when `Abstract' was set was
23009 wrong. NewSlot should only be used if the `new' keyword is present.
23011 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
23012 locating our system dir. Sorry about this.
23014 2002-02-13 Miguel de Icaza <miguel@ximian.com>
23016 * driver.cs (GetSystemDir): Compute correctly the location of our
23017 system assemblies. I was using the compiler directory instead of
23018 the library directory.
23020 2002-02-13 Ravi Pratap <ravi@ximian.com>
23022 * expression.cs (BetterFunction): Put back in what Miguel commented out
23023 since it is the correct fix. The problem is elsewhere ;-)
23025 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
23026 parameters of the parms method are themselves compatible or not !
23028 (StandardConversionExists): Fix very dangerous bug where we were forgetting
23029 to check that a class implements an interface before saying that an implicit
23030 conversion was allowed. Use ImplementsInterface to do the checking.
23032 2002-02-13 Miguel de Icaza <miguel@ximian.com>
23034 * class.cs (Method.Define): Track whether we are an explicit
23035 implementation or not. And only call DefineMethodOverride if we
23036 are an explicit implementation.
23038 (Property.DefineMethod): Ditto.
23040 2002-02-11 Ravi Pratap <ravi@ximian.com>
23042 * expression.cs (BetterFunction): Catch hideous bug which was
23043 preventing us from detecting ambiguous calls due to implicit casts i.e
23046 2002-01-29 Miguel de Icaza <miguel@ximian.com>
23048 * support.cs (Pair): Remove un-needed method. I figured why I was
23049 getting the error in cs-parser.jay, the variable in a foreach loop
23050 is readonly, and the compiler does not really treat this as a variable.
23052 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
23053 instead of EQUALS in grammar.
23055 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
23057 * expression.cs (Unary.DoResolve): Check whether the argument is
23060 2002-01-28 Miguel de Icaza <miguel@ximian.com>
23062 * support.cs: Api for Pair to set a value. Despite the fact that
23063 the variables are public the MS C# compiler refuses to compile
23064 code that accesses the field if the variable is part of a foreach
23067 * statement.cs (Fixed): Begin implementation of the fixed
23070 (Block.AddVariable): Return the VariableInfo on success and null
23071 on failure instead of true/false.
23073 * cs-parser.jay (foreach): Catch errors on variables already
23074 defined (we were ignoring this value before) and properly unwind
23075 the block hierarchy
23077 (fixed_statement): grammar for the fixed statement.
23079 2002-01-25 Miguel de Icaza <miguel@ximian.com>
23081 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
23082 pointer types to be incretemented.
23084 (SizeOf): Implement.
23086 * cs-parser.jay (pointer_member_access): Implement
23087 expr->IDENTIFIER production.
23089 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
23090 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
23093 (Unary): Implement indirection.
23095 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
23096 use in non-unsafe context).
23098 (SimpleName.DoResolve): Check for pointers in field access on safe
23101 (Expression.LoadFromPtr): Factor the load-indirect code in this
23102 function. This was duplicated in UnboxCast and ParameterReference
23104 2002-01-24 Miguel de Icaza <miguel@ximian.com>
23106 * expression.cs (ComposedCast): report an error if a pointer cast
23107 is used in a safe region.
23109 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
23110 pointer type casts in unsafe context.
23112 * codegen.cs (EmitContext): Set up IsUnsafe.
23114 * cs-parser.jay (non_expression_type): Add productions for pointer
23117 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
23118 code. We should not use force into static mode if the method is
23119 not virtual. Fixes bug in MIS
23121 * statement.cs (Do.Emit, While.Emit, For.Emit,
23122 Statement.EmitBoolExpression): Add support to Do and While to
23123 propagate infinite loop as `I do return' semantics.
23125 Improve the For case to also test for boolean constants.
23127 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
23128 to the list of attributes we can add.
23130 Remove `EmitContext' argument.
23132 * class.cs (Method.Define): Apply parameter attributes.
23133 (Constructor.Define): Apply parameter attributes.
23134 (MethodCore.LabelParameters): Move here the core of labeling
23137 * support.cs (ReflectionParameters.ParameterModifier,
23138 InternalParameters.ParameterModifier): Use IsByRef on the type and
23139 only return the OUT bit for these parameters instead of in/out/ref
23142 This is because I miss-understood things. The ParameterInfo.IsIn
23143 and IsOut represent whether the parameter has the [In] and [Out]
23146 2002-01-22 Miguel de Icaza <miguel@ximian.com>
23148 * ecore.cs (FieldExpr.Emit): Release temporaries.
23150 * assign.cs (LocalTemporary.Release): new function.
23152 * codegen.cs (EmitContext.GetTemporaryStorage,
23153 EmitContext.FreeTemporaryStorage): Rework the way we deal with
23154 temporary storage. Now we can "put back" localbuilders when we
23157 2002-01-21 Miguel de Icaza <miguel@ximian.com>
23159 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
23160 need to make a copy of the variable to generate verifiable code.
23162 2002-01-19 Miguel de Icaza <miguel@ximian.com>
23164 * driver.cs: Compute dynamically the system directory.
23166 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
23167 Slower, but more generally useful. Used by the abstract
23168 registering implementation.
23170 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
23171 the rules for the special rule on Type/instances. First check if
23172 we have the same name, and if so, try that special static path
23173 rather than the instance path.
23175 2002-01-18 Miguel de Icaza <miguel@ximian.com>
23177 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
23180 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
23181 Enum, ValueType, Delegate or Array for non-corlib compiles.
23183 * cs-tokenizer.cs: Catch long identifiers (645)
23185 * typemanager.cs (IndexerPropetyName): Ravi never tested this
23188 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
23189 fix, we were returning too early, so we were not registering
23190 pending methods from abstract classes.
23192 Do not register pending methods if the class is abstract.
23194 * expression.cs (Conditional.DoResolve): Report circular implicit
23195 conversions when we neecd to compute it for conditional
23198 (Is.DoResolve): If the expression is always of the provided type,
23199 flag warning 183. If the expression can not ever be of the
23200 provided type flag warning 184.
23202 * class.cs: Catch 169 as well.
23204 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
23207 2002-01-18 Nick Drochak <ndrochak@gol.com>
23209 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
23211 2002-01-17 Miguel de Icaza <miguel@ximian.com>
23213 * interface.cs: (PopulateMethod): Check for pointers being defined
23214 only if the unsafe context is active.
23215 (PopulateProperty): ditto.
23216 (PopulateIndexer): ditto.
23218 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
23219 specified. If pointers are present, make sure that they are
23220 present in an unsafe context.
23221 (Constructor, Constructor.Define): ditto.
23222 (Field, Field.Define): ditto.
23223 (Property, Property.Define): ditto.
23224 (Event, Event.Define): ditto.
23226 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
23227 hashtable if there are classes or structs defined.
23229 * expression.cs (LocalVariableReference.DoResolve): Simplify this
23230 code, as the constant resolution moved.
23232 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
23233 the metadata, so we can flag error 133.
23235 * decl.cs (MemberCore.UnsafeOK): New function to test that a
23236 pointer is being declared in an unsafe context.
23238 2002-01-16 Miguel de Icaza <miguel@ximian.com>
23240 * modifiers.cs (Modifiers.Check): Require a Location argument.
23241 Report error 227 for Unsafe use.
23243 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
23245 * statement.cs (For.Emit): If the test is null, then report that
23246 we do `return', as we wont reach anything afterwards.
23248 (Switch.SwitchGoverningType): Track the expression that matched
23251 * driver.cs: Allow negative numbers as an error code to flag.
23253 * cs-parser.jay: Handle 1551.
23255 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
23257 2002-01-15 Miguel de Icaza <miguel@ximian.com>
23259 * cs-parser.jay: Report 1518 (type declaration can only contain
23260 class, struct, interface, enum or delegate)
23262 (switch_label): Report 1523 (keywords `case' or `default' must
23265 (opt_switch_sections): Report 1522 (empty switch)
23267 * driver.cs: Report 1515 (response file specified multiple times)
23268 Report 1516 (Source file specified multiple times).
23270 * expression.cs (Argument.Resolve): Signal 1510
23272 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
23273 access not allowed in static code)
23275 2002-01-11 Ravi Pratap <ravi@ximian.com>
23277 * typemanager.cs (IsPointerType): Utility method which we are going
23280 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
23281 the object type, so we take care of that.
23283 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
23285 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
23286 added to non-params parameters :-)
23288 * typemanager.cs (CSharpName): Include 'void' type too.
23290 (void_ptr_type): Include in the set of core types.
23292 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
23295 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
23298 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
23299 completely forgotten about it.
23301 2002-01-10 Ravi Pratap <ravi@ximian.com>
23303 * cs-parser.jay (pointer_type): Add. This begins our implementation
23304 of parsing rules for unsafe code.
23306 (unsafe_statement): Implement.
23308 (embedded_statement): Modify to include the above.
23310 * statement.cs (Unsafe): Implement new class for unsafe blocks.
23312 * codegen.cs (EmitContext.InUnsafe): Add. This determines
23313 if the current context is an unsafe one.
23315 * cs-parser.jay (local_variable_pointer_type): Since local variable types
23316 are handled differently, we need separate rules for them.
23318 (local_variable_declaration): Update to use local_variable_pointer_type
23319 to allow variable declarations of unmanaged pointer types.
23321 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
23322 in unsafe contexts.
23324 * ../errors/cs0214.cs : Add.
23326 2002-01-16 Nick Drochak <ndrochak@gol.com>
23328 * makefile: remove 'response' file when cleaning.
23330 2002-01-15 Miguel de Icaza <miguel@ximian.com>
23332 * cs-parser.jay: Report 1524.
23334 2002-01-14 Miguel de Icaza <miguel@ximian.com>
23336 * typemanager.cs (RegisterMethod): drop checking if we have
23337 registered this from here
23339 2002-01-12 Miguel de Icaza <miguel@ximian.com>
23341 * class.cs (Method.EmitDestructor): Implement calling our base
23344 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
23345 value of InFinally.
23347 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
23348 this routine and will wrap the call in a try/catch block. Deal
23351 2002-01-11 Miguel de Icaza <miguel@ximian.com>
23353 * ecore.cs (Expression.MemberLookup): instead of taking a
23354 parameter `same_type' that was used to tell whether we could
23355 access private members we compute our containing type from the
23358 (FieldExpr): Added partial support for volatile fields. This does
23359 not work for volatile fields exposed from assemblies, as I can not
23360 figure out how to extract the modreq from it.
23362 Updated all the source files to use this.
23364 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
23365 because it is referenced by MemberLookup very often.
23367 2002-01-09 Ravi Pratap <ravi@ximian.com>
23369 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
23370 TypeBuilder.GetCustomAttributes to retrieve what we need.
23372 Get rid of redundant default_member_attr_type as this is the same as
23373 default_member_type which already exists.
23375 * interface.cs, attribute.cs : Update accordingly.
23377 2002-01-08 Miguel de Icaza <miguel@ximian.com>
23379 * typemanager.cs: Enable IndexerPropertyName again. It does not
23380 work for TYpeBuilders though. Ravi, can you please fix this?
23382 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
23384 * expression.cs (Argument.Emit): Handle the case of ref objects
23385 being passed to ref functions;
23387 (ParameterReference.EmitLoad): Loads the content of the pointer
23388 without dereferencing.
23390 2002-01-07 Miguel de Icaza <miguel@ximian.com>
23392 * cs-tokenizer.cs: Implemented the pre-processing expressions.
23394 2002-01-08 Ravi Pratap <ravi@ximian.com>
23396 * class.cs (Indexer.DefineMethod): Incorporate the interface
23397 type in the name of the method if we are doing explicit interface
23400 * expression.cs (ConversionExists): Remove as it is completely obsolete.
23402 (BetterConversion): Fix extremely trivial bug where we were referring to
23403 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
23406 * ../errors/bug16.cs : Add although we have fixed it.
23408 2002-01-07 Miguel de Icaza <miguel@ximian.com>
23410 * expression.cs (BaseIndexer): Begin implementation.
23412 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
23414 * cs-parser.jay (indexer_declarator): Use qualified_identifier
23415 production directly to remove a shift/reduce, and implement
23416 explicit interface implementation.
23418 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
23419 after a floating point suffix.
23421 * expression.cs (DoNumericPromotions): Improved the conversion for
23422 uint/uint. If we have a constant, we avoid doing a typecast to a
23425 * class.cs (Indexer): Implement explicit interface implementation
23428 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
23430 * class.cs: make the default instance constructor public and hidebysig.
23432 2001-01-03 Ravi Pratap <ravi@ximian.com>
23434 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
23435 so we can call it from elsewhere.
23437 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
23438 we emit it internally if the class has a defined indexer; otherwise the user
23439 emits it by decorating the class definition with the DefaultMemberAttribute.
23441 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
23442 attribute is not used on a type which defines an indexer.
23444 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
23445 character when we skip whitespace.
23447 * ../errors/cs0646.cs : Add.
23449 2002-01-03 Miguel de Icaza <miguel@ximian.com>
23451 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
23454 * makefile: Add practical target `mcs3.exe' which builds the third
23455 generation compiler.
23457 * expression.cs (New): Fix structures constructor calling.
23459 * class.cs (Property, Method, Indexer): Emit Final flag on the
23460 method if we are an interface implementation and we are not
23463 * ecore.cs (PropertyExpr): New public field `IsBase', tells
23464 whether this property is referencing a `base' method.
23466 * expression.cs (Invocation.EmitCall): take an extra argument:
23467 is_base, this is used to determine whether the `call' or
23468 `callvirt' opcode should be used.
23471 * delegate.cs: update EmitCall.
23473 * class.cs (Method.Define): Set NewSlot for the cases where we are
23474 not implementing an interface method.
23476 (Property.Define): ditto.
23478 2002-01-02 Miguel de Icaza <miguel@ximian.com>
23480 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
23481 'r'. Allows mcs to parse itself fully.
23483 2002-01-02 Ravi Pratap <ravi@ximian.com>
23485 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
23486 of the number of initializers that require the InitializeArray method.
23488 (CheckIndices): Store the Expression in all cases - not the plain value. Also
23489 update the above field where necessary.
23491 (MakeByteBlob): Update accordingly.
23493 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
23496 (EmitDynamicInitializers): Update in accordance with the new optimization.
23498 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
23499 same OpCode applies.
23501 * cs-parser.jay : Fix some glaring errors I introduced.
23503 2002-01-01 Ravi Pratap <ravi@ximian.com>
23505 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
23506 so that we can check for name clashes there too.
23508 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
23509 for interface indexers.
23511 * interfaces.cs (Define): Emit the default member attribute.
23513 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
23514 variable was being referred to while setting the value ;-)
23516 2002-01-01 Miguel de Icaza <miguel@ximian.com>
23518 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
23519 byte-by-byte information when we know the data is zero.
23521 Make the block always a multiple of 4, because
23522 DefineInitializedData has a bug.
23524 * assign.cs: Fix, we should assign from the temporary, not from
23527 * expression.cs (MakeByteBlob): Fix my incorrect code.
23529 2001-12-31 Miguel de Icaza <miguel@ximian.com>
23531 * typemanager.cs (EnumToUnderlying): This function is used to get
23532 the underlying type from an enumeration, because it does not
23535 * constant.cs: Use the I4_S form for values between -128 and 127.
23537 * statement.cs (Block.LookupLabel): Looks up a label.
23538 (Block): Drop support for labeled blocks.
23540 (LabeledStatement): New kind of statement that represents a label
23543 (Goto): Finally implement this bad boy.
23545 * cs-parser.jay: Update to reflect new mechanism to implement
23548 2001-12-30 Miguel de Icaza <miguel@ximian.com>
23550 * codegen.cs (EmitContext.This): a codegen property that keeps the
23551 a single instance of this instead of creating many different this
23554 * delegate.cs (Delegate.DoResolve): Update to use the property;
23556 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
23558 * expression.cs (BaseAccess.DoResolve): Ditto.
23560 2001-12-29 Ravi Pratap <ravi@ximian.com>
23562 * typemanager.cs (methodimpl_attr_type): Add to hold the type
23563 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
23565 (InitCoreTypes): Update accordingly.
23567 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
23568 so we can quickly store the state.
23570 (ApplyAttributes): Set the correct implementation flags
23571 for InternalCall methods.
23573 2001-12-29 Miguel de Icaza <miguel@ximian.com>
23575 * expression.cs (EmitCall): if a method is not virtual, then do
23576 not use callvirt on it.
23578 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
23579 user defined stuff) requires the use of stobj, which takes an
23580 address on the stack instead of an array and an index. So emit
23581 the Ldelema operation for it.
23583 (EmitStoreOpcode): Use stobj for valuetypes.
23585 (UnaryMutator.EmitCode): Use the right 1 value depending on
23586 whether we are dealing with int64/uint64, float or doubles.
23588 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
23589 constructors that I implemented last night.
23591 (Constructor.IsDefault): Fix to work properly for static
23594 * cs-parser.jay (CheckDef): report method signature errors.
23595 Update error number 103 to be 132.
23597 * decl.cs: New AdditionResult enumeration value: MethodExists.
23598 Although we do this check for methods later on in the semantic
23599 analysis, catching repeated default constructors is so easy that
23600 we catch these here.
23602 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
23605 (ParameterReference.EmitAssign, Emit): handle
23608 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
23609 (ArrayAccess.EmitStoreOpcode): ditto.
23611 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
23613 * expression.cs (MakeByteBlob): Complete all the missing types
23614 (uint, short, ushort, byte, sbyte)
23616 * class.cs: Only init instance field initializers on instance
23619 Rename `constructors' to instance_constructors.
23621 (TypeContainer.AddConstructor): Only add constructors to the list
23622 if it is not static.
23624 Make sure that we handle default_static_constructor independently
23625 everywhere where we handle instance_constructors
23627 2001-12-28 Miguel de Icaza <miguel@ximian.com>
23629 * class.cs: Do not lookup or create a base initializer for a
23630 static constructor.
23632 (ConstructorInitializer.Resolve): use the proper type to lookup
23635 * cs-parser.jay: Report error 1585 (modifiers between type and name).
23637 * enum.cs, interface.cs: Remove CloseType, this is taken care by
23640 * decl.cs: CloseType is now an virtual method, the default
23641 implementation just closes this type.
23643 2001-12-28 Ravi Pratap <ravi@ximian.com>
23645 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
23646 to PreserveSig by default. Also emit HideBySig on such methods.
23648 Basically, set the defaults to standard values.
23650 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
23651 argument, if candidate is better, it can't be worse than the best !
23653 (Invocation): Re-write bits to differentiate between methods being
23654 applicable in their expanded form and their normal form - for params
23657 Get rid of use_standard everywhere as only standard conversions are allowed
23658 in overload resolution.
23660 More spec conformance.
23662 2001-12-27 Miguel de Icaza <miguel@ximian.com>
23664 * driver.cs: Add --timestamp, to see where the compiler spends
23667 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
23668 `this' in static code.
23670 (SimpleName.DoResolve): Implement in terms of a helper function
23671 that allows static-references to be passed upstream to
23674 (Expression.ResolveWithSimpleName): Resolve specially simple
23675 names when called by MemberAccess to implement the special
23678 (Expression.ImplicitReferenceConversion): Handle conversions from
23679 Null to reference types before others, as Null's type is
23682 * expression.cs (Invocation.EmitCall): Handle the special case of
23683 calling methods declared on a reference type from a ValueType
23684 (Base classes System.Object and System.Enum)
23686 (MemberAccess.Resolve): Only perform lookups on Enumerations if
23687 the left hand side is a TypeExpr, not on every enumeration.
23689 (Binary.Resolve): If types are reference types, then do a cast to
23690 object on operators != and == of both arguments.
23692 * typemanager.cs (FindMembers): Extract instance and static
23693 members if requested.
23695 * interface.cs (PopulateProperty): Use void_type instead of null
23696 as the return type for the setter method.
23698 (PopulateIndexer): ditto.
23700 2001-12-27 Ravi Pratap <ravi@ximian.com>
23702 * support.cs (ReflectionParameters): Fix minor bug where we
23703 were examining the wrong parameter for the ParamArray attribute.
23705 Cope with requests for the type of the parameter at position
23706 greater than the params parameter's. We now return the element
23707 type of the params array as that makes more sense.
23709 * expression.cs (Invocation.IsParamsMethodApplicable): Update
23710 accordingly as we no longer have to extract the element type
23713 (Invocation.OverloadResolve): Update.
23715 2001-12-27 Miguel de Icaza <miguel@ximian.com>
23717 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
23718 against IEnumerator, test whether the return value is a descendant
23719 of the IEnumerator interface.
23721 * class.cs (Indexer.Define): Use an auxiliary method to implement
23722 the other bits of the method definition. Begin support for
23723 explicit interface implementation.
23725 (Property.DefineMethod): Use TypeManager.void_type instead of null
23726 for an empty return value.
23728 2001-12-26 Miguel de Icaza <miguel@ximian.com>
23730 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
23731 dealing with a FieldExpr which is composed of a FieldBuilder, in
23732 the code path we did extract the constant, but we should have
23733 obtained the underlying value to be able to cast it (otherwise we
23734 end up in an infinite loop, this is what Ravi was running into).
23736 (ArrayCreation.UpdateIndices): Arrays might be empty.
23738 (MemberAccess.ResolveMemberAccess): Add support for section
23739 14.5.4.1 that deals with the special case of E.I when E is a type
23740 and something else, that I can be a reference to a static member.
23742 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
23743 handle a particular array type to create byte blobs, it is just
23744 something we dont generate byteblobs for.
23746 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
23749 * location.cs (Push): remove the key from the hashtable that we
23750 are about to add. This happens for empty files.
23752 * driver.cs: Dispose files after we have parsed them.
23754 (tokenize): new function that only runs the tokenizer on its
23755 input, for speed testing.
23757 2001-12-26 Ravi Pratap <ravi@ximian.com>
23759 * class.cs (Event.Define): Define the private field only if there
23760 are no accessors defined.
23762 * expression.cs (ResolveMemberAccess): If there is no associated
23763 field with the event, that means we have an event defined with its
23764 own accessors and we should flag error cs0070 since transforming
23765 ourselves into a field is not valid in that case.
23767 * ecore.cs (SimpleName.DoResolve): Same as above.
23769 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
23770 and charset to sane values.
23772 2001-12-25 Ravi Pratap <ravi@ximian.com>
23774 * assign.cs (DoResolve): Perform check on events only if they
23775 are being accessed outside the declaring type.
23777 * cs-parser.jay (event_declarations): Update rules to correctly
23778 set the type of the implicit parameter etc.
23780 (add_accessor, remove_accessor): Set current local parameters.
23782 * expression.cs (Binary): For delegate addition and subtraction,
23783 cast the return value from the method into the appropriate delegate
23786 2001-12-24 Ravi Pratap <ravi@ximian.com>
23788 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
23789 of these as the workaround is unnecessary.
23791 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
23792 delegate data - none of that is needed at all.
23794 Re-write bits to extract the instance expression and the delegate method
23797 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
23800 * attribute.cs (ApplyAttributes): New method to take care of common tasks
23801 of attaching attributes instead of duplicating code everywhere.
23803 * everywhere : Update code to do attribute emission using the above method.
23805 2001-12-23 Miguel de Icaza <miguel@ximian.com>
23807 * expression.cs (IsParamsMethodApplicable): if there are not
23808 parameters, return immediately.
23810 * ecore.cs: The 0 literal can be implicity converted to an enum
23813 (SimpleName.DoResolve): First lookup the type, then lookup the
23816 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
23817 want to get its address. If the InstanceExpression is not
23818 addressable, store the result in a temporary variable, then get
23821 * codegen.cs: Only display 219 errors on warning level or above.
23823 * expression.cs (ArrayAccess): Make it implement the
23824 IMemoryLocation interface.
23826 (Binary.DoResolve): handle the operator == (object a, object b)
23827 and operator != (object a, object b) without incurring into a
23828 BoxedCast (because 5 != o should never be performed).
23830 Handle binary enumerator operators.
23832 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
23833 value type, otherwise use Ldelem_ref.
23835 Use precomputed names;
23837 (AddressOf): Implement address of
23839 * cs-parser.jay (labeled_statement): Fix recursive block
23840 addition by reworking the production.
23842 * expression.cs (New.DoEmit): New has a special case:
23844 If we are dealing with a ValueType, we have a few
23845 situations to deal with:
23847 * The target of New is a ValueType variable, that is
23848 easy, we just pass this as the variable reference
23850 * The target of New is being passed as an argument,
23851 to a boxing operation or a function that takes a
23854 In this case, we need to create a temporary variable
23855 that is the argument of New.
23858 2001-12-23 Ravi Pratap <ravi@ximian.com>
23860 * rootcontext.cs (LookupType): Check that current_type is not null before
23861 going about looking at nested types.
23863 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
23864 not implement the IAssignMethod interface any more.
23866 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
23867 where we tranform them into FieldExprs if they are being resolved from within
23868 the declaring type.
23870 * ecore.cs (SimpleName.DoResolve): Do the same here.
23872 * assign.cs (DoResolve, Emit): Clean up code considerably.
23874 * ../errors/bug10.cs : Add.
23876 * ../errors/cs0070.cs : Add.
23878 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
23880 * assign.cs : Get rid of EventIsLocal everywhere.
23882 2001-12-23 Miguel de Icaza <miguel@ximian.com>
23884 * ecore.cs (ConvertIntLiteral): finished the implementation.
23886 * statement.cs (SwitchLabel): Convert the value we are using as a
23887 key before looking up the table.
23889 2001-12-22 Miguel de Icaza <miguel@ximian.com>
23891 * codegen.cs (EmitTopBlock): Require a Location argument now.
23893 * cs-parser.jay (constructor_declarator): We need to setup
23894 current_local_parameters before we parse the
23895 opt_constructor_initializer, to allow the variables to be bound
23896 to the constructor arguments.
23898 * rootcontext.cs (LookupType): First lookup nested classes in our
23899 class and our parents before we go looking outside our class.
23901 * expression.cs (ConstantFold): Extract/debox the values at the
23904 * rootcontext.cs (EmitCode): Resolve the constants first before we
23905 resolve the types. This is not really needed, but it helps debugging.
23907 * statement.cs: report location.
23909 * cs-parser.jay: pass location to throw statement.
23911 * driver.cs: Small bug fix.
23913 * report.cs: Updated format to be 4-zero filled digits.
23915 2001-12-22 Ravi Pratap <ravi@ximian.com>
23917 * expression.cs (CheckIndices): Fix minor bug where the wrong
23918 variable was being referred to ;-)
23920 (DoEmit): Do not call EmitStaticInitializers when the
23921 underlying type is System.Object.
23923 2001-12-21 Ravi Pratap <ravi@ximian.com>
23925 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
23926 and do the usual workaround for SRE.
23928 * class.cs (MyEventBuilder.EventType): New member to get at the type
23929 of the event, quickly.
23931 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
23933 * assign.cs (Assign.DoResolve): Handle the case when the target
23934 is an EventExpr and perform the necessary checks.
23936 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
23939 (SimpleName.MemberStaticCheck): Include check for EventExpr.
23941 (EventExpr): Set the type in the constructor itself since we
23942 are meant to be born fully resolved.
23944 (EventExpr.Define): Revert code I wrote earlier.
23946 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
23947 instance expression is null. The instance expression is a This in that case
23948 or a null, depending on whether it is a static method or not.
23950 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
23951 refers to more than one method.
23953 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
23954 and accordingly flag errors.
23956 2001-12-21 Miguel de Icaza <miguel@ximian.com>
23958 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
23960 2001-12-22 Miguel de Icaza <miguel@ximian.com>
23962 * location.cs (ToString): Provide useful rutine.
23964 2001-12-21 Miguel de Icaza <miguel@ximian.com>
23966 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
23967 objects, return the actual integral boxed.
23969 * statement.cs (SwitchLabel): define an ILLabel for each
23972 (Switch.CheckSwitch): If the value is a Literal, extract
23973 the underlying literal.
23975 Also in the unused hashtable we had, add the SwitchLabel so we can
23976 quickly look this value up.
23978 * constant.cs: Implement a bunch of new constants. Rewrite
23979 Literal based on this. Made changes everywhere to adapt to this.
23981 * expression.cs (Expression.MakeByteBlob): Optimize routine by
23982 dereferencing array only once, and also copes with enumrations.
23984 bytes are two bytes wide, not one.
23986 (Cast): Perform constant conversions.
23988 * ecore.cs (TryImplicitIntConversion): Return literals instead of
23989 wrappers to the literals here.
23991 * expression.cs (DoNumericPromotions): long literals can converted
23992 to ulong implicity (this is taken care of elsewhere, but I was
23993 missing this spot).
23995 * ecore.cs (Expression.Literalize): Make the return type Literal,
23996 to improve type checking.
23998 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
24000 2001-12-20 Miguel de Icaza <miguel@ximian.com>
24002 * literal.cs: Revert code from ravi that checked the bounds. The
24003 bounds are sane by the definition of the type itself.
24005 * typemanager.cs: Fix implementation of ImplementsInterface. We
24006 need to actually look up in our parent hierarchy for interfaces
24009 * const.cs: Use the underlying type for enumerations
24011 * delegate.cs: Compute the basename for the delegate creation,
24012 that should fix the delegate test case, and restore the correct
24013 Type Lookup semantics in rootcontext
24015 * rootcontext.cs: Revert Ravi's last patch. The correct way of
24016 referencing a nested type with the Reflection API is using the "+"
24019 * cs-parser.jay: Do not require EOF token at the end.
24021 2001-12-20 Ravi Pratap <ravi@ximian.com>
24023 * rootcontext.cs (LookupType): Concatenate type names with
24024 a '.' instead of a '+' The test suite passes again.
24026 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
24027 field of the enumeration.
24029 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
24030 the case when the member is an EventExpr.
24032 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
24033 static has an associated instance expression.
24035 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
24037 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
24039 * class.cs (Event.Define): Register event and perform appropriate checks
24042 We define the Add and Remove methods even if the use provides none because
24043 in that case, we provide default implementations ourselves.
24045 Define a private field of the type of the event. This is done by the CSC compiler
24046 and we should be doing it too ;-)
24048 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
24049 More methods we use in code we generate.
24051 (multicast_delegate_type, delegate_type): Two separate types since the distinction
24054 (InitCoreTypes): Update accordingly for the above.
24056 * class.cs (Event.Emit): Generate code for default accessors that we provide
24058 (EmitDefaultMethod): Do the job in the above.
24060 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
24063 2001-12-20 Miguel de Icaza <miguel@ximian.com>
24065 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
24066 builders even if we were missing one.
24068 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
24069 pass the Basename as our class name instead of the Name. The
24070 basename will be correctly composed for us.
24072 * parameter.cs (Paramters): Now takes a Location argument.
24074 * decl.cs (DeclSpace.LookupType): Removed convenience function and
24075 make all the code call directly LookupType in RootContext and take
24076 this chance to pass the Location information everywhere.
24078 * Everywhere: pass Location information.
24080 2001-12-19 Miguel de Icaza <miguel@ximian.com>
24082 * class.cs (Constructor.Define): Updated way of detecting the
24083 length of the parameters.
24085 (TypeContainer.DefineType): Use basename as the type name for
24088 (TypeContainer.Define): Do not recursively define types here, as
24089 definition is taken care in order by the RootContext.
24091 * tree.cs: Keep track of namespaces in a per-file basis.
24093 * parameter.cs (Parameter.ComputeSignature): Update to use
24096 (Parameters.GetSignature): ditto.
24098 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
24099 instead of a TypeContainer.
24101 (Interface.SemanticAnalysis): Use `this' instead of our parent to
24102 resolve names. Because we need to be resolve in our context, not
24105 * driver.cs: Implement response files.
24107 * class.cs (TypeContainer.DefineType): If we are defined, do not
24108 redefine ourselves.
24110 (Event.Emit): Emit the code for add/remove handlers.
24111 (Event.Define): Save the MethodBuilders for add/remove.
24113 * typemanager.cs: Use pair here too.
24115 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
24116 DictionaryEntry requires the first argument to be non-null.
24118 (enum_declaration): Compute full name for registering the
24121 (delegate_declaration): Instead of using
24122 formal_parameter_list, use opt_formal_parameter_list as the list
24125 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
24126 (EventParsing): New property that controls whether `add' and
24127 `remove' are returned as tokens or identifiers (for events);
24129 2001-12-19 Ravi Pratap <ravi@ximian.com>
24131 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
24132 use MyEventBuilder only and let it wrap the real builder for us.
24134 (MyEventBuilder): Revamp constructor etc.
24136 Implement all operations that we perform on EventBuilder in precisely the same
24139 (FindMembers): Update to use the EventBuilder member.
24141 (Event.Emit): Update accordingly.
24143 2001-12-18 Ravi Pratap <ravi@ximian.com>
24145 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
24146 by calling the appropriate methods.
24148 (GetCustomAttributes): Make stubs as they cannot possibly do anything
24151 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
24153 2001-12-17 Ravi Pratap <ravi@ximian.com>
24155 * delegate.cs (Delegate.Populate): Check that the return type
24156 and various parameters types are indeed accessible.
24158 * class.cs (Constructor.Define): Same here.
24160 (Field.Define): Ditto.
24162 (Event.Define): Ditto.
24164 (Operator.Define): Check that the underlying Method defined itself
24165 correctly - so it's MethodBuilder should not be null.
24167 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
24168 expression happens to be null.
24170 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
24171 members but as of now we don't seem to be able to do anything really useful with it.
24173 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
24174 not the EventBuilder.
24176 2001-12-18 Miguel de Icaza <miguel@ximian.com>
24178 * cs-tokenizer.cs: Add support for defines.
24179 Add support for #if, #elif, #else, #endif
24181 (eval_var): evaluates a variable.
24182 (eval): stubbed for evaluating functions.
24184 * cs-parser.jay: Pass the defines information
24186 * driver.cs: Add --define command line option.
24188 * decl.cs: Move MemberCore here.
24190 Make it the base class for DeclSpace. This allows us to catch and
24191 report 108 and 109 for everything now.
24193 * class.cs (TypeContainer.Define): Extract all the members
24194 before populating and emit the warning 108 (new keyword required
24195 to override) instead of having each member implement this.
24197 (MemberCore.Define): New abstract method, we will be using this in
24198 the warning reporting engine in Populate.
24200 (Operator.Define): Adjust to new MemberCore protocol.
24202 * const.cs (Const): This does not derive from Expression, it is a
24203 temporary object we use to create fields, it is a MemberCore.
24205 * class.cs (Method.Define): Allow the entry point to be in a
24208 * driver.cs: Rewrite the argument handler to clean it up a bit.
24210 * rootcontext.cs: Made it just an auxiliary namespace feature by
24211 making everything static.
24213 * driver.cs: Adapt code to use RootContext type name instead of
24216 * delegate.cs: Remove RootContext argument.
24218 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
24221 * class.cs (Event.Define): The lookup can fail.
24223 * cs-tokenizer.cs: Begin implementation of pre-procesor.
24225 * expression.cs: Resolve the this instance before invoking the code.
24227 2001-12-17 Miguel de Icaza <miguel@ximian.com>
24229 * cs-parser.jay: Add a production in element_access that allows
24230 the thing to become a "type" reference. This way we can parse
24231 things like "(string [])" as a type.
24233 Note that this still does not handle the more complex rules of
24237 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
24239 * ecore.cs: (CopyNewMethods): new utility function used to
24240 assemble the list of methods from running FindMembers.
24242 (MemberLookup): Rework FindMembers so that
24244 2001-12-16 Miguel de Icaza <miguel@ximian.com>
24246 * class.cs (TypeContainer): Remove Delegates who fail to be
24249 * delegate.cs (Populate): Verify that we dont get null return
24250 values. TODO: Check for AsAccessible.
24252 * cs-parser.jay: Use basename to emit error 574 (destructor should
24253 have the same name as container class), not the full name.
24255 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
24256 possible representation.
24258 Also implements integer type suffixes U and L.
24260 2001-12-15 Miguel de Icaza <miguel@ximian.com>
24262 * expression.cs (ArrayCreation.DoResolve): We need to do the
24263 argument resolution *always*.
24265 * decl.cs: Make this hold the namespace. Hold the root context as
24267 (LookupType): Move here.
24269 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
24271 * location.cs (Row, Name): Fixed the code, it was always returning
24272 references to the first file.
24274 * interface.cs: Register properties defined through interfaces.
24276 * driver.cs: Add support for globbing on the command line
24278 * class.cs (Field): Make it derive from MemberCore as well.
24281 2001-12-15 Ravi Pratap <ravi@ximian.com>
24283 * class.cs (Event::Define): Check that the type of the event is a delegate
24284 type else flag error #66.
24286 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
24289 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
24290 values of EntryPoint, CharSet etc etc.
24292 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
24294 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
24295 be null and we should ignore this. I am not sure if this is really clean. Apparently,
24296 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
24297 which needs this to do its work.
24299 * ../errors/cs0066.cs : Add.
24301 2001-12-14 Miguel de Icaza <miguel@ximian.com>
24303 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
24306 * class.cs: (MethodSignature.MethodSignature): Removed hack that
24307 clears out the parameters field.
24308 (MemberSignatureCompare): Cleanup
24310 (MemberCore): New base class used to share code between MethodCore
24313 (RegisterRequiredImplementations) BindingFlags.Public requires
24314 either BindingFlags.Instace or Static. Use instance here.
24316 (Property): Refactored code to cope better with the full spec.
24318 * parameter.cs (GetParameterInfo): Return an empty array instead
24321 * class.cs (Property): Abstract or extern properties have no bodies.
24323 * parameter.cs (GetParameterInfo): return a zero-sized array.
24325 * class.cs (TypeContainer.MethodModifiersValid): Move all the
24326 method modifier validation to the typecontainer so we can reuse
24327 this on properties.
24329 (MethodCore.ParameterTypes): return an empty sized array of types.
24331 (Property.Define): Test property modifier validity.
24333 Add tests for sealed/override too.
24335 (Method.Emit): abstract or extern methods have no bodies.
24337 2001-12-14 Ravi Pratap <ravi@ximian.com>
24339 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
24342 (Method::Define, ::Emit): Modify accordingly.
24344 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
24346 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
24348 * makefile: Pass in /unsafe.
24350 2001-12-13 Miguel de Icaza <miguel@ximian.com>
24352 * class.cs (MakeKey): Kill routine.
24354 * class.cs (TypeContainer.Define): Correctly define explicit
24355 method implementations (they require the full interface name plus
24358 * typemanager.cs: Deply the PtrHashtable here and stop using the
24359 lame keys. Things work so much better.
24361 This of course broke everyone who depended on `RegisterMethod' to
24362 do the `test for existance' test. This has to be done elsewhere.
24364 * support.cs (PtrHashtable): A hashtable that avoid comparing with
24365 the object stupid Equals method (because, that like fails all over
24366 the place). We still do not use it.
24368 * class.cs (TypeContainer.SetRequiredInterface,
24369 TypeContainer.RequireMethods): Killed these two routines and moved
24370 all the functionality to RegisterRequiredImplementations.
24372 (TypeContainer.RegisterRequiredImplementations): This routine now
24373 registers all the implementations required in an array for the
24374 interfaces and abstract methods. We use an array of structures
24375 which can be computed ahead of time to reduce memory usage and we
24376 also assume that lookups are cheap as most classes will not
24377 implement too many interfaces.
24379 We also avoid creating too many MethodSignatures.
24381 (TypeContainer.IsInterfaceMethod): Update and optionally does not
24382 clear the "pending" bit if we find that there are problems with
24385 (TypeContainer.VerifyPendingMethods): Update to report errors of
24386 methods that look like implementations but are not.
24388 (TypeContainer.Define): Add support for explicit interface method
24391 2001-12-12 Miguel de Icaza <miguel@ximian.com>
24393 * typemanager.cs: Keep track of the parameters here instead of
24394 being a feature of the TypeContainer.
24396 * class.cs: Drop the registration of parameters here, as
24397 InterfaceMethods are also interface declarations.
24399 * delegate.cs: Register methods with the TypeManager not only with
24400 the TypeContainer. This code was buggy.
24402 * interface.cs: Full registation here.
24404 2001-12-11 Miguel de Icaza <miguel@ximian.com>
24406 * expression.cs: Remove reducer for binary expressions, it can not
24409 * const.cs: Put here the code that used to go into constant.cs
24411 * constant.cs: Put here the code for constants, this is a new base
24412 class for Literals.
24414 * literal.cs: Make Literal derive from Constant.
24416 2001-12-09 Miguel de Icaza <miguel@ximian.com>
24418 * statement.cs (Return.Emit): Report error 157 if the user
24419 attempts to return from a finally block.
24421 (Return.Emit): Instead of emitting a return, jump to the end of
24424 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
24425 LocalBuilder to store the result of the function. ReturnLabel is
24426 the target where we jump.
24429 2001-12-09 Radek Doulik <rodo@ximian.com>
24431 * cs-parser.jay: remember alias in current namespace
24433 * ecore.cs (SimpleName::DoResolve): use aliases for types or
24436 * class.cs (LookupAlias): lookup alias in my_namespace
24438 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
24440 (LookupAlias): lookup alias in this and if needed in parent
24443 2001-12-08 Miguel de Icaza <miguel@ximian.com>
24447 * rootcontext.cs: (ModuleBuilder) Made static, first step into
24448 making things static. I need this to avoid passing the
24449 TypeContainer when calling ParameterType.
24451 * support.cs (InternalParameters.ParameterType): Remove ugly hack
24452 that did string manipulation to compute the type and then call
24453 GetType. Use Parameter.ParameterType instead.
24455 * cs-tokenizer.cs: Consume the suffix for floating values.
24457 * expression.cs (ParameterReference): figure out whether this is a
24458 reference parameter or not. Kill an extra variable by computing
24459 the arg_idx during emission.
24461 * parameter.cs (Parameters.GetParameterInfo): New overloaded
24462 function that returns whether a parameter is an out/ref value or not.
24464 (Parameter.ParameterType): The type of the parameter (base,
24465 without ref/out applied).
24467 (Parameter.Resolve): Perform resolution here.
24468 (Parameter.ExternalType): The full type (with ref/out applied).
24470 * statement.cs (Using.Emit, Using.EmitExpression): Implement
24471 support for expressions on the using statement.
24473 2001-12-07 Miguel de Icaza <miguel@ximian.com>
24475 * statement.cs (Using.EmitLocalVariableDecls): Split the
24476 localvariable handling of the using statement.
24478 (Block.EmitMeta): Keep track of variable count across blocks. We
24479 were reusing slots on separate branches of blocks.
24481 (Try.Emit): Emit the general code block, we were not emitting it.
24483 Check the type of the declaration to be an IDisposable or
24484 something that can be implicity converted to it.
24486 Emit conversions if required.
24488 * ecore.cs (EmptyExpression): New utility class.
24489 (Expression.ImplicitConversionExists): New utility function.
24491 2001-12-06 Miguel de Icaza <miguel@ximian.com>
24493 * statement.cs (Using): Implement.
24495 * expression.cs (LocalVariableReference): Support read only variables.
24497 * statement.cs: Remove the explicit emit for the Leave opcode.
24498 (VariableInfo): Add a readonly field.
24500 2001-12-05 Miguel de Icaza <miguel@ximian.com>
24502 * ecore.cs (ConvCast): new class used to encapsulate the various
24503 explicit integer conversions that works in both checked and
24504 unchecked contexts.
24506 (Expression.ConvertNumericExplicit): Use new ConvCast class to
24507 properly generate the overflow opcodes.
24509 2001-12-04 Miguel de Icaza <miguel@ximian.com>
24511 * statement.cs: The correct type for the EmptyExpression is the
24512 element_type, not the variable type. Ravi pointed this out.
24514 2001-12-04 Ravi Pratap <ravi@ximian.com>
24516 * class.cs (Method::Define): Handle PInvoke methods specially
24517 by using DefinePInvokeMethod instead of the usual one.
24519 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
24520 above to do the task of extracting information and defining the method.
24522 2001-12-04 Ravi Pratap <ravi@ximian.com>
24524 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
24525 of the condition for string type.
24527 (Emit): Move that here.
24529 (ArrayCreation::CheckIndices): Keep string literals in their expression
24532 (EmitDynamicInitializers): Handle strings appropriately.
24534 2001-12-04 Miguel de Icaza <miguel@ximian.com>
24536 * codegen.cs (EmitContext): Replace multiple variables with a
24537 single pointer to the current Switch statement.
24539 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
24542 2001-12-03 Miguel de Icaza <miguel@ximian.com>
24546 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
24549 (Foreach.Emit): Foreach on arrays was not setting
24550 up the loop variables (for break/continue).
24552 (GotoCase): Semi-implented.
24554 2001-12-03 Ravi Pratap <ravi@ximian.com>
24556 * attribute.cs (CheckAttribute): Handle system attributes by using
24557 Attribute.GetAttributes to examine information we need.
24559 (GetValidPlaces): Same here.
24561 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
24563 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
24565 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
24567 (Method::Define): Set appropriate flags if we have a DllImport attribute.
24569 (Method::Emit): Handle the case when we are a PInvoke method.
24571 2001-12-03 Miguel de Icaza <miguel@ximian.com>
24573 * expression.cs: Use ResolveWithSimpleName on compound names.
24575 2001-12-02 Ravi Pratap <ravi@ximian.com>
24577 * constant.cs (EmitConstant): Make sure we resolve the associated expression
24578 before trying to reduce it.
24580 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
24582 * constant.cs (LookupConstantValue): Implement.
24584 (EmitConstant): Use the above in emitting the constant.
24586 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
24587 that are user-defined by doing a LookupConstantValue on them.
24589 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
24592 2001-11-29 Miguel de Icaza <miguel@ximian.com>
24594 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
24596 (BaseAccess.DoResolve): Implement.
24598 (MemberAccess.DoResolve): Split this routine into a
24599 ResolveMemberAccess routine that can be used independently
24601 2001-11-28 Miguel de Icaza <miguel@ximian.com>
24603 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
24604 As that share bits of the implementation. Is returns a boolean,
24605 while As returns the Type that is being probed.
24607 2001-12-01 Ravi Pratap <ravi@ximian.com>
24609 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
24610 instead of a Literal - much easier.
24612 (EnumInTransit): Remove - utterly useless :-)
24614 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
24616 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
24618 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
24619 chain when we have no associated expression.
24621 2001-11-30 Ravi Pratap <ravi@ximian.com>
24623 * constant.cs (Define): Use Location while reporting the errror.
24625 Also emit a warning when 'new' is used and there is no inherited
24628 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
24631 (LookupEnumValue): Implement to lookup an enum member's value and define it
24634 (Populate): Re-write accordingly to use the above routine.
24636 2001-11-27 Miguel de Icaza <miguel@ximian.com>
24638 * expression.cs (This): Fix prototype for DoResolveLValue to
24639 override the base class DoResolveLValue.
24641 * cs-parser.cs: Report errors cs574 and cs575 (destructor
24644 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
24645 (we need to load the address of the field here). This fixes
24648 (FieldExpr.DoResolveLValue): Call the DoResolve
24649 function to initialize the Instance expression.
24651 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
24652 correctly the GetEnumerator operation on a value type.
24654 * cs-parser.jay: Add more simple parsing error catches.
24656 * statement.cs (Switch): Add support for string switches.
24657 Handle null specially.
24659 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
24661 2001-11-28 Ravi Pratap <ravi@ximian.com>
24663 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
24665 (declare_local_constant): New helper function.
24667 * statement.cs (AddConstant): Keep a separate record of constants
24669 (IsConstant): Implement to determine if a variable is a constant.
24671 (GetConstantExpression): Implement.
24673 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
24675 * statement.cs (IsVariableDefined): Re-write.
24677 2001-11-27 Ravi Pratap <ravi@ximian.com>
24679 * class.cs (TypeContainer::FindMembers): Look for constants
24680 in the case when we are looking for MemberTypes.Field
24682 * expression.cs (MemberAccess::DoResolve): Check that in the
24683 case we are a FieldExpr and a Literal, we are not being accessed
24684 by an instance reference.
24686 * cs-parser.jay (local_constant_declaration): Implement.
24688 (declaration_statement): Implement for constant declarations.
24690 2001-11-26 Miguel de Icaza <miguel@ximian.com>
24692 * statement.cs (Switch): Catch double defaults.
24694 (Switch): More work on the switch() statement
24695 implementation. It works for integral values now, need to finish
24699 2001-11-24 Miguel de Icaza <miguel@ximian.com>
24701 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
24702 integer literals into other integer literals. To be used by
24705 2001-11-24 Ravi Pratap <ravi@ximian.com>
24707 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
24710 (EmitDynamicInitializers): Cope with the above since we extract data
24711 directly from ArrayData now.
24713 (ExpectInitializers): Keep track of whether initializers are mandatory
24716 (Bounds): Make it a hashtable to prevent the same dimension being
24717 recorded for every element in that dimension.
24719 (EmitDynamicInitializers): Fix bug which prevented the Set array method
24722 Also fix bug which was causing the indices to be emitted in the reverse
24725 2001-11-24 Miguel de Icaza <miguel@ximian.com>
24727 * expression.cs (ArrayCreation): Implement the bits that Ravi left
24728 unfinished. They do not work, because the underlying code is
24731 2001-11-22 Miguel de Icaza <miguel@ximian.com>
24733 * cs-parser.jay: Remove bogus fixme.
24735 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
24736 on Switch statement.
24738 2001-11-23 Ravi Pratap <ravi@ximian.com>
24740 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
24743 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
24744 parameter. Apparently, any expression is allowed.
24746 (ValidateInitializers): Update accordingly.
24748 (CheckIndices): Fix some tricky bugs thanks to recursion.
24750 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
24751 I was being completely brain-dead.
24753 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
24754 and re-write acordingly.
24756 (DelegateInvocation): Re-write accordingly.
24758 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
24760 (MakeByteBlob): Handle types more correctly.
24762 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
24763 initialization from expressions but it is incomplete because I am a complete
24766 2001-11-22 Miguel de Icaza <miguel@ximian.com>
24768 * statement.cs (If.Emit): Fix a bug that generated incorrect code
24769 on If. Basically, we have to return `true' (ie, we do return to
24770 our caller) only if both branches of the if return.
24772 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
24773 short-circuit operators, handle them as short circuit operators.
24775 (Cast.DoResolve): Resolve type.
24776 (Cast.Cast): Take an expression as the target type.
24778 * cs-parser.jay (cast_expression): Remove old hack that only
24779 allowed a limited set of types to be handled. Now we take a
24780 unary_expression and we resolve to a type during semantic
24783 Use the grammar productions from Rhys to handle casts (this is
24784 not complete like Rhys syntax yet, we fail to handle that corner
24785 case that C# has regarding (-x), but we will get there.
24787 2001-11-22 Ravi Pratap <ravi@ximian.com>
24789 * class.cs (EmitFieldInitializer): Take care of the case when we have a
24790 field which is an array type.
24792 * cs-parser.jay (declare_local_variables): Support array initialization too.
24794 * typemanager.cs (MakeKey): Implement.
24796 (everywhere): Use the above appropriately.
24798 * cs-parser.jay (for_statement): Update for array initialization while
24799 declaring variables.
24801 * ecore.cs : The error message was correct, it's the variable's names that
24802 were misleading ;-) Make the code more readable.
24804 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
24805 the correct type etc.
24807 (ConvertExplicit): Handle Enum types by examining the underlying type.
24809 2001-11-21 Ravi Pratap <ravi@ximian.com>
24811 * parameter.cs (GetCallingConvention): Always return
24812 CallingConventions.Standard for now.
24814 2001-11-22 Miguel de Icaza <miguel@ximian.com>
24816 * expression.cs (Binary.ResolveOperator): Update the values of `l'
24817 and `r' after calling DoNumericPromotions.
24819 * ecore.cs: Fix error message (the types were in the wrong order).
24821 * statement.cs (Foreach.ProbeCollectionType): Need to pass
24822 BindingFlags.Instance as well
24824 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
24825 implicit int literal conversion in an empty cast so that we
24826 propagate the right type upstream.
24828 (UnboxCast): new class used to unbox value types.
24829 (Expression.ConvertExplicit): Add explicit type conversions done
24832 (Expression.ImplicitNumericConversion): Oops, forgot to test for
24833 the target type before applying the implicit LongLiterals to ULong
24836 2001-11-21 Miguel de Icaza <miguel@ximian.com>
24838 * cs-parser.jay (for_statement): Reworked the way For works: now
24839 we declare manually any variables that are introduced in
24840 for_initializer to solve the problem of having out-of-band code
24841 emition (that is what got for broken).
24843 (declaration_statement): Perform the actual variable declaration
24844 that used to be done in local_variable_declaration here.
24846 (local_variable_declaration): Do not declare anything, just pass
24847 the information on a DictionaryEntry
24849 2001-11-20 Ravi Pratap <ravi@ximian.com>
24851 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
24852 re-write of the logic to now make it recursive.
24854 (UpdateIndices): Re-write accordingly.
24856 Store element data in a separate ArrayData list in the above methods.
24858 (MakeByteBlob): Implement to dump the array data into a byte array.
24860 2001-11-19 Ravi Pratap <ravi@ximian.com>
24862 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
24865 * constant.cs (Define): Implement.
24867 (EmitConstant): Re-write fully.
24869 Pass in location info.
24871 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
24874 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
24875 DictionaryEntry since we need location info too.
24877 (constant_declaration): Update accordingly.
24879 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
24880 code into another method : UpdateIndices.
24882 2001-11-18 Ravi Pratap <ravi@ximian.com>
24884 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
24885 some type checking etc.
24887 2001-11-17 Ravi Pratap <ravi@ximian.com>
24889 * expression.cs (ArrayCreation::ValidateInitializers): Implement
24890 bits to provide dimension info if the user skips doing that.
24892 Update second constructor to store the rank correctly.
24894 2001-11-16 Ravi Pratap <ravi@ximian.com>
24896 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
24897 and try to implement.
24899 * ../errors/cs0150.cs : Add.
24901 * ../errors/cs0178.cs : Add.
24903 2001-11-16 Miguel de Icaza <miguel@ximian.com>
24905 * statement.cs: Implement foreach on multi-dimensional arrays.
24907 * parameter.cs (Parameters.GetParameterByName): Also lookup the
24908 name of the params argument.
24910 * expression.cs: Use EmitStoreOpcode to get the right opcode while
24911 initializing the array.
24913 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
24914 we can use this elsewhere.
24916 * statement.cs: Finish implementation of foreach for single
24919 * cs-parser.jay: Use an out-of-band stack to pass information
24920 around, I wonder why I need this.
24922 foreach_block: Make the new foreach_block the current_block.
24924 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
24925 function used to return a static Parameters structure. Used for
24926 empty parameters, as those are created very frequently.
24928 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
24930 2001-11-15 Ravi Pratap <ravi@ximian.com>
24932 * interface.cs : Default modifier is private, not public. The
24933 make verify test passes again.
24935 2001-11-15 Ravi Pratap <ravi@ximian.com>
24937 * support.cs (ReflectionParameters): Fix logic to determine
24938 whether the last parameter is a params one. Test 9 passes again.
24940 * delegate.cs (Populate): Register the builders we define with
24941 RegisterParameterForBuilder. Test 19 passes again.
24943 * cs-parser.jay (property_declaration): Reference $6 instead
24944 of $$ to get at the location.
24946 (indexer_declaration): Similar stuff.
24948 (attribute): Ditto.
24950 * class.cs (Property): Register parameters for the Get and Set methods
24951 if they exist. Test 23 passes again.
24953 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
24954 call to EmitArguments as we are sure there aren't any params arguments.
24955 Test 32 passes again.
24957 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
24958 IndexOutOfRangeException.
24960 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
24961 Test 33 now passes again.
24963 2001-11-15 Miguel de Icaza <miguel@ximian.com>
24965 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
24966 broke a bunch of things. Will have to come up with a better way
24967 of tracking locations.
24969 * statement.cs: Implemented foreach for single dimension arrays.
24971 2001-11-09 Miguel de Icaza <miguel@ximian.com>
24973 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
24974 an error. This removes the lookup from the critical path.
24976 * cs-parser.jay: Removed use of temporary_loc, which is completely
24979 2001-11-14 Miguel de Icaza <miguel@ximian.com>
24981 * support.cs (ReflectionParameters.ParameterModifier): Report
24982 whether the argument is a PARAMS argument or not.
24984 * class.cs: Set the attribute `ParamArrayAttribute' on the
24985 parameter argument.
24987 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
24988 and cons_param_array_attribute (ConstructorInfo for
24989 ParamArrayAttribute).,
24991 * codegen.cs: Emit the return using the `Return' statement, that
24992 way we can report the error correctly for missing return values.
24994 * class.cs (Method.Emit): Clean up.
24996 * expression.cs (Argument.Resolve): Take another argument: the
24997 location where this argument is used. Notice that this is not
24998 part of the "Argument" class as to reduce the size of the
24999 structure (we know the approximate location anyways).
25001 Test if the argument is a variable-reference, if not, then
25002 complain with a 206.
25004 (Argument.Emit): Emit addresses of variables.
25006 (Argument.FullDesc): Simplify.
25008 (Invocation.DoResolve): Update for Argument.Resolve.
25010 (ElementAccess.DoResolve): ditto.
25012 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
25013 method should be virtual, as this method is always virtual.
25015 (NewDelegate.DoResolve): Update for Argument.Resolve.
25017 * class.cs (ConstructorInitializer.DoResolve): ditto.
25019 * attribute.cs (Attribute.Resolve): ditto.
25021 2001-11-13 Miguel de Icaza <miguel@ximian.com>
25023 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
25025 * expression.cs (ParameterReference): Drop IStackStorage and implement
25026 IAssignMethod instead.
25028 (LocalVariableReference): ditto.
25030 * ecore.cs (FieldExpr): Drop IStackStorage and implement
25031 IAssignMethod instead.
25033 2001-11-13 Miguel de Icaza <miguel@ximian.com>
25035 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
25036 enumerations that are used in heavily used structures derive from
25037 byte in a laughable and pathetic attempt to reduce memory usage.
25038 This is the kind of pre-optimzations that you should not do at
25039 home without adult supervision.
25041 * expression.cs (UnaryMutator): New class, used to handle ++ and
25042 -- separatedly from the other unary operators. Cleans up the
25043 code, and kills the ExpressionStatement dependency in Unary.
25045 (Unary): Removed `method' and `Arguments' from this class, making
25046 it smaller, and moving it all to SimpleCall, so I can reuse this
25047 code in other locations and avoid creating a lot of transient data
25048 strucutres when not required.
25050 * cs-parser.jay: Adjust for new changes.
25052 2001-11-11 Miguel de Icaza <miguel@ximian.com>
25054 * enum.cs (Enum.Populate): If there is a failure during
25057 * cs-parser.jay (opt_enum_base): we used to catch type errors
25058 here, but this is really incorrect. The type error should be
25059 catched during semantic analysis.
25061 2001-12-11 Ravi Pratap <ravi@ximian.com>
25063 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
25064 current_local_parameters as expected since I, in my stupidity, had forgotten
25067 * attribute.cs (GetValidPlaces): Fix stupid bug.
25069 * class.cs (Method::Emit): Perform check on applicability of attributes.
25071 (Constructor::Emit): Ditto.
25073 (Field::Emit): Ditto.
25075 (Field.Location): Store location information.
25077 (Property, Event, Indexer, Operator): Ditto.
25079 * cs-parser.jay (field_declaration): Pass in location for each field.
25081 * ../errors/cs0592.cs : Add.
25083 2001-11-12 Ravi Pratap <ravi@ximian.com>
25085 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
25087 (InitCoreTypes): Update accordingly.
25089 (RegisterAttrType, LookupAttr): Implement.
25091 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
25092 info about the same.
25094 (Resolve): Update to populate the above as necessary.
25096 (Error592): Helper.
25098 (GetValidPlaces): Helper to the above.
25100 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
25102 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
25104 2001-11-12 Ravi Pratap <ravi@ximian.com>
25106 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
25108 * ../errors/cs0617.cs : Add.
25110 2001-11-11 Ravi Pratap <ravi@ximian.com>
25112 * enum.cs (Emit): Rename to Populate to be more consistent with what
25113 we expect it to do and when exactly it is called.
25115 * class.cs, rootcontext.cs : Update accordingly.
25117 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
25118 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
25120 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
25122 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
25123 of a fieldinfo using the above, when dealing with a FieldBuilder.
25125 2001-11-10 Ravi Pratap <ravi@ximian.com>
25127 * ../errors/cs0031.cs : Add.
25129 * ../errors/cs1008.cs : Add.
25131 * ../errrors/cs0543.cs : Add.
25133 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
25136 (FindMembers): Implement.
25138 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
25139 enums and delegates too.
25141 (enum_types): Rename to builder_to_enum.
25143 (delegate_types): Rename to builder_to_delegate.
25145 * delegate.cs (FindMembers): Implement.
25147 2001-11-09 Ravi Pratap <ravi@ximian.com>
25149 * typemanager.cs (IsEnumType): Implement.
25151 * enum.cs (Emit): Re-write parts to account for the underlying type
25152 better and perform checking etc.
25154 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
25155 of the underlying type.
25157 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
25160 * enum.cs (error31): Helper to report error #31.
25162 * cs-parser.jay (enum_declaration): Store location of each member too.
25164 * enum.cs (member_to_location): New hashtable.
25166 (AddEnumMember): Update location hashtable.
25168 (Emit): Use the location of each member while reporting errors.
25170 2001-11-09 Miguel de Icaza <miguel@ximian.com>
25172 * cs-parser.jay: A for_initializer if is a
25173 local_variable_declaration really ammount to have an implicit
25174 block with the variable declaration and no initializer for for.
25176 * statement.cs (For.Emit): Cope with null initializers.
25178 This fixes the infinite loop on for initializers.
25180 2001-11-08 Miguel de Icaza <miguel@ximian.com>
25182 * enum.cs: More cleanup.
25184 * ecore.cs: Remove dead code.
25186 * class.cs (Property.Emit): More simplification.
25187 (Event.Emit): ditto.
25189 Reworked to have less levels of indentation.
25191 2001-11-08 Ravi Pratap <ravi@ximian.com>
25193 * class.cs (Property): Emit attributes.
25203 * enum.cs (Emit): Ditto.
25205 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
25208 * class.cs (Field, Event, etc.): Move attribute generation into the
25209 Emit method everywhere.
25211 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
25212 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
25213 as we had no way of defining nested enums !
25215 * rootcontext.cs : Adjust code accordingly.
25217 * typemanager.cs (AddEnumType): To keep track of enum types separately.
25219 2001-11-07 Ravi Pratap <ravi@ximian.com>
25221 * expression.cs (EvalConstantExpression): Move into ecore.cs
25223 * enum.cs (Enum): Rename some members and make them public and readonly
25224 according to our convention.
25226 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
25229 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
25231 (Enum::Emit): Write a simple version for now which doesn't try to compute
25232 expressions. I shall modify this to be more robust in just a while.
25234 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
25236 (TypeContainer::CloseType): Create the Enum types too.
25238 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
25240 * expression.cs (EvalConstantExpression): Get rid of completely.
25242 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
25243 user-defined values and other cases.
25245 (IsValidEnumLiteral): Helper function.
25247 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
25248 out there in the case we had a literal FieldExpr.
25250 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
25252 (Literalize): Revamp a bit to take two arguments.
25254 (EnumLiteral): New class which derives from Literal to wrap enum literals.
25256 2001-11-06 Ravi Pratap <ravi@ximian.com>
25258 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
25260 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
25262 (Resolve): Use the above to ensure we have proper initializers.
25264 2001-11-05 Ravi Pratap <ravi@ximian.com>
25266 * expression.cs (Expression::EvalConstantExpression): New method to
25267 evaluate constant expressions.
25269 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
25271 2001-11-07 Miguel de Icaza <miguel@ximian.com>
25273 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
25276 (Binary.ResolveOperator): Handle operator != (object a, object b)
25277 and operator == (object a, object b);
25279 (Binary.DoNumericPromotions): Indicate whether the numeric
25280 promotion was possible.
25282 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
25285 Made the ArrayAccess implement interface IAssignMethod instead of
25286 IStackStore as the order in which arguments are passed reflects
25289 * assign.cs: Instead of using expr.ExprClass to select the way of
25290 assinging, probe for the IStackStore/IAssignMethod interfaces.
25292 * typemanager.cs: Load InitializeArray definition.
25294 * rootcontext.cs (RootContext.MakeStaticData): Used to define
25295 static data that can be used to initialize arrays.
25297 2001-11-05 Miguel de Icaza <miguel@ximian.com>
25299 * expression.cs: Handle operator== and operator!= for booleans.
25301 (Conditioal.Reduce): Implement reducer for the ?: operator.
25303 (Conditional.Resolve): Implement dead code elimination.
25305 (Binary.Resolve): Catch string literals and return a new
25306 concatenated string.
25308 (Unary.Reduce): Implement reduction of unary expressions.
25310 * ecore.cs: Split out the expression core handling here.
25312 (Expression.Reduce): New method used to perform constant folding
25313 and CSE. This is needed to support constant-expressions.
25315 * statement.cs (Statement.EmitBoolExpression): Pass true and false
25316 targets, and optimize for !x.
25318 2001-11-04 Ravi Pratap <ravi@ximian.com>
25320 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
25321 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
25322 set custom atttributes.
25324 * literal.cs (Literal::GetValue): New abstract method to return the actual
25325 value of the literal, cast as an object.
25327 (*Literal): Implement GetValue method.
25329 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
25330 expressions to the arraylist but objects of type Argument.
25332 * class.cs (TypeContainer::Emit): Emit our attributes too.
25334 (Method::Emit, Constructor::Emit): Ditto.
25336 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
25337 to be ignoring earlier.
25339 2001-11-03 Ravi Pratap <ravi@ximian.com>
25341 * attribute.cs (AttributeSection::Define): Implement to do the business
25342 of constructing a CustomAttributeBuilder.
25344 (Attribute): New trivial class. Increases readability of code.
25346 * cs-parser.jay : Update accordingly.
25348 (positional_argument_list, named_argument_list, named_argument): New rules
25350 (attribute_arguments): Use the above so that we are more correct.
25352 2001-11-02 Ravi Pratap <ravi@ximian.com>
25354 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
25355 to perform all checks for a method with a params parameter.
25357 (Invocation::OverloadResolve): Update to use the above method and therefore
25358 cope correctly with params method invocations.
25360 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
25363 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
25364 constructors in our parent too because we can't afford to miss out on
25367 * attribute.cs (AttributeSection): New name for the class Attribute
25369 Other trivial changes to improve readability.
25371 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
25372 use the new class names.
25374 2001-11-01 Ravi Pratap <ravi@ximian.com>
25376 * class.cs (Method::Define): Complete definition for params types too
25378 (Indexer::Define): Ditto.
25380 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
25381 Cope everywhere with a request for info about the array parameter.
25383 2001-11-01 Ravi Pratap <ravi@ximian.com>
25385 * tree.cs (RecordNamespace): Fix up to check for the correct key.
25387 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
25388 local_variable_type to extract the string corresponding to the type.
25390 (local_variable_type): Fixup the action to use the new helper method.
25392 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
25395 * expression.cs : Clean out code which uses the above.
25397 2001-10-31 Ravi Pratap <ravi@ximian.com>
25399 * typemanager.cs (RegisterMethod): Check if we already have an existing key
25400 and bale out if necessary by returning a false.
25402 (RegisterProperty): Ditto.
25404 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
25405 and print out appropriate error messages.
25407 * interface.cs (everywhere): Ditto.
25409 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
25410 location to constructor.
25412 * class.cs (Property, Event, Indexer): Update accordingly.
25414 * ../errors/cs111.cs : Added.
25416 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
25417 of a method, as laid down by the spec.
25419 (Invocation::OverloadResolve): Use the above method.
25421 2001-10-31 Ravi Pratap <ravi@ximian.com>
25423 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
25424 now take a TypeContainer and a Parameters object.
25426 (ParameterData): Modify return type of ParameterModifier method to be
25427 Parameter.Modifier and not a string.
25429 (ReflectionParameters, InternalParameters): Update accordingly.
25431 * expression.cs (Argument::GetParameterModifier): Same here.
25433 * support.cs (InternalParameters::ParameterType): Find a better way of determining
25434 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
25435 symbol in it at all so maybe this is only for now.
25437 2001-10-30 Ravi Pratap <ravi@ximian.com>
25439 * support.cs (InternalParameters): Constructor now takes an extra argument
25440 which is the actual Parameters class.
25442 (ParameterDesc): Update to provide info on ref/out modifiers.
25444 * class.cs (everywhere): Update call to InternalParameters to pass in
25445 the second argument too.
25447 * support.cs (ParameterData): Add ParameterModifier, which is a method
25448 to return the modifier info [ref/out etc]
25450 (InternalParameters, ReflectionParameters): Implement the above.
25452 * expression.cs (Argument::ParameterModifier): Similar function to return
25453 info about the argument's modifiers.
25455 (Invocation::OverloadResolve): Update to take into account matching modifiers
25458 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
25459 a new SetFormalParameters object which we pass to InternalParameters.
25461 2001-10-30 Ravi Pratap <ravi@ximian.com>
25463 * expression.cs (NewArray): Merge into the ArrayCreation class.
25465 2001-10-29 Ravi Pratap <ravi@ximian.com>
25467 * expression.cs (NewArray): Merge classes NewBuiltinArray and
25468 NewUserdefinedArray into one as there wasn't much of a use in having
25471 * expression.cs (Argument): Change field's name to ArgType from Type.
25473 (Type): New readonly property which returns the proper type, taking into
25474 account ref/out modifiers.
25476 (everywhere): Adjust code accordingly for the above.
25478 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
25479 whether we are emitting for a ref or out parameter.
25481 * expression.cs (Argument::Emit): Use the above field to set the state.
25483 (LocalVariableReference::Emit): Update to honour the flag and emit the
25486 * parameter.cs (Attributes): Set the correct flags for ref parameters.
25488 * expression.cs (Argument::FullDesc): New function to provide a full desc.
25490 * support.cs (ParameterData): Add method ParameterDesc to the interface.
25492 (ReflectionParameters, InternalParameters): Implement the above method.
25494 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
25497 (Invocation::FullMethodDesc): Ditto.
25499 2001-10-29 Miguel de Icaza <miguel@ximian.com>
25501 * cs-parser.jay: Add extra production for the second form of array
25504 * expression.cs (ArrayCreation): Update to reflect the above
25507 * Small changes to prepare for Array initialization.
25509 2001-10-28 Miguel de Icaza <miguel@ximian.com>
25511 * typemanager.cs (ImplementsInterface): interface might be null;
25512 Deal with this problem;
25514 Also, we do store negative hits on the cache (null values), so use
25515 this instead of calling t.GetInterfaces on the type everytime.
25517 2001-10-28 Ravi Pratap <ravi@ximian.com>
25519 * typemanager.cs (IsBuiltinType): New method to help determine the same.
25521 * expression.cs (New::DoResolve): Get rid of array creation code and instead
25522 split functionality out into different classes.
25524 (New::FormArrayType): Move into NewBuiltinArray.
25526 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
25529 (NewBuiltinArray): New class to handle creation of built-in arrays.
25531 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
25532 account creation of one-dimensional arrays.
25534 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
25536 (NewUserdefinedArray::DoResolve): Implement.
25538 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
25540 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
25541 we maintain inside the TypeManager. This is necessary to perform lookups on the
25544 (LookupType): Update to perform GetType on the module builders too.
25546 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
25548 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
25550 2001-10-23 Ravi Pratap <ravi@ximian.com>
25552 * expression.cs (New::DoResolve): Implement guts of array creation.
25554 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
25556 2001-10-27 Miguel de Icaza <miguel@ximian.com>
25558 * expression.cs: Fix bug I introduced lsat night that broke
25561 (Expression.Resolve): Report a 246 error (can not resolve name)
25562 if we find a SimpleName in the stream.
25564 (Expression.ResolveLValue): Ditto.
25566 (Expression.ResolveWithSimpleName): This function is a variant of
25567 ResolveName, this one allows SimpleNames to be returned without a
25568 warning. The only consumer of SimpleNames is MemberAccess
25570 2001-10-26 Miguel de Icaza <miguel@ximian.com>
25572 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
25573 might arrive here. I have my doubts that this is correct.
25575 * statement.cs (Lock): Implement lock statement.
25577 * cs-parser.jay: Small fixes to support `lock' and `using'
25579 * cs-tokenizer.cs: Remove extra space
25581 * driver.cs: New flag --checked, allows to turn on integer math
25584 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
25585 Threading.Monitor.Exit
25587 2001-10-23 Miguel de Icaza <miguel@ximian.com>
25589 * expression.cs (IndexerAccess::DoResolveLValue): Set the
25590 Expression Class to be IndexerAccess.
25592 Notice that Indexer::DoResolve sets the eclass to Value.
25594 2001-10-22 Miguel de Icaza <miguel@ximian.com>
25596 * class.cs (TypeContainer::Emit): Emit code for indexers.
25598 * assign.cs (IAssignMethod): New interface implemented by Indexers
25599 and Properties for handling assignment.
25601 (Assign::Emit): Simplify and reuse code.
25603 * expression.cs (IndexerAccess, PropertyExpr): Implement
25604 IAssignMethod, clean up old code.
25606 2001-10-22 Ravi Pratap <ravi@ximian.com>
25608 * typemanager.cs (ImplementsInterface): New method to determine if a type
25609 implements a given interface. Provides a nice cache too.
25611 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
25614 (ConvertReferenceExplicit): Ditto.
25616 * delegate.cs (Delegate::Populate): Update to define the parameters on the
25617 various methods, with correct names etc.
25619 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
25620 Operator.UnaryNegation.
25622 * cs-parser.jay (operator_declarator): Be a little clever in the case where
25623 we have a unary plus or minus operator.
25625 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
25628 * everywhere : update accordingly.
25630 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
25633 * class.cs (Method::Define): For the case where we are implementing a method
25634 inherited from an interface, we need to set the MethodAttributes.Final flag too.
25635 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
25637 2001-10-21 Ravi Pratap <ravi@ximian.com>
25639 * interface.cs (FindMembers): Implement to work around S.R.E
25642 * typemanager.cs (IsInterfaceType): Implement.
25644 (FindMembers): Update to handle interface types too.
25646 * expression.cs (ImplicitReferenceConversion): Re-write bits which
25647 use IsAssignableFrom as that is not correct - it doesn't work.
25649 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
25650 and accordingly override EmitStatement.
25652 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
25653 using the correct logic :-)
25655 2001-10-19 Ravi Pratap <ravi@ximian.com>
25657 * ../errors/cs-11.cs : Add to demonstrate error -11
25659 2001-10-17 Miguel de Icaza <miguel@ximian.com>
25661 * assign.cs (Assign::Resolve): Resolve right hand side first, and
25662 then pass this as a hint to ResolveLValue.
25664 * expression.cs (FieldExpr): Add Location information
25666 (FieldExpr::LValueResolve): Report assignment to readonly
25669 (Expression::ExprClassFromMemberInfo): Pass location information.
25671 (Expression::ResolveLValue): Add new method that resolves an
25674 (Expression::DoResolveLValue): Default invocation calls
25677 (Indexers): New class used to keep track of indexers in a given
25680 (IStackStore): Renamed from LValue, as it did not really describe
25681 what this did. Also ResolveLValue is gone from this interface and
25682 now is part of Expression.
25684 (ElementAccess): Depending on the element access type
25686 * typemanager.cs: Add `indexer_name_type' as a Core type
25687 (System.Runtime.CompilerServices.IndexerNameAttribute)
25689 * statement.cs (Goto): Take a location.
25691 2001-10-18 Ravi Pratap <ravi@ximian.com>
25693 * delegate.cs (Delegate::VerifyDelegate): New method to verify
25694 if two delegates are compatible.
25696 (NewDelegate::DoResolve): Update to take care of the case when
25697 we instantiate a delegate from another delegate.
25699 * typemanager.cs (FindMembers): Don't even try to look up members
25700 of Delegate types for now.
25702 2001-10-18 Ravi Pratap <ravi@ximian.com>
25704 * delegate.cs (NewDelegate): New class to take care of delegate
25707 * expression.cs (New): Split the delegate related code out into
25708 the NewDelegate class.
25710 * delegate.cs (DelegateInvocation): New class to handle delegate
25713 * expression.cs (Invocation): Split out delegate related code into
25714 the DelegateInvocation class.
25716 2001-10-17 Ravi Pratap <ravi@ximian.com>
25718 * expression.cs (New::DoResolve): Implement delegate creation fully
25719 and according to the spec.
25721 (New::DoEmit): Update to handle delegates differently.
25723 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
25724 because of which we were printing out arguments in reverse order !
25726 * delegate.cs (VerifyMethod): Implement to check if the given method
25727 matches the delegate.
25729 (FullDelegateDesc): Implement.
25731 (VerifyApplicability): Implement.
25733 * expression.cs (Invocation::DoResolve): Update to accordingly handle
25734 delegate invocations too.
25736 (Invocation::Emit): Ditto.
25738 * ../errors/cs1593.cs : Added.
25740 * ../errors/cs1594.cs : Added.
25742 * delegate.cs (InstanceExpression, TargetMethod): New properties.
25744 2001-10-16 Ravi Pratap <ravi@ximian.com>
25746 * typemanager.cs (intptr_type): Core type for System.IntPtr
25748 (InitCoreTypes): Update for the same.
25750 (iasyncresult_type, asynccallback_type): Ditto.
25752 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
25755 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
25758 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
25759 the builders for the 4 members of a delegate type :-)
25761 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
25764 * expression.cs (New::DoResolve): Implement guts for delegate creation.
25766 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
25768 2001-10-15 Miguel de Icaza <miguel@ximian.com>
25770 * statement.cs (Break::Emit): Implement.
25771 (Continue::Emit): Implement.
25773 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
25774 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
25775 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
25776 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
25779 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
25780 properties that track the label for the current loop (begin of the
25781 loop and end of the loop).
25783 2001-10-15 Ravi Pratap <ravi@ximian.com>
25785 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
25786 use of emitting anything at all.
25788 * class.cs, rootcontext.cs : Get rid of calls to the same.
25790 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
25792 (Populate): Define the constructor correctly and set the implementation
25795 * typemanager.cs (delegate_types): New hashtable to hold delegates that
25798 (AddDelegateType): Implement.
25800 (IsDelegateType): Implement helper method.
25802 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
25804 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
25805 and accordingly handle it.
25807 * delegate.cs (Populate): Take TypeContainer argument.
25808 Implement bits to define the Invoke method. However, I still haven't figured out
25809 how to take care of the native int bit :-(
25811 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
25812 Qualify the name of the delegate, not its return type !
25814 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
25817 (StandardConversionExists): Checking for array types turns out to be recursive.
25819 (ConvertReferenceExplicit): Implement array conversion.
25821 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
25823 2001-10-12 Ravi Pratap <ravi@ximian.com>
25825 * cs-parser.jay (delegate_declaration): Store the fully qualified
25826 name as it is a type declaration.
25828 * delegate.cs (ReturnType, Name): Rename members to these. Make them
25831 (DefineDelegate): Renamed from Define. Does the same thing essentially,
25832 as TypeContainer::DefineType.
25834 (Populate): Method in which all the definition of the various methods (Invoke)
25837 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
25840 (CloseDelegate): Finally creates the delegate.
25842 * class.cs (TypeContainer::DefineType): Update to define delegates.
25843 (Populate, Emit and CloseType): Do the same thing here too.
25845 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
25846 delegates in all these operations.
25848 2001-10-14 Miguel de Icaza <miguel@ximian.com>
25850 * expression.cs: LocalTemporary: a new expression used to
25851 reference a temporary that has been created.
25853 * assign.cs: Handle PropertyAccess back here, so that we can
25854 provide the proper semantic access to properties.
25856 * expression.cs (Expression::ConvertReferenceExplicit): Implement
25857 a few more explicit conversions.
25859 * modifiers.cs: `NEW' modifier maps to HideBySig.
25861 * expression.cs (PropertyExpr): Make this into an
25862 ExpressionStatement, and support the EmitStatement code path.
25864 Perform get/set error checking, clean up the interface.
25866 * assign.cs: recognize PropertyExprs as targets, and if so, turn
25867 them into toplevel access objects.
25869 2001-10-12 Miguel de Icaza <miguel@ximian.com>
25871 * expression.cs: PropertyExpr::PropertyExpr: use work around the
25874 * typemanager.cs: Keep track here of our PropertyBuilders again to
25875 work around lameness in SRE.
25877 2001-10-11 Miguel de Icaza <miguel@ximian.com>
25879 * expression.cs (LValue::LValueResolve): New method in the
25880 interface, used to perform a second resolution pass for LValues.
25882 (This::DoResolve): Catch the use of this in static methods.
25884 (This::LValueResolve): Implement.
25886 (This::Store): Remove warning, assigning to `this' in structures
25889 (Invocation::Emit): Deal with invocation of
25890 methods on value types. We need to pass the address to structure
25891 methods rather than the object itself. (The equivalent code to
25892 emit "this" for structures leaves the entire structure on the
25893 stack instead of a pointer to it).
25895 (ParameterReference::DoResolve): Compute the real index for the
25896 argument based on whether the method takes or not a `this' pointer
25897 (ie, the method is static).
25899 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
25900 value types returned from functions when we need to invoke a
25901 method on the sturcture.
25904 2001-10-11 Ravi Pratap <ravi@ximian.com>
25906 * class.cs (TypeContainer::DefineType): Method to actually do the business of
25907 defining the type in the Modulebuilder or Typebuilder. This is to take
25908 care of nested types which need to be defined on the TypeBuilder using
25909 DefineNestedMethod.
25911 (TypeContainer::GetClassBases): Implement. Essentially the code from the
25912 methods in RootContext, only ported to be part of TypeContainer.
25914 (TypeContainer::GetInterfaceOrClass): Ditto.
25916 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
25918 * interface.cs (Interface::DefineInterface): New method. Does exactly
25919 what RootContext.CreateInterface did earlier, only it takes care of nested types
25922 (Interface::GetInterfaces): Move from RootContext here and port.
25924 (Interface::GetInterfaceByName): Same here.
25926 * rootcontext.cs (ResolveTree): Re-write.
25928 (PopulateTypes): Re-write.
25930 * class.cs (TypeContainer::Populate): Populate nested types too.
25931 (TypeContainer::Emit): Emit nested members too.
25933 * typemanager.cs (AddUserType): Do not make use of the FullName property,
25934 instead just use the name argument passed in as it is already fully
25937 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
25938 to TypeContainer mapping to see if a type is user-defined.
25940 * class.cs (TypeContainer::CloseType): Implement.
25942 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
25943 the default constructor.
25945 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
25948 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
25950 * interface.cs (CloseType): Create the type here.
25952 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
25955 Remove all the methods which are now in TypeContainer.
25957 2001-10-10 Ravi Pratap <ravi@ximian.com>
25959 * delegate.cs (Define): Re-write bits to define the delegate
25962 2001-10-10 Miguel de Icaza <miguel@ximian.com>
25964 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
25966 * expression.cs (ImplicitReferenceConversion): handle null as well
25967 as a source to convert to any reference type.
25969 * statement.cs (Return): Perform any implicit conversions to
25970 expected return type.
25972 Validate use of return statement.
25974 * codegen.cs (EmitContext): Pass the expected return type here.
25976 * class.cs (Method, Constructor, Property): Pass expected return
25977 type to EmitContext.
25979 2001-10-09 Miguel de Icaza <miguel@ximian.com>
25981 * expression.cs: Make DoResolve take an EmitContext instead of a
25984 Replaced `l' and `location' for `loc', for consistency.
25986 (Error, Warning): Remove unneeded Tc argument.
25988 * assign.cs, literal.cs, constant.cs: Update to new calling
25991 * codegen.cs: EmitContext now contains a flag indicating whether
25992 code is being generated in a static method or not.
25994 * cs-parser.jay: DecomposeQI, new function that replaces the old
25995 QualifiedIdentifier. Now we always decompose the assembled
25996 strings from qualified_identifier productions into a group of
25999 2001-10-08 Miguel de Icaza <miguel@ximian.com>
26001 * rootcontext.cs: Deal with field-less struct types correctly now
26002 by passing the size option to Define Type.
26004 * class.cs: Removed hack that created one static field.
26006 2001-10-07 Miguel de Icaza <miguel@ximian.com>
26008 * statement.cs: Moved most of the code generation here.
26010 2001-10-09 Ravi Pratap <ravi@ximian.com>
26012 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
26015 (ElementAccess): Remove useless bits for now - keep checks as the spec
26018 2001-10-08 Ravi Pratap <ravi@ximian.com>
26020 * expression.cs (ElementAccess::DoResolve): Remove my crap code
26021 and start performing checks according to the spec.
26023 2001-10-07 Ravi Pratap <ravi@ximian.com>
26025 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
26026 rank_specifiers instead.
26028 (rank_specifiers): Change the order in which the rank specifiers are stored
26030 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
26032 * expression.cs (ElementAccess): Implement the LValue interface too.
26034 2001-10-06 Ravi Pratap <ravi@ximian.com>
26036 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
26037 except that user defined conversions are not included.
26039 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
26040 perform the conversion of the return type, if necessary.
26042 (New::DoResolve): Check whether we are creating an array or an object
26043 and accordingly do the needful.
26045 (New::Emit): Same here.
26047 (New::DoResolve): Implement guts of array creation.
26049 (New::FormLookupType): Helper function.
26051 2001-10-07 Miguel de Icaza <miguel@ximian.com>
26053 * codegen.cs: Removed most of the code generation here, and move the
26054 corresponding code generation bits to the statement classes.
26056 Added support for try/catch/finalize and throw.
26058 * cs-parser.jay: Added support for try/catch/finalize.
26060 * class.cs: Catch static methods having the flags override,
26061 virtual or abstract.
26063 * expression.cs (UserCast): This user cast was not really doing
26064 what it was supposed to do. Which is to be born in fully resolved
26065 state. Parts of the resolution were being performed at Emit time!
26069 2001-10-05 Miguel de Icaza <miguel@ximian.com>
26071 * expression.cs: Implicity convert the result from UserCast.
26073 2001-10-05 Ravi Pratap <ravi@ximian.com>
26075 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
26076 prevented it from working correctly.
26078 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
26079 merely ConvertImplicit.
26081 2001-10-05 Miguel de Icaza <miguel@ximian.com>
26083 * typemanager.cs: Make the LookupTypeContainer function static,
26084 and not per-instance.
26086 * class.cs: Make static FindMembers (the one that takes a Type
26089 * codegen.cs: Add EmitForeach here.
26091 * cs-parser.jay: Make foreach a toplevel object instead of the
26092 inline expansion, as we need to perform semantic analysis on it.
26094 2001-10-05 Ravi Pratap <ravi@ximian.com>
26096 * expression.cs (Expression::ImplicitUserConversion): Rename to
26097 UserDefinedConversion.
26099 (Expression::UserDefinedConversion): Take an extra argument specifying
26100 whether we look for explicit user conversions too.
26102 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
26104 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
26106 (ExplicitUserConversion): Make it a call to UserDefinedConversion
26107 with the appropriate arguments.
26109 * cs-parser.jay (cast_expression): Record location too.
26111 * expression.cs (Cast): Record location info.
26113 (Expression::ConvertExplicit): Take location argument.
26115 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
26116 to determine if we are doing explicit conversions.
26118 (UserCast::Emit): Update accordingly.
26120 (Expression::ConvertExplicit): Report an error if everything fails.
26122 * ../errors/cs0030.cs : Add.
26124 2001-10-04 Miguel de Icaza <miguel@ximian.com>
26126 * modifiers.cs: If the ABSTRACT keyword is present, also set the
26127 virtual and newslot bits.
26129 * class.cs (TypeContainer::RegisterRequiredImplementations):
26130 Record methods we need.
26132 (TypeContainer::MakeKey): Helper function to make keys for
26133 MethodBases, since the Methodbase key is useless.
26135 (TypeContainer::Populate): Call RegisterRequiredImplementations
26136 before defining the methods.
26138 Create a mapping for method_builders_to_methods ahead of time
26139 instead of inside a tight loop.
26141 (::RequireMethods): Accept an object as the data to set into the
26142 hashtable so we can report interface vs abstract method mismatch.
26144 2001-10-03 Miguel de Icaza <miguel@ximian.com>
26146 * report.cs: Make all of it static.
26148 * rootcontext.cs: Drop object_type and value_type computations, as
26149 we have those in the TypeManager anyways.
26151 Drop report instance variable too, now it is a global.
26153 * driver.cs: Use try/catch on command line handling.
26155 Add --probe option to debug the error reporting system with a test
26158 * report.cs: Add support for exiting program when a probe
26159 condition is reached.
26161 2001-10-03 Ravi Pratap <ravi@ximian.com>
26163 * expression.cs (Binary::DoNumericPromotions): Fix the case when
26164 we do a forcible conversion regardless of type, to check if
26165 ForceConversion returns a null.
26167 (Binary::error19): Use location to report error.
26169 (Unary::error23): Use location here too.
26171 * ../errors/cs0019.cs : Check in.
26173 * ../errors/cs0023.cs : Check in.
26175 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
26176 case of a non-null MethodInfo object with a length of 0 !
26178 (Binary::ResolveOperator): Flag error if overload resolution fails to find
26179 an applicable member - according to the spec :-)
26180 Also fix logic to find members in base types.
26182 (Unary::ResolveOperator): Same here.
26184 (Unary::report23): Change name to error23 and make first argument a TypeContainer
26185 as I was getting thoroughly confused between this and error19 :-)
26187 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
26188 (::FindMostEncompassedType): Implement.
26189 (::FindMostEncompassingType): Implement.
26190 (::StandardConversionExists): Implement.
26192 (UserImplicitCast): Re-vamp. We now need info about most specific
26193 source and target types so that we can do the necessary conversions.
26195 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
26196 mathematical union with no duplicates.
26198 2001-10-03 Miguel de Icaza <miguel@ximian.com>
26200 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
26201 in order from base classes to child classes, so that we can in
26202 child classes look up in our parent for method names and
26203 attributes (required for handling abstract, virtual, new, override
26204 constructs: we need to instrospect our base class, and if we dont
26205 populate the classes in order, the introspection might be
26206 incorrect. For example, a method could query its parent before
26207 the parent has any methods and would determine that the parent has
26208 no abstract methods (while it could have had them)).
26210 (RootContext::CreateType): Record the order in which we define the
26213 2001-10-02 Miguel de Icaza <miguel@ximian.com>
26215 * class.cs (TypeContainer::Populate): Also method definitions can
26216 fail now, keep track of this.
26218 (TypeContainer::FindMembers): Implement support for
26219 DeclaredOnly/noDeclaredOnly flag.
26221 (Constructor::Emit) Return the ConstructorBuilder.
26223 (Method::Emit) Return the MethodBuilder.
26224 Check for abstract or virtual methods to be public.
26226 * rootcontext.cs (RootContext::CreateType): Register all the
26227 abstract methods required for the class to be complete and the
26228 interface methods that must be implemented.
26230 * cs-parser.jay: Report error 501 (method requires body if it is
26231 not marked abstract or extern).
26233 * expression.cs (TypeOf::Emit): Implement.
26235 * typemanager.cs: runtime_handle_type, new global type.
26237 * class.cs (Property::Emit): Generate code for properties.
26239 2001-10-02 Ravi Pratap <ravi@ximian.com>
26241 * expression.cs (Unary::ResolveOperator): Find operators on base type
26242 too - we now conform exactly to the spec.
26244 (Binary::ResolveOperator): Same here.
26246 * class.cs (Operator::Define): Fix minor quirk in the tests.
26248 * ../errors/cs0215.cs : Added.
26250 * ../errors/cs0556.cs : Added.
26252 * ../errors/cs0555.cs : Added.
26254 2001-10-01 Miguel de Icaza <miguel@ximian.com>
26256 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
26257 single integer which is really efficient
26259 2001-10-01 Ravi Pratap <ravi@ximian.com>
26261 * expression.cs (Expression::ImplicitUserConversion): Use location
26262 even in the case when we are examining True operators.
26264 * class.cs (Operator::Define): Perform extensive checks to conform
26265 with the rules for operator overloading in the spec.
26267 * expression.cs (Expression::ImplicitReferenceConversion): Implement
26268 some of the other conversions mentioned in the spec.
26270 * typemanager.cs (array_type): New static member for the System.Array built-in
26273 (cloneable_interface): For System.ICloneable interface.
26275 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
26276 we start resolving the tree and populating types.
26278 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
26280 2001-10-01 Miguel de Icaza <miguel@ximian.com>
26282 * expression.cs (Expression::ExprClassFromMemberInfo,
26283 Expression::Literalize): Create literal expressions from
26284 FieldInfos which are literals.
26286 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
26287 type casts, because they were wrong. The test suite in tests
26290 (ImplicitNumericConversion): ushort to ulong requires a widening
26293 Int32 constant to long requires widening cast as well.
26295 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
26296 for integers because the type on the stack is not i4.
26298 2001-09-30 Miguel de Icaza <miguel@ximian.com>
26300 * expression.cs (report118): require location argument.
26302 * parameter.cs: Do not dereference potential null value.
26304 * class.cs: Catch methods that lack the `new' keyword when
26305 overriding a name. Report warnings when `new' is used without
26306 anything being there to override.
26308 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
26310 * class.cs: Only add constructor to hashtable if it is non-null
26311 (as now constructors can fail on define).
26313 (TypeManager, Class, Struct): Take location arguments.
26315 Catch field instance initialization in structs as errors.
26317 accepting_filter: a new filter for FindMembers that is static so
26318 that we dont create an instance per invocation.
26320 (Constructor::Define): Catch errors where a struct constructor is
26323 * cs-parser.jay: Pass location information for various new
26326 * delegate.cs (Delegate): take a location argument.
26328 * driver.cs: Do not call EmitCode if there were problesm in the
26329 Definition of the types, as many Builders wont be there.
26331 * decl.cs (Decl::Decl): Require a location argument.
26333 * cs-tokenizer.cs: Handle properly hex constants that can not fit
26334 into integers, and find the most appropiate integer for it.
26336 * literal.cs: Implement ULongLiteral.
26338 * rootcontext.cs: Provide better information about the location of
26339 failure when CreateType fails.
26341 2001-09-29 Miguel de Icaza <miguel@ximian.com>
26343 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
26346 * expression.cs (Binary::CheckShiftArguments): Add missing type
26348 (Binary::ResolveOperator): Add type to the logical and and logical
26349 or, Bitwise And/Or and Exclusive Or code paths, it was missing
26352 (Binary::DoNumericPromotions): In the case where either argument
26353 is ulong (and most signed types combined with ulong cause an
26354 error) perform implicit integer constant conversions as well.
26356 2001-09-28 Miguel de Icaza <miguel@ximian.com>
26358 * expression.cs (UserImplicitCast): Method should always be
26360 (Invocation::BetterConversion): Simplified test for IntLiteral.
26362 (Expression::ImplicitNumericConversion): Split this routine out.
26363 Put the code that performs implicit constant integer conversions
26366 (Expression::Resolve): Become a wrapper around DoResolve so we can
26367 check eclass and type being set after resolve.
26369 (Invocation::Badness): Remove this dead function
26371 (Binary::ResolveOperator): Do not compute the expensive argumnets
26372 unless we have a union for it.
26374 (Probe::Emit): Is needs to do an isinst and then
26375 compare against null.
26377 (::CanConvert): Added Location argument. If the Location argument
26378 is null (Location.Null), then we do not report errors. This is
26379 used by the `probe' mechanism of the Explicit conversion. We do
26380 not want to generate an error for something that the user
26381 explicitly requested to be casted. But the pipeline for an
26382 explicit cast first tests for potential implicit casts.
26384 So for now, if the Location is null, it means `Probe only' to
26385 avoid adding another argument. Might have to revise this
26388 (ClassCast): New class used to type cast objects into arbitrary
26389 classes (used in Explicit Reference Conversions).
26391 Implement `as' as well.
26393 Reverted all the patches from Ravi below: they were broken:
26395 * The use of `level' as a mechanism to stop recursive
26396 invocations is wrong. That was there just to catch the
26397 bug with a strack trace but not as a way of addressing
26400 To fix the problem we have to *understand* what is going
26401 on and the interactions and come up with a plan, not
26402 just get things going.
26404 * The use of the type conversion cache that I proposed
26405 last night had an open topic: How does this work across
26406 protection domains. A user defined conversion might not
26407 be public in the location where we are applying the
26408 conversion, a different conversion might be selected
26409 (ie, private A->B (better) but public B->A (worse),
26410 inside A, A->B applies, but outside it, B->A will
26413 * On top of that (ie, even if the above is solved),
26414 conversions in a cache need to be abstract. Ie, `To
26415 convert from an Int to a Short use an OpcodeCast', not
26416 `To convert from an Int to a Short use the OpcodeCast on
26417 the variable 5' (which is what this patch was doing).
26419 2001-09-28 Ravi Pratap <ravi@ximian.com>
26421 * expression.cs (Invocation::ConversionExists): Re-write to use
26422 the conversion cache
26424 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
26425 cache all conversions done, not just user-defined ones.
26427 (Invocation::BetterConversion): The real culprit. Use ConversionExists
26428 to determine if a conversion exists instead of acutually trying to
26429 perform the conversion. It's faster too.
26431 (Expression::ConvertExplicit): Modify to use ConversionExists to check
26432 and only then attempt the implicit conversion.
26434 2001-09-28 Ravi Pratap <ravi@ximian.com>
26436 * expression.cs (ConvertImplicit): Use a cache for conversions
26437 already found. Check level of recursion and bail out if necessary.
26439 2001-09-28 Miguel de Icaza <miguel@ximian.com>
26441 * typemanager.cs (string_concat_string_string, string_concat_object_object):
26442 Export standard methods that we expect for string operations.
26444 * statement.cs (Block::UsageWarning): Track usage of variables and
26445 report the errors for not used variables.
26447 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
26450 2001-09-27 Miguel de Icaza <miguel@ximian.com>
26452 * codegen.cs: remove unnneded code
26454 * expression.cs: Removed BuiltinTypeAccess class
26456 Fix the order in which implicit conversions are
26459 The previous fixed dropped support for boxed conversions (adding a
26460 test to the test suite now)
26462 (UserImplicitCast::CanConvert): Remove test for source being null,
26463 that code is broken. We should not feed a null to begin with, if
26464 we do, then we should track the bug where the problem originates
26465 and not try to cover it up here.
26467 Return a resolved expression of type UserImplicitCast on success
26468 rather than true/false. Ravi: this is what I was talking about,
26469 the pattern is to use a static method as a "constructor" for
26472 Also, do not create arguments until the very last minute,
26473 otherwise we always create the arguments even for lookups that
26474 will never be performed.
26476 (UserImplicitCast::Resolve): Eliminate, objects of type
26477 UserImplicitCast are born in a fully resolved state.
26479 * typemanager.cs (InitCoreTypes): Init also value_type
26480 (System.ValueType).
26482 * expression.cs (Cast::Resolve): First resolve the child expression.
26484 (LValue): Add new method AddressOf to be used by
26487 Change the argument of Store to take an EmitContext instead of an
26488 ILGenerator, because things like FieldExpr need to be able to call
26489 their children expression to generate the instance code.
26491 (Expression::Error, Expression::Warning): Sugar functions for
26494 (Expression::MemberLookup): Accept a TypeContainer instead of a
26495 Report as the first argument.
26497 (Expression::ResolvePrimary): Killed. I still want to improve
26498 this as currently the code is just not right.
26500 (Expression::ResolveMemberAccess): Simplify, but it is still
26503 (Unary::Resolve): Catch errors in AddressOf operators.
26505 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
26506 index to a byte for the short-version, or the compiler will choose
26507 the wrong Emit call, which generates the wrong data.
26509 (ParameterReference::Emit, ::Store): same.
26511 (FieldExpr::AddressOf): Implement.
26513 * typemanager.cs: TypeManager: made public variable instead of
26516 * driver.cs: document --fatal.
26518 * report.cs (ErrorMessage, WarningMessage): new names for the old
26519 Error and Warning classes.
26521 * cs-parser.jay (member_access): Turn built-in access to types
26522 into a normal simplename
26524 2001-09-27 Ravi Pratap <ravi@ximian.com>
26526 * expression.cs (Invocation::BetterConversion): Fix to cope
26527 with q being null, since this was introducing a bug.
26529 * expression.cs (ConvertImplicit): Do built-in conversions first.
26531 2001-09-27 Ravi Pratap <ravi@ximian.com>
26533 * expression.cs (UserImplicitCast::Resolve): Fix bug.
26535 2001-09-27 Ravi Pratap <ravi@ximian.com>
26537 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
26538 I had introduced long ago (what's new ?).
26540 * expression.cs (UserImplicitCast::CanConvert): Static method to do
26541 the work of all the checking.
26542 (ConvertImplicit): Call CanConvert and only then create object if necessary.
26543 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
26545 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
26546 that is the right way.
26548 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
26549 overloading resolution. Use everywhere instead of cutting and pasting code.
26551 (Binary::ResolveOperator): Use MakeUnionSet.
26553 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
26554 we have to convert to bool types. Not complete yet.
26556 2001-09-27 Miguel de Icaza <miguel@ximian.com>
26558 * typemanager.cs (TypeManager::CSharpName): support ushort.
26560 * expression.cs (Expression::TryImplicitIntConversion): Attempts
26561 to provide an expression that performsn an implicit constant int
26562 conversion (section 6.1.6).
26563 (Expression::ConvertImplicitRequired): Reworked to include
26564 implicit constant expression conversions.
26566 (Expression::ConvertNumericExplicit): Finished.
26568 (Invocation::Emit): If InstanceExpression is null, then it means
26569 that we perform a call on this.
26571 2001-09-26 Miguel de Icaza <miguel@ximian.com>
26573 * expression.cs (Unary::Emit): Remove some dead code.
26574 (Probe): Implement Resolve and Emit for `is'.
26575 (Expression::ConvertImplicitRequired): Attempt to do constant
26576 expression conversions here. Maybe should be moved to
26577 ConvertImplicit, but I am not sure.
26578 (Expression::ImplicitLongConstantConversionPossible,
26579 Expression::ImplicitIntConstantConversionPossible): New functions
26580 that tell whether is it possible to apply an implicit constant
26581 expression conversion.
26583 (ConvertNumericExplicit): Started work on explicit numeric
26586 * cs-parser.jay: Update operator constants.
26588 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
26589 (Parameters::GetSignature): Hook up VerifyArgs here.
26590 (Parameters::VerifyArgs): Verifies that no two arguments have the
26593 * class.cs (Operator): Update the operator names to reflect the
26594 ones that the spec expects (as we are just stringizing the
26597 * expression.cs (Unary::ResolveOperator): Fix bug: Use
26598 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
26599 previous usage did only work for our methods.
26600 (Expression::ConvertImplicit): Handle decimal implicit numeric
26601 conversions as well.
26602 (Expression::InternalTypeConstructor): Used to invoke constructors
26603 on internal types for default promotions.
26605 (Unary::Emit): Implement special handling for the pre/post
26606 increment/decrement for overloaded operators, as they need to have
26607 the same semantics as the other operators.
26609 (Binary::ResolveOperator): ditto.
26610 (Invocation::ConversionExists): ditto.
26611 (UserImplicitCast::Resolve): ditto.
26613 2001-09-26 Ravi Pratap <ravi@ximian.com>
26615 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
26616 operator, return after emitting body. Regression tests pass again !
26618 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
26619 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
26620 (Invocation::OverloadResolve): Ditto.
26621 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
26623 * everywhere : update calls to the above methods accordingly.
26625 2001-09-26 Miguel de Icaza <miguel@ximian.com>
26627 * assign.cs (Assign): Make it inherit from ExpressionStatement.
26629 * expression.cs (ExpressionStatement): New base class used for
26630 expressions that can appear in statements, so that we can provide
26631 an alternate path to generate expression that do not leave a value
26634 (Expression::Emit, and all the derivatives): We no longer return
26635 whether a value is left on the stack or not. Every expression
26636 after being emitted leaves a single value on the stack.
26638 * codegen.cs (EmitContext::EmitStatementExpression): Use the
26639 facilties of ExpressionStatement if possible.
26641 * cs-parser.jay: Update statement_expression.
26643 2001-09-25 Miguel de Icaza <miguel@ximian.com>
26645 * driver.cs: Change the wording of message
26647 2001-09-25 Ravi Pratap <ravi@ximian.com>
26649 * expression.cs (Binary::ResolveOperator): Had forgottten to set
26650 the type of the expression to the return type of the method if
26651 we have an overloaded operator match ! The regression tests pass again !
26652 (Unary::ResolveOperator): Ditto.
26654 * expression.cs (Invocation::ConversionExists): Correct the member lookup
26655 to find "op_Implicit", not "implicit" ;-)
26656 (UserImplicitCast): New class to take care of user-defined implicit conversions.
26657 (ConvertImplicit, ForceConversion): Take TypeContainer argument
26659 * everywhere : Correct calls to the above accordingly.
26661 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
26662 (ConvertImplicit): Do user-defined conversion if it exists.
26664 2001-09-24 Miguel de Icaza <miguel@ximian.com>
26666 * assign.cs: track location.
26667 (Resolve): Use implicit conversions on assignment.
26669 * literal.cs: Oops. Not good, Emit of short access values should
26670 pass (Bytes) or the wrong argument will be selected.
26672 * expression.cs (Unary::Emit): Emit code for -expr.
26674 (Unary::ResolveOperator): Handle `Substract' for non-constants
26675 (substract from zero from the non-constants).
26676 Deal with Doubles as well.
26678 (Expression::ConvertImplicitRequired): New routine that reports an
26679 error if no implicit conversion exists.
26681 (Invocation::OverloadResolve): Store the converted implicit
26682 expressions if we make them
26684 2001-09-24 Ravi Pratap <ravi@ximian.com>
26686 * class.cs (ConstructorInitializer): Take a Location argument.
26687 (ConstructorBaseInitializer): Same here.
26688 (ConstructorThisInitializer): Same here.
26690 * cs-parser.jay : Update all calls accordingly.
26692 * expression.cs (Unary, Binary, New): Take location argument.
26693 Update accordingly everywhere.
26695 * cs-parser.jay : Update all calls to the above to take a location
26698 * class.cs : Ditto.
26700 2001-09-24 Ravi Pratap <ravi@ximian.com>
26702 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
26703 (Invocation::BetterConversion): Same here
26704 (Invocation::ConversionExists): Ditto.
26706 (Invocation::ConversionExists): Implement.
26708 2001-09-22 Ravi Pratap <ravi@ximian.com>
26710 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
26711 Also take an additional TypeContainer argument.
26713 * All over : Pass in TypeContainer as argument to OverloadResolve.
26715 * typemanager.cs (CSharpName): Update to check for the string type and return
26718 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
26721 2001-09-21 Ravi Pratap <ravi@ximian.com>
26723 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
26724 (Invocation::BetterFunction): Implement.
26725 (Invocation::BetterConversion): Implement.
26726 (Invocation::ConversionExists): Skeleton, no implementation yet.
26728 Okay, things work fine !
26730 2001-09-21 Miguel de Icaza <miguel@ximian.com>
26732 * typemanager.cs: declare and load enum_type, delegate_type and
26735 * expression.cs (Expression::Emit): Now emit returns a value that
26736 tells whether a value is left on the stack or not. This strategy
26737 might be reveted tomorrow with a mechanism that would address
26738 multiple assignments.
26739 (Expression::report118): Utility routine to report mismatches on
26742 (Unary::Report23): Report impossible type/operator combination
26745 (Unary::IsIncrementableNumber): Whether the type can be
26746 incremented or decremented with add.
26747 (Unary::ResolveOperator): Also allow enumerations to be bitwise
26749 (Unary::ResolveOperator): Implement ++, !, ~,
26751 (Invocation::Emit): Deal with new Emit convetion.
26753 * All Expression derivatives: Updated their Emit method to return
26754 whether they leave values on the stack or not.
26756 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
26757 stack for expressions that are statements.
26759 2001-09-20 Miguel de Icaza <miguel@ximian.com>
26761 * expression.cs (LValue): New interface. Must be implemented by
26763 (LocalVariableReference, ParameterReference, FieldExpr): Implement
26766 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
26767 interface for generating code, simplifies the code.
26769 2001-09-20 Ravi Pratap <ravi@ximian.com>
26771 * expression.cs (everywhere): Comment out return statements in ::Resolve
26772 methods to avoid the warnings.
26774 2001-09-20 Miguel de Icaza <miguel@ximian.com>
26776 * driver.cs (parse): Report error 2001 if we can not open the
26779 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
26782 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
26785 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
26786 otherwise nested blocks end up with the same index.
26788 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
26790 * expression.cs: Instead of having FIXMEs in the Resolve
26791 functions, throw exceptions so it is obvious that we are facing a
26794 * cs-parser.jay (invocation_expression): Pass Location information.
26796 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
26797 Use a basename for those routines because .NET does not like paths
26800 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
26803 2001-09-19 Miguel de Icaza <miguel@ximian.com>
26805 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
26806 are loading the correct data types (throws an exception if not).
26807 (TypeManager::InitCoreTypes): Use CoreLookupType
26809 * expression.cs (Unary::ResolveOperator): return the child
26810 expression for expressions which are just +expr.
26811 (Unary::ResolveOperator): Return negative literals for -LITERAL
26812 expressions (otherwise they are Unary {Literal}).
26813 (Invocation::Badness): Take into account `Implicit constant
26814 expression conversions'.
26816 * literal.cs (LongLiteral): Implement long literal class.
26817 (IntLiteral): export the `Value' of the intliteral.
26819 2001-09-19 Ravi Pratap <ravi@ximian.com>
26821 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
26823 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
26824 instead of 'Operator'
26826 * expression.cs (Binary::ResolveOperator): Update accordingly.
26827 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
26830 * cs-parser.jay (unary_expression): Update to use the new names.
26832 * gen-treedump.cs (GetUnary): Same here.
26834 * expression.cs (Unary::Resolve): Implement.
26835 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
26836 operators are found instead of making noise ;-)
26837 (Unary::ResolveOperator): New method to do precisely the same thing which
26838 Binary::ResolveOperator does for Binary expressions.
26839 (Unary.method, .Arguments): Add.
26840 (Unary::OperName): Implement.
26841 (Unary::ForceConversion): Copy and Paste !
26843 * class.cs (Operator::Define): Fix a small bug for the case when we have
26846 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
26847 for the inbuilt operators. Only overloading works for now ;-)
26849 2001-09-18 Miguel de Icaza <miguel@ximian.com>
26851 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
26852 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
26854 * expression.cs (This::Emit): Implement.
26855 (This::Resolve): Implement.
26856 (TypeOf:Resolve): Implement.
26857 (Expression::ResolveSimpleName): Add an implicit this to instance
26859 (MemberAccess::Resolve): Deal with Parameters and Fields.
26860 Bind instance variable to Field expressions.
26861 (FieldExpr::Instance): New field used to track the expression that
26862 represents the object instance.
26863 (FieldExpr::Resolve): Track potential errors from MemberLookup not
26865 (FieldExpr::Emit): Implement.
26867 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
26868 the last instruction contains a return opcode to avoid generating
26869 the last `ret' instruction (this generates correct code, and it is
26870 nice to pass the peverify output).
26872 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
26873 initializer for static and instance variables.
26874 (Constructor::Emit): Allow initializer to be null in the case of
26875 static constructors. Only emit initializer for instance
26878 (TypeContainer::FindMembers): Return a null array if there are no
26881 Also fix the code for the MemberTypes.Method branch, as it was not
26882 scanning that for operators (or tried to access null variables before).
26884 * assign.cs (Assign::Emit): Handle instance and static fields.
26888 * driver.cs: Stop compilation if there are parse errors.
26890 * cs-parser.jay (constructor_declaration): Provide default base
26891 initializer for non-static constructors.
26892 (constructor_declarator): Do not provide a default base
26893 initializers if none was specified.
26894 Catch the fact that constructors should not have parameters.
26896 * class.cs: Do not emit parent class initializers for static
26897 constructors, that should be flagged as an error.
26899 2001-09-18 Ravi Pratap <ravi@ximian.com>
26901 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
26902 Move back code into TypeContainer::Populate.
26904 2001-09-18 Ravi Pratap <ravi@ximian.com>
26906 * class.cs (TypeContainer::AddConstructor): Fix the check to
26907 compare against Name, not Basename.
26908 (Operator::OpType): Change Plus and Minus to Add and Subtract.
26910 * cs-parser.jay : Update accordingly.
26912 * class.cs (TypeContainer::FindMembers): For the case where we are searching
26913 for methods, don't forget to look into the operators too.
26914 (RegisterMethodBuilder): Helper method to take care of this for
26915 methods, constructors and operators.
26916 (Operator::Define): Completely revamp.
26917 (Operator.OperatorMethod, MethodName): New fields.
26918 (TypeContainer::Populate): Move the registering of builders into
26919 RegisterMethodBuilder.
26920 (Operator::Emit): Re-write.
26922 * expression.cs (Binary::Emit): Comment out code path to emit method
26923 invocation stuff for the case when we have a user defined operator. I am
26924 just not able to get it right !
26926 2001-09-17 Miguel de Icaza <miguel@ximian.com>
26928 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
26931 (Expression::MemberLookup): Provide a version that allows to
26932 specify the MemberTypes and BindingFlags.
26934 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
26935 so it was not fetching variable information from outer blocks.
26937 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
26938 Beforefieldinit as it was buggy.
26940 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
26941 that Ravi put here.
26943 * class.cs (Constructor::Emit): Only emit if block is not null.
26944 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
26945 deal with this by semantically definining it as if the user had
26948 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
26949 constructors as we now "emit" them at a higher level.
26951 (TypeContainer::DefineDefaultConstructor): Used to define the
26952 default constructors if none was provided.
26954 (ConstructorInitializer): Add methods Resolve and Emit.
26956 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
26958 2001-09-17 Ravi Pratap <ravi@ximian.com>
26960 * class.cs (TypeContainer::EmitDefaultConstructor): Register
26961 the default constructor builder with our hashtable for methodbuilders
26964 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
26965 and argument_count is 0 in which case we have a match.
26966 (Binary::ResolveOperator): More null checking and miscellaneous coding
26969 2001-09-17 Ravi Pratap <ravi@ximian.com>
26971 * rootcontext.cs (IsNameSpace): Compare against null.
26973 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
26975 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
26976 and Unary::Operator.
26978 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
26981 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
26982 we have overloaded operators.
26983 (Binary::ResolveOperator): Implement the part which does the operator overload
26986 * class.cs (Operator::Emit): Implement.
26987 (TypeContainer::Emit): Emit the operators we have too.
26989 * expression.cs (Binary::Emit): Update to emit the appropriate code for
26990 the case when we have a user-defined operator.
26992 2001-09-17 Miguel de Icaza <miguel@ximian.com>
26994 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
26996 2001-09-16 Ravi Pratap <ravi@ximian.com>
26998 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
26999 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
27000 (Constructor::Emit): Implement.
27001 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
27002 if we have no work to do.
27003 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
27006 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
27007 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
27009 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
27012 2001-09-15 Ravi Pratap <ravi@ximian.com>
27014 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
27016 (Tree::RecordNamespace): Method to do what the name says ;-)
27017 (Tree::Namespaces): Property to get at the namespaces hashtable.
27019 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
27022 * rootcontext.cs (IsNamespace): Fixed it :-)
27024 2001-09-14 Miguel de Icaza <miguel@ximian.com>
27026 * class.cs (TypeContainer::FindMembers): Add support for
27028 (MethodCore): New class that encapsulates both the shared aspects
27029 of a Constructor and a Method.
27030 (Method, Constructor): Factored pieces into MethodCore.
27032 * driver.cs: Added --fatal which makes errors throw exceptions.
27033 Load System assembly as well as part of the standard library.
27035 * report.cs: Allow throwing exceptions on errors for debugging.
27037 * modifiers.cs: Do not use `parent', instead use the real type
27038 container to evaluate permission settings.
27040 * class.cs: Put Ravi's patch back in. He is right, and we will
27041 have to cope with the
27043 2001-09-14 Ravi Pratap <ravi@ximian.com>
27045 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
27046 FamORAssem, not FamANDAssem.
27048 2001-09-14 Miguel de Icaza <miguel@ximian.com>
27050 * driver.cs: Added --parse option that only parses its input files
27053 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
27054 incorrect. IsTopLevel is not used to tell whether an object is
27055 root_types or not (that can be achieved by testing this ==
27056 root_types). But to see if this is a top-level *class* (not
27057 necessarly our "toplevel" container).
27059 2001-09-14 Ravi Pratap <ravi@ximian.com>
27061 * enum.cs (Enum::Define): Modify to call the Lookup method on the
27062 parent instead of a direct call to GetType.
27064 2001-09-14 Ravi Pratap <ravi@ximian.com>
27066 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
27067 Modifiers.TypeAttr. This should just be a call to that method.
27069 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
27070 object so that we can determine if we are top-level or not.
27072 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
27075 * enum.cs (Enum::Define): Ditto.
27077 * modifiers.cs (FieldAttr): Re-write.
27079 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
27080 (TypeContainer::HaveStaticConstructor): New property to provide access
27081 to precisely that info.
27083 * modifiers.cs (MethodAttr): Re-write.
27084 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
27086 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
27087 of top-level types as claimed.
27089 2001-09-13 Miguel de Icaza <miguel@ximian.com>
27091 * expression.cs (MemberLookup): Fruitless attempt to lookup
27092 constructors. Maybe I need to emit default constructors? That
27093 might be it (currently .NET emits this for me automatically).
27094 (Invocation::OverloadResolve): Cope with Arguments == null.
27095 (Invocation::EmitArguments): new function, shared by the new
27096 constructor and us.
27097 (Invocation::Emit): Handle static and instance methods. Emit
27098 proper call instruction for virtual or non-virtual invocations.
27099 (New::Emit): Implement.
27100 (New::Resolve): Implement.
27101 (MemberAccess:Resolve): Implement.
27102 (MethodGroupExpr::InstanceExpression): used conforming to the spec
27103 to track instances.
27104 (FieldExpr::Resolve): Set type.
27106 * support.cs: Handle empty arguments.
27108 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
27109 SimpleLookup): Auxiliary routines to help parse a qualifier
27112 Update qualifier_identifier rule.
27114 * codegen.cs: Removed debugging messages.
27116 * class.cs: Make this a global thing, this acts just as a "key" to
27117 objects that we might have around.
27119 (Populate): Only initialize method_builders_to_methods once.
27121 * expression.cs (PropertyExpr): Initialize type from the
27124 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
27125 Resolve pattern. Attempt to implicitly convert value to boolean.
27128 * expression.cs: Set the type for the int32/int32 argument case.
27129 (Binary::ResolveOperator): Set the return type to boolean for
27130 comparission operators
27132 * typemanager.cs: Remove debugging print code.
27134 (Invocation::Resolve): resolve type.
27136 * class.cs: Allocate a MemberInfo of the correct size, as the code
27137 elsewhere depends on the test to reflect the correct contents.
27139 (Method::) Keep track of parameters, due to System.Reflection holes
27141 (TypeContainer::Populate): Keep track of MethodBuilders to Method
27144 (TypeContainer::FindMembers): Use ArrayList and then copy an array
27145 of the exact size and return that.
27147 (Class::LookupMethodByBuilder): New function that maps
27148 MethodBuilders to its methods. Required to locate the information
27149 on methods because System.Reflection bit us again.
27151 * support.cs: New file, contains an interface ParameterData and
27152 two implementations: ReflectionParameters and InternalParameters
27153 used to access Parameter information. We will need to grow this
27156 * expression.cs (Invocation::GetParameterData): implement a cache
27157 and a wrapper around the ParameterData creation for methods.
27158 (Invocation::OverloadResolve): Use new code.
27160 2001-09-13 Ravi Pratap <ravi@ximian.com>
27162 * class.cs (TypeContainer::EmitField): Remove and move into
27163 (Field::Define): here and modify accordingly.
27164 (Field.FieldBuilder): New member.
27165 (TypeContainer::Populate): Update accordingly.
27166 (TypeContainer::FindMembers): Implement.
27168 2001-09-13 Miguel de Icaza <miguel@ximian.com>
27170 * statement.cs: (VariableInfo::VariableType): New field to be
27171 initialized with the full type once it is resolved.
27173 2001-09-12 Miguel de Icaza <miguel@ximian.com>
27175 * parameter.cs (GetParameterInfo): Use a type cache to compute
27176 things only once, and to reuse this information
27178 * expression.cs (LocalVariableReference::Emit): Implement.
27179 (OpcodeCast::Emit): fix.
27181 (ParameterReference::Resolve): Implement.
27182 (ParameterReference::Emit): Implement.
27184 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
27185 that are expressions need to stay as Expressions.
27187 * typemanager.cs (CSharpName): Returns the C# name of a type if
27190 * expression.cs (Expression::ConvertImplicit): New function that
27191 implements implicit type conversions.
27193 (Expression::ImplicitReferenceConversion): Implements implicit
27194 reference conversions.
27196 (EmptyCast): New type for transparent casts.
27198 (OpcodeCast): New type for casts of types that are performed with
27199 a sequence of bytecodes.
27201 (BoxedCast): New type used for casting value types into reference
27202 types. Emits a box opcode.
27204 (Binary::DoNumericPromotions): Implements numeric promotions of
27205 and computation of the Binary::Type.
27207 (Binary::EmitBranchable): Optimization.
27209 (Binary::Emit): Implement code emission for expressions.
27211 * typemanager.cs (TypeManager): Added two new core types: sbyte
27214 2001-09-12 Ravi Pratap <ravi@ximian.com>
27216 * class.cs (TypeContainer::FindMembers): Method which does exactly
27217 what Type.FindMembers does, only we don't have to use reflection. No
27218 implementation yet.
27220 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
27221 typecontainer objects as we need to get at them.
27222 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
27224 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
27225 typecontainer object.
27227 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
27228 of just a Report object.
27230 2001-09-11 Ravi Pratap <ravi@ximian.com>
27232 * class.cs (Event::Define): Go back to using the prefixes "add_" and
27234 (TypeContainer::Populate): Now define the delegates of the type too.
27235 (TypeContainer.Delegates): Property to access the list of delegates defined
27238 * delegates.cs (Delegate::Define): Implement partially.
27240 * modifiers.cs (TypeAttr): Handle more flags.
27242 2001-09-11 Ravi Pratap <ravi@ximian.com>
27244 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
27246 (Operator::Define): Re-write logic to get types by using the LookupType method
27247 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
27248 (Indexer::Define): Ditto.
27249 (Event::Define): Ditto.
27250 (Property::Define): Ditto.
27252 2001-09-10 Ravi Pratap <ravi@ximian.com>
27254 * class.cs (TypeContainer::Populate): Now define operators too.
27255 (TypeContainer.Operators): New property to access the list of operators
27257 (Operator.OperatorMethodBuilder): New member to hold the method builder
27258 for the operator we are defining.
27259 (Operator::Define): Implement.
27261 2001-09-10 Ravi Pratap <ravi@ximian.com>
27263 * class.cs (Event::Define): Make the prefixes of the accessor methods
27264 addOn_ and removeOn_
27266 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
27267 of the location being passed in too. Ideally, this should go later since all
27268 error reporting should be done through the Report object.
27270 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
27271 (Populate): Iterate thru the indexers we have and define them too.
27272 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
27273 for the get and set accessors.
27274 (Indexer::Define): Implement.
27276 2001-09-09 Miguel de Icaza <miguel@ximian.com>
27278 * expression.cs (Binary::Resolve): Beginning of it. I scratched
27279 my previous implementation, did not work.
27281 * typemanager.cs: Add a couple of missing types (the longs).
27283 * literal.cs: Use TypeManager.bool_type instead of getting it.
27285 * expression.cs (EventExpr): New kind of expressions.
27286 (Expressio::ExprClassFromMemberInfo): finish
27288 2001-09-08 Miguel de Icaza <miguel@ximian.com>
27290 * assign.cs: Emit stores to static fields differently.
27292 2001-09-08 Ravi Pratap <ravi@ximian.com>
27294 * Merge in changes and adjust code to tackle conflicts. Backed out my
27295 code in Assign::Resolve ;-)
27297 2001-09-08 Ravi Pratap <ravi@ximian.com>
27299 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
27300 instead Report.Error and also pass in the location.
27301 (CSharpParser::Lexer): New readonly property to return the reference
27302 to the Tokenizer object.
27303 (declare_local_variables): Use Report.Error with location instead of plain
27307 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
27308 (Operator.CheckBinaryOperator): Ditto.
27310 * cs-parser.jay (operator_declarator): Update accordingly.
27312 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
27313 (CheckBinaryOperator): Same here.
27315 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
27316 on the name without any prefixes of namespace names etc. This is because we
27317 already might have something already fully qualified like
27318 'System.Console.WriteLine'
27320 * assign.cs (Resolve): Begin implementation. Stuck ;-)
27322 2001-09-07 Ravi Pratap <ravi@ximian.com>
27324 * cs-tokenizer.cs (location): Return a string which also contains
27327 * expression.cs (ElementAccess): New class for expressions of the
27328 type 'element access.'
27329 (BaseAccess): New class for expressions of the type 'base access.'
27330 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
27333 * cs-parser.jay (element_access): Implement action.
27334 (base_access): Implement actions.
27335 (checked_expression, unchecked_expression): Implement.
27337 * cs-parser.jay (local_variable_type): Correct and implement.
27338 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
27340 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
27342 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
27343 name and the specifiers.
27345 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
27347 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
27348 making them all public ;-)
27350 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
27353 2001-09-07 Miguel de Icaza <miguel@ximian.com>
27355 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
27357 (FieldExpr, PropertyExprs): New resolved expressions.
27358 (SimpleName::MemberStaticCheck): Perform static checks for access
27359 to non-static fields on static methods. Maybe this should be
27360 generalized for MemberAccesses.
27361 (SimpleName::ResolveSimpleName): More work on simple name
27364 * cs-parser.jay (primary_expression/qualified_identifier): track
27365 the parameter index.
27367 * codegen.cs (CodeGen::Save): Catch save exception, report error.
27368 (EmitContext::EmitBoolExpression): Chain to expression generation
27369 instead of temporary hack.
27370 (::EmitStatementExpression): Put generic expression code generation.
27372 * assign.cs (Assign::Emit): Implement variable assignments to
27373 local variables, parameters and fields.
27375 2001-09-06 Miguel de Icaza <miguel@ximian.com>
27377 * statement.cs (Block::GetVariableInfo): New method, returns the
27378 VariableInfo for a variable name in a block.
27379 (Block::GetVariableType): Implement in terms of GetVariableInfo
27381 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
27382 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
27384 2001-09-06 Ravi Pratap <ravi@ximian.com>
27386 * cs-parser.jay (operator_declaration): Continue on my quest : update
27387 to take attributes argument.
27388 (event_declaration): Ditto.
27389 (enum_declaration): Ditto.
27390 (indexer_declaration): Ditto.
27392 * class.cs (Operator::Operator): Update constructor accordingly.
27393 (Event::Event): Ditto.
27395 * delegate.cs (Delegate::Delegate): Same here.
27397 * enum.cs (Enum::Enum): Same here.
27399 2001-09-05 Ravi Pratap <ravi@ximian.com>
27401 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
27403 * ../tests/cs0658.cs : New file to demonstrate error 0658.
27405 * attribute.cs (Attributes): New class to encapsulate all attributes which were
27406 being passed around as an arraylist.
27407 (Attributes::AddAttribute): Method to add attribute sections.
27409 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
27410 (struct_declaration): Update accordingly.
27411 (constant_declaration): Update.
27412 (field_declaration): Update.
27413 (method_header): Update.
27414 (fixed_parameter): Update.
27415 (parameter_array): Ditto.
27416 (property_declaration): Ditto.
27417 (destructor_declaration): Ditto.
27419 * class.cs (Struct::Struct): Update constructors accordingly.
27420 (Class::Class): Ditto.
27421 (Field::Field): Ditto.
27422 (Method::Method): Ditto.
27423 (Property::Property): Ditto.
27424 (TypeContainer::OptAttribute): update property's return type.
27426 * interface.cs (Interface.opt_attributes): New member.
27427 (Interface::Interface): Update to take the extra Attributes argument.
27429 * parameter.cs (Parameter::Parameter): Ditto.
27431 * constant.cs (Constant::Constant): Ditto.
27433 * interface.cs (InterfaceMemberBase): New OptAttributes field.
27434 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
27435 the attributes as a parameter.
27436 (InterfaceProperty): Update constructor call.
27437 (InterfaceEvent): Ditto.
27438 (InterfaceMethod): Ditto.
27439 (InterfaceIndexer): Ditto.
27441 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
27442 pass the attributes too.
27443 (interface_event_declaration): Ditto.
27444 (interface_property_declaration): Ditto.
27445 (interface_method_declaration): Ditto.
27446 (interface_declaration): Ditto.
27448 2001-09-05 Miguel de Icaza <miguel@ximian.com>
27450 * class.cs (Method::Define): Track the "static Main" definition to
27451 create an entry point.
27453 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
27454 EntryPoint if we find it.
27456 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
27457 (EmitContext::ig): Make this variable public.
27459 * driver.cs: Make the default output file be the first file name
27460 with the .exe extension.
27462 Detect empty compilations
27464 Handle various kinds of output targets. Handle --target and
27465 rename -t to --dumper.
27467 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
27468 methods inherited from Expression return now an Expression. This
27469 will is used during the tree rewriting as we resolve them during
27472 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
27473 the spec. Missing entirely is the information about
27474 accessability of elements of it.
27476 (Expression::ExprClassFromMemberInfo): New constructor for
27477 Expressions that creates a fully initialized Expression based on
27478 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
27481 (Invocation::Resolve): Begin implementing resolution of invocations.
27483 * literal.cs (StringLiteral): Implement Emit.
27485 2001-09-05 Ravi Pratap <ravi@ximian.com>
27487 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
27490 2001-09-04 Ravi Pratap <ravi@ximian.com>
27492 * cs-parser.jay (attribute_arguments): Implement actions.
27493 (attribute): Fix bug in production. Implement action.
27494 (attribute_list): Implement.
27495 (attribute_target): Implement.
27496 (attribute_target_specifier, opt_target_specifier): Implement
27497 (CheckAttributeTarget): New method to check if the attribute target
27499 (attribute_section): Implement.
27500 (opt_attributes): Implement.
27502 * attribute.cs : New file to handle attributes.
27503 (Attribute): Class to hold attribute info.
27505 * cs-parser.jay (opt_attribute_target_specifier): Remove production
27506 (attribute_section): Modify production to use 2 different rules to
27507 achieve the same thing. 1 s/r conflict down !
27508 Clean out commented, useless, non-reducing dimension_separator rules.
27510 * class.cs (TypeContainer.attributes): New member to hold list
27511 of attributes for a type.
27512 (Struct::Struct): Modify to take one more argument, the attribute list.
27513 (Class::Class): Ditto.
27514 (Field::Field): Ditto.
27515 (Method::Method): Ditto.
27516 (Property::Property): Ditto.
27518 * cs-parser.jay (struct_declaration): Update constructor call to
27519 pass in the attributes too.
27520 (class_declaration): Ditto.
27521 (constant_declaration): Ditto.
27522 (field_declaration): Ditto.
27523 (method_header): Ditto.
27524 (fixed_parameter): Ditto.
27525 (parameter_array): Ditto.
27526 (property_declaration): Ditto.
27528 * constant.cs (Constant::Constant): Update constructor similarly.
27529 Use System.Collections.
27531 * parameter.cs (Parameter::Parameter): Update as above.
27533 2001-09-02 Ravi Pratap <ravi@ximian.com>
27535 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
27536 (TypeContainer.delegates): New member to hold list of delegates.
27538 * cs-parser.jay (delegate_declaration): Implement the action correctly
27539 this time as I seem to be on crack ;-)
27541 2001-09-02 Miguel de Icaza <miguel@ximian.com>
27543 * rootcontext.cs (RootContext::IsNamespace): new function, used to
27544 tell whether an identifier represents a namespace.
27546 * expression.cs (NamespaceExpr): A namespace expression, used only
27547 temporarly during expression resolution.
27548 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
27549 utility functions to resolve names on expressions.
27551 2001-09-01 Miguel de Icaza <miguel@ximian.com>
27553 * codegen.cs: Add hook for StatementExpressions.
27555 * class.cs: Fix inverted test for static flag in methods.
27557 2001-09-02 Ravi Pratap <ravi@ximian.com>
27559 * class.cs (Operator::CheckUnaryOperator): Correct error number used
27560 to make it coincide with MS' number.
27561 (Operator::CheckBinaryOperator): Ditto.
27563 * ../errors/errors.txt : Remove error numbers added earlier.
27565 * ../errors/cs1019.cs : Test case for error # 1019
27567 * ../errros/cs1020.cs : Test case for error # 1020
27569 * cs-parser.jay : Clean out commented cruft.
27570 (dimension_separators, dimension_separator): Comment out. Ostensibly not
27571 used anywhere - non-reducing rule.
27572 (namespace_declarations): Non-reducing rule - comment out.
27574 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
27575 with TypeContainer::AddEnum.
27577 * delegate.cs : New file for delegate handling classes.
27578 (Delegate): Class for declaring delegates.
27580 * makefile : Update.
27582 * cs-parser.jay (delegate_declaration): Implement.
27584 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
27586 * class.cs (Event::Define): Implement.
27587 (Event.EventBuilder): New member.
27589 * class.cs (TypeContainer::Populate): Update to define all enums and events
27591 (Events): New property for the events arraylist we hold. Shouldn't we move to using
27592 readonly fields for all these cases ?
27594 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
27596 * class.cs (Property): Revamp to use the convention of making fields readonly.
27597 Accordingly modify code elsewhere.
27599 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
27600 the Define method of the Property class.
27602 * class.cs : Clean up applied patch and update references to variables etc. Fix
27604 (TypeContainer::Populate): Update to define all the properties we have. Also
27605 define all enumerations.
27607 * enum.cs (Define): Implement.
27609 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
27611 * cs-parser.jay (overloadable_operator): The semantic value is an
27612 enum of the Operator class.
27613 (operator_declarator): Implement actions.
27614 (operator_declaration): Implement.
27616 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
27617 validity of definitions.
27618 (Operator::CheckBinaryOperator): Static method to check for binary operators
27619 (TypeContainer::AddOperator): New method to add an operator to a type.
27621 * cs-parser.jay (indexer_declaration): Added line to actually call the
27622 AddIndexer method so it gets added ;-)
27624 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
27625 already taken care of by the MS compiler ?
27627 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
27629 * class.cs (Operator): New class for operator declarations.
27630 (Operator::OpType): Enum for the various operators.
27632 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
27634 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
27635 ostensibly handle this in semantic analysis.
27637 * cs-parser.jay (general_catch_clause): Comment out
27638 (specific_catch_clauses, specific_catch_clause): Ditto.
27639 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
27640 (catch_args, opt_catch_args): New productions.
27641 (catch_clause): Rewrite to use the new productions above
27642 (catch_clauses): Modify accordingly.
27643 (opt_catch_clauses): New production to use in try_statement
27644 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
27645 and re-write the code in the actions to extract the specific and
27646 general catch clauses by being a little smart ;-)
27648 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
27649 Hooray, try and catch statements parse fine !
27651 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27653 * statement.cs (Block::GetVariableType): Fix logic to extract the type
27654 string from the hashtable of variables.
27656 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
27657 I end up making that mistake ;-)
27658 (catch_clauses): Fixed gross error which made Key and Value of the
27659 DictionaryEntry the same : $1 !!
27661 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27663 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
27665 * cs-parser.jay (event_declaration): Correct to remove the semicolon
27666 when the add and remove accessors are specified.
27668 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27670 * cs-parser.jay (IndexerDeclaration): New helper class to hold
27671 information about indexer_declarator.
27672 (indexer_declarator): Implement actions.
27673 (parsing_indexer): New local boolean used to keep track of whether
27674 we are parsing indexers or properties. This is necessary because
27675 implicit_parameters come into picture even for the get accessor in the
27676 case of an indexer.
27677 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
27679 * class.cs (Indexer): New class for indexer declarations.
27680 (TypeContainer::AddIndexer): New method to add an indexer to a type.
27681 (TypeContainer::indexers): New member to hold list of indexers for the
27684 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
27686 * cs-parser.jay (add_accessor_declaration): Implement action.
27687 (remove_accessor_declaration): Implement action.
27688 (event_accessors_declaration): Implement
27689 (variable_declarators): swap statements for first rule - trivial.
27691 * class.cs (Event): New class to hold information about event
27693 (TypeContainer::AddEvent): New method to add an event to a type
27694 (TypeContainer::events): New member to hold list of events.
27696 * cs-parser.jay (event_declaration): Implement actions.
27698 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
27700 * cs-parser.jay (dim_separators): Implement. Make it a string
27701 concatenating all the commas together, just as they appear.
27702 (opt_dim_separators): Modify accordingly
27703 (rank_specifiers): Update accordingly. Basically do the same
27704 thing - instead, collect the brackets here.
27705 (opt_rank_sepcifiers): Modify accordingly.
27706 (array_type): Modify to actually return the complete type string
27707 instead of ignoring the rank_specifiers.
27708 (expression_list): Implement to collect the expressions
27709 (variable_initializer): Implement. We make it a list of expressions
27710 essentially so that we can handle the array_initializer case neatly too.
27711 (variable_initializer_list): Implement.
27712 (array_initializer): Make it a list of variable_initializers
27713 (opt_array_initializer): Modify accordingly.
27715 * expression.cs (New::NType): Add enumeration to help us
27716 keep track of whether we have an object/delegate creation
27717 or an array creation.
27718 (New:NewType, New::Rank, New::Indices, New::Initializers): New
27719 members to hold data about array creation.
27720 (New:New): Modify to update NewType
27721 (New:New): New Overloaded contructor for the array creation
27724 * cs-parser.jay (array_creation_expression): Implement to call
27725 the overloaded New constructor.
27727 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
27729 * class.cs (TypeContainer::Constructors): Return member
27730 constructors instead of returning null.
27732 2001-08-26 Miguel de Icaza <miguel@ximian.com>
27734 * typemanager.cs (InitCoreTypes): Initialize the various core
27735 types after we have populated the type manager with the user
27736 defined types (this distinction will be important later while
27737 compiling corlib.dll)
27739 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
27740 on Expression Classification. Now all expressions have a method
27741 `Resolve' and a method `Emit'.
27743 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
27744 generation from working. Also add some temporary debugging
27747 2001-08-24 Miguel de Icaza <miguel@ximian.com>
27749 * codegen.cs: Lots of code generation pieces. This is only the
27750 beginning, will continue tomorrow with more touches of polish. We
27751 handle the fundamentals of if, while, do, for, return. Others are
27752 trickier and I need to start working on invocations soon.
27754 * gen-treedump.cs: Bug fix, use s.Increment here instead of
27757 * codegen.cs (EmitContext): New struct, used during code
27758 emission to keep a context. Most of the code generation will be
27761 * cs-parser.jay: Add embedded blocks to the list of statements of
27762 this block. So code generation proceeds in a top down fashion.
27764 2001-08-23 Miguel de Icaza <miguel@ximian.com>
27766 * statement.cs: Add support for multiple child blocks.
27768 2001-08-22 Miguel de Icaza <miguel@ximian.com>
27770 * codegen.cs (EmitCode): New function, will emit the code for a
27771 Block of code given a TypeContainer and its ILGenerator.
27773 * statement.cs (Block): Standard public readonly optimization.
27774 (Block::Block constructors): Link children.
27775 (Block::Child): Child Linker.
27776 (Block::EmitVariables): Emits IL variable declarations.
27778 * class.cs: Drop support for MethodGroups here, delay until
27780 (Method::): Applied the same simplification that I did before, and
27781 move from Properties to public readonly fields.
27782 (Method::ParameterTypes): Returns the parameter types for the
27783 function, and implements a cache that will be useful later when I
27784 do error checking and the semantic analysis on the methods is
27786 (Constructor::GetCallingConvention): Renamed from CallingConvetion
27787 and made a method, optional argument tells whether this is a class
27788 or a structure to apply the `has-this' bit.
27789 (Method::GetCallingConvention): Implement, returns the calling
27791 (Method::Define): Defines the type, a second pass is performed
27792 later to populate the methods.
27794 (Constructor::ParameterTypes): implement a cache similar to the
27795 one on Method::ParameterTypes, useful later when we do semantic
27798 (TypeContainer::EmitMethod): New method. Emits methods.
27800 * expression.cs: Removed MethodGroup class from here.
27802 * parameter.cs (Parameters::GetCallingConvention): new method.
27804 2001-08-21 Miguel de Icaza <miguel@ximian.com>
27806 * class.cs (TypeContainer::Populate): Drop RootContext from the
27809 (Constructor::CallingConvention): Returns the calling convention.
27810 (Constructor::ParameterTypes): Returns the constructor parameter
27813 (TypeContainer::AddConstructor): Keep track of default constructor
27814 and the default static constructor.
27816 (Constructor::) Another class that starts using `public readonly'
27817 instead of properties.
27819 (Constructor::IsDefault): Whether this is a default constructor.
27821 (Field::) use readonly public fields instead of properties also.
27823 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
27824 track of static constructors; If none is used, turn on
27825 BeforeFieldInit in the TypeAttributes.
27827 * cs-parser.jay (opt_argument_list): now the return can be null
27828 for the cases where there are no arguments.
27830 (constructor_declarator): If there is no implicit `base' or
27831 `this', then invoke the default parent constructor.
27833 * modifiers.cs (MethodAttr): New static function maps a set of
27834 modifiers flags into a MethodAttributes enum
27835 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
27836 MethodAttr, TypeAttr to represent the various mappings where the
27837 modifiers are used.
27838 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
27840 2001-08-19 Miguel de Icaza <miguel@ximian.com>
27842 * parameter.cs (GetParameterInfo): Fix bug where there would be no
27845 * interface.cs (PopulateIndexer): Implemented the code generator
27846 for interface indexers.
27848 2001-08-17 Miguel de Icaza <miguel@ximian.com>
27850 * interface.cs (InterfaceMemberBase): Now we track the new status
27853 (PopulateProperty): Implement property population. Woohoo! Got
27854 Methods and Properties going today.
27856 Removed all the properties for interfaces, and replaced them with
27857 `public readonly' fields.
27859 2001-08-16 Miguel de Icaza <miguel@ximian.com>
27861 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
27862 initialize their hashtables/arraylists only when they are needed
27863 instead of doing this always.
27865 * parameter.cs: Handle refs and out parameters.
27867 * cs-parser.jay: Use an ArrayList to construct the arguments
27868 instead of the ParameterCollection, and then cast that to a
27871 * parameter.cs: Drop the use of ParameterCollection and use
27872 instead arrays of Parameters.
27874 (GetParameterInfo): Use the Type, not the Name when resolving
27877 2001-08-13 Miguel de Icaza <miguel@ximian.com>
27879 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
27880 and instead use public readonly fields.
27882 * class.cs: Put back walking code for type containers.
27884 2001-08-11 Miguel de Icaza <miguel@ximian.com>
27886 * class.cs (MakeConstant): Code to define constants.
27888 * rootcontext.cs (LookupType): New function. Used to locate types
27891 2001-08-08 Miguel de Icaza <miguel@ximian.com>
27893 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
27894 this System.Reflection code is. Kudos to Microsoft
27896 * typemanager.cs: Implement a type cache and avoid loading all
27897 types at boot time. Wrap in LookupType the internals. This made
27898 the compiler so much faster. Wow. I rule!
27900 * driver.cs: Make sure we always load mscorlib first (for
27901 debugging purposes, nothing really important).
27903 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
27904 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
27906 * rootcontext.cs: Lookup types on their namespace; Lookup types
27907 on namespaces that have been imported using the `using' keyword.
27909 * class.cs (TypeContainer::TypeAttr): Virtualize.
27910 (Class::TypeAttr): Return attributes suitable for this bad boy.
27911 (Struct::TypeAttr): ditto.
27912 Handle nested classes.
27913 (TypeContainer::) Remove all the type visiting code, it is now
27914 replaced with the rootcontext.cs code
27916 * rootcontext.cs (GetClassBases): Added support for structs.
27918 2001-08-06 Miguel de Icaza <miguel@ximian.com>
27920 * interface.cs, statement.cs, class.cs, parameter.cs,
27921 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
27922 Drop use of TypeRefs, and use strings instead.
27924 2001-08-04 Miguel de Icaza <miguel@ximian.com>
27928 * class.cs (Struct::Struct): set the SEALED flags after
27929 checking the modifiers.
27930 (TypeContainer::TypeAttr): new property, returns the
27931 TypeAttributes for a class.
27933 * cs-parser.jay (type_list): Oops, list production was creating a
27934 new list of base types.
27936 * rootcontext.cs (StdLib): New property.
27937 (GetInterfaceTypeByName): returns an interface by type name, and
27938 encapsulates error handling here.
27939 (GetInterfaces): simplified.
27940 (ResolveTree): Encapsulated all the tree resolution here.
27941 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
27944 * driver.cs: Add support for --nostdlib, to avoid loading the
27945 default assemblies.
27946 (Main): Do not put tree resolution here.
27948 * rootcontext.cs: Beginning of the class resolution.
27950 2001-08-03 Miguel de Icaza <miguel@ximian.com>
27952 * rootcontext.cs: Provide better error reporting.
27954 * cs-parser.jay (interface_base): set our $$ to be interfaces.
27956 * rootcontext.cs (CreateInterface): Handle the case where there
27957 are no parent interfaces.
27959 (CloseTypes): Routine to flush types at the end.
27960 (CreateInterface): Track types.
27961 (GetInterfaces): Returns an array of Types from the list of
27962 defined interfaces.
27964 * typemanager.c (AddUserType): Mechanism to track user types (puts
27965 the type on the global type hash, and allows us to close it at the
27968 2001-08-02 Miguel de Icaza <miguel@ximian.com>
27970 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
27971 RecordInterface instead.
27973 * cs-parser.jay: Updated to reflect changes above.
27975 * decl.cs (Definition): Keep track of the TypeBuilder type that
27976 represents this type here. Not sure we will use it in the long
27977 run, but wont hurt for now.
27979 * driver.cs: Smaller changes to accomodate the new code.
27981 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
27984 * rootcontext.cs (CreateInterface): New method, used to create
27985 the System.TypeBuilder type for interfaces.
27986 (ResolveInterfaces): new entry point to resolve the interface
27988 (CodeGen): Property, used to keep track of the code generator.
27990 2001-07-26 Miguel de Icaza <miguel@ximian.com>
27992 * cs-parser.jay: Add a second production for delegate_declaration
27995 (enum_body): Put an opt_comma here instead of putting it on
27996 enum_body or enum_member_declarations so we can handle trailing
27997 commas on enumeration members. Gets rid of a shift/reduce.
27999 (type_list): Need a COMMA in the middle.
28001 (indexer_declaration): Tell tokenizer to recognize get/set
28003 * Remove old targets.
28005 * Re-add the parser target.
28007 2001-07-13 Simon Cozens <simon@simon-cozens.org>
28009 * cs-parser.jay: Add precendence rules for a number of operators
28010 ot reduce the number of shift/reduce conflicts in the grammar.
28012 2001-07-17 Miguel de Icaza <miguel@ximian.com>
28014 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
28017 Get rid of old crufty code.
28019 * rootcontext.cs: Use this to keep track of the parsed
28020 representation and the defined types available to the program.
28022 * gen-treedump.cs: adjust for new convention.
28024 * type.cs: Split out the type manager, and the assembly builder
28027 * typemanager.cs: the type manager will live here now.
28029 * cil-codegen.cs: And the code generator here.
28031 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
28033 * makefile: Fixed up for easy making.
28035 2001-07-13 Simon Cozens <simon@simon-cozens.org>
28037 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
28040 (unary_expression): Expand pre_increment_expression and
28041 post_decrement_expression to reduce a shift/reduce.
28043 2001-07-11 Simon Cozens
28045 * cs-tokenizer.cs: Hex numbers should begin with a 0.
28047 Improve allow_keyword_as_indent name.
28049 2001-06-19 Miguel de Icaza <miguel@ximian.com>
28051 * Adjustments for Beta2.
28053 2001-06-13 Miguel de Icaza <miguel@ximian.com>
28055 * decl.cs: Added `Define' abstract method.
28056 (InTransit): new property, used to catch recursive definitions.
28058 * interface.cs: Implement `Define'.
28060 * modifiers.cs: Map Modifiers.constants to
28061 System.Reflection.TypeAttribute flags.
28063 * class.cs: Keep track of types and user-defined types.
28064 (BuilderInit): New method for creating an assembly
28065 (ResolveType): New function to launch the resolution process, only
28066 used by interfaces for now.
28068 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
28069 that are inserted into the name space.
28071 2001-06-08 Miguel de Icaza <miguel@ximian.com>
28073 * ARGH. I have screwed up my tree so many times due to the use of
28074 rsync rather than using CVS. Going to fix this at once.
28076 * driver.cs: Objetify driver. Load assemblies, use assemblies to
28079 2001-06-07 Miguel de Icaza <miguel@ximian.com>
28081 * Experiment successful: Use System.Type rather that our own
28084 2001-05-25 Miguel de Icaza <miguel@ximian.com>
28086 * cs-parser.jay: Removed nsAliases from here.
28088 Use new namespaces, handle `using XXX;'
28090 * namespace.cs: Reimplemented namespace handling, use a recursive
28091 definition of the class. Now we can keep track of using clauses
28092 and catch invalid using clauses.
28094 2001-05-24 Miguel de Icaza <miguel@ximian.com>
28096 * gen-treedump.cs: Adapted for all the renaming.
28098 * expression.cs (Expression): this class now has a Type property
28099 which returns an expression Type.
28101 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
28102 `Type', as this has a different meaning now in the base
28104 2001-05-22 Miguel de Icaza <miguel@ximian.com>
28106 * interface.cs, class.cs: Removed from all the sources the
28107 references to signature computation, as we can not do method
28108 signature computation during the parsing time, as we are not
28109 trying to solve at that point distinguishing:
28113 void a (NS.Blah x) {}
28116 Which depending on the context might be valid or not, as we do not
28117 know if Blah is the same thing as NS.Blah at that point.
28119 * Redid everything so the code uses TypeRefs now instead of
28120 Types. TypeRefs are just temporary type placeholders, that need
28121 to be resolved. They initially have a pointer to a string and the
28122 current scope in which they are used. This is used later by the
28123 compiler to resolve the reference to an actual Type.
28125 * DeclSpace is no longer a CIR.Type, and neither are
28126 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
28127 are all DeclSpaces, but no Types.
28129 * type.cs (TypeRefManager): This implements the TypeRef manager,
28130 which keeps track of all the types that need to be resolved after
28131 the parsing has finished.
28133 2001-05-13 Miguel de Icaza <miguel@ximian.com>
28135 * ARGH. We are going to have to store `foreach' as a class rather
28136 than resolving it, as we need to verify error 1579 after name
28137 resolution. *OR* we could keep a flag that says `This request to
28138 IEnumerator comes from a foreach statement' which we can then use
28139 to generate the error.
28141 2001-05-10 Miguel de Icaza <miguel@ximian.com>
28143 * class.cs (TypeContainer.AddMethod): we now add methods to the
28144 MethodGroup instead of the method hashtable.
28146 * expression.cs: Add MethodGroup abstraction, which gets us one
28147 step closer to the specification in the way we handle method
28150 * cs-parser.jay (primary_expression): qualified_identifier now
28151 tried to match up an identifier to a local variable reference or
28152 to a parameter reference.
28154 current_local_parameters is now a parser global variable that
28155 points to the current parameters for the block, used during name
28158 (property_declaration): Now creates an implicit `value' argument to
28161 2001-05-09 Miguel de Icaza <miguel@ximian.com>
28163 * parameter.cs: Do not use `param' arguments as part of the
28164 signature, per the spec.
28166 2001-05-08 Miguel de Icaza <miguel@ximian.com>
28168 * decl.cs: Base class for classes, structs and interfaces. This
28169 is the "Declaration Space"
28171 * cs-parser.jay: Use CheckDef for checking declaration errors
28172 instead of having one on each function.
28174 * class.cs: Factor out some code for handling error handling in
28175 accordance to the "Declarations" section in the "Basic Concepts"
28176 chapter in the ECMA C# spec.
28178 * interface.cs: Make all interface member classes derive from
28179 InterfaceMemberBase.
28181 2001-05-07 Miguel de Icaza <miguel@ximian.com>
28183 * Many things: all interfaces are parsed and generated in
28184 gen-treedump. Support for member variables, constructors,
28185 destructors, properties, constants is there.
28187 Beginning of the IL backend, but very little done, just there for
28190 2001-04-29 Miguel de Icaza <miguel@ximian.com>
28192 * cs-parser.jay: Fix labeled statement.
28194 * cs-tokenizer.cs (escape): Escape " and ' always.
28195 ref_line, ref_name: keep track of the line/filename as instructed
28196 by #line by the compiler.
28199 2001-04-27 Miguel de Icaza <miguel@ximian.com>
28201 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
28202 to match the values in System.CodeDOM.
28204 Divid renamed to Divide.
28206 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
28208 (Statements.set): remove.
28210 * System.CodeDOM/CodeCatchClause.cs: always have a valid
28213 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
28214 falseStatements always have valid values.
28216 * cs-parser.jay: Use System.CodeDOM now.