1 2008-01-24 Marek Safar <marek.safar@gmail.com>
3 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
4 Fixed user operator conversions.
6 2008-01-24 Marek Safar <marek.safar@gmail.com>
8 * generic.cs: Do nullable type to null comparison optimization during
11 2008-01-24 Marek Safar <marek.safar@gmail.com>
14 * generic.cs: Enabled l-value resolve on nullable expressions.
16 2008-01-24 Marek Safar <marek.safar@gmail.com>
19 * class.cs: Ingore static ctors with parameters for any further checks.
21 2008-01-24 Marek Safar <marek.safar@gmail.com>
24 * namespace.cs: Removed redundant check.
26 2008-01-24 Marek Safar <marek.safar@gmail.com>
29 * expression.cs: ElementInitializers can be resolved only once.
31 2008-01-24 Marek Safar <marek.safar@gmail.com>
33 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
34 Condition expressions.
36 2008-01-23 Marek Safar <marek.safar@gmail.com>
38 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
40 2008-01-22 Marek Safar <marek.safar@gmail.com>
42 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
45 * generic.cs: Implemented coalesce expression.
47 2008-01-22 Marek Safar <marek.safar@gmail.com>
50 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
51 expression tree type inference.
53 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
56 * expression.cs (Binary.IsUnsignedType): Fix typo.
58 2008-01-22 Marek Safar <marek.safar@gmail.com>
60 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
62 2008-01-22 Marek Safar <marek.safar@gmail.com>
65 * ecore.cs, expression.cs: Wider range of extension method supported
68 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
70 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
71 AssemblyBuilder to operate in compiler context. Fixes mcs part of
74 2008-01-22 Marek Safar <marek.safar@gmail.com>
77 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
79 2008-01-22 Miguel de Icaza <miguel@novell.com>
81 * expression.cs (CreateExpressionTree): Add support for or and
82 logical or, and indent following the coding conventions.
84 * typemanager.cs (LinqExpression): renamed from
85 ExpressionTreeManager, for a shorter name.
87 Use TypeManager.CoreLookupType to lookup types from our core
88 assemblies and turn those into "Type" variables.
90 Consumers that previously used "Namespace" and "Type" from this
91 class should instead use the TypeExpression which is a type that
92 is fully resolved (without involving the regular C# resolution
95 This typically looks like this:
97 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
98 new MemberAccess (texpr, name, type_arguments, loc)
100 This avoids the problem in: #355178
102 2008-01-21 Marek Safar <marek.safar@gmail.com>
104 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
105 feature in parser only as we do in other cases.
107 2008-01-21 Marek Safar <marek.safar@gmail.com>
109 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
110 typemanager.cs: A refactoring of params arguments to reuse existing
111 expressions (params -> array initializer) to emit params argument instead
112 of specialized handling.
113 It was required by expression tree implementation and it has other benefits
114 as well, we now apply same optimization for params arguments as we do for
117 2008-01-18 Marek Safar <marek.safar@gmail.com>
119 A fix for bug #353526
120 * generic.cs: A type inference of params arguments may not required any
121 temporary array creation.
123 2008-01-18 Marek Safar <marek.safar@gmail.com>
125 A fix for bug #353534
126 * generic.cs, ecore.cs, expression.cs: A method group type inference is
127 supported for delegates only.
129 2008-01-18 Marek Safar <marek.safar@gmail.com>
131 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
132 type for more than 1 candidates.
134 2008-01-18 Marek Safar <marek.safar@gmail.com>
136 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
139 2008-01-16 Marek Safar <marek.safar@gmail.com>
141 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
142 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
143 operator) expressions.
145 2008-01-16 Zoltan Varga <vargaz@gmail.com>
147 * statement.cs: Avoid declaring an IL variable for this_variable since it is
148 not accessed from the generated IL.
150 2008-01-14 Marek Safar <marek.safar@gmail.com>
152 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
153 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
154 statement.cs: The first expression tree implementation drop, mostly
157 2008-01-14 Marek Safar <marek.safar@gmail.com>
159 * ecore.cs (IsNestedChild): Refactored.
161 2008-01-11 Marek Safar <marek.safar@gmail.com>
163 * lambda.cs: Don't use a cast on unknown expression statement.
165 2008-01-10 Geoff Norton <gnorton@novell.com>
167 * cs-tokenizer.cs: One more token to distinguish between method and lambda
170 2008-01-09 Marek Safar <marek.safar@gmail.com>
172 * doc.cs: Report better /doc crash details.
174 2008-01-09 Marek Safar <marek.safar@gmail.com>
176 A fix for bug #352536
177 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
179 2008-01-08 Marek Safar <marek.safar@gmail.com>
181 A fix for bug #352287
182 * ecore.cs, expression.cs: Do `this' access checking in all member access
185 2008-01-08 Marek Safar <marek.safar@gmail.com>
187 * rootcontext.cs, driver.cs: Switch to linq mode by default.
189 * report.cs: Reset message stacks.
191 2008-01-08 Marek Safar <marek.safar@gmail.com>
193 * generic.cs (InferInPhases): Correctly calculate params position.
195 2008-01-08 Marek Safar <marek.safar@gmail.com>
197 * cs-tokenizer.cs: No need to parse full string when parsing lambda
200 2008-01-07 Marek Safar <marek.safar@gmail.com>
202 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
204 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
206 * driver.cs: Updated --help option.
208 2008-01-07 Marek Safar <marek.safar@gmail.com>
210 * generic.cs (InferParamsTypeArguments): Removed.
211 (InferInPhases): Add params type inference.
212 (LowerBoundInference): Fixed scoring mechanism.
214 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
216 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
218 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
219 byte array for unsigned "baked" assemblies.
221 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
223 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
224 array for assemblies that are not strongnamed.
226 2008-01-04 Marek Safar <marek.safar@gmail.com>
228 A fix for bug #351481
229 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
230 declaring type for nested generic types.
232 2008-01-04 Marek Safar <marek.safar@gmail.com>
234 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
237 2008-01-03 Marek Safar <marek.safar@gmail.com>
239 A fix for bug #351047
240 * expression.cs (Binary.ResolveOperator): Allow equality operators between
241 null and structs only when equality and inequality operators are defined
242 either as an user-operators or predefined operators.
244 2008-01-03 Marek Safar <marek.safar@gmail.com>
246 A fix for bug #351047
247 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
249 2008-01-03 Marek Safar <marek.safar@gmail.com>
251 A fix for bug #351257
252 * cs-tokenizer.cs: Advance line number for '\r' correctly.
254 2008-01-03 Marek Safar <marek.safar@gmail.com>
256 A fix for bug #351157
257 * class.cs (Using): Fixed yet another broken cloning.
259 (Block): Put back more sensible default value for statements.
261 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
263 * codegen.cs: Allow AssemblyVersion with only major version component.
266 2007-12-29 Marek Safar <marek.safar@gmail.com>
268 A fix for bug #324654
269 * class.cs: Use FullName property as member name.
271 2007-12-28 Marek Safar <marek.safar@gmail.com>
273 A fix for bug #342117
274 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
275 constructor constraint.
277 2007-12-28 Marek Safar <marek.safar@gmail.com>
279 A fix for bug #338273
280 * class.cs (ProbertyBase): Access modifier checks are required for overrides
283 2007-12-28 Marek Safar <marek.safar@gmail.com>
285 A fix for bug #350839
286 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
288 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
290 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
293 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
295 * statement.cs: Changed some Hashtables to use HybridDictionaries
296 instead. It was observed that some HashTables only contained a few
297 items in the vast majority of cases. Since HybridDictionary is
298 more efficient on small sets (<10 elements), "known_variables"
299 from class ExplicitBlock as well as "labels" and "constants " from
300 class Block were changed to HybridDictionaries.
302 Atsai results: (56216kb->54987kb)
304 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
307 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
309 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
312 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
314 * expression.cs: foreach loop to for loop, saved on allocation of
315 enumerator (59333kb->59141kb)
317 * statement.cs. Changed foreach loops to for loops, saved on
318 allocation of enumerator (59141kb->59006kb)
320 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
321 when constructed with no specified capacity. This was causing a
322 few ArrayLists to allocate more memory than they would potentially
323 need in the Block class and MemberCache class. Setting the
324 ArrayLists to construct with a capacity of 1 saves some
325 memory. (56216kb->55585kb)
327 2007-12-27 Marek Safar <marek.safar@gmail.com>
329 A fix for bug #347189 (2nd issue)
330 * expression.cs (MemberAccess): Nested type can be found in base non-generic
333 2007-12-27 Miguel de Icaza <miguel@novell.com>
335 * report.cs: Do not use colors if stdout and stderr are not a
338 2007-12-27 Marek Safar <marek.safar@gmail.com>
340 A fix for bug #346998
341 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
344 2007-12-27 Marek Safar <marek.safar@gmail.com>
346 A fix for bug #343465
347 * class.cs: Explicit method name for nested types uses dots only.
349 2007-12-27 Marek Safar <marek.safar@gmail.com>
351 A fix for bug #343707
352 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
354 2007-12-27 Marek Safar <marek.safar@gmail.com>
356 * ecore.cs: Report type inference errors only when arguments count matches
359 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
361 * expression.cs, report.cs: New warning.
363 * typemanager.cs: Catch anonymous method type too.
365 2007-12-23 Marek Safar <marek.safar@gmail.com>
367 A fix for bug #346379
368 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
370 2007-12-23 Marek Safar <marek.safar@gmail.com>
372 A fix for bug #347359
373 * expression.cs (Invocation): Don't resolve already resolved expression.
375 2007-12-23 Marek Safar <marek.safar@gmail.com>
377 A fix for bug #347189
378 * class.cs (FixedField): Use non-dependent code only in the define phase.
380 2007-12-23 Marek Safar <marek.safar@gmail.com>
382 A fix for bug #348076
383 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
385 2007-12-22 Marek Safar <marek.safar@gmail.com>
387 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
388 discovered extension methods.
390 2007-12-22 Marek Safar <marek.safar@gmail.com>
392 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
395 2007-12-21 Miguel de Icaza <miguel@novell.com>
397 * report.cs (ErrorMessage): Add support for using colors on
398 terminals that support it.
400 2007-12-21 Marek Safar <marek.safar@gmail.com>
402 * ecore.cs: Use information about expanded params for error reporting.
404 2007-12-21 Marek Safar <marek.safar@gmail.com>
406 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
407 and logic for params overloads.
409 2007-12-15 Miguel de Icaza <miguel@novell.com>
411 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
412 as this is also created from the parser. Fixes #349034
414 2007-12-12 Miguel de Icaza <miguel@novell.com>
416 * statement.cs (Throw.CloneTo): it is valid to have empty
417 expressions for throw.
419 2007-12-03 Marek Safar <marek.safar@gmail.com>
421 * cs-parser.jay: Set delegate constraint parsing region correctly.
423 2007-12-03 Marek Safar <marek.safar@gmail.com>
425 A fix for bug #345467
426 * typemanager.cs (IsEqual): Compare generic parameters position only.
428 2007-11-28 Marek Safar <marek.safar@gmail.com>
430 * expression.cs (BaseAccess): Type arguments can be null.
432 2007-11-27 Raja R Harinath <harinath@gmail.com>
434 * statement.cs (Block.Resolve): Ensure flow-branching tree is
435 consistent even when an error has occured.
436 (Switch.Resolve): Likewise.
438 2007-11-22 Marek Safar <marek.safar@gmail.com>
440 A fix for bug #334505
441 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
444 2007-11-22 Marek Safar <marek.safar@gmail.com>
446 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
447 refactorings required to resolve extension methods correctly when mixing
448 generics and non-generics members.
450 2007-11-20 Marek Safar <marek.safar@gmail.com>
452 A fix for bug #342584
453 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
456 2007-11-19 Marek Safar <marek.safar@gmail.com>
458 A fix for bug #342512
459 * delegate.cs: Use delegate argument expression when is available. Don't
460 emit virtual call when class is sealed.
462 2007-11-16 Marek Safar <marek.safar@gmail.com>
464 A fix for bug #325423
465 * assign.cs (FieldInitializer): Use resolved expression for emit.
467 * class.cs: Print less confusing error message.
469 2007-11-16 Marek Safar <marek.safar@gmail.com>
471 * cs-tokenizer.cs: Removed GMCS ifdefs.
473 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
476 * cs-parser.jay: Disabled nullable check.
478 * generic-mcs: Copied more generic stuff.
480 2007-11-16 Marek Safar <marek.safar@gmail.com>
482 * gcs-parser.jay: Merged to cs-parser.jay.
484 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
485 * *.csproj, *.sources: Updated to use only jay parser file.
487 2007-11-16 Marek Safar <marek.safar@gmail.com>
489 * gcs-parser.jay: Added nullable and default expression feature checks.
491 2007-11-16 Marek Safar <marek.safar@gmail.com>
493 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
494 it fixes many TODOs and hidden bugs.
496 * expression: Removed duplicate error check.
498 2007-11-15 Marek Safar <marek.safar@gmail.com>
500 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
501 implicitly type local variable only when it is used in a declaration.
503 2007-11-15 Marek Safar <marek.safar@gmail.com>
505 * attribute.cs: Use CS0612 for empty strings.
507 2007-11-14 Marek Safar <marek.safar@gmail.com>
509 * lambda.cs, statement.cs: Contextual return may act as a statement.
511 2007-11-14 Marek Safar <marek.safar@gmail.com>
513 A fix for a regression cause by #324222
514 * class.cs: Don't report unused even when it implements an interface.
516 2007-11-13 Marek Safar <marek.safar@gmail.com>
518 A fix for bug #341205
519 * ecore.cs, expression.cs: Method group expression cannot do static
520 method access with an instance reference check before overloading takes
523 2007-11-13 Marek Safar <marek.safar@gmail.com>
525 A fix for bug #325359
526 * class.cs: Use predictable name for automatically generated property.
528 2007-11-12 Marek Safar <marek.safar@gmail.com>
530 A fix for bug #324996
531 * expression.cs (Is): Handle case where D is nullable and T is not
534 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
536 2007-11-12 Marek Safar <marek.safar@gmail.com>
538 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
539 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
540 Flush small error reporting changes.
542 2007-11-09 Marek Safar <marek.safar@gmail.com>
544 A fix for bug #324996
545 * expression.cs: Rewrote Is expression implementation to work with
546 generics, nullable types, anonymous method. A const result expression
547 uses existing infrastructure instead of custom not fully-featured one.
549 2007-11-08 Marek Safar <marek.safar@gmail.com>
551 A fix for bug #340202
552 * class.cs: Consider generics for volatile field.
554 2007-11-08 Marek Safar <marek.safar@gmail.com>
556 A fix for bug #335594
557 * expression.cs: Use conversion rules when handling string addition.
559 2007-11-07 Marek Safar <marek.safar@gmail.com>
561 A fix for bug #336651
562 * expression.cs: Fixed a crash when probing is on.
564 2007-11-07 Marek Safar <marek.safar@gmail.com>
566 A fix for bug #324242
567 * covert.cs: Added a conversion from any nullable-type with an
568 underlying enum-type to the type System.Enum.
570 2007-11-07 Marek Safar <marek.safar@gmail.com>
572 A fix for bug #324222
573 * class.cs: Report all non-used event fields.
575 2007-11-07 Marek Safar <marek.safar@gmail.com>
577 A fix for bug #325161
578 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
579 qualifier for generic types.
581 2007-11-07 Marek Safar <marek.safar@gmail.com>
583 A fix for bug #322971
584 * expression.cs, ecore.cs: Added intermediate result value check for
587 2007-11-07 Marek Safar <marek.safar@gmail.com>
589 A fix for bug #324754
590 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
591 when it was requested.
593 2007-11-07 Marek Safar <marek.safar@gmail.com>
595 A fix for bug #325101
596 * expression.cs: Do type not value comparison for `is' expression.
598 2007-11-07 Marek Safar <marek.safar@gmail.com>
600 A fix for bug #320236
601 * convert.cs: Don't apply user conversion on underlying target type.
603 2007-11-06 Marek Safar <marek.safar@gmail.com>
605 * expression.cs: Don't use unresolved expression for error reporting.
607 2007-11-06 Marek Safar <marek.safar@gmail.com>
609 A fix for bugs #337712, #324490
610 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
611 overloading resolution too.
613 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
614 the process consistent and more robust.
616 * expression.cs, linq.cs, report.cs: Update.
618 2007-11-02 Marek Safar <marek.safar@gmail.com>
620 A fix for bug #332909
621 * attribute.cs: Resolve attributes in correct context using error
624 * rootcontext.cs: Define Obsolete attribute members as core members.
626 2007-11-02 Marek Safar <marek.safar@gmail.com>
628 * statement.cs: Removed unused methods.
630 2007-10-31 Wade Berrier <wberrier@novell.com>
632 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
633 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
636 2007-10-31 Marek Safar <marek.safar@gmail.com>
638 A fix for bug #338102
639 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
640 methods registered as non-generics.
642 2007-10-31 Marek Safar <marek.safar@gmail.com>
644 A fix for bugs #337712, #324490
645 * delegate.cs: Delegate covariance and contravariance is not allowed for
648 2007-10-31 Marek Safar <marek.safar@gmail.com>
650 A fix for bug #337719
651 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
654 2007-10-30 Marek Safar <marek.safar@gmail.com>
656 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
658 2007-10-29 Marek Safar <marek.safar@gmail.com>
660 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
663 2007-10-29 Raja R Harinath <rharinath@novell.com>
665 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
667 2007-10-29 Marek Safar <marek.safar@gmail.com>
669 A fix for bug #334652
670 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
671 extension methods when we have not found the best candidate in normal
674 2007-10-27 Marek Safar <marek.safar@gmail.com>
676 * AssemblyInfo.cs: Keep up-to-date.
678 2007-10-27 Marek Safar <marek.safar@gmail.com>
680 * Makefile: Fixed generics compiler name.
682 2007-10-27 Marek Safar <marek.safar@gmail.com>
684 * lambda.test: removed, lambda parsing is done differently.
686 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
688 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
690 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
692 2007-10-27 Marek Safar <marek.safar@gmail.com>
694 * Makefile, *.sources : All C# compilers are in mcs folder.
696 * *.cs: Use existing 2_1 define for smcs.
698 2007-10-26 Marek Safar <marek.safar@gmail.com>
700 A fix for bug #335847
701 * assign.cs, expression.cs: Couple of changes to avoid creating a
702 temporary variable for each object initializer assignment statement. It
703 simplifies struct initialization too, otherwise two temporary variables
705 Implemented optimization of redundant default element initializers.
707 2007-10-25 Marek Safar <marek.safar@gmail.com>
709 A fix for bug #336766
710 * expression.cs (Class.CheckBase): Use generic name when method is
713 2007-10-25 Marek Safar <marek.safar@gmail.com>
715 A fix for bug #334737
716 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
717 variable and not variable argument for prepared copies.
719 2007-10-24 Marek Safar <marek.safar@gmail.com>
721 A fix for bug #325110
722 * class.cs, expression.cs, attribute.cs: Use open generic method when
723 checking conditional attribute.
725 2007-10-24 Marek Safar <marek.safar@gmail.com>
727 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
728 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
729 FeatureIsNotAvailable.
731 2007-10-24 Marek Safar <marek.safar@gmail.com>
733 ** C# 3.0 Partial methods
735 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
736 methods support. Because of member cache issue with generics only
737 non-generics partial methods are fully supported.
739 2007-10-23 Marek Safar <marek.safar@gmail.com>
741 * class.cs, decl.cs: Rewrote member overloads check to cope with
742 generics and to use member cache for member checking. It also improves
743 performance and fixes remaining overloads issues.
745 2007-10-20 Marek Safar <marek.safar@gmail.com>
747 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
748 roottypes.cs, typemanager.cs:
750 A member cache creation logic changed to add members immediately and
751 not rely on fallback. The member cache is now only prefered way
752 how to access and find type declaration members. It saves 5 MB of memory
753 during MWF compilation and makes code ready for more optimizations and
754 clean-ups, it's also a pre-requirement for partial methods.
756 2007-10-18 Raja R Harinath <harinath@gmail.com>
758 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
759 handling for generic parameters.
761 2007-10-15 Marek Safar <marek.safar@gmail.com>
763 * class.cs (FixedField): Removed redundant volatile check.
765 2007-10-15 Marek Safar <marek.safar@gmail.com>
767 * class.cs, decl.cs: Fixed overload members verification to do only one
768 check per possible collision.
770 2007-10-13 Marek Safar <marek.safar@gmail.com>
772 A fix for bug #325478
773 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
774 and create only one disposable flags container.
776 2007-10-12 Marek Safar <marek.safar@gmail.com>
778 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
779 * statement.cs (Fixed): Fixed variables cloning.
781 2007-10-12 Marek Safar <marek.safar@gmail.com>
783 A fix for bug #333342
784 * class.cs (EventField): Don't mark value type event as synchronized.
786 2007-10-12 Marek Safar <marek.safar@gmail.com>
788 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
789 inference to identify best candidate method correctly.
790 (ProperyExpr): A range variable is read only and cannot be modified.
792 2007-10-11 Marek Safar <marek.safar@gmail.com>
794 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
795 logic to identify best candidate method correctly.
797 2007-10-11 Marek Safar <marek.safar@gmail.com>
799 * location.cs (Equals, GetHashCode): Removed.
801 2007-10-11 Marek Safar <marek.safar@gmail.com>
803 * report.cs: Implemented message recorder. It is used mainly for lambda
804 expressions to capture otherwise swallowed error messages.
806 * anonymous.cs, lambda.cs.cs: Do full parameters check.
808 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
810 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
812 * expression.cs (MemberAccess): Always report lookup failure.
814 * location.cs: Implemented Equals, GetHashCode.
816 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
818 2007-10-10 Jb Evain <jbevain@novell.com>
820 * codegen.cs: re-enable assembly version check.
822 2007-10-09 Marek Safar <marek.safar@gmail.com>
824 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
827 * namespace.cs (UsingAlias): Do correct version check.
829 2007-10-08 Marek Safar <marek.safar@gmail.com>
831 * expresison.cs, ecore.cs: Issue extension method error message when
834 * rootcontext.cs: Added ISO_2 compiler mode option.
836 2007-10-08 Marek Safar <marek.safar@gmail.com>
838 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
841 2007-10-08 Marek Safar <marek.safar@gmail.com>
843 * attribute.cs (GetString, GetBoolean): Work with both literal and
846 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
847 Moved method overload specific methods to MethodGroupExpr.
849 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
850 it should be less memory consuming.
852 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
854 * codegen.cs: remove the assembly version check until the buildbot is
857 2007-10-07 Jb Evain <jbevain@novell.com>
859 * attribute.cs (Attribute.GetString): if the value
860 expression is a StringConstant, return its string value.
862 2007-10-07 Jb Evain <jbevain@novell.com>
864 * typemanager.cs: add `assembly_version_attribute_type`.
865 * codegen.cs: on attribute emission, check that the
866 AssemblyVersionAttribute doesn't overflow.
868 2007-10-05 Marek Safar <marek.safar@gmail.com>
870 A fix for bug #324677
871 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
872 parent container of a scope container with currently resolved one.
874 2007-10-05 Marek Safar <marek.safar@gmail.com>
876 A fix for bug #325534
877 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
880 2007-10-05 Marek Safar <marek.safar@gmail.com>
882 A fix for bug #327504
883 * class.cs (Operator.Define): Refactored implicit and explicit user
884 operator conversion rules.
886 2007-10-05 Marek Safar <marek.safar@gmail.com>
888 A fix for bug #327520
889 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
891 2007-10-04 Marek Safar <marek.safar@gmail.com>
893 A fix for bug #328022
894 * class.cs (MethodData.Define): Use correct method to check whether
895 a method implementents an accessor.
897 2007-10-04 Marek Safar <marek.safar@gmail.com>
899 A fix for bug #330069
900 * statement.cs (Fixed.Resolve): Read the first array element only when
901 an array is instantiated.
903 2007-10-04 Marek Safar <marek.safar@gmail.com>
905 * expression.cs, assign.cs, generics.cs: Print correct operator when
906 compound assignment is used.
908 2007-10-04 Marek Safar <marek.safar@gmail.com>
910 A fix for bug #325841
911 * expression.cs (ArrayAccess): Use full argument cloning only for
912 string compound concatenation.
914 2007-10-03 Marek Safar <marek.safar@gmail.com>
916 A fix for bug #328774
917 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
919 (PropertyExpr.EmitAssign): Fixed string concatenation compound
922 2007-10-03 Raja R Harinath <rharinath@novell.com>
925 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
926 Event accessibility checks here. Remove some bogus code that
927 accidently made GenericMethods work.
928 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
930 2007-09-25 Marek Safar <marek.safar@gmail.com>
932 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
934 * statement.cs (Block): Refactored AddVariable to allow error handling
937 * generic.cs: New stub.
939 2007-09-23 Marek Safar <marek.safar@gmail.com>
941 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
944 2007-09-17 Marek Safar <marek.safar@gmail.com>
946 * class.cs: Use partial container to record whether any partial part
947 contains static field initializer and therefore default contructor has
950 2007-09-14 Marek Safar <marek.safar@gmail.com>
952 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
953 mono-list when only one of two partial parts has defined accessibility
956 2007-09-14 Marek Safar <marek.safar@gmail.com>
960 * class.cs (TypeContainer): Set correct resolve context for all field
963 2007-09-13 Marek Safar <marek.safar@gmail.com>
965 * assign.cs: Fixed a crash when field is resolved twice with an error.
967 * codegen.cs: Changed InFieldInitializer to be flag.
969 * anonymous.cs, ecore.cs, expression.cs: Update after
970 IsInFieldInitializer rename.
972 * const.cs: Removed unused parameter.
974 * class.cs: Changed the way how we resolve and emit field initializers.
975 The field initilizers have to have access to contructor block to emit
976 compiler generated code.
978 2007-09-13 Marek Safar <marek.safar@gmail.com>
980 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
981 generics use TypeContainer instead.
983 2007-09-12 Marek Safar <marek.safar@gmail.com>
985 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
987 * lambda.cs (ResolveParameters): Use more powerful
988 InflateGenericArgument.
990 * parameters.cs: Better exception message.
992 2007-09-10 Marek Safar <marek.safar@gmail.com>
994 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
995 correct expression block type.
997 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
999 * expression.cs (Invocation): Extracted method group resolve to
1002 2007-09-07 Marek Safar <marek.safar@gmail.com>
1004 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
1005 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
1007 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
1008 generic extension methods.
1010 2007-09-06 Marek Safar <marek.safar@gmail.com>
1012 A fix for bug #82676 (Do I get it right now?)
1013 * convert.cs (Binary.ResolveOperator): An interface is converted to the
1014 object before a standard conversion is applied.
1016 2007-09-06 Marek Safar <marek.safar@gmail.com>
1018 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
1021 2007-09-05 Marek Safar <marek.safar@gmail.com>
1023 A fix for bug #82676
1024 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
1025 non-generic interface types.
1027 2007-09-05 Marek Safar <marek.safar@gmail.com>
1029 A fix for bug #82690
1030 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
1032 2007-09-05 Marek Safar <marek.safar@gmail.com>
1034 A fix for bug #82571
1035 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
1036 modifier for container based methods.
1038 2007-09-05 Marek Safar <marek.safar@gmail.com>
1040 A fix for bug #82676
1041 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
1042 any interface-type T means to any of interface type T.
1044 2007-09-04 Marek Safar <marek.safar@gmail.com>
1046 * namespace.cs: We have 2 versions of System.Core assembly.
1048 2007-09-04 Marek Safar <marek.safar@gmail.com>
1050 A fix for bug #82652
1051 * class.cs (Class.GetClassBases): Compare types and not expressions.
1053 2007-09-04 Marek Safar <marek.safar@gmail.com>
1055 A fix for bug #82620
1056 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
1057 actually never worked before.
1058 (IndexerAccess): Emit prepared arguments before they are modified.
1060 2007-09-04 Marek Safar <marek.safar@gmail.com>
1062 A fix for bug #82563
1063 * assign.cs: Revert wrong fix.
1065 * expression.cs (VariableReference.EmitAssign): Handle ref reference
1067 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
1068 Instead of ldelema/stdind we have to use temporary variables to handle
1069 cases like String.Concat (params string[]).
1071 2007-08-31 Marek Safar <marek.safar@gmail.com>
1073 * class.cs: EmitAttributes to Emit rename.
1075 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
1077 (MemberCore.HasClsCompliantAttribute): Don't depend on
1078 GetClsCompliantAttributeValue execution.
1080 2007-08-31 Marek Safar <marek.safar@gmail.com>
1082 * anonymous.cs: Use shorter type prefix.
1084 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
1087 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
1088 variables when probing is on.
1090 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
1091 unresolved variables.
1092 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
1093 handle transparent identifiers.
1095 2007-08-26 Marek Safar <marek.safar@gmail.com>
1097 * attribute.cs (IsClsCompliant): Add nullable types test.
1099 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
1101 * doc.cs : catch other types of exception than XmlException to
1102 report CS1570. Fixed bug #82565.
1104 2007-08-23 Marek Safar <marek.safar@gmail.com>
1106 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
1107 The number of delegate parameters has to match.
1108 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
1111 2007-08-21 Marek Safar <marek.safar@gmail.com>
1113 * anonymous.cs (AnonymousMethod): Generate private anonymous method
1114 to fix problem with private arguments.
1116 2007-08-20 Marek Safar <marek.safar@gmail.com>
1118 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
1120 * decl.cs (MemberName): Ignore generic type with no generic arguments.
1122 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
1123 empty. Add cloning suport.
1125 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
1127 2007-08-20 Marek Safar <marek.safar@gmail.com>
1129 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
1130 to create EmptyCast. It handles EmptyConstantCast specialization for
1133 2007-08-18 Marek Safar <marek.safar@gmail.com>
1135 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
1136 (EmitArrayArgument): One routine for array arguments.
1137 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
1139 2007-08-17 Marek Safar <marek.safar@gmail.com>
1141 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
1143 2007-08-17 Marek Safar <marek.safar@gmail.com>
1145 * anonymous.cs: MemberLookupFinal update.
1147 * class.cs (ConstructorInitializer): Is expression based.
1149 * delegate.cs: MethodGroupExpr update.
1151 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
1153 (Error_MemberLookupFailed): Customizable error override.
1154 (MethodGroupExpr): Keep queried type for later usage.
1155 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
1158 * expression.cs: Error_MemberLookupFailed refactoring.
1159 (New.DoResolve): Resolve as much as possible.
1160 (ElementInitializer.Error_MemberLookupFailed): Object initializer
1161 customization for invalid member types.
1163 * statement.cs: MethodGroupExpr update.
1165 2007-08-16 Marek Safar <marek.safar@gmail.com>
1167 * modifier.cs (Check): Check all modifiers and not only accessibility
1170 2007-08-16 Marek Safar <marek.safar@gmail.com>
1172 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
1173 type and not an expression.
1175 2007-08-16 Marek Safar <marek.safar@gmail.com>
1177 * statement.cs (Catch.Clone): Type and variable can be null.
1179 2007-08-16 Marek Safar <marek.safar@gmail.com>
1181 A fix for bug #81979
1182 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
1183 I am really not sure whether this is the best fix.
1185 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
1188 2007-08-14 Marek Safar <marek.safar@gmail.com>
1190 ** C# 3.0 Object and collection initializers (major re-write)
1192 * assign.cs (DoResolve): Initializers are not assign related.
1194 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
1195 used during collection or object initialization.
1197 * expression.cs (Error_InvalidArguments): Add initializers specific
1198 messages. More will come later because it requires some general
1200 (New.DoResolve): Better error handling for unsafe types.
1201 (EmptyExpressionStatement): New class.
1202 (ElementInitializer): An object initializer expression.
1203 (CollectionElementInitializer): A collection initializer expression.
1204 (CollectionOrObjectInitializers): A block of object or collection
1206 (NewInitialize): New expression with element/object initializers.
1208 * statement.cs: Reverted object/collection initializer hacks.
1210 * typemanager.cs (CSharpName): Filter __arglist type.
1212 2007-08-09 Marek Safar <marek.safar@gmail.com>
1214 ** C# 3.0 Anonymous Types (update to the latest standard)
1216 * expression.cs (Binary.ResolveOperator): Threat all null based types
1218 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
1219 (AnonymousTypeParameter): Updated.
1221 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
1222 (AnonymousTypeClass): New anonymous type container.
1224 * class.cs (AddField): Return operation result.
1226 * generic.cs: Another empty TypeArguments overload.
1228 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
1229 are stored at top of normal hierarchy.
1231 * typemanager.cs (CSharpName): Filter anonymous types.
1233 2007-08-09 Marek Safar <marek.safar@gmail.com>
1235 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
1236 as single Concat call. How could we miss that :-(
1238 2007-08-08 Marek Safar <marek.safar@gmail.com>
1240 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
1242 2007-08-07 Miguel de Icaza <miguel@novell.com>
1244 * expression.cs: Fix the previous commit, the creation of the
1245 arguments array list needs also to be conditional on the arguments
1248 * class.cs: Add a little bit of help to help narrow down problems.
1250 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
1251 not try to copy in that case.
1253 * driver.cs: When building SMCS, include a new different set of
1254 default assemblies here. Do this here so we can control whether
1255 to include the default assemblies with /noconfig.
1257 2007-08-03 Marek Safar <marek.safar@gmail.com>
1259 A fix for bug #81979
1260 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
1263 2007-08-03 Marek Safar <marek.safar@gmail.com>
1265 A fix for bug #82300
1267 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
1268 we are in probing scope.
1270 2007-08-03 Marek Safar <marek.safar@gmail.com>
1272 A fix for bug #82301
1274 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
1275 (Statement.CloneTo): Clone and not map children blocks.
1277 2007-08-03 Marek Safar <marek.safar@gmail.com>
1279 A fix for bug #82299
1281 * expression.cs (LocalVariableReference.CloneTo): Remap local info
1284 * statement.cs (Statement.CloneTo): Clone variables before statements
1285 to allow remaping of local variables.
1287 2007-08-03 Marek Safar <marek.safar@gmail.com>
1289 A fix for bug #82296
1292 * report.cs: Log crash details for future clone problems.
1294 * statement.cs (Return.Clone): Don't clone non-existent expression.
1296 2007-08-03 Raja R Harinath <harinath@gmail.com>
1298 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
1299 (Class.AddBasesForPart): Move CS0537 check here from ...
1300 * cs-parser.jay (class_declaration): ... here. Move calling of
1301 'AddBasesForPart' to ...
1302 (class_bases): ... here.
1303 (struct_declaration, interface_declaration): Update to changes.
1305 2007-08-02 Marek Safar <marek.safar@gmail.com>
1307 A fix for bug #81923
1309 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
1310 conversion is allowed.
1312 2007-08-02 Marek Safar <marek.safar@gmail.com>
1314 A fix for bug #81564
1316 * ecore.cs (EventExpr): Add IsBase handling.
1318 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
1321 2007-08-02 Raja R Harinath <harinath@gmail.com>
1323 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
1324 * cs-parser.jay: Some whitespace cleanups.
1325 (current_delegate): New.
1327 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
1328 a dummy code block, and use 'type_name' instead of 'member_name'.
1329 (interface_declaration, class_declaration): Likewise.
1330 (delegate_declaration): Likewise. Rearrange slightly and use
1332 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
1333 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
1335 2007-08-02 Marek Safar <marek.safar@gmail.com>
1337 A fix for bug #82039
1339 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
1342 * typemanager.cs (CSharpName): Split to string overload.
1344 2007-08-02 Marek Safar <marek.safar@gmail.com>
1347 * report.cs: Updated warning CS0472.
1349 2007-08-01 Marek Safar <marek.safar@gmail.com>
1351 A fix for bug #82181
1353 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
1355 2007-08-01 Marek Safar <marek.safar@gmail.com>
1357 A fix for bug #82277
1358 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
1360 2007-08-01 Marek Safar <marek.safar@gmail.com>
1362 ** C# 3.0 Type Inference (major bits are working)
1364 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
1365 (.ImplicitStandardConversionExists): Uses compatible.
1366 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
1367 (.InferReturnType): New method.
1368 (.Compatible): Refactored.
1369 (.ResolveParameters): Uses factory to create resolved parameters.
1370 (.CompatibleMethod): Add probing mode support.
1371 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
1372 clearly distinguish between 2 different operations.
1373 (LambdaMethod): Moved to lambda.cs.
1374 (AnonymousMethod): Removed unused fields and methods.
1375 (AnonymousDelegate): Simplified.
1377 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
1379 * convert. cs (ImplicitConversionStandard): Compatible works differently.
1381 * delegate.cs (Delegate): New mehods to reduce code duplication.
1382 (.GetConstructor): New method.
1383 (.GetInvokeMethod): New method.
1384 (DelegateCreation): Updated.
1386 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
1388 (OverloadResolve): Made probing little bit faster.
1390 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
1393 * generic.cs (TypeInferenceContext): Dummy implementation.
1395 * iterators.cs: Updated after Resolve/Define rename.
1397 * lambda.cs (LambdaExpression)
1398 (.ResolveParameters): Handles both type of arguments and type inference too.
1400 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
1401 (InflateTypes): Updated.
1403 * support.cs (InflateTypes): Changed signature and updated.
1405 * typemanager.cs (LookupMemberCache): Better dynamic type check.
1406 (MemberLookup_FindMembers): More MS tricks.
1407 (GetParameterData): Ditto.
1408 (GetDelegateParameters): Uses quick path for dynamic types.
1410 2007-08-01 Marek Safar <marek.safar@gmail.com>
1412 * class.cs (MethodData.Define): EmitContext is required for generic stuff
1415 2007-07-31 Marek Safar <marek.safar@gmail.com>
1417 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
1420 2007-07-26 Jb Evain <jbevain@novell.com>
1422 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
1423 which takes a boolean 'report_errors', similar to the GetMethod.
1424 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
1425 in .net 2.1, do not report errors here.
1427 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
1428 System.Runtime.CompilerServices.RequiredAttributeAttribute and
1429 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
1432 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
1433 of the type InternalsVisibleToAttribute before the first call
1434 to CoreLookupType which is allowed to fail (third boolean parameter
1435 to true). Because, during the resolution for a type that is not
1436 immediately found, we try to check if the type is not defined in
1437 a friend assembly, and to do so, we need the
1438 InternalVisibleToAttribute.
1440 2007-07-23 Miguel de Icaza <miguel@novell.com>
1442 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
1443 feature that allows structs to be compared against null and inline
1444 the result as true or false.
1446 Notice that the same code is not permitted inside a generic block
1447 of code that would do:
1449 class Foo<T> where T : struct {
1456 It is only allowed if the type of T is not bound (no where
1457 clause). In my opinion, this CSC 2 behavior is broken but people
1458 seem to be using it (IronRuby does, a few bug reports on bugzilla
1459 have it and some people have complained about it).
1461 All of the users that depend on this behavior have code that is
1464 * report.cs (Warning, Error): make these take object arguments,
1465 not strings, as that allows us to take advantage of Format.
1467 2007-07-20 William Holmes <billholmes54@gmail.com>
1469 * decl.cs: Changed MemberName.CountTypeArguments to also check the
1470 Left member variable for the Count.
1471 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
1472 MemberName.CountTypeArguments to avoid a NRE.
1474 This code is contributed under the MIT X11 license
1476 2007-07-18 Marek Safar <marek.safar@gmail.com>
1478 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
1480 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
1482 * doc.cs : generic method arguments are written as ``x while generic
1483 type arguments are `x. Combined with the previous change, fixed bug
1486 2007-07-18 Raja R Harinath <rharinath@novell.com>
1489 * expression.cs (Binary.ResolveOperator): When converting
1490 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
1492 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
1494 * doc.cs : when T: or whatever x: is specified, it does not really
1495 check the doc comment's syntax correctness. Fixed bug #82006.
1497 2007-07-18 Marek Safar <marek.safar@gmail.com>
1499 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
1500 LambdaExpression better.
1502 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
1504 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
1506 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
1507 as it can be generated.
1509 * expression.cs (Invocation.Error_InvalidArguments): Show correct
1512 * lambda.cs (LambdaExpression): Refactored to share same code with
1513 AnonymousMethodExpression.
1515 2007-07-17 Marek Safar <marek.safar@gmail.com>
1517 * anonymous.cs (MakeName): Include host name for easier debugging.
1518 (LambdaMethod): New class for lambda spcecific stuff.
1520 * attribute.cs: Set EmitContext return type.
1522 * class.cs: Set EmitContext return type.
1524 * codegen.cs (EmitContext): Return type cannot be null to stop messing
1525 with null/void meaning.
1527 * iterators.cs (ContainerType): Implemented.
1529 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
1531 * statement.cs (Return): Updated to lambda expressions.
1532 (Block.CloneTo): Parent can be null.
1534 2007-07-13 Marek Safar <marek.safar@gmail.com>
1536 A fix for bug #81917
1537 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
1539 * class.cs (FixedField): Check whether field is in unsafe scope.
1541 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
1542 (FieldExpr.Emit): Fixed buffers cannot be volatile.
1544 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
1547 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
1549 2007-07-13 Marek Safar <marek.safar@gmail.com>
1551 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
1552 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
1555 2007-07-13 Marek Safar <marek.safar@gmail.com>
1557 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
1559 2007-07-13 Marek Safar <marek.safar@gmail.com>
1561 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
1562 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
1564 * codegen.cs(EmitContext): Add ProbingMode flag.
1566 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
1568 * driver.cs: For now set both warning values.
1570 * ecore.cs (SimpleName): Name is readonly.
1571 (MethodGroup.OverloadResolve): One quick path for probing.
1573 * expression.cs (Unary): Set Oper r/o.
1574 (Binary): Set Oper r/o.
1575 (ParameterReference): Set few instance variables as r/o.
1576 (ParameterReference.DoResolveBase): Don't capture aruments when
1578 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
1579 (Arglist): arguments are private.
1580 (SizeOf): type is private and r/o.
1581 (MemberAccess): arguments are private.
1583 * report.cs: Enhanced reporting on/off capabilities.
1585 * lambda.cs: Uses ec.IsInProbingMode.
1586 (ContextualReturn): Derives from return.
1588 * rootcontext.cs: For now set both warning values.
1590 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
1592 (Return.Resolve): Don't die immediately.
1593 (Block.Resolve): Speed-up probing.
1594 (Block.CloneTo): Clone only child blocks.
1596 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
1598 * iterators.cs: reverted Miguel's latest change (r81925) as it
1599 breaks the build in System.
1601 2007-07-13 Miguel de Icaza <miguel@novell.com>
1603 * iterators.cs (Yield.CheckContext): Check for the iterator type
1604 also here as we can call into Yield even in codepaths that are not
1606 (MethodOrOperator is the only path that was checked).
1608 In addition to the standard check, use a more specific check for
1609 constructors to report a more verbose error.
1611 2007-07-12 Miguel de Icaza <miguel@novell.com>
1613 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
1614 report the warning and continue
1616 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
1617 values on the stack on the call to Emit. Use EmitStatement if
1618 possible, or using Emit + Pop if not possible. Fixes #82064
1620 2007-07-12 Raja R Harinath <rharinath@novell.com>
1622 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
1623 avoid try...finally in some cases.
1625 2007-07-10 Marek Safar <marek.safar@gmail.com>
1627 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
1629 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
1630 instead of method. Re-use standard error handling.
1631 (ConstructorInitializer.Emit): Simplified.
1633 * delegate.cs: Updated after Invocation.EmitCall change.
1635 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
1636 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
1637 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
1638 method and don't permanently changing input arguments.
1639 (MethodGroupExpr): Introduced resolved best_candidate, when method group
1640 is resolved it has one of the candidates is the best one which is later
1641 used to emit. Removed a few unused method.
1642 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
1644 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
1645 (Binary.ResolveOperator): Ditto.
1646 (ConditionalLogicalOperator.DoResolve): Ditto.
1647 (Invocation): Uses method group.
1648 (Invocation.DoResolve): Simplified.
1649 (Invocation.EmitCall): Removed useless is_static.
1650 (Invocation.Emit): Delegate to method group.
1651 (Invocation.EmitStatement): Simplified.
1652 (New): Uses method group.
1653 (MemberAccess.DoResolve): Don't destroy original expression.
1655 * statement.cs (ForEach.Resolve): Use null for no method arguments.
1657 2007-07-04 Marek Safar <marek.safar@gmail.com>
1659 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
1662 * lambda.cs: Add custom error message type.
1664 2007-07-03 Marek Safar <marek.safar@gmail.com>
1666 * lambda.cs: Simplified little bit.
1668 * parameter.cs: Introduced ImplicitLambdaParameter.
1669 (Parameters.CreateFullyResolved): New factory instead of ctor.
1673 * delegate.cs: Updated parameter creation.
1675 2007-07-03 Marek Safar <marek.safar@gmail.com>
1677 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
1680 * generic.cs: Synchronized with gmcs.
1682 2007-07-03 Marek Safar <marek.safar@gmail.com>
1684 * class.cs (Indexer): Check return type as soon as possible.
1686 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
1689 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
1691 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
1693 * parameter.cs (Parameter): Use expression type when it is available.
1695 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
1696 method modifier for the first parameter only.
1698 2007-06-24 Marek Safar <marek.safar@gmail.com>
1700 A fix for bug #81938
1701 * typemanager.cs (ChangeType): Fixed couple of char conversions.
1703 * constant.cs: Tide up an exception message.
1705 2007-06-22 Marek Safar <marek.safar@gmail.com>
1707 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
1708 an uninitialized variable is used.
1710 * expression.cs (LocalVariableReference.DoResolve): Ditto.
1712 2007-06-22 Marek Safar <marek.safar@gmail.com>
1714 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
1715 not found error handling.
1717 * expression.cs (ArrayCreation): Removed redundant fields and little bit
1719 (ArrayCreation.ResolveArrayElement): To be ready to customization.
1720 (ArrayCreation.DoResolve): Simplified.
1721 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
1722 its own resolve process.
1723 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
1725 2007-06-20 Marek Safar <marek.safar@gmail.com>
1727 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
1730 2007-06-20 Marek Safar <marek.safar@gmail.com>
1732 * cs-tokenizer.cs: Removed var related stuff.
1734 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
1735 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
1736 a type and a keyword at same time.
1738 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
1741 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
1742 implicitly typed arrays, more changes will follow.
1744 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
1746 2007-06-19 Marek Safar <marek.safar@gmail.com>
1748 * ecore.cs (VarExpr): Removed Handled field.
1750 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
1751 build-in assign functionality.
1752 (ForEach.Resolve): Removed all implicitly typed local variable code and
1754 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
1755 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
1757 2007-06-18 Marek Safar <marek.safar@gmail.com>
1759 * assign.cs: Removed implicitly typed local variable check.
1761 * expression.cs (LocalVariableReference.DoResolve): Add check for self
1762 referencing implicitly typed local variable.
1763 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
1766 * statement.cs (Fixed): Removed unsupported implicitly typed local
1769 2007-06-15 Marek Safar <marek.safar@gmail.com>
1771 * decl.cs (MemberName): Moved all Unbound stuff to parser.
1773 2007-06-14 Marek Safar <marek.safar@gmail.com>
1775 A fix for bugs #81855 and #76274
1776 * attribute.cs (AttachTo): Always set owner for global attributes to
1779 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
1782 * cs-parser.jay: Assembly and module attributes must precede all other
1783 elements except using clauses and extern alias declarations.
1785 2007-06-13 Marek Safar <marek.safar@gmail.com>
1787 A fix for bug #81748
1789 * expression.cs: More checks for non ISO-1 features.
1791 2007-06-12 Marek Safar <marek.safar@gmail.com>
1793 A fix for bug #81807
1794 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
1795 present inside switch statement and it is required by nullable check.
1797 2007-06-12 Marek Safar <marek.safar@gmail.com>
1799 A fix for bug #81840
1800 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
1801 when type matching fails.
1803 * namespace.cs: Tiny error message change.
1805 2007-06-12 Marek Safar <marek.safar@gmail.com>
1807 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
1808 reporting. Added automatic property check.
1810 * class.cs: Updated after CheckAbstractAndExtern relocation.
1811 (AEventPropertyAccessor.GetSignatureForError): Customized.
1813 2007-06-11 Marek Safar <marek.safar@gmail.com>
1815 * class.cs (DefineBaseTypes): Base type can be undefined.
1817 * ecore.cs (TypeLookup): Minor refactoring.
1818 (DoResolveAsTypeStep): Removed redundant check.
1820 * namespace.cs (Lookup): Removed redundant check.
1822 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
1823 ResolveAsTypeTerminal step.
1824 (BootstrapCorlib_*): Simplified.
1825 (PopulateCoreType): Core types can be now external.
1827 2007-06-07 Marek Safar <marek.safar@gmail.com>
1829 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
1831 (InferTypeArguments): Infers anonymous expression type arguments.
1832 (Compatible): Split to Compatible and InferTypeArguments.
1834 * lambda.cs: Updated.
1836 2007-06-08 Marek Safar <marek.safar@gmail.com>
1838 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
1840 2007-06-07 Raja R Harinath <harinath@gmail.com>
1842 Fix #80477, cs0135-2.cs, cs0135-3.cs
1843 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
1844 names to the "known" variables list.
1845 (Block.CheckInvariantMeaningInBlock): Handle the fact the
1846 parameter names are also "known".
1847 (Block.CheckError136): Remove.
1848 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
1851 2007-06-07 Marek Safar <marek.safar@gmail.com>
1853 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
1855 2007-06-06 Marek Safar <marek.safar@gmail.com>
1857 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
1858 internal error not an user error.
1860 * expression.cs (IsApplicable): Refactored to make debugging easier.
1862 * support.cs: More tricks for non-mono runtimes.
1864 * typemanager.cs (CoreLookupType): Made public.
1865 (InitSystemCore): All linq specific stuff moved to linq.cs
1867 2007-06-05 Marek Safar <marek.safar@gmail.com>
1869 * typemanager.cs (CSharpSignature): One more missing build-in types
1871 More tricks for non-mono runtime.
1873 2007-06-05 Raja R Harinath <harinath@gmail.com>
1875 * statement.cs (Block.CheckError136_InParents): Remove.
1876 (Block.AddVariable): Use GetParameterInfo instead.
1877 (ToplevelBlock.ProcessArguments): Likewise.
1879 2007-06-04 Raja R Harinath <rharinath@novell.com>
1881 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
1883 (ToplevelBlock.GetParameterInfo): Split out of ...
1884 (ToplevelBlock.GetParameterRefernce): ... this.
1885 (ToplevelBlock.ParameterMap): Remove.
1886 * expression.cs (ParameterReference): Update to use
1887 ToplevelParameterInfo.
1889 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
1892 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
1893 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
1895 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
1896 (ToplevelBlock.ProcessParameters) ... here.
1897 (ToplevelBlock..ctor): Invoke it.
1899 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
1902 * statement.cs (IKnownVariable): New interface.
1903 (LocalInfo): Implement it.
1904 (ToplevelParameterInfo): New class.
1905 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
1906 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
1907 GetKnownVariableInfo.
1909 2007-06-03 Raja R Harinath <harinath@gmail.com>
1911 Partly speed up CS0136 error checks.
1912 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
1913 'recurse' parameter.
1914 (Block.DoCheckError136): Only check errors in parameters. Move
1915 local variable checks ...
1916 (Block.AddVariable): ... here, and ...
1917 (ToplevelBlock.ResolveMeta): ... here.
1919 2007-06-02 Raja R Harinath <harinath@gmail.com>
1921 * statement.cs (Block.IsChildOf): Remove.
1923 * statement.cs (Statement.Clone): Move special case code ...
1924 (Block.CloneTo): ... here.
1926 2007-05-29 Raja R Harinath <rharinath@novell.com>
1928 * statement.cs (ToplevelBlock.container): Remove field. It's
1929 redundant with 'Parent'.
1930 (ToplevelBlock.ContainerBlock): Remove accessor.
1931 (ToplevelBlock..ctor): Update to changes. Register anonymous
1932 child with parent here, ...
1933 * cs-parser.jay (end_anonymous): ... not here. Don't modify
1935 (start_anonymous): Don't save current_block.
1936 (top_current_block): Remove.
1938 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
1939 (Block.Resolve): Update to changes.
1940 (Block..ctor): Move setting of "correct" 'Toplevel'
1941 and 'Explicit' fields to ...
1942 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
1944 2007-05-27 Raja R Harinath <harinath@gmail.com>
1947 * statement.cs (Block.Implicit): Remove.
1948 (Block): Update to changes.
1949 * flowanalysis.cs: Likewise.
1951 Mildly speed up CheckInvariantMeaningInBlock
1952 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
1953 Recursively call AddKnownVariable to all enclosing blocks.
1954 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
1955 Remove recursive calls.
1956 (Block): Update to changes.
1958 New ExplicitBlock invariants
1959 * statement.cs (Block.Explicit): New field. It points to the
1960 immediately enclosing non-implicit block.
1961 (Block..ctor): Maintain the invariant.
1962 * cs-parser.jay: Take advantage of invariant.
1964 Introduce ExplicitBlock
1965 * statement.cs (ExplicitBlock): New.
1966 (ToplevelBlock): Derive from it.
1967 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
1969 (Block.Implicit): Update to changes.
1970 * cs-parser.jay: Update to changes.
1973 * codegen.cs (EmitContext.IsLastStatement): Remove.
1974 * statement.cs (Block.DoEmit): Update to changes.
1976 2007-05-25 Raja R Harinath <rharinath@novell.com>
1978 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
1979 modifying current_block directly.
1981 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
1983 * class.cs: Implemented automatic properties (C# 3.0)
1984 Thanks to Marek for the help.
1986 2007-05-23 Raja R Harinath <rharinath@novell.com>
1988 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
1989 variable as assigned, note also that all its components are
1991 (MyBitVector.SetRange): New. Function to set multiple bits to true.
1993 2007-05-19 Marek Safar <marek.safar@gmail.com>
1995 * anonymous.cs, class.cs: Emit Compiler generated attribute when
1996 member is marked as compiler generated.
1998 * decl.cs (MemberCore): Refactored ModFlags into property.
2000 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
2001 (Check): Check only accessibility modifiers.
2003 2007-05-18 Raja R Harinath <rharinath@novell.com>
2005 Track all assignable slots in one bit array
2006 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
2007 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
2008 logic from VariableMap constructor here. Use the same 'offset'
2009 variable that's later used for computing offsets of local
2011 * flowanalysis.cs (UsageVector.parameters): Remove.
2012 (UsageVector): Update to changes.
2013 (VariableMap): Remove.
2015 Avoid creating ParameterMap in every block
2016 * statement.cs (Block.ParameterMap): Move ...
2017 (ToplevelBlock.ParameterMap): ... here.
2018 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
2020 * flowanalysis.cs (FlowBranching.param_map): Remove.
2021 (FlowBranching.UsageVector): Update to changes.
2022 (FlowBranchingToplevel.CheckOutParameters): Likewise.
2024 * statement.cs (Block.CloneTo): Clone Toplevel field too.
2026 * expression.cs (ParameterReference): Distinguish between block
2027 where parameter was referenced and declared.
2029 2007-05-18 Marek Safar <marek.safar@gmail.com>
2031 * flowanalysis.cs, statement.cs: Put back improved error handling.
2033 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
2037 Imporved object and collection initialization (C# 3.0).
2039 2007-05-15 Marek Safar <marek.safar@gmail.com>
2041 A fix for bug #81380
2042 * expression.cs (Is.DoResolve): Only value types have constant `is'
2045 2007-05-15 Raja R Harinath <rharinath@novell.com>
2047 * statement.cs (ToplevelBlock.child): Remove.
2049 2007-05-15 Raja R Harinath <harinath@gmail.com>
2051 Rationalize ResolveMeta: refactoring
2052 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
2053 out constant handling code into ...
2054 (Block.DoResolveConstants): ... this.
2056 Rationalize ResolveMeta: kill local_map
2057 * statement.cs (Block.local_map, Block.LocalMap): Remove.
2058 (Block.AssignableSlots): New.
2059 (Block.ResolveMeta): Make protected. Don't create a VariableMap
2060 for locals -- move code from VariableMap here. Avoid unnecessary
2062 * flowanalysis.cs (FlowBranching.local_map): Remove.
2063 (FlowBranching..ctor): Use Block.AssignableSlots.
2064 (VariableMap): Remove unused constructors.
2066 2007-05-11 Raja R Harinath <rharinath@novell.com>
2068 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
2070 2007-05-11 Marek Safar <marek.safar@gmail.com>
2072 * typemanager.cs (IsFriendAssembly): Should not be called for building
2075 2007-05-09 Marek Safar <marek.safar@gmail.com>
2077 * literal.cs (NullConstant): Print null in all cases.
2079 * expression.cs (Binary.ResolveOperator): Implemented delegate
2080 comparison based on C# 2.0 changes.
2082 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
2084 This code is contributed under the MIT X11 license
2086 The following enables support for several C# 3.0 language features:
2088 * cs-tokenizer.cs: Added support for the "var" keyword.
2090 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
2091 Added VarExpr class to facilitate type inferencing.
2093 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
2094 to support anonymous types.
2096 * assign.cs: Added support for type inferencing and initialization.
2098 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
2100 * expression.cs: Added implicit array support to ArrayCreation.
2101 Added 5 types and 1 interface:
2103 IInitializable Implementing classes can inject initializing
2104 statements after object instantiation.
2106 Initializer Stores data for object initialization.
2108 AnonymousType An expression for anonymous types.
2110 AnonymousTypeParameter Stores data about an anonymous type's field.
2112 NewInitialize An expression for object initialization.
2114 CollectionInitialize An expression for collection initialization.
2116 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
2119 2007-05-06 Marek Safar <marek.safar@gmail.com>
2121 A fix for bug #81500
2122 * cs-tokenizer.cs: Add special handling for coalescing operator.
2124 2007-05-06 Marek Safar <marek.safar@gmail.com>
2126 A fix for bug #81529
2127 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
2128 its value from base class until it is redefined.
2130 2007-05-02 Raja R Harinath <rharinath@novell.com>
2132 Fix regression in cs0631-3.cs
2133 * cs-parser.jay (operator_declarator): Add opt_attributes to error
2134 fallback. Make error fallback catch more cases.
2136 2007-05-01 Miguel de Icaza <miguel@novell.com>
2138 * cs-parser.jay: Allow parameters in operator declarations to have
2141 2007-04-27 Miguel de Icaza <miguel@novell.com>
2143 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
2146 * lambda.cs (ContextualReturn.Resolve): An expression is valid
2147 inside the ContextualReturn, it does not have to be an
2148 ExpressionStatement.
2150 2007-04-24 Miguel de Icaza <miguel@novell.com>
2152 * lambda.cs (ContextualReturn.Resolve): if the return type is not
2155 2007-04-23 Miguel de Icaza <miguel@novell.com>
2157 * anonymous.cs (AnonymousContainer): split the virtual Resolve
2158 method in two methods: ResolveNoDefine and Resolve.
2160 ResolveNoDefine will stop just after ResolveTopBlock has been
2163 Resolve will then continue by creating a method and issuing the
2164 call to method.Define ().
2166 (AnonymousMethod): Split and implement the new Resolve and
2167 ResolveNoDefine as well.
2169 * lambda.cs (LambdaExpression): Split the anonymous method
2170 resolution code into a separate routine (CoreCompatibilityTest)
2171 from DoCompatibleTest.
2173 (LambdaExpression.TryBuild): New method, this method tries to
2174 build the LambdaExpression with the given set of types to be used
2175 as the types for the various parameters of the lambda expression.
2177 If the compilation succeed with the given types, the infered type
2178 of the Anonymous method is returned, otherwise null is returned.
2180 2007-04-23 Marek Safar <marek.safar@gmail.com>
2182 A fix for bug #81414
2183 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
2185 2007-04-22 Miguel de Icaza <miguel@novell.com>
2187 * cs-tokenizer.cs: Change various identifiers here from the
2188 camelCasing to the recommended Linux-like style for instance
2189 variables from the Coding Guidelines.
2191 2007-04-19 Martin Baulig <martin@ximian.com>
2194 (Convert.ImplicitReferenceConversionCore): Allow conversions from
2195 System.Enum to System.ValueType.
2197 2007-04-13 Martin Baulig <martin@ximian.com>
2199 Rewrote implicit reference conversions. We need to distinguish
2200 between implicit reference conversions (13.1.4) and implicit
2201 boxing conversions (13.1.5).
2203 According to the spec, there's an an implicit conversion
2204 "From a one-dimensional array-type S[] to IList<T> and base
2205 interfaces of this interface, provided there is an implicit
2206 reference conversion from S to T." Note that this does not
2207 include boxing conversions.
2210 (Convert.ImplicitTypeParameterBoxingConversion): New method.
2211 (Convert.ImplicitReferenceConversion): Split into
2212 ImplicitReferenceConversionCore() and
2213 ImplicitBoxingConversionExist().
2214 (Convert.ImplicitReferenceConversionExists): Use the new
2215 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
2217 2007-04-12 Martin Baulig <martin@ximian.com>
2219 * convert.cs (Convert.ImplicitReferenceConversion): Move the
2220 `TypeManager.null_type' checks up to the top of the method.
2222 2007-04-11 Marek Safar <marek.safar@gmail.com>
2224 A fix for bug #81350
2225 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
2228 2007-04-11 Martin Baulig <martin@ximian.com>
2230 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
2231 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
2232 to make this work for generic classes; fixes #79561.
2234 2007-04-11 Martin Baulig <martin@ximian.com>
2236 * expression.cs (As): Add support for nullable types; fixes #79371.
2238 2007-04-11 Martin Baulig <martin@ximian.com>
2240 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
2241 `type.FullName' is null; fixes #80243.
2243 2007-04-11 Martin Baulig <martin@ximian.com>
2245 * expression.cs (Invocation.IsApplicable): Don't modify the method
2246 if type inference succeeded, but the method was not applicable.
2249 2007-04-10 Marek Safar <marek.safar@gmail.com>
2251 A fix for bug #81324
2252 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
2253 internal and external namespaces containers.
2255 2007-04-10 Martin Baulig <martin@ximian.com>
2257 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
2258 TypeManager.DropGenericMethodArguments() so we also call
2259 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
2261 2007-04-10 Martin Baulig <martin@ximian.com>
2263 * iterators.cs (Iterator.CreateIterator): Don't crash if
2264 `method.ReturnType' is null. This happens if something went wrong
2265 while resolving that typ (we already reported an error in this case).
2267 2007-04-10 Martin Baulig <martin@ximian.com>
2269 * expression.cs (New.DoResolve): Don't call CheckComImport() on
2270 generic interfaces; report the CS0144 directly.
2272 2007-04-10 Martin Baulig <martin@ximian.com>
2274 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
2275 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
2277 2007-04-10 Martin Baulig <martin@ximian.com>
2279 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
2281 2007-04-09 Raja R Harinath <rharinath@novell.com>
2284 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
2285 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
2288 * statement.cs (For.Resolve): If resolution fails, use
2291 2007-04-08 Marek Safar <marek.safar@gmail.com>
2293 * anonymous.cs (MakeName): Make faster and zero-based.
2294 (VerifyExplicitParameterCompatibility): Back to mode where generic
2295 parameter is ignored.
2296 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
2298 * class.cs (EmitType): Method can emit another new method.
2300 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
2302 * driver.cs: Updated.
2304 * lambda.cs: Reuse predefined empty parameters.
2306 * parameter.cs: Updated
2308 * support.cs: Implemented InflateTypes.
2310 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
2311 (InitSystemCore): Introduced to isolate 3.0 dependencies.
2313 2007-04-03 Martin Baulig <martin@ximian.com>
2317 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
2318 version of TypeManager.IsOverride() which also works with generic
2321 2007-04-03 Martin Baulig <martin@ximian.com>
2326 (Convert.ExplicitReferenceConversion): We need to cast when
2327 converting from IList<T> to S[].
2329 2007-04-01 Marek Safar <marek.safar@gmail.com>
2331 * decl.cs (FindExtensionMethods): Consider all candidates with same name
2334 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
2336 2007-03-31 Marek Safar <marek.safar@gmail.com>
2338 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
2339 argument and return type inferring.
2341 * codegen.cs (InferReturnType): Flag whether return can be inferred.
2342 (ReturnType): Turned to property.
2344 * statement.cs (Return): Implemented return type inferring.
2346 * support.cs (ReflectionParameters): Use local types if possible.
2348 2007-03-30 Raja R Harinath <rharinath@novell.com>
2350 * flowanalysis.cs (FlowBranching.Reachability): Remove.
2351 (FlowBranching.UsageVector): Update to changes.
2353 Prepare to kill 'Reachability'
2354 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
2355 argument of constructor.
2357 2007-03-29 Raja R Harinath <rharinath@novell.com>
2359 Prepare to kill 'Reachability'
2360 * flowanalysis.cs (UsageVector.is_unreachable): New.
2361 (UsageVector): Update to maintain 'is_unreachable' in parallel to
2362 'reachability', and verify they're consistent.
2365 * expression.cs (New.EmitStatement): Handle type parameters here too.
2367 2007-03-29 Martin Baulig <martin@ximian.com>
2372 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
2373 CompilerGeneratedClass.
2374 (ScopeInfo.EmitScopeInstance): Make this protected.
2375 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
2376 `ec.CurrentAnonymousMethod.Scope == Scope'.
2378 * statement.cs (Block.ScopeInfo): Make this a property.
2380 2007-03-27 Raja R Harinath <harinath@gmail.com>
2382 Prepare to kill 'Reachability'
2383 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
2384 (FlowBranching.UsageVector.Reachability): Remove property.
2385 (FlowBranching.UsageVector.IsUnreachable): New property.
2386 (FlowBranching.UsageVector.ResetBarrier): New.
2387 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
2388 * codegen.cs, statement.cs: Update to changes.
2390 2007-03-27 Martin Baulig <martin@ximian.com>
2395 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
2398 2007-03-26 Raja R Harinath <rharinath@novell.com>
2400 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
2401 instead of TriState. Remove all mention of TriState.
2403 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
2404 replaced by a boolean. Add boolean 'is_unreachable' field, check
2405 and maintain invariants.
2407 2007-03-25 Marek Safar <marek.safar@gmail.com>
2409 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
2411 2007-03-25 Marek Safar <marek.safar@gmail.com>
2413 * expression.cs: Stop using obsolete 2.0 opcodes.
2415 2007-03-25 Marek Safar <marek.safar@gmail.com>
2417 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
2418 one of the latests Martin's fixes.
2420 2007-03-23 Miguel de Icaza <miguel@novell.com>
2422 * expression.cs: On BigEndian systems, swap the bytes, temporary
2423 solution until we get a new bitconverter class.
2425 2007-03-23 Martin Baulig <martin@ximian.com>
2429 * decl.cs (MemberCache.AddMembers): Add generic methods both as
2430 "Method" and "Method`1". Normally, a cache lookup is done on the
2431 "Method" form (ie. without the generic arity), but this one makes
2432 lookups on the full form work as well.
2434 2007-03-22 Raja R Harinath <rharinath@novell.com>
2436 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
2439 2007-03-20 Bill Holmes <billholmes54@gmail.com>
2441 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
2442 ordered_member_list, to TypeBuilder to store members to be defined
2443 in the order they were parsed in.
2444 - ordered_explicit_member_list contains all properties indexers
2445 and methods that are defined as explicit implementation of an
2446 interface or base class.
2447 - ordered_member_list contains all properties indexers and methods
2448 that are not defined as explicit implementation of an interface
2451 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
2452 functionality in these removed classes has been replaced with
2453 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
2454 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
2456 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
2457 to CheckForDuplications inside GetMethod and SetMethod Define Method
2458 to handle method property and indexer name conflicts.
2462 All code is contributed under the MIT/X11 license.
2464 2007-03-20 Martin Baulig <martin@ximian.com>
2466 * class.cs (TypeContainer.Interfaces): Removed; they're now
2467 included in `TypeContainer.Types'.
2469 2007-03-20 Martin Baulig <martin@ximian.com>
2471 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
2473 * class.cs (TypeContainer.CreateType): New public method. This is
2474 now called before DefineType() to create the TypeBuilders.
2475 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
2476 has already been created by CreateType().
2477 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
2478 don't resolve our base classes here; this has been moved into
2479 DefineBaseTypes(). We're now called from CreateType().
2480 (TypeContainer.DefineBaseTypes): New private method; resolve our
2481 base classes here. We're now called from DefineType().
2484 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
2485 our types first to create all the TypeBuilders. After that, call
2486 TypeContainer.DefineType() on all the types which'll resolve their
2487 base classes and setup the resolve order.
2489 2007-03-20 Martin Baulig <martin@ximian.com>
2491 * class.cs (TypeContainer.Enums): Removed; they're now included in
2492 `TypeContainer.Types'.
2494 2007-03-20 Martin Baulig <martin@ximian.com>
2497 (TypeContainer.DefineType): Don't call ResolveMembers() here.
2498 (TypeContainer.DoResolveMembers): Call DefineType() on our
2499 `compiler_generated' classes; moved here from DefineNestedTypes().
2502 (RootContext.ResolveTree): Call ResolveMembers() on all
2503 TypeContainer's in the `type_container_resolve_order'.
2505 2007-03-19 Marek Safar <marek.safar@gmail.com>
2507 * class.cs: Use corlib to handle InternalMethodImplAttribute.
2509 2007-03-17 Marek Safar <marek.safar@gmail.com>
2511 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
2512 implementation flags.
2514 2007-03-17 Marek Safar <marek.safar@gmail.com>
2516 * class.cs: More optimizations for type parameters.
2518 2007-03-15 Marek Safar <marek.safar@gmail.com>
2520 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
2522 * ecore.cs, parameter.cs: More common code for both corlibs.
2524 * typemanager.cs (IsGenericMethod): Simplified.
2526 2007-03-15 Raja R Harinath <rharinath@novell.com>
2528 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2530 * statement.cs, iterators.cs, lambda.cs: Update to changes.
2532 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
2533 unconditionally. Simplify explanation.
2534 (Try.Resolve, Using.Resolve): Likewise.
2536 2007-03-15 Martin Baulig <martin@ximian.com>
2540 * decl.cs (DeclSpace): If we're a partial class, use our
2541 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
2543 2007-03-15 Raja R Harinath <rharinath@novell.com>
2545 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2547 (FlowBranching.UsageVector): Update to changes.
2548 (FlowBranching.MergeSiblings): Likewise.
2549 * statement.cs: Likewise.
2551 2007-03-15 Martin Baulig <martin@ximian.com>
2556 (MemberCache): Added a special .ctor for type parameters.
2559 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
2562 2007-03-09 Martin Baulig <martin@ximian.com>
2564 * enum.cs (Enum): Make this a TypeContainer.
2565 (EnumMember): Derive from `Const'.
2568 (Const.DoResolveValue): New protected virtual method; move most of
2569 the functionality of ResolveValue() here so we can override it in
2571 (Const.CreateConstantReference): Make this virtual.
2573 * class.cs (Kind): Add `Kind.Enum'.
2574 (TypeContainer.Emit): Don't emit the enums here; they're already
2575 in the `RootContext.typecontainer_resolve_order'.
2577 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
2578 here; they're already in the `typecontainer_resolve_order'.
2580 * ecore.cs (EnumConstant.ConvertImplicitly): Add
2581 TypeManager.DropGenericTypeArguments().
2584 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
2585 (TypeManager.IsEnumType): Likewise.
2586 (TypeManager.EnumToUnderlying): Likewise.
2587 (TypeManager.IsEqual): Add support for enums.
2589 2007-03-12 Raja R Harinath <rharinath@novell.com>
2591 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
2592 DefaultParameterValueAttribute to be undefined, say if System.dll
2595 2007-03-11 Marek Safar <marek.safar@gmail.com>
2597 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
2600 2007-03-10 Marek Safar <marek.safar@gmail.com>
2602 * class.cs, parameter.cs: Unified parameters verification.
2604 2007-03-08 Martin Baulig <martin@ximian.com>
2606 * cs-parser.jay (constructor_header): Pass the location to the
2607 newly created TopLevelBlock.
2609 2007-03-07 Martin Baulig <martin@ximian.com>
2611 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
2613 2007-03-06 Miguel de Icaza <miguel@novell.com>
2615 * convert.cs (ExplicitReferenceConversionExists): Sync this method
2616 with the changes from David, fixes the build.
2618 2007-03-05 David Mitchell <dmitchell@logos.com>
2620 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
2621 and its base interfaces to a one-dimensional array type S[],
2622 provided there is an implicit or explicit reference conversion
2625 2007-03-03 Marek Safar <marek.safar@gmail.com>
2627 * cs-tokenizer.cs: Implemented basic linq grammar.
2629 * driver.cs: Set linq lang version on demand.
2631 2007-02-26 Marek Safar <marek.safar@gmail.com>
2633 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
2635 2007-02-25 Marek Safar <marek.safar@gmail.com>
2637 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
2640 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
2642 Check property and event extern attributes.
2644 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
2647 2007-02-24 Marek Safar <marek.safar@gmail.com>
2649 A fix for bug #80407
2650 * ecore.cs: Don't report ambiguity error when methods have same parent.
2652 2007-02-23 Marek Safar <marek.safar@gmail.com>
2654 A fix for bug #80878
2655 * class.cs, cs-parser.jay: Event property can host anonymous methods.
2657 2007-02-22 Marek Safar <marek.safar@gmail.com>
2659 * attribute.cs: Enable ExtensionAttribute presence test.
2661 2007-02-22 Marek Safar <marek.safar@gmail.com>
2663 * class.cs: Warn about missing GetHashCode only when Equals is override.
2665 * decl.cs: Check accessibility of type arguments.
2667 * typemanager.cs: Correctly report nullable array.
2669 2007-02-20 Marek Safar <marek.safar@gmail.com>
2671 * class.cs, report.cs: Capture more details when things go wrong.
2673 2007-02-20 Marek Safar <marek.safar@gmail.com>
2675 A fix for bug #80650
2676 * cs-parser.jay: Anonymous container starts at constructor declaration
2677 and not at block beginning because it has to be usable in constructor
2680 * statement.cs: Use context location and not block one for error reporting.
2682 2007-02-18 Marek Safar <marek.safar@gmail.com>
2684 A fix for bug #78712
2685 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
2688 2007-02-18 Marek Safar <marek.safar@gmail.com>
2690 A fix for bug #80493 by Atsushi Enomoto
2691 * cs-parser.jay: Ignore invalid attribute target.
2693 2007-02-18 Marek Safar <marek.safar@gmail.com>
2695 * cs-tokenizer.cs: Ignore '\0' as white space character.
2697 2007-02-17 Miguel de Icaza <miguel@novell.com>
2699 * cs-parser.jay: Add support for lambda expressions to the mcs
2702 * lambda.cs: Only clone when we are probing, not on the final call
2703 (Compatible is the final call).
2705 * statement.cs (CloneContext): Introduce class to provide block
2706 remapping during clone.
2708 All statements Clone themselves now.
2710 (Clone): special handling for blocks, when we clone a block, we
2711 register the block inside this routine, as children of the block
2712 might trigger a lookup.
2714 * expression.cs: Add support for CloneContext in all expressions.
2716 2007-02-17 Marek Safar <marek.safar@gmail.com>
2718 A fix for bug #80493
2719 * statement.cs: Report ambiguous warning when interfaces are not related.
2721 2007-02-15 Marek Safar <marek.safar@gmail.com>
2723 C# 3.0 extension methods.
2725 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
2726 cannot be used directly.
2728 * class.cs (Class.Emit): Emit extension attribute if any class method
2729 is extension method.
2730 (Method.Define): Add basic extension method validation conditions.
2731 (Method.Emit): Emit extension attribute for method.
2733 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
2734 extension method exists. Currently we follow same approach as Microsoft
2735 does, emit even if a method or a class are private but this can change
2738 * cs-parser.jay: Add handling of `this' keyword in method parameters
2741 * decl.cs (DeclSpace.IsStaticClass): New property.
2742 (MemberCache.FindExtensionMethods): Looks for extension methods with
2743 defined name and extension type.
2745 * doc.cs: Updated after OverloadResolve changes.
2747 * driver.cs: Add new soft reference to System.Core.dll.
2749 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
2750 (ExtensionMethodGroupExpr): Represents group of extension methods.
2752 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
2753 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
2754 to MethodGroupExpr and made non-static for easier customization.
2755 (Invocation.DoResolve): Add extension method lookup when no standard
2757 (MemberAccess.DoResolve): Try extension methods if no member exists.
2759 * modifiers.cs: Add METHOD_EXTENSION modifier.
2761 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
2762 as well as candidate extension type.
2763 (ComputeNamespaces): When assembly constains extension methods registers
2765 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
2766 extension method lookup.
2767 (Namespace.LookupExtensionMethod): Looks for extension method in this
2769 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
2770 find a method which matches name and extensionType.
2772 * parameter.cs (Parameter): Add This modifer.
2773 (HasExtensionMethodModifier): New property.
2774 (Resolve): Add extension parameter check.
2775 (ModFlags): turned to property to exclude this modifier as it is not real
2777 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
2779 * support.cs (ParameterData): Add ExtensionMethodType.
2780 (ReflectionParameters): Implemented ExtensionMethodType interface property.
2782 * typemanager.cs: Add type and ctor extension attribute type.
2784 2007-02-15 Miguel de Icaza <miguel@novell.com>
2786 * report.cs (DisableErrors, EnableErrors): used to prevent error
2787 output when we are "trying" to compile various methods with
2790 * ecore.cs (Expression): Add Clone method that calls the virtual
2791 CloneTo method. The current CloneTo method in Expression throws
2792 an exception so we can track down all the places where this must
2793 be implemented (not using abstract, because that would be a lot of
2794 up-front-work before we can start testing the implementation
2797 Important: we only need Clone capabilities for expressions created
2798 by the parser, as the expressions we will be cloning are
2799 expressions in the pre-resolved state. This vastly simplifies
2802 (SimpleName): Add CloneTo that does nothing.
2803 (EmptyCast): Add CloneTo.
2805 * expression.cs (Binary): Implement CloneTo.
2806 (Invocation.IsApplicable): Store the current ec in
2807 EmitContext.TempEc and restore it on return. This is used so we
2808 do not have to sprinkle hundres of methods with an extra
2809 EmitContext, we know that the only user is the lambda expression
2810 ImplicitConversionExists code.
2812 (Argument): Add Cloning capabilities.
2813 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
2814 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
2815 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
2816 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
2817 IndexerAccess): Add Clone capability.
2819 (LocalVariableReference, This): TODO: needs cloned Block mapping.
2821 (Argument): Add cloning capability.
2823 * assign.cs (Assign): Implement CloneTo.
2825 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
2827 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
2828 version by calling Convert with the EmitContext (that we are
2829 currently storing in ec, this is not great, but will do for now,
2830 to avoid passing EmitContext parameters to hundreds of functions
2831 that do not need them now).
2833 (SetExpression): Remove, it is not needed.
2835 (ContextualReturn): Implement CloneTo.
2837 * statement.cs (Statement): Implement cloning infrastructure,
2838 similar to expressions.
2840 (Block): Partial implementation of Clone for statements.
2842 (Return): Implement clone.
2844 * constant.cs (Constant.CloneTo): New method, does nothing.
2846 * codegen.cs (TempEc): Add a static EmitContext as a temporary
2847 solution, until we decide how to exactly do this.
2849 2007-02-14 Marek Safar <marek.safar@gmail.com>
2851 A fix for bug #80493
2852 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
2853 a property is override we need to use second accessor.
2855 2007-02-13 Marek Safar <marek.safar@gmail.com>
2857 A fix for bug #80418
2858 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
2861 2007-02-13 Marek Safar <marek.safar@gmail.com>
2863 Another fix for bug #80749
2864 * pending.cs: Abstract class has priority over interfaces.
2866 2007-02-13 Marek Safar <marek.safar@gmail.com>
2868 Another fix for bug #80749
2869 * pending.cs: Abstract class has priority over interfaces.
2871 2007-02-13 Marek Safar <marek.safar@gmail.com>
2873 Another fix for bug #80749
2874 * pending.cs: Abstract class has priority over interfaces.
2876 2007-02-13 Marek Safar <marek.safar@gmail.com>
2878 Another fix for bug #80749
2879 * pending.cs: Abstract class has priority over interfaces.
2881 2007-02-13 Marek Safar <marek.safar@gmail.com>
2883 * class.cs Better error message.
2885 * driver.cs: Add shorter versions of -optimize option.
2887 2007-02-13 Martin Baulig <martin@ximian.com>
2889 * class.cs (Constructor.Emit): Check the return value of
2890 ec.ResolveTopBlock() and return on error.
2892 2007-02-13 Raja R Harinath <rharinath@novell.com>
2894 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
2895 message to fix error message regression.
2897 2007-02-12 Marek Safar <marek.safar@gmail.com>
2899 * delegate.cs: Delegate creation expression cannot be of Nullable type.
2901 2007-02-12 Marek Safar <marek.safar@gmail.com>
2903 A fix for bug #80749
2904 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
2905 its parent container.
2907 * class.cs (DefineFieldInitializers): Each initializer can has different
2910 * const.cs: Updated.
2912 2007-02-11 Miguel de Icaza <miguel@novell.com>
2914 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
2915 now all the heavy lifting to check that embedded statements or
2916 expressions have the right form is done in the ContextualReturn.
2918 (ContextualReturn): New class.
2920 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
2921 method that can be invoked to report 201, so we do not replicate
2924 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
2926 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
2927 treating tabs as spaces.
2929 2007-02-09 Marek Safar <marek.safar@gmail.com>
2931 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
2932 * assign.cs: Use full implicit conversion for right side check.
2934 2007-02-09 Marek Safar <marek.safar@gmail.com>
2936 * statement.cs (Switch): Switch over boolean type is not standardized.
2938 2007-02-08 Marek Safar <marek.safar@gmail.com>
2940 A fix for bug #80755
2941 * decl.cs (FindBaseEvent): Don't use method cache for events.
2943 2007-02-07 Marek Safar <marek.safar@gmail.com>
2945 * cs-parser.jay: Better syntax error handling.
2947 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
2948 instead of underlying type value.
2950 2007-02-06 Marek Safar <marek.safar@gmail.com>
2952 * driver.cs: Check define identifier before is registered.
2954 * namespace.cs: Use existing error message.
2956 * report.cs: New warning.
2958 2007-02-06 Marek Safar <marek.safar@gmail.com>
2960 A fix for bug #80742
2961 * expression.cs: Delegate Invoke method can be called directly.
2963 2007-02-06 Marek Safar <marek.safar@gmail.com>
2965 A fix for bug #80676
2966 * class.cs (IsEntryPoint): The Main method can have params modifier.
2968 2007-02-04 Miguel de Icaza <miguel@novell.com>
2970 * parameter.cs (Parameter, Parameters): Add Clone method.
2972 * anonymous.cs (Compatible): Turn method into virtual method, so
2973 LambdaExpression can implement a different behavior.
2975 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
2976 out the basic checking here, so it can be used by
2979 * lambda.cs: Introduce "Compatible" function that will do the
2982 2007-02-02 Marek Safar <marek.safar@gmail.com>
2984 * attribute.cs: Unified one error message.
2986 * class.cs (Class): Use type attributes and not properties to test static
2988 (IsEntryPoint): Don's pass local variable.
2990 * convert.cs: Removed duplicate check.
2992 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
2994 * driver.cs: Don't crash when soft reference does not exist.
2996 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
2997 (UsingEntry): Removed redundant allocation.
2999 * parameter.cs: Add fast path for type parameters.
3001 * support.cs: Don't allocate attribute when it's not used.
3003 2007-01-30 Miguel de Icaza <miguel@novell.com>
3006 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
3007 this into a virtual method, so we can override it in LambdaExpression.
3009 * driver.cs: Improve diagnostics in case of failure.
3011 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
3012 write a function that is slightly more complex and that parses:
3014 type identifier [, type identifier]* )
3016 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
3019 (canEmpty ? i >= 0 : i > 0)
3021 2007-01-30 Raja R Harinath <rharinath@novell.com>
3023 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
3024 exception on possibly valid code.
3026 2007-01-29 Raja R Harinath <rharinath@novell.com>
3028 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
3030 (parse_opt_type_arguments): Remove. It's almost the same as
3032 (parse_namespace_or_typename): Use parse_less_than.
3034 2007-01-28 Miguel de Icaza <miguel@novell.com>
3036 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
3037 this bug took a few hours to find, because the state saved and
3038 restored by PushPosition and PopPosition was ignoring the state of
3039 parse_generic_less_than.
3041 I can also now remove the handling of OP_LT and OP_GT, this solves
3044 * cs-tokenizer.cs: store the location for the ARROW token, we use
3047 (PushPosition, PopPosition): save/restore also `current_token',
3048 restore `parse_generic_less_than' (was missing).
3050 (parse_opt_type_arguments): use parse_type, not
3051 parse_namespace_or_typename to parse types.
3053 * lambda.cs: Empty new file, will eventually have the lambda
3054 expression implementation.
3056 * lambda.test: used to test the internal tokenizer.
3058 * report.cs (FeatureIsNotISO1): Rename from
3059 FeatureIsNotStandardized, because it was about the language level
3060 (1 vs 2) it was not about standarization.
3062 (FeatureRequiresLINQ): New.
3064 * support.cs (SeekableStreamReader): Only require that the reader
3065 is a TextReader, not a StreamReader, so we can plug StringReader.
3067 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
3068 given position in the input stream the following tokens can be
3069 parsed as a type followed by an identifier.
3071 (is_punct): after a '(' if parse_type_and_parameter returns true,
3072 then return a special token OPEN_PARENS_LAMBDA which is used to
3073 avoid reduce/reduce errors in the grammar for the
3074 lambda_expression rules.
3076 (parse_type): implement a type parser inside the
3077 tokenizer, the parser only returns true or false depending on
3078 whether the input at a given position can be parsed as a type.
3080 (peek_token): new method used during type parsing.
3082 2007-01-28 Raja R Harinath <rharinath@novell.com>
3085 * anonymous.cs (ScopeInfo.InflateParameters): New.
3086 (AnonymousContainer.Resolve): Use it to redirect types of
3087 delegate parameters.
3089 2007-01-27 Raja R Harinath <rharinath@novell.com>
3092 * expression.cs (Error_InvalidArguments): Don't use two different
3093 messages for CS1503. Use ExtraInformation and
3094 SymbolRelatedToPreviousError instead.
3097 * decl.cs (DeclSpace.initialize_type_params): Don't access
3098 'type_params' of a partial class directly.
3100 2007-01-26 Miguel de Icaza <miguel@novell.com>
3102 * constant.cs: Removed a handful of out-of-range checks that were
3105 2007-01-25 Marek Safar <marek.safar@gmail.com>
3107 * expression.cs (CheckUselessComparison): Add additional check for char
3110 * namespace.cs: Fixed typo.
3112 2007-01-23 Miguel de Icaza <miguel@novell.com>
3114 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
3115 gone, instead we inline the test, preventing the needless casts to
3116 longs, ulongs and doubles for the parameters, avoiding calls to
3117 methods that overchecked stuff, and instead inlined things
3120 2007-01-20 Marek Safar <marek.safar@gmail.com>
3122 * cs-parser.jay: Better parameter error handling.
3124 2007-01-17 Marek Safar <marek.safar@gmail.com>
3126 A fix for bug #80368, #80522
3127 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
3128 whether array initializer contains constants only.
3129 (ArrayCreation.Emit): Use better formula to decide when
3130 are array initializers for static initialization.
3131 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
3132 have to emit even constants otherwise they are pre-initialized.
3134 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
3135 Raja R Harinath <rharinath@novell.com>
3137 Fix emit order of 'get' vs. 'set'.
3138 * support.cs (Accessors): New.
3139 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
3140 Note the order in which accessors are declared in the source.
3141 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
3142 Refactored from Property.Define and Indexer.Define.
3143 (PropertyBase.DefineAccessors): New helper that calls the above in
3144 appropriate order as noted by the parser.
3145 (Property.Define, Indexer.Define): Update to changes.
3146 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
3148 2007-01-17 Raja R Harinath <rharinath@novell.com>
3150 Fix cs0029-6.cs and gcs0029-2.cs (regression)
3151 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
3152 there's an implicit conversion from the current type to the target
3153 type before converting the underlying constant.
3155 2007-01-16 Marek Safar <marek.safar@gmail.com>
3157 * const.cs (ResolveValue): Updated after constant conversion was made more
3160 * constant.cs (GetAttributableValue): constant to object conversion is
3161 used for attributes only.
3162 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
3163 constant conversions.
3164 (LongConstant.ConvertImplicitly): Ditto.
3166 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
3167 (ImplicitConversionStandard): Handle constant conversion as extra step.
3168 It solves the issue when constant conversion was called indirectly like
3169 inside array initializer and constant folding was skipped.
3171 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
3174 * statement.cs(ImplicitConversionStandard): Updated after constant
3175 conversion was made more generic.
3177 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
3179 * expression.cs (As.DoResolve): Use GenericConstraints instead of
3180 Constraints, solves the problem where the compiler incorrectly
3181 reported that a type parameter was not constrained to a class (Bug
3184 2007-01-14 Marek Habersack <grendello@gmail.com>
3186 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
3188 2007-01-14 Marek Safar <marek.safar@gmail.com>
3190 A fix for bug #80368
3191 * assign.cs (FieldInitializer): New class implements field
3192 initializer statement.
3194 * attribute.cs: Update after FieldMember rename.
3196 * class.cs (PropertyBasedMember): New common class for property based
3198 (InterfaceMemberBase): New base class for all members which can be used as
3199 an interface members.
3200 (MethodCore): Moved really common code to InterfaceMemberBase.
3201 (Method.Define): Equal and GetHasCode detection is relevant for methods
3203 (MethodData.Define): Don't assume that public event implements an
3204 interface automatically.
3205 (MethodData.DefineMethodBuilder): Issue an error even if only extern
3207 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
3208 (FieldMember): Merged with FieldBase.
3209 (EventProperty.AEventPropertyAccessor): New specialization to check whether
3210 event extern modifier can be used.
3211 (EventField.EventFieldAccessor): Moved event field specific code here.
3212 (Event.AllowedModifiers): Even event can be extern.
3213 (Event.FindOutBaseMethod): New override specific to events.
3214 (Indexer.parameters): Reintroduce parameters because base class holds
3215 only properties common data.
3216 (Indexer.CheckForDuplications): Indexers are threated as methods so we
3217 need do extra parameters check.
3219 * const.cs: Update after FieldMember rename.
3221 * decl.cs (MemberCache.FindBaseEvent): New method.
3223 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
3224 to reflect that indexer is now derived from PropertyBased.
3226 * ecore.cs (GetMemberType): Made public.
3227 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
3230 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
3232 * typemanager.cs (CSharpSignature): Correctly print event accessors.
3233 (RegisterEvent): Removed.
3234 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
3235 (GetPrivateFieldOfEvent): Renamed to GetEventField.
3237 2007-01-11 Raja R Harinath <rharinath@novell.com>
3240 * statement.cs (CollectionForeach.TryType): Prefer generic
3241 GetEnumerator over non-generic variant. Fix code to follow comments.
3243 2007-01-09 Raja R Harinath <rharinath@novell.com>
3246 * support.cs (ReflectionParameter): Don't use an invalid index on
3247 the generic parameter data.
3249 2007-01-08 Miguel de Icaza <miguel@novell.com>
3251 * driver.cs: Just add a tiny bit of infrastructure.
3253 2007-01-02 Marek Safar <marek.safar@gmail.com>
3255 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
3256 where field type is struct from current assembly.
3258 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
3261 2007-01-02 Marek Safar <marek.safar@gmail.com>
3263 A fix for bug #80381
3264 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
3267 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
3269 (Namespace.LookupType): Always use core types from corlib when speficied.
3271 * report.cs: A new warning.
3273 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
3274 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
3275 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
3277 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
3278 (InitCoreTypes): Set expression type of object_type and value_type
3279 immediately after lookup.
3281 2007-01-01 Miguel de Icaza <miguel@novell.com>
3283 * cs-tokenizer.cs: Accept Pc class characters (Connector
3284 Punctuation) as valid identifiers. Fixes #78259
3286 * expression.cs (Invocation.DoResolve): Moved the check for the
3287 use of `this' for doing method calls to the Invocation resolution
3288 step, after overload resolution has taken place instead of doing
3289 the check at the low-level `This.DoResolve' level.
3291 The `This.DoResolve'(appens before overload resolution, so it has
3292 no way of knowing if the method that will be called will be
3293 instace or static, triggering an erroneous report for cs0188 (Bug
3296 We now do the check for instance method invocations after we know
3297 what method will be called.
3299 (This.CheckThisUsage): Move the actual use of this structure
3300 checking into its own method and expose it.
3302 * Everywhere that called Error_ValueCannotBeConverted: pass a new
3305 Exceptions: Null.ConvertImplicitly,
3306 Constant.ImplicitConversionRequired as there are too many call
3307 sites for passing the ec.
3309 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
3310 EmitContext, if the value is null, then we do not try to provide
3311 the extra information from the error (If a userdefined conversion
3312 exists, as UserDefinedConversion requires a non null-EmitContext).
3316 2006-12-30 Raja R Harinath <rharinath@novell.com>
3318 * flowanalysis.cs (MyBitVector): Document some invariants.
3319 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
3320 introduced below, and add a couple of others,
3322 2006-12-30 Marek Safar <marek.safar@gmail.com>
3324 * attribute.cs (GetMethodObsoleteAttribute): Uses new
3325 GetPropertyFromAccessor and GetEventFromAccessor.
3327 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
3328 overrides non-obsolete one.
3329 (Indexer.Define): Error message has been moved to the parser.
3331 * cs-parser.jay: Better syntax errors handling.
3333 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
3334 when an invocation has no arguments.
3336 * ecore.cs: Removed not used caching.
3338 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
3341 * report.cs: Add a new warning.
3343 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
3345 * typemanager.cs (enumeration_type): Removed.
3346 (CSharpSignature): Reuses IsSpecialMethod.
3347 (IsEqual): Hack for MS BCL.
3348 (GetPropertyFromAccessor): New method.
3349 (GetEventFromAccessor): New method.
3350 (IsSpecialMethod): Fixed to handle more cases.
3352 2006-12-30 Marek Safar <marek.safar@gmail.com>
3354 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
3355 Made white spaces array static.
3357 * ecore.cs (RemoveGenericArity): Optimized.
3359 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
3361 (MyBitVector.initialize_vector): Simplified.
3363 2006-12-22 Miguel de Icaza <miguel@novell.com>
3365 * ecore.cs: Am not entirely happy with this hack, but it seems to
3366 address the issue in 80257 (a small test case for
3369 I set the MethodGroupExpr.Type to an internal compiler type
3370 (itself in this case) to force the resolution to take place. Why
3371 it does not take place with a null is beyond me.
3373 2006-12-20 Marek Safar <marek.safar@gmail.com>
3375 A fix for bug #80288
3376 * expression.cs (ResolveOperator): Consider user defined conversion for
3377 logical and operator too.
3378 (EmitBranchable): Optimization for logical and when full constant folding
3379 could not be applied but one operand is constant.
3381 2006-12-19 Marek Safar <marek.safar@gmail.com>
3383 * class.cs (GetClassBases): Write 5 times every day, will never use
3384 FullName for error reporting.
3386 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
3388 2006-12-19 Martin Baulig <martin@ximian.com>
3390 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
3391 the symbol file info here.
3393 2006-12-18 Marek Safar <marek.safar@gmail.com>
3395 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
3396 of `elseif' is taking then following sections are not taking.
3397 Fixes an issue reported on mono mailing list.
3399 2006-12-18 Marek Safar <marek.safar@gmail.com>
3401 A fix for bug #80300
3402 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
3403 a caller is not taking.
3405 2006-12-18 Raja R Harinath <rharinath@novell.com>
3407 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
3408 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
3409 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
3410 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
3411 * class.cs: Update to changes.
3413 2006-12-17 Marek Safar <marek.safar@gmail.com>
3415 A fix for bug #79934
3416 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
3419 * class.cs (ResolveMembers): Register an iterator in current container and
3422 2006-12-16 Raja R Harinath <rharinath@novell.com>
3425 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
3426 satisfy a params annotated parameter.
3428 2006-12-16 Marek Safar <marek.safar@gmail.com>
3430 A fix for bug #77014
3431 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
3432 paramters correctly and not rely on hacks in Parameters class.
3433 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
3435 (Invocation.VerifyArgumentsCompat): Ditto.
3436 (Invocation.EmitArguments): Changed to correctly emit params arguments at
3439 * parameter.cs (HasParams): Don't assume that params is the last one.
3441 * support.cs (ReflectionParameters.ctor): Look for params attribute
3443 (ReflectionParameters.ParameterType): Removed hack when we returned last
3444 parameter for out of range parameters.
3445 (ParameterName, ParameterModifier): Ditto.
3447 2006-12-14 Marek Safar <marek.safar@gmail.com>
3449 A fix for bug #79987
3450 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
3451 when assembly is not CLS compliant but type is. I have no idea why is this
3454 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
3456 2006-12-13 Miguel de Icaza <miguel@novell.com>
3458 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
3459 in struct constructors, they are basically no-ops.
3461 2006-12-12 Marek Safar <marek.safar@gmail.com>
3463 * cs-tokenizer.cs (Position): Save preprocessor status too.
3465 2006-12-12 Marek Safar <marek.safar@gmail.com>
3467 A fix for bug #77794
3468 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
3470 2006-12-12 Marek Safar <marek.safar@gmail.com>
3472 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
3474 (pp_expr): Report error for an invalid expression.
3475 (handle_preprocessing_directive): Simplified; add more error checking.
3477 2006-12-11 Marek Safar <marek.safar@gmail.com>
3479 A fix for bug #74939
3480 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
3481 directives handling.
3483 2006-12-10 Marek Safar <marek.safar@gmail.com>
3485 A fix for bugs #80093, and #75984
3486 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
3487 logic, it seems to me as it worked before "by coincidence".
3488 (xtoken): Simplified to use reworked handle_preprocessing_directive.
3489 (cleanup): Enabled endif check.
3491 2006-12-09 Marek Safar <marek.safar@gmail.com>
3493 A fix for bug #80162
3494 * statement.cs (CollectionForeach.TryType): Generics and non-generics
3495 enumerators are never ambiguous.
3497 2006-12-08 Raja R Harinath <rharinath@novell.com>
3500 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
3502 2006-12-06 Marek Safar <marek.safar@gmail.com>
3504 A fix for bug #80144
3505 * class.cs (EventProperty.Define): Explicit implementation means
3506 that an even is used.
3508 2006-12-06 Marek Safar <marek.safar@gmail.com>
3510 Fixes the operators implementation (part II)
3512 * cfold.cs (DoConstantNumericPromotions): Renamed to
3513 DoBinaryNumericPromotions and simplified.
3514 (BinaryFold): Couple of conversion fixes; simplified.
3516 * constant.cs, ecore.cs, literal.cs
3517 (ToType): Renamed to ConvertImplicitly.
3518 (Reduce): Renamed to ConvertExplicitly.
3520 * class.cs, convert.cs: Updated.
3522 * expression.cs: TryReduce doesn't throw an exception.
3524 2006-12-01 Marek Safar <marek.safar@gmail.com>
3526 A fix for bug #80108
3527 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
3530 2006-11-30 Marek Safar <marek.safar@gmail.com>
3532 Fixes unary operators implementation (part I)
3535 * cfold.cs (Error_CompileTimeOverflow): Made internal
3537 * const.cs (IConstant): Changed to use reference to constant and
3538 not constant itself.
3539 Updated IConstant implementations.
3541 * constant.cs (CreateConstant): New factory method.
3542 Updated IConstant implementation.
3544 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
3546 * ecore.cs: Updated to use CreateConstantReference.
3548 * enum.cs: Reflects IConstant changes.
3550 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
3552 * literal.cs (NullConstant): Change to be independently usable.
3554 2006-11-29 Martin Baulig <martin@ximian.com>
3556 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
3557 we need to emit the scope initializer before calling the base .ctor.
3559 * anonymous.cs: Merged back from the new anonymous methods branch.
3560 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
3562 * expression.cs (ParameterReference.DoResolveBase): Create a
3563 "normal" ScopeInfo when capturing parameters rather than using the
3564 root scope; this makes things work with anonymous methods having
3568 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
3570 2006-11-22 Marek Safar <marek.safar@gmail.com>
3572 A fix for bug #79987
3573 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
3574 check to a base class.
3575 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
3576 only when assembly has missing attribute.
3577 * report.cs: Update.
3579 2006-11-21 Marek Safar <marek.safar@gmail.com>
3581 * cs-tokenizer.cs: Merged with gmcs version.
3583 2006-11-20 Marek Safar <marek.safar@gmail.com>
3586 * cs-parser.jay: Better error message when partial keyword is misplaced.
3588 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
3590 A fix for bug #79810
3591 report.cs: CS1058 only applies to 2.0 profile (gmcs).
3592 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
3593 a RuntimeWrappedException by default.
3595 2006-11-18 Marek Safar <marek.safar@gmail.com>
3597 A fix for bug #79843
3598 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
3600 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
3602 2006-11-18 Marek Safar <marek.safar@gmail.com>
3604 * driver.cs, namespace.cs: Uses faster IndexOf version.
3606 2006-11-17 Marek Safar <marek.safar@gmail.com>
3608 A fix for bug #79941
3609 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
3611 (Operator.Define): Implicit/Explicit operator of same type is duplicate
3612 even if internal name is different.
3613 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
3614 (UserDefinedConversion): Simplified as the operators cannot be internal.
3615 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
3617 (MethodLookup): Replaced EmitContext with parentType.
3618 * expression.cs: Updated.
3620 2006-11-09 Raja R Harinath <rharinath@novell.com>
3622 * driver.cs (BadAssembly): Handle all the ugliness of
3623 DefineDynamicAssembly.
3625 2006-11-08 Raja R Harinath <rharinath@novell.com>
3627 Address parts of #58244 -- most of what's left is in the runtime
3628 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
3629 CS1509 error checks, and handle them for all assembly loads, not
3630 just the first invocation.
3631 (LoadModule): Likewise. Move handling of 'adder_method' ...
3632 * codegen.cs (AssemblyClass.AddModule): ... here.
3634 2006-11-02 Marek Safar <marek.safar@gmail.com>
3636 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
3637 IEnumerable<T> is ambiguous.
3639 2006-10-31 Marek Safar <marek.safar@gmail.com>
3641 A fix for bug #67689
3642 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
3643 GetEnumerator is ambiguous.
3645 * report.cs: Add new warning.
3647 2006-10-29 Marek Safar <marek.safar@gmail.com>
3649 A fix for bug #78602
3650 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3651 to protected member can be nested type.
3653 2006-10-28 Marek Safar <marek.safar@gmail.com>
3655 A fix for bug #78965
3656 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3657 to protected member must derive from current type.
3659 2006-10-27 Marek Safar <marek.safar@gmail.com>
3661 assign.cs: Reuses error method.
3663 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
3664 instead of type for constants.
3665 (Expression.Error_ValueAssignment): Common error method.
3667 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
3670 2006-10-27 Marek Safar <marek.safar@gmail.com>
3672 A fix for bug #79081
3673 * expression.cs (MemberAccess.DoResolve): Check nested type
3676 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
3678 * doc.cs : nested delegates were not handled. Fixed bug #79754.
3680 2006-10-26 Marek Safar <marek.safar@gmail.com>
3682 A fix for bug #76591
3683 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
3685 2006-10-26 Marek Safar <marek.safar@gmail.com>
3687 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
3688 type forwarder of the same type multiple times.
3690 2006-10-26 Raja R Harinath <rharinath@novell.com>
3693 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
3694 instance as an rvalue, even when we later resolve as an lvalue.
3696 2006-10-25 Martin Baulig <martin@ximian.com>
3698 * anonymous.cs: Fix #79673.
3700 2006-10-24 Marek Safar <marek.safar@seznam.cz>
3702 A fix for bug #79666
3703 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
3704 ignored when is optimized (= default value) as its value is already set.
3706 2006-10-23 Marek Safar <marek.safar@seznam.cz>
3708 A fix for bug #79724
3709 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
3710 TypeContainer for type lookup.
3712 2006-10-23 Marek Safar <marek.safar@seznam.cz>
3714 A fix for bug #79231
3715 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
3716 * expression.cs (OverloadResolve): Always convert type name for
3718 (ResolveNamespaceOrType): Don't confuse a nested type with any
3721 2006-10-18 Martin Baulig <martin@ximian.com>
3723 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
3725 2006-10-17 Miguel de Icaza <miguel@novell.com>
3727 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
3728 an int32, but requesting an int64 from the conversion
3730 2006-10-12 Martin Baulig <martin@ximian.com>
3733 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
3735 2006-10-12 Martin Baulig <martin@ximian.com>
3738 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
3740 2006-10-11 Miguel de Icaza <miguel@novell.com>
3742 * convert.cs: Remove broken code: I was doing the "Existance"
3743 tests for Implicit conversions.
3745 2006-10-10 Miguel de Icaza <miguel@novell.com>
3747 * convert.cs: Added one missing case in
3748 ImplicitStandardConversionExists uint64 to intptr.
3752 * typemanager.cs (uintptr_type): another core known type.
3754 * ecore.cs (OperatorCast): routine used to do cast operations that
3755 depend on op_Explicit. We could change some of the Decimal
3756 conversions to use this.
3758 This one has a probe mechanism that checks both types for an op_
3759 which it coudl be used to eliminate two classes: CastToDecimal
3760 and CastFromDecimal.
3762 * convert.cs: Implement the conversions documented in #59800
3764 2006-10-10 Martin Baulig <martin@ximian.com>
3766 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
3767 before RootScope.ResolveMembers().
3769 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
3770 `CurrentType' if appropriate.
3772 2006-10-09 Marek Safar <marek.safar@seznam.cz>
3774 A fix for bug #78568
3775 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
3776 when contains binary operators.
3777 * cs-parser.jay: Updated.
3779 2006-10-09 Martin Baulig <martin@ximian.com>
3782 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
3783 moved that into Define() and also do the other type parameter
3784 checks there. Fixes #79094. Added gtest-292.cs.
3787 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
3788 since that doesn't include type parameters; don't use `Ldelema'
3789 for type parameters. Fixes #78980. Added gtest-293.cs.
3791 2006-10-08 Marek Safar <marek.safar@seznam.cz>
3794 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
3795 conversion is allowed.
3797 2006-10-06 Marek Safar <marek.safar@seznam.cz>
3799 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
3800 error reporting when no error occurs.
3802 2006-10-06 Marek Safar <marek.safar@seznam.cz>
3804 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
3807 2006-10-06 Raja R Harinath <rharinath@novell.com>
3810 * class.cs (DefineTypeBuilder): Check circular dependencies before
3811 setting the parent of the TypeBuilder.
3812 (CheckRecursiveDefinition): Don't use 'BaseType', since
3813 it may not be valid until after DefineTypeBuilder. Use
3814 'base_type' instead.
3816 2006-10-04 Martin Baulig <martin@ximian.com>
3818 Merged the Anonymous Methods patch.
3820 * anonymous.cs, iterators.cs: The new anonymous methods code.
3822 * statement.cs (Variable): New public abstract class.
3823 (LocalInfo.Variable): New public property.
3824 (LocalInfo.ResolveVariable): New public method.
3825 (Block.Flags): Add `IsIterator'.
3826 (Block.AddVariable): Improved the CS0136 check.
3827 (Block.AnonymousChildren): New public property.
3828 (Block.AddAnonymousChild): New public method.
3829 (ToplevelBlock): Update to use the new anonymous method framework.
3830 (ToplevelBlock.ctor): `container' is now a `Block' and not a
3831 `ToplevelBlock'; this is required to correctly implement the
3833 (Fixed, Using): Use `TemporaryVariable' instead of directly
3834 creating the `LocalBuilder'.
3836 * parameter.cs (Parameter.ResolveVariable): New public method.
3837 (Parameters.ResolveVariable): Likewise.
3839 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
3841 * class.cs (TypeContainer): Replaced the `iterators' list and
3842 corresponding methods with a list of `CompilerGeneratedClass'es.
3843 (TypeContainer.ResolveMembers): New public method.
3844 (Method): `IIteratorContainer' has been replaced by
3847 * expression.cs (VariableReference): New public abstract base
3848 class for `LocalVariableReference', `ParameterReference' and
3851 * codegen.cs (EmitContext): Removed `capture_context',
3852 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
3853 (EmitContext.EmitThis): Removed.
3855 * cs-parser.jay: Replace `iterator_container' with
3858 2006-10-04 Martin Baulig <martin@ximian.com>
3860 * generic.cs (GenericMethod): Don't make this abstract.
3861 (Constraints.Clone): Added dummy implementation.
3863 2006-10-04 Raja R Harinath <harinath@gmail.com>
3866 * namespace.cs (LookForAnyGenericType): Avoid nullref on
3867 'declspaces'. Avoid allocating arrays willy-nilly.
3870 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
3871 cases out of the switch.
3873 2006-09-28 Marek Safar <marek.safar@seznam.cz>
3875 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
3876 message when non-generic type is used with the type arguments.
3877 * expression.cs: Updated.
3879 2006-09-28 Raja R Harinath <rharinath@novell.com>
3882 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
3883 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3884 Change semantics slightly. Don't insist on having only one
3885 temporary EmptyExpression -- just throttle the creation of new ones.
3888 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
3889 non-interfaces too. If no methods are found, don't try to create
3892 2006-09-28 Marek Safar <marek.safar@seznam.cz>
3894 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
3897 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
3898 us produce better error message.
3900 2006-09-27 Marek Safar <marek.safar@seznam.cz>
3902 * expression.cs (Binary.ResolveOperator): Warn about a side effect
3903 of the `|' operator.
3905 * report.cs: A new warning added.
3907 2006-09-27 Martin Baulig <martin@ximian.com>
3909 * generic.cs (GenericMethod): Don't make this abstract.
3911 2006-09-27 Martin Baulig <martin@ximian.com>
3914 (InternalErrorException): Added overloaded ctor taking a params array.
3916 2006-09-26 Marek Safar <marek.safar@seznam.cz>
3918 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
3919 Fixed the cases when same error was reported twice.
3921 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
3922 now report symbol information.
3924 2006-09-25 Martin Baulig <martin@ximian.com>
3926 * class.cs: Completely unified with the gmcs version.
3928 2006-09-25 Martin Baulig <martin@ximian.com>
3930 * typemanager.cs (TypeManager.IsNullableType): New public function.
3931 (TypeManager.IsNullableTypeOf): Likewise.
3932 (TypeManager.IsNullableValueType): Likewise.
3934 * class.cs (MethodCore): Added the `GenericMethod' argument from
3935 gmcs and also unified all classes derived from `MethodCore' with gmcs.
3937 2006-09-24 Raja R Harinath <harinath@gmail.com>
3939 * convert.cs: Unify with gmcs version.
3941 2006-09-24 Marek Safar <marek.safar@seznam.cz>
3943 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
3944 verify them as well.
3946 * report.cs: New warning.
3948 2006-09-24 Marek Safar <marek.safar@seznam.cz>
3950 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
3951 for anonymous block with out argument.
3953 2006-09-24 Marek Safar <marek.safar@seznam.cz>
3955 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
3956 not used private events only.
3958 2006-09-23 Marek Safar <marek.safar@seznam.cz>
3960 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
3962 * const.cs (Const.Define): Check for constant type.
3963 (Const.IsConstantTypeValid): Looks for valid constant types.
3965 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
3967 * ecore.cs (EmptyConstantCast): New common class for all constant based
3970 * expression.cs (Is.DoResolve): Handle null constant especially.
3971 (New.DoResolve): Check for new void().
3972 (MemberAccess.DoResolve): Cope with all kind of nulls.
3974 * literal.cs (NullConstant): Uses EmptyConstantCast.
3975 (NullDefault): Based on EmptyConstantCast.
3976 (NullLiteral): Uses EmptyConstantCast.
3978 * statement.cs (Block.ResolveMeta): Check for constant type.
3980 2006-09-22 Martin Baulig <martin@ximian.com>
3982 * delegate.cs, attribute.cs: Merged with the gmcs versions.
3984 2006-09-22 Raja R Harinath <rharinath@novell.com>
3986 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
3990 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
3991 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
3994 2006-09-22 Martin Baulig <martin@ximian.com>
3996 * ecore.cs: Merged with the gmcs version.
3998 * generic.cs (ConstructedType): New dummy class.
3999 (TypeArguments): Don't make this abstract.
4002 (TypeManager.IsGenericTypeDefinition): New method.
4003 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
4005 2006-09-22 Raja R Harinath <rharinath@novell.com>
4007 * expression.cs (ComposedCast): Check for arrays of TypedReference
4008 before creating the type, not after.
4010 2006-09-21 Marek Safar <marek.safar@seznam.cz>
4012 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
4013 after ToType change.
4015 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
4016 when constant must be implicitly convertible.
4018 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
4020 * ecore.cs (NullCast): Derives from NullConstant.
4022 * expression.cs (Is.DoResolve): Removed useless variables.
4023 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
4024 (New.Constantify): Add enum support.
4025 (MemberAccess.DoResolve): Add warning when accessing null constant or
4028 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
4031 * literal.cs (NullConstant): New abstract class with common
4032 functionality for all null specializations.
4033 (NullDefault): Represents default(X) when result can be
4035 (NullLiteral): Updated.
4037 * report.cs: Add new warning.
4039 2006-09-21 Martin Baulig <martin@ximian.com>
4041 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
4043 2006-09-21 Martin Baulig <martin@ximian.com>
4045 * generic.cs (GenericConstraints): New dummy class.
4046 (Constraints): Likewise.
4047 (TypeParameter): Likewise.
4048 (TypeParameterName): Likewise.
4049 (GenericMethod): Likewise.
4051 * typemanager.cs (TypeManager.GetGenericArguments): New method.
4053 * decl.cs: Merged with the gmcs version.
4055 2006-09-21 Raja R Harinath <rharinath@novell.com>
4057 * generic.cs (TypeParameter): Implement IMemberContainer.
4058 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
4060 * rootcontext.cs: Unify with gmcs version.
4062 * report.cs: Unify with gmcs version.
4063 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
4064 from gmcs/generics.cs.
4065 * generics.cs (TypeParameter): New dummy class.
4067 * support.cs: Unify with gmcs version.
4069 2006-09-20 Raja R Harinath <rharinath@novell.com>
4071 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
4072 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
4074 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
4075 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
4076 * mcs.exe.sources: Add generic.cs.
4078 * codegen.cs: Unify with gmcs version.
4080 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
4081 (EmitContext): Add GenericDeclContainer implementation.
4082 * decl.cs (MemberCore, DeclSpace): Likewise.
4083 * namespace.cs: Remove #ifdef GMCS_SOURCE.
4085 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
4086 MCS TypeManager has a corresponding dummy method.
4088 2006-09-19 Martin Baulig <martin@ximian.com>
4090 * expression.cs: Completely merged with the gmcs version.
4092 2006-09-19 Martin Baulig <martin@ximian.com>
4094 * expression.cs (Invocation): Merged with the gmcs version.
4095 (ArrayAccess.GetStoreOpcode): Likewise.
4097 2006-09-19 Martin Baulig <martin@ximian.com>
4100 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
4101 (TypeManager.IsGenericMethodDefinition): Likewise.
4103 2006-09-19 Martin Baulig <martin@ximian.com>
4106 (TypeManager.IsEqual): Moved the gmcs implementation here.
4107 (TypeManager.DropGenericTypeArguments): Likewise.
4108 (TypeManager.DropGenericMethodArguments): Likewise.
4109 (TypeManager.GetTypeArguments): Moved here from gmcs.
4110 (TypeManager.HasGenericArguments): Likewise.
4112 2006-09-19 Martin Baulig <martin@ximian.com>
4114 * expression.cs (Binary): Merged with the gmcs version.
4116 2006-09-19 Martin Baulig <martin@ximian.com>
4118 * expression.cs (Probe, As, Is): Merged with the gmcs version.
4120 2006-09-19 Martin Baulig <martin@ximian.com>
4122 * typemanager.cs: Merged with the gmcs version.
4124 2006-09-16 Raja R Harinath <rharinath@novell.com>
4126 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
4127 * driver.cs: Likewise.
4129 2006-09-16 Marek Safar <marek.safar@seznam.cz>
4132 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
4133 only if parent type is class.
4134 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
4137 2006-09-15 Marek Safar <marek.safar@seznam.cz>
4140 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
4142 * typemanager.cs(CSharpName): Converts NullType to null.
4144 2006-09-15 Martin Baulig <martin@ximian.com>
4147 (TypeManager.GetMethodName): Added mcs implementation.
4148 (TypeManager.IsEqual): Likewise.
4151 (SimpleName.RemoveGenericArity): Added dummy implementation.
4153 * pending.cs: Merged with the gmcs version.
4155 2006-09-15 Martin Baulig <martin@ximian.com>
4157 * statement.cs: Merge with the gmcs version.
4159 2006-09-15 Martin Baulig <martin@ximian.com>
4161 * statement.cs (Switch): Merge with the gmcs implementation
4162 (without nullables), which is newer.
4164 2006-09-15 Martin Baulig <martin@ximian.com>
4166 * statement.cs (Block.Variables): Make this public.
4167 (ToplevelBlock.Parameters): Make this a property.
4168 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
4170 2006-09-15 Martin Baulig <martin@ximian.com>
4172 * namespace.cs: Merge with the gmcs version.
4174 2006-09-15 Martin Baulig <martin@ximian.com>
4176 * decl.cs (MemberName): Minor code cleanups.
4178 2006-09-15 Martin Baulig <martin@ximian.com>
4180 * parameter.cs: Merge with the gmcs version.
4182 2006-09-15 Martin Baulig <martin@ximian.com>
4184 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
4185 and an error in mcs.
4187 2006-09-15 Martin Baulig <martin@ximian.com>
4189 * flowanalysis.cs: Merged from GMCS; added the generics code into
4190 a `GMCS_SOURCE' conditional so we can share this file.
4192 2006-09-08 Martin Baulig <martin@ximian.com>
4194 * typemanager.cs (TypeManager.interlocked_type): New public field.
4195 (TypeManager.int_interlocked_compare-exchange): New public field.
4196 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
4197 enumerator types here and call InitGenericCoreTypes().
4198 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
4199 after calling InitEnumUnderlyingTypes().
4202 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
4203 `classes_second_stage'.
4205 2006-09-14 Marek Safar <marek.safar@seznam.cz>
4207 * assign.cs, ecore.cs, expression.cs: Share error message text.
4208 * class.cs (FieldMember.Define): Check for varible of static type.
4209 * driver.cs (LoadAssembly): Uses error output for errors.
4210 * statement.cs: Updated.
4212 2006-09-08 Marek Safar <marek.safar@seznam.cz>
4214 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
4217 2006-09-07 Martin Baulig <martin@ximian.com>
4220 (MainDriver): Revert r62663 from Marek; see #70506 for details.
4222 2006-08-29 Miguel de Icaza <miguel@novell.com>
4224 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
4226 2006-08-17 Miguel de Icaza <miguel@novell.com>
4228 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
4229 #52019 and #79064, the use of the \uXXXX sequence in source code
4230 to represent unicode characters.
4232 2006-08-15 Marek Safar <marek.safar@seznam.cz>
4234 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
4236 * class.cs, ecore.cs, statement.cs: Merged to one error message.
4238 2006-08-13 Miguel de Icaza <miguel@novell.com>
4240 * assign.cs: Catch attempts to assign to a method groups in += and
4243 2006-08-13 Marek Safar <marek.safar@seznam.cz>
4246 * cs-parser.jay: Don't destroy current array type by typeof of array's.
4248 2006-08-12 Marek Safar <marek.safar@seznam.cz>
4250 * class.cs (Method.Define): Issue a warning when generic method looks like
4252 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
4255 2006-08-09 Marek Safar <marek.safar@seznam.cz>
4257 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
4259 * decl.cs (MemberCache.FindMembers): When container is interface we need to
4260 search all base interfaces as a member can be ambiguous.
4261 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
4262 Constructor member type filter.
4263 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
4264 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
4265 reporting for returned memberinfos.
4266 * report.cs: Updated.
4267 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
4268 version to work on all runtimes.
4269 (TypeManager.RealMemberLookup): Removed members filtering.
4271 2006-08-08 Raja R Harinath <rharinath@novell.com>
4273 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
4274 (PropertyExpr.EmitAssign): Likewise.
4275 * expression.cs (Indirection.EmitAssign): Likewise.
4276 (LocalVariableReference.EmitAssign): Likewise.
4277 (ParameterReference.EmitAssign): Likewise.
4278 (Invocation.EmitArguments): Likewise.
4279 (ArrayAccess.EmitAssign): Likewise.
4280 (IndexerAccess.EmitAssign): Likewise.
4281 (This.EmitAssign): Likewise.
4282 (ConditionalLogicalOperator.Emit): Likewise.
4285 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
4286 instead of ArrayList. If the hashtable has a LocalBuilder, don't
4287 leave it in after returning it.
4288 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
4290 2006-08-06 Marek Safar <marek.safar@seznam.cz>
4292 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
4295 2006-08-03 Raja R Harinath <rharinath@novell.com>
4297 Fix cs0146-3.cs and cs0146-4.cs.
4298 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
4299 enclosing types don't depend on the current type.
4301 2006-08-02 Raja R Harinath <rharinath@novell.com>
4304 * class.cs (TypeContainer.DoDefineMembers): Use
4305 FindBaseMemberWithSameName on Parent, since we're interested in
4306 whether we hide inherited members or not.
4307 (FindBaseMemberWithSameName): Make slightly more robust.
4309 Fix the non-generic testcase from #77396
4310 * decl.cs (DeclSpace.DeclContainer): Remove override.
4312 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
4313 declspaces for doppelgangers too.
4314 (UsingEntry): Implement IResolveContext.
4315 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
4316 'this' as the resolve context.
4317 (LocalAliasEntry): Likewise.
4319 Implement parts of #77403
4320 * roottypes.cs (RootDeclSpace): New. Used to represent the
4321 toplevel declaration space. Each namespace declaration introduces
4322 a "partial" root declaretion space.
4323 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
4324 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
4325 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
4326 from 'current_namespace.SlaveDeclSpace'.
4327 (namespace_declaration): Likewise.
4328 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
4329 check. It can't happen now.
4330 * decl.cs (DeclSpace.LookupType): Likewise.
4331 * driver.cs (MainDriver): Sanity check.
4333 2006-08-01 Raja R Harinath <rharinath@novell.com>
4335 * decl.cs (DeclSpace.FindNestedType): Remove.
4336 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
4337 LookupTypeContainer to get the container of the nested type.
4338 * class.cs (TypeContainer.FindNestedType): Make non-override.
4340 2006-07-31 Raja R Harinath <rharinath@novell.com>
4342 * decl.cs (DeclSpace.PartialContainer): Move field from ...
4343 * class.cs (TypeContainer.PartialContainer): ... here.
4344 (TypeContainer.AddBasesForPart): New helper.
4345 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
4347 * cs-parser.jay (current_class): Convert to DeclSpace.
4348 (struct_declaration, interface_declaration, class_declaration):
4349 Use AddBasesForPart instead of .Bases directly.
4350 * const.cs, iterators.cs: Update to changes.
4352 2006-07-28 Raja R Harinath <rharinath@novell.com>
4354 * class.cs (TypeContainer.AddMemberType): Rename from
4356 (TypeContainer.AddMember): Rename from AddToMemberContainer.
4357 (AddTypeContainer): New. Combine AddClassOrStruct and
4359 (AddPartial): Update. Add 'is_partial' argument.
4360 * roottypes.cs: Update to changes.
4361 * cs-parser.jay (push_current_class): New helper for handling
4362 current_container and current_class.
4363 (struct_declaration, interface_declaration, class_declaration):
4366 2006-07-26 Raja R Harinath <rharinath@novell.com>
4368 * roottypes.cs: Rename from tree.cs.
4370 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
4371 * tree.cs (Tree, ITreeDump): Remove types.
4372 * rootcontext.cs (tree, Tree): Remove fields.
4373 (root, ToplevelTypes): New.
4374 * *.cs: Update to rename.
4376 * tree.cs (Tree.RecordDecl): Remove.
4377 (RootTypes.AddToTypeContainer): Record the toplevel type in its
4379 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
4381 2006-07-23 Raja R Harinath <harinath@gmail.com>
4383 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
4384 DoFlowAnalysis and OmitStructFlowAnalysis here.
4385 (ec.With): Rename from WithUnsafe and generalize.
4386 (ec.WithCheckState): Remove. All users can be handled by 'With'.
4387 (ec.WithFlowAnalyis): New.
4388 * ecore.cs, expression.cs, statement.cs: Update.
4390 2006-07-22 Raja R Harinath <harinath@gmail.com>
4392 * statement.cs (Block.ResolveMeta): Simplify slightly.
4394 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
4395 multiple boolean fields. Convert InUnsafe, constant_check_state,
4396 check_state to flags.
4397 (CheckState, ConstantCheckState): Update.
4398 (InUnsafe): New read-only property.
4399 (FlagsHandle): Rename from CheckStateHandle and convert to handle
4401 (WithUnsafe): New helper similar to WithCheckState.
4402 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
4403 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
4405 2006-07-21 Raja R Harinath <rharinath@novell.com>
4407 Make comparisons use the same IL irrespective of whether they're
4408 in a 'checked' or 'unchecked' context: one of the issues in #78899
4409 * codegen.cs (EmitContext.CheckState): Make read-only property.
4410 (EmitContext.ConstantCheckState): Likewise.
4411 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
4412 helper that implement a save/restore stack for CheckState
4413 values. This is the only way to change check-state.
4414 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
4415 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
4416 (CheckedExpr.EmitBranchable): New forwarding method.
4417 (UnCheckedExpr): Likewise.
4418 * statement.cs (Block.ResolveMeta): Use WithCheckState.
4419 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
4420 (Checked.Resolve, checked.DoEmit): Likewise.
4422 2006-07-20 Miguel de Icaza <miguel@novell.com>
4424 * anonymous.cs: Cache the resolved anonymous delegate, and return
4425 this so that the ResolveTopBlock is only triggered once, not
4428 Currently we trigger ResolvetopBlock twice due to a first pass of
4429 argument check compatibility, and a second pass that does the
4432 2006-07-15 Marek Safar <marek.safar@seznam.cz>
4434 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
4436 * rootcontext.cs (Reset): Add helper_classes.
4438 2006-07-15 Marek Safar <marek.safar@seznam.cz>
4441 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
4444 2006-07-13 Miguel de Icaza <miguel@novell.com>
4446 * statement.cs (Lock): Handle expressions of type
4447 TypeManager.null_type specially. Fixes #78770
4449 2006-07-08 Marek Safar <marek.safar@seznam.cz>
4451 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
4454 2006-07-08 Marek Safar <marek.safar@seznam.cz>
4456 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
4457 for accessors as well.
4458 * ecore.cs (EventExpr): Add AccessorTable.
4460 2006-07-01 Marek Safar <marek.safar@seznam.cz>
4463 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
4464 for CS0122 where appropriate.
4465 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
4467 (Filter): Assembly can be null in the case of top level attributes.
4469 2006-06-25 Marek Safar <marek.safar@seznam.cz>
4473 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
4474 is done at global level.
4476 2006-06-24 Marek Safar <marek.safar@seznam.cz>
4478 A fix for #77002, Implemented TypeForwarder support.
4480 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
4481 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
4482 * typemanager.cs (): Add type_forwarder_attr_type.
4484 2006-06-24 Marek Safar <marek.safar@seznam.cz>
4486 * report.cs: Add CS0469 warning.
4488 2006-06-21 Martin Baulig <martin@ximian.com>
4490 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
4491 the `try'-block, so we also report CS0016 etc. there.
4493 2006-06-21 Martin Baulig <martin@ximian.com>
4496 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
4498 2006-06-21 Martin Baulig <martin@ximian.com>
4500 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
4501 also report CS1686 for parameters.
4503 2006-06-21 Martin Baulig <martin@ximian.com>
4505 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
4506 instead of an error if the value is not implicitly convertible to
4507 the switch types; fixes #77964.
4509 2006-06-21 Raja R Harinath <rharinath@novell.com>
4512 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
4513 FieldBuilder is null.
4516 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
4517 'left' and 'right' before error-checking.
4519 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
4521 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
4523 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
4524 (FieldExpr.DoResolve): likewise.
4525 (PropertyExpr.InstanceResolve): likewise.
4526 (EventExpr.InstanceResolve): likewise.
4528 2006-06-04 Marek Safar <marek.safar@seznam.cz>
4530 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
4531 attribute applicable tests for attribute argument.
4533 2006-06-02 Raja R Harinath <rharinath@novell.com>
4536 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
4537 (Binary.OverloadResolve_PredefinedIntegral): New.
4538 (Binary.OverloadResolve_PredefinedFloating): New.
4539 (Binary.OverloadResolve_PredefinedString): New.
4540 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
4541 Follow the standard more closely, and treat numeric promotions in
4542 terms of overload resolution.
4543 (Binary.CheckShiftArguments): Simplify.
4545 2006-06-01 Raja R Harinath <rharinath@novell.com>
4547 * flowanalysis.cs (MyBitVector): Simplify representation.
4548 (MyBitVector.Clone): Avoid allocating BitArray.
4549 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
4550 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
4551 (*): Update. Change all references to MyBitVector.And and
4552 MyBitVector.Or to &= and |=.
4554 2006-05-29 Raja R Harinath <rharinath@novell.com>
4557 * cs-parser.jay (formal_parameter_list): Extend the pattern below
4558 to param arguments too.
4560 2006-05-26 Miguel de Icaza <miguel@novell.com>
4562 * cs-parser.jay: Catch another parsing form for arglist being
4563 followed by other arguments. Fixes #78313.
4565 2006-05-24 Raja R Harinath <rharinath@novell.com>
4567 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
4568 checking of out parameters to ...
4569 (FlowBranchingToplevel.Merge): ... here.
4570 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
4571 set, propagate the origin upward, and only complain if there was
4573 (FlowBranchingException.AddContinueOrigin): Likewise.
4574 (FlowBranchingException.AddReturnOrigin): Likewise.
4575 (FlowBranchingException.AddGotoOrigin): Likewise.
4577 2006-05-23 Raja R Harinath <rharinath@novell.com>
4579 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
4580 unreachable, skip it.
4581 (FlowBranchingException.Merge): Always propagate jumps, even if
4582 the finally block renders subsequent code unreachable.
4584 2006-05-18 Raja R Harinath <rharinath@novell.com>
4587 * statement.cs (Goto.Resolve): Move responsibility for resolving
4588 'goto' to FlowBranching.AddGotoOrigin.
4589 (Goto.SetResolvedTarget): New. Callback to set the
4590 LabeledStatement that's the target of the goto.
4591 (Goto.DoEmit): Use Leave instead of Br when crossing an
4592 unwind-protect boundary.
4593 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
4594 LookupLabel and adjust to new semantics.
4595 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
4596 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
4597 Goto.SetResolvedTarget to update target.
4598 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
4599 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
4600 AddBreakOrigin & co. Delay propagation until ...
4601 (FlowBranchingException.Merge): ... this.
4603 * statement.cs (Block.Resolve): Always depend on flow-branching to
4604 determine unreachability. Kill workaround that originally emitted
4605 only one statement after an "unreachable" label (see infloop in
4608 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
4609 This is still "wrong", but anything better would probably need a
4610 multi-pass algorithm.
4611 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
4612 usage vector. Force current usage vector to be reachable, to
4613 optimistically signify backward jumps.
4614 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
4616 (FlowBranchingLabeled.Merge): New. If no backward jump was
4617 detected, return the original salted-away usage vector instead,
4618 updated with appropriate changes. Print unreachable warning if
4620 * statement.cs (Block.Resolve): Don't print unreachable warning on
4621 a labeled statement.
4623 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
4625 * driver.cs: Pass filename without path to AssemblyBuilder's
4626 AddResourceFile. Fixes bug #78407.
4628 2006-05-17 Raja R Harinath <rharinath@novell.com>
4630 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
4631 * flowanalysis.cs (FlowBranchingLabeled): ... here.
4632 (FlowBranching.MergeChild): Overwrite
4633 reachability information from Labeled branchings too.
4635 2006-05-16 Raja R Harinath <rharinath@novell.com>
4637 * statement.cs (Goto.Resolve): Merge jump origins here ...
4638 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
4640 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
4641 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
4642 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
4643 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
4645 * statement.cs (Goto.Resolve): ... not here.
4646 (Goto.Emit): Remove CS1632 check.
4648 2006-05-14 Marek Safar <marek.safar@seznam.cz>
4650 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
4653 2006-05-11 Raja R Harinath <rharinath@novell.com>
4655 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
4656 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
4657 (FlowBranchingException.Label): Likewise.
4659 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
4661 (MyBitVector.Or): Use it to avoid losing information (Count).
4662 (FlowBranching.MergeOrigins): Likewise.
4664 * flowanalysis.cs (UsageVector.IsDirty): Remove.
4665 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
4666 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
4667 (UsageVector.ToString): Simplify.
4668 (UsageVector.MergeSiblings): Move here from ...
4669 (FlowBranching.Merge): ... here.
4670 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
4673 2006-05-10 Raja R Harinath <rharinath@novell.com>
4675 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
4676 null bitvector is treated as all-true.
4678 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
4679 (MyBitVector): Rationalize invariants. 'vector != null' implies
4680 that we have our own copy of the bitvector. Otherwise,
4681 'InheritsFrom == null' implies all inherited bits are true.
4683 2006-05-09 Marek Safar <marek.safar@seznam.cz>
4685 * statement.cs (LocalInfo): Add IsConstant.
4686 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
4687 local variable for constants.
4689 2006-05-09 Raja R Harinath <rharinath@novell.com>
4691 * flowanalysis.cs (MyBitVector.Empty): New.
4692 (MyBitVector): Don't allow InheritedFrom to be null.
4693 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
4694 (UsageVector, FlowBranching): Update to changes.
4696 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
4697 recursion. The 'Parent == null' condition isn't sufficient for
4699 (FlowBranching.AddBreakOrigin): Likewise.
4700 (FlowBranching.AddContinueOrigin): Likewise.
4701 (FlowBranching.AddReturnOrigin): Likewise.
4702 (FlowBranching.StealFinallyClauses): Likewise.
4703 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
4704 (FlowBranching.CheckOutParameters): Likewise.
4705 (FlowBranchingToplevel): Terminate all the above recursions here.
4706 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
4707 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
4709 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
4711 (FlowBranchingToplevel): New. Empty for now.
4712 (FlowBranching.MergeTopBlock): Update.
4713 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
4714 branching for the anonymous delegate.
4715 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
4717 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
4718 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
4719 information at the start of the merge. Reorganize.
4721 2006-05-07 Marek Safar <marek.safar@seznam.cz>
4723 * class.cs (MethodData.Define): Method cannot implement interface accessor.
4725 2006-05-07 Marek Safar <marek.safar@seznam.cz>
4727 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
4728 to newly introduced ctor.
4730 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
4731 message to one place.
4732 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
4735 2006-05-07 Marek Safar <marek.safar@seznam.cz>
4737 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
4739 * ecore.cs (Expression.ResolveAsConstant): Updated.
4741 * statement.cs (ResolveMeta): Updated.
4743 2006-05-06 Marek Safar <marek.safar@seznam.cz>
4745 * cs-parser.jay: __arglist cannot be used in initializer.
4747 2006-05-06 Marek Safar <marek.safar@seznam.cz>
4750 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
4753 2006-05-05 Raja R Harinath <rharinath@novell.com>
4755 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
4756 (LabeledStatement): Add 'name' parameter.
4757 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
4758 (Block.AddLabel): Update to changes.
4759 * cs-parser.jay (labeled_statement): Likewise.
4761 * flowanalysis.cs (BranchingType.Labeled): New.
4762 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
4763 (FlowBranchingLabeled): New. Does nothing for now, but will
4764 eventually handle 'goto' flows.
4765 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
4766 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
4767 that's terminated ...
4768 (Block.Resolve): ... here.
4770 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
4771 (UsageVector.MergeFinallyOrigins): Likewise.
4772 (FlowBranching.InTryOrCatch): Likewise.
4773 (FlowBranching.AddFinallyVector): Likewise.
4774 (FlowBranchingException): Update to changes.
4777 * statement.cs (Return.Resolve): Move error checking to ...
4778 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
4779 (FlowBranchingException): Handle return origins like break and
4781 (FlowBranching.UsageVector.CheckOutParameters): Remove.
4783 2006-05-04 Marek Safar <marek.safar@seznam.cz>
4786 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
4789 2006-05-04 Marek Safar <marek.safar@seznam.cz>
4792 * class.cs (MethodData.Define): Do public accessor check only when method
4793 implements an interface.
4795 2006-05-04 Raja R Harinath <rharinath@novell.com>
4797 Remove special handling of 'break'
4798 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
4799 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
4800 (UsageVector.Break): Remove.
4801 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
4803 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
4805 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
4806 UsageVector.Breaks (). Don't set NeedsReturnLabel.
4808 2006-05-03 Marek Safar <marek.safar@seznam.cz>
4811 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
4812 be the interface member.
4814 2006-05-03 Marek Safar <marek.safar@seznam.cz>
4817 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
4818 for emitting small (int) values.
4820 2006-05-03 Raja R Harinath <rharinath@novell.com>
4823 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
4824 control-flow passes through the 'finally' after merging-in all the
4825 control-flows from 'try' and the 'catch' clauses.
4827 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
4828 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
4829 always true at the only non-recursive entry point.
4830 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
4831 FlowBranchingBreakable.
4832 (FlowBranchingLoop): Remove.
4833 * statement.cs (Return.DoResolve): Update to changes.
4836 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
4837 (FlowBranching.CreateBranching): Handle it: create a
4838 FlowBranchingContinuable.
4839 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
4840 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
4841 except that it handles the 'continue' command.
4842 (FlowBranching.UsageVector.MergeOrigins): Rename from
4844 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
4845 except that it overrides AddContinueOrigin.
4846 (FlowBranchingException): Override AddContinueOrigin, similar to
4848 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
4849 Create a new branching around the embedded statement.
4850 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
4851 control flow after the embedded statement.
4852 (Continue.Resolve): Move all error checking to AddContinueOrigin.
4854 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
4855 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
4856 FlowBranchingBreakable.
4857 (FlowBranchingSwitch): Remove.
4860 * statement.cs (Break.Resolve): Simplify. Move responsibility for
4861 error reporting to ...
4862 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
4863 Rename from 'AddBreakVector'. Add new location argument. Return
4864 a bool indicating whether the 'break' crosses an unwind-protect.
4865 (FlowBranchingException.AddBreakOrigin): Add.
4866 (FlowBranchingException.Merge): Propagate 'break's to surrounding
4867 flowbranching after updating with the effects of the 'finally'
4869 (FlowBranchingBreakable): New common base class for
4870 FlowBranchingLoop and FlowBranchingSwitch.
4872 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
4874 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
4876 2006-05-02 Raja R Harinath <rharinath@novell.com>
4878 * statement.cs (Do.Resolve): If the loop is infinite, set the
4880 (While.Resolve, For.Resolve): Set a barrier after the embedded
4881 statement. There's no direct control flow that goes from the end
4882 of the embedded statement to the end of the loop.
4883 * flowanalysis.cs (FlowBranching.Infinite): Remove.
4884 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
4885 above ensure that the reachability is correctly computed.
4887 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
4888 (UsageVector.MergeBreakOrigins): If the current path is
4889 unreachable, treat it as if all parameters/locals are initialized.
4890 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
4891 infinite loops before merging-in break origins.
4893 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
4894 (Reachability.Reachable): Split part into ...
4895 (Reachability.Unreachable): ... this. Simplify.
4896 (Reachability.IsUnreachable): Use 'Unreachable' instead.
4898 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
4899 (Reachability.SetThrowsSometimes): Likewise.
4900 (FlowBranchingBlock.MergeTopBlock): Don't compare against
4901 TriState.Always, use corresponding property.
4902 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
4903 (Block.Resolve): Likewise. Remove some redundant checks.
4905 2006-05-02 Raja R Harinath <harinath@gmail.com>
4907 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
4908 (Reachability.Meet): Don't bother checking AlwaysThrows --
4909 barrier is always set.
4910 (FlowBranchingBlock.Merge): Likewise.
4912 2006-05-01 Raja R Harinath <harinath@gmail.com>
4914 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
4915 checks for unreachable.
4917 2006-05-01 Marek Safar <marek.safar@seznam.cz>
4920 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
4922 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
4923 whether field is really assigned.
4925 2006-04-30 Raja R Harinath <harinath@gmail.com>
4927 * flowanalysis.cs (Reachability): Make 4-argument constructor
4929 (Reachability.Meet): Rename from 'And'. Remove static variant.
4930 (Reachability.Always): Rename from the highly misleading
4931 'Reachability.Never'.
4932 (FlowBranching.Merge): Update to changes. Mark an impossible
4933 situation with a 'throw'.
4934 (*): Update to changes.
4936 2006-04-29 Raja R Harinath <harinath@gmail.com>
4938 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
4940 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
4941 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
4942 (*): Update to changes.
4943 * statement.cs: Update to changes.
4945 2006-04-28 Marek Safar <marek.safar@seznam.cz>
4948 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
4950 2006-04-28 Raja R Harinath <harinath@gmail.com>
4952 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
4955 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
4956 argument to two arguments: an usage-vector and a bool. Move call
4957 to FlowBranching.Merge () ...
4958 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
4960 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
4961 handling of loop and switch reachability to ...
4962 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
4964 2006-04-27 Raja R Harinath <harinath@gmail.com>
4966 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
4967 handling to FlowBranchingLoop.InLoop.
4968 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
4970 2006-04-26 Marek Safar <marek.safar@seznam.cz>
4973 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
4974 anonymous method is allowed from AnonymousContainer here.
4976 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
4978 2006-04-24 Raja R Harinath <rharinath@novell.com>
4981 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
4983 2006-04-23 Marek Safar <marek.safar@seznam.cz>
4986 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
4987 (DoubleConstant.Reduce): Ditto.
4989 2006-04-23 Raja R Harinath <rharinath@novell.com>
4991 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
4992 Remove 'lvalue_right_side' argument. Move parts to ...
4993 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
4994 (LocalVariable.DoResolveLValue): ... these.
4996 2006-04-21 Raja R Harinath <rharinath@novell.com>
4999 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
5000 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
5001 (LocalVariableReference.DoResolveBase): Use it to implement new
5003 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
5004 (Argument.Resolve): Simplify. Move CS1510 check ...
5005 * ecore.cs (Expression.ResolveLValue): ... here.
5006 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
5007 (PropertyExpr.DoResolveLValue): Likewise.
5008 (FieldExpr.Report_AssignToReadonly): Likewise.
5009 (FieldExpr.DoResolve): Add 'out_access' argument. Use
5010 LValueMemberAccess or LValueMemberOutAccess on instance depending
5012 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
5013 DoResolve as appropriate.
5015 2006-04-20 Raja R Harinath <rharinath@novell.com>
5018 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
5019 implicit conversions on 'out' and 'ref' arguments.
5021 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
5022 improve clarity. Remove dead code.
5025 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
5026 (Catch.Resolve): Resolve VarBlock if it exists.
5028 2006-04-19 Miguel de Icaza <miguel@novell.com>
5030 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
5031 twice, this was some residual code, the enumerator was emitted
5032 properly in the two branche of if later.
5034 2006-04-19 Raja R Harinath <rharinath@novell.com>
5036 * expression.cs (Cast.ResolveLValue): Remove. The result of a
5037 cast is never an lvalue.
5038 (Cast.DoResolve, Cast.ResolveRest): Combine.
5039 (Argument.Emit): Simplify slightly. Move 'Expr is
5040 IMemoryLocation' check ...
5041 (Argument.Resolve): ... here.
5042 (Argument.Error_LValueRequired): Remove. Inline into only user.
5044 Simplifications. Fix cs0191-2.cs
5045 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
5046 CS1649 and CS1651 to ...
5047 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
5048 the actual selection of the error code and message to a lookup
5049 table. Add a dummy return value to simplify callsites.
5050 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
5051 readonly fields of other instances of the same type. Move CS0197
5053 * expression.cs (Argument.Resolve): ... here. Simplify code.
5054 Ensure that ec.InRefOutArgumentResolving is only set during LValue
5055 resolution of an out or ref argument. The code simplification
5056 above uses this invariant.
5058 2006-04-18 Raja R Harinath <rharinath@novell.com>
5060 Possibly fix #77752. Fix cs1690-[4-7].cs.
5061 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
5062 CheckMarshallByRefAccess. Drop parameter.
5063 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
5065 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
5067 * report.cs (AllWarnings): Add CS1690.
5068 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
5070 (LocalVariableReference.DoResolveBase): Update.
5072 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5074 * class.cs (MethodOrOperator): Moved common parts from method class.
5075 detect obsolete attributes.
5076 (Method.Define): Simplified as it reuses code from base.
5077 (Constructor.ValidAttributeTargets): Fixed issue found during
5079 (Destructor.ValidAttributeTargets): Fixed issue found during
5081 (Operator): Finished refactoring set off by #78020. Operator class is now
5082 ordinary method class.
5084 * anonymous.cs: Updated.
5086 * decl.cs (DeclSpace): Add IsGeneric
5088 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5090 * class.cs (Constructor.Emit): Don't emit the attributes twice.
5092 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5094 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
5095 detect obsolete attributes.
5096 (Method.CreateEmitContext): Moved to MethodOrOperator.
5098 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5101 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
5102 customized exception to make crash detection easier.
5103 (MethodOrOperator): Started to work on new base class for methods and
5105 (Method): Derives from MethodOrOperator.
5106 (Constructor.Emit): Emits its own attributes.
5107 (AbstractPropertyEventMethod.Emit): Ditto.
5108 (Operator): Derives from MethodOrOperator, will refactor fully in extra
5110 (Operator.Emit): It's temporary more tricky than should be.
5112 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
5114 * report.cs (InternalErrorException): Add ctor with inner exception.
5116 2006-04-08 Marek Safar <marek.safar@seznam.cz>
5119 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
5122 2006-04-07 Marek Safar <marek.safar@seznam.cz>
5125 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
5128 2006-04-06 Marek Safar <marek.safar@seznam.cz>
5130 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
5131 attribute is present and Guid not.
5132 (Interface.ApplyAttributeBuilder): Ditto.
5134 * attribute.cs: Add error message.
5136 2006-04-06 Marek Safar <marek.safar@seznam.cz>
5140 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
5141 sources (it's composite) so hold them in extra array as they are used in
5142 Emit phase only. It worked in the previous versions by mistake.
5143 (Attribute.Emit): Emit attribute for more owners when exist.
5145 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
5146 it has now different behaviour.
5148 2006-04-04 Marek Safar <marek.safar@seznam.cz>
5150 * constant.cs (Constant.IsDefaultInitializer): New method.
5152 * class.cs: Updated.
5154 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
5155 re-initialize default values. It saves KBs almost for every assembly.
5156 Thanks Zoltan for the idea.
5157 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
5158 (ArrayCreation.DoResolve): Resolve only once.
5159 (ArrayCreation.Emit): Emit static initializer only when it is faster.
5160 (ArrayCreation.GetAttributableValue): Cope with optimized values.
5162 2006-04-03 Zoltan Varga <vargaz@gmail.com>
5164 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
5167 2006-04-01 Marek Safar <marek.safar@seznam.cz>
5169 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
5170 in an embedded statement too.
5172 2006-04-01 Raja R Harinath <rharinath@novell.com>
5175 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
5177 2006-04-01 Marek Safar <marek.safar@seznam.cz>
5181 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
5184 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
5186 2006-03-31 Marek Safar <marek.safar@seznam.cz>
5188 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
5191 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
5192 LocalTemporary change.
5194 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
5196 (ClassOrStruct.DefineFieldInitializers): Implemented static field
5197 initializers optimization.
5198 (ClassOrStruct.TypeAttr): Moved from modifiers.
5199 (Constructor.CheckBase): Don't crash when static ctor has parameters.
5200 (FieldBase.ResolveInitializer): Resolves initializer.
5201 (FieldBase.HasDefaultInitializer): New property.
5203 * cs-parser.jay: Removed message.
5205 * expression.cs (CompilerGeneratedThis): New specialization.
5207 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
5209 2006-03-28 Marek Safar <marek.safar@seznam.cz>
5211 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
5213 2006-03-27 Marek Safar <marek.safar@seznam.cz>
5215 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
5216 be now EnumConstants only.
5218 2006-03-27 Marek Safar <marek.safar@seznam.cz>
5220 * attribute.cs, driver.cs: Reset more caches.
5222 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5224 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
5226 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5228 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
5229 for easier reuse. Updated all overrides.
5230 (IntegralConstant): New base class for all integral constants.
5231 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
5232 of the constant range, report custom error.
5233 (UIntConstant.Reduce): Fixed uint conversion.
5235 * ecore.cs, literal.cs: Reduce updates.
5237 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5241 * class.cs (Constructor.Define): Removed extra if for default ctors.
5242 A patch from Atsushi Enomoto.
5244 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5246 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
5247 GetAttributableValue.
5249 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
5252 * convert.cs (ImplicitConversionRequired): Error message moved to
5255 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
5256 automatic implicit conversion of an output value.
5257 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
5259 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
5261 (TypeOf.GetAttributableValue): Add extra handling for object type.
5263 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
5264 special error message.
5266 2006-03-25 Marek Safar <marek.safar@seznam.cz>
5268 * class.cs (Constructor.Emit): Don't crash when struct ctor is
5270 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
5271 compatible with MS runtime.
5273 2006-03-23 Marek Safar <marek.safar@seznam.cz>
5275 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
5276 attribute arguments here.
5278 * class.cs (Indexer.Define): The check was moved to attribute class.
5280 2006-03-22 Marek Safar <marek.safar@seznam.cz>
5282 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
5283 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
5286 2006-03-22 Raja R Harinath <rharinath@novell.com>
5288 Support ParameterDefaultValueAttribute in gmcs. Also applied to
5289 mcs to keep code differences small.
5290 * attribute.cs (Attribute.GetParameterDefaultValue): New.
5291 * typemanager.cs (parameter_default_value_attribute_type): New.
5292 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
5295 2006-03-21 Marek Safar <marek.safar@seznam.cz>
5297 * expression.cs (StringConcat.Append): Reverted back to no warning state.
5299 2006-03-21 Marek Safar <marek.safar@seznam.cz>
5301 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
5303 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
5306 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
5308 * doc-bootstrap.cs : fix build.
5310 2006-03-20 Marek Safar <marek.safar@seznam.cz>
5312 * expression.cs (StringConcat.Append): Issue a warning when empty string
5315 2006-03-20 Marek Safar <marek.safar@seznam.cz>
5317 * assign.cs (CompoundAssign.ResolveSource): Removed.
5319 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
5322 * class.cs (TypeContainer.FindMethods): Removed.
5323 (TypeContainer.CheckMemberUsage): Made static.
5325 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
5327 * constant.cs (CheckRange): Removed unused type argument.
5328 (CheckUnsigned): Removed unused type argument.
5330 * cs-parser.jay: Updated after MemberAccess clean up.
5331 Uses Length for empty string test.
5333 * cs-tokenizer.cs: Uses Length for empty string test.
5334 (IsCastToken): Made static.
5335 (is_hex): Made static.
5336 (real_type_suffix): Made static.
5338 * decl.cs (SetupCache): Made static.
5339 (OnGenerateDocComment): Removed unused ds argument.
5341 * delegate.cs (VerifyDelegate): Removed unused argument.
5343 * doc.cs: Uses Length for empty string test.
5345 * driver.cs: Uses Length for empty string test.
5347 * enum.cs (IsValidEnumType): Made static
5349 * expression.cs (EnumLiftUp): Removed unused argument.
5350 (ResolveMethodGroup): Ditto.
5351 (BetterConversion): Ditto.
5352 (GetVarargsTypes): Ditto.
5353 (UpdateIndices): Ditto.
5354 (ValidateInitializers): Ditto.
5355 (MemberAccess.ctor): Ditto.
5356 (GetIndexersForType): Ditto.
5358 * flowanalysis.cs: (MergeFinally): Removed unused argument.
5360 * iterators.cs: Updated after MemberAccess clean up.
5362 * location.cs: Uses Length for empty string test.
5364 * namespace.cs: Uses Length for empty string test.
5366 * report.cs (CheckWarningCode): Made static.
5368 * statement.cs (LabeledStatement): Removed unused argument.
5370 * typemanager.cs (FilterNone): Removed.
5372 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5374 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
5377 * class.cs: Updated.
5379 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5381 * cs-parser.jay.cs: __arglist is not allowed for delegates.
5383 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5387 * expression.cs (VerifyArgumentsCompat): Reverted to double error
5388 reporting, it's more tricky than I thought.
5390 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5394 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
5396 (AnonymousMethod.ImplicitStandardConversionExists): New method.
5397 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
5398 Add more error reporting; Fixed issue with params.
5400 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
5402 * cs-parser.jay: AnonymousMethod requires host container.
5404 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
5406 2006-03-18 Raja R Harinath <harinath@gmail.com>
5408 * class.cs: Change 'TypeContainer ds' constructor argument to
5409 'DeclSpace parent'. Some classes were missed below due to
5410 different naming convention.
5412 * class.cs (MemberCore.Parent): Delete. This makes the
5413 ParentContainer changes below enforceable by the compiler.
5415 Treat pointers to enclosing declaration space as 'DeclSpace', not
5417 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
5418 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
5420 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
5422 (Block.AddThisVariable): Likewise.
5423 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
5424 (AbstractPropertyEventMethod.Emit): Likewise.
5425 (AbstractPropertyEventMethod.EmitMethod): Likewise.
5426 (GetMethod.Define, SetMethod.Define): Likewise.
5427 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
5428 (DelegateMethod.EmitMethod): Likewise.
5430 Fix regression test-partial-13.cs.
5431 Rationalize use of PartialContainer. Ensure that the partial
5432 class semantics can be tied to type-correctness, i.e., any
5433 violation will cause a compile error.
5434 * class.cs, const.cs: Access all fields that belong to class
5435 TypeContainer via ParentContainer. Arguments of EmitContexts and
5436 Resolve()-like functions still use 'Parent'.
5438 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
5439 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
5440 (PropertyMethod.CheckModifiers): Remove unused argument.
5441 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
5444 2006-03-17 Raja R Harinath <harinath@gmail.com>
5446 Make semantics of PartialContainer simpler.
5447 * decl.cs (DeclSpace.IsPartial): Remove.
5448 * class.cs (TypeContainer.IsPartial): Likewise.
5449 (TypeContainer..ctor): Set PartialContainer to point to self.
5450 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
5451 (TypeContainer.FindNestedType): Likewise.
5452 (MemberCore.ParentContainer): Simplify. Remove deprecation.
5454 2006-03-17 Marek Safar <marek.safar@seznam.cz>
5456 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
5458 2006-03-15 Marek Safar <marek.safar@seznam.cz>
5460 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
5463 2006-03-15 Marek Safar <marek.safar@seznam.cz>
5465 * class.cs (Operator.Define): An error for base conversion was not
5468 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
5470 * iterator.cs : yield break is allowed in try statement which has
5471 catch clauses. Fixed bug #77767.
5473 2006-03-13 Marek Safar <marek.safar@seznam.cz>
5475 A fix for #77593, #77574.
5477 * class.cs (MethodCore.CheckBase): Another if for operator.
5479 2006-03-09 Marek Safar <marek.safar@seznam.cz>
5481 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
5484 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
5485 (DelegateCreation.ImplicitStandardConversionExists): New method for just
5488 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
5491 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
5492 Updated after another emitcontext usage was clean up. It should help us to
5493 synchronize with gmcs easier.
5495 2006-03-04 Marek Safar <marek.safar@seznam.cz>
5499 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
5500 (Event.Define): ditto
5501 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
5503 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
5504 Removed redundant code and set NewSlot for Invoke method too.
5506 * parameter.cs (Parameters.ctor): Add custom, type ctor.
5507 (Parameters.MergeGenerated): New method. Use this method when you merge
5508 compiler generated argument with user arguments.
5510 2006-03-03 Marek Safar <marek.safar@seznam.cz>
5512 * attribute.cs (ResolveAsTypeTerminal): Removed.
5514 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
5515 specialization for predefined types; 30% speed up.
5516 Finally placed obsolete check to right place.
5517 (Expression.ResolveType): Removed.
5519 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
5520 Updated after ResolveType was removed.
5522 * expression.cs (Cast.ctor): Check void cast.
5523 (Binary.ResolveAsTypeTerminal): Is never type.
5524 (Conditional.ResolveAsTypeTerminal): Is never type.
5526 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
5528 2006-03-01 Raja R Harinath <rharinath@novell.com>
5531 * expression.cs (ParameterReference.DoResolveBase): Change return
5533 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
5537 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
5540 * typemanager.cs (GetFullNameSignature): Don't nullref on
5541 protected accessors.
5543 2006-02-27 Marek Safar <marek.safar@seznam.cz>
5545 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
5546 these two separated members to simplify the code.
5547 (Attribute.Resolve): Refactored to use new fields and methods.
5548 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
5549 implemented obsolete attribute checking.
5550 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
5551 implemented obsolete checking again. It look line never ending quest ;-)
5552 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
5554 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
5556 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
5558 *class.cs (Property.Define): Add RegisterProperty call.
5560 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
5561 argument groups (only 2).
5563 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
5564 encoding expression to arguments.
5565 (Expression.ExprClassToResolveFlags): Just turned to property.
5567 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
5568 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
5569 optimized as well as implemented support for zero-length attributes.
5571 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
5572 Add caching of PropertyInfo's.
5574 2006-02-25 Marek Safar <marek.safar@seznam.cz>
5576 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
5577 error multiple times.
5579 2006-02-25 Marek Safar <marek.safar@seznam.cz>
5581 New partial class implementation.
5582 A fix for #77027, #77029, #77403
5584 * attribute.cs (Attributable): Made attributes protected.
5586 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
5587 the replacements of ClassPart and PartialContainer.
5588 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
5589 (TypeContainer.AddInterface): Ditto.
5590 (TypeContainer.AddPartial): The main method for partial classes. It checks
5591 for errors and merges ModFlags and attributes. At the end class is added to
5593 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
5595 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
5596 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
5597 from the rest of partial classes.
5598 (TypeContainer.GetClassBases): Simplified.
5599 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
5601 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
5602 (TypeContainer.HasExplicitLayout): Uses Flags now.
5603 (PartialContainer): Removed.
5604 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
5605 (StaticClass): Was merged with Class.
5606 (Class.GetClassBases): class and static class bases are verified here.
5607 (Class.TypeAttr): Added static attributes when class is static.
5608 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
5609 (MemberBase): In some cases we need to call parent container for partial
5610 class. It should be eliminated but it's not easy now.
5612 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
5614 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
5615 partial classed to accumulate class comments.
5616 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
5618 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
5620 * driver.cs (MainDriver): Tree.GetDecl was removed.
5622 * modifiers.cs (Modifiers): Add partial modifier.
5624 * tree.cs (Tree.decl): Removed.
5625 (RootTypes): Started to use this class more often for root types
5628 2006-02-22 Marek Safar <marek.safar@seznam.cz>
5632 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
5633 external interface does not have an attribute.
5635 2006-02-22 Marek Safar <marek.safar@seznam.cz>
5637 Another prerequisites for new partial classs implementation.
5639 * attribute.cs (Attribute.Equal): Implemented.
5640 (Attribute.Emit): Changed as attributes can be applied more than twice.
5641 (Attributes.Emit): Check for duplicate attributes here.
5643 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
5644 as a parameter, clean-up.
5646 2006-02-11 Marek Safar <marek.safar@seznam.cz>
5650 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
5651 contains obsolete attribute check which can in some cases look for base
5652 type of current class which is not initialized yet.
5653 (TypeContainer.BaseType): Replacement of ptype.
5655 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
5657 2006-02-11 Marek Safar <marek.safar@seznam.cz>
5659 First of prerequisites for new partial classs implemention.
5661 * attribute.cs (Attributable): Extended by ResolveContext;
5662 Attributes finally have correct context for resolving in all cases.
5663 (AttachTo): Attribute owner is assigned here.
5665 * codegen.cs (IResolveContext): Introduce new interface to hold
5666 all information needed in resolving phase.
5667 (EmitContext): Implements IResolveContext; more clean-up needed here.
5669 * decl.cs (MemberCore): Implemented IResolveContext.
5671 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
5672 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
5673 parameter.cs, statement.cs, tree.cs, typemanager.cs:
5674 Refactored to use new IResolveContext instead of EmitContext; cleanup
5676 2006-02-06 Miguel de Icaza <miguel@novell.com>
5678 * codegen.cs (EmitScopeInitFromBlock): check here the
5679 capture_context, there is no need to make two calls to the
5682 * anonymous.cs: Add some debugging messages that might help me
5683 track other instances of this problem in the future (the
5684 regression of test 467).
5686 * cs-parser.jay: track the variable block, as we need to initalize
5687 any captured variables declared in this block for the "catch"
5688 portion of the "Try" statement.
5690 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
5691 scope initialization for captured variables.
5693 Also, move the emit for the variables after the block location has
5696 2006-02-06 Marek Safar <marek.safar@seznam.cz>
5698 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
5700 2006-02-02 Miguel de Icaza <miguel@novell.com>
5702 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
5703 commit yesterday, the initialization for the roots is necessary.
5704 What is not necessary is the scope activation.
5706 2006-02-02 Raja R Harinath <rharinath@novell.com>
5708 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
5709 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
5711 (Argument.Resolve): Remove CS0206 checks.
5713 2006-02-01 Miguel de Icaza <miguel@novell.com>
5715 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
5716 scopes for all the roots, the scopes will now be emitted when the
5717 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
5719 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
5720 code. This reduces a lot of existing cruft.
5722 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
5723 that the ScopeInfo is generated as we enter the scope, not at the
5724 time of use, which is what we used to do before.
5726 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
5727 every time a Block is about to be emitted if we have a
5730 2006-02-01 Raja R Harinath <rharinath@novell.com>
5732 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
5734 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
5736 * typemanager.cs (cons_param_array_attribute): Make private.
5737 (Reset): Set it to null.
5738 (InitCoreHelpers): Don't initialize it.
5739 (ConsParamArrayAttribute): New. Initialize it as needed.
5740 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
5742 2006-01-31 Miguel de Icaza <miguel@novell.com>
5744 * expression.cs: There might be errors reported during the
5745 selection of applicable methods. If there are errors, do not
5746 continue execution as it will lead the compiler to crash.
5748 2006-01-30 Miguel de Icaza <miguel@novell.com>
5750 * expression.cs: Member access is not allowed on anonymous
5751 methods. Fixes #77402.
5753 2006-01-30 Raja R Harinath <rharinath@novell.com>
5756 * cs-parser.jay (VariableDeclaration): Don't set
5757 current_array_type to null.
5758 (field_declaration, event_declaration, declaration_statement):
5759 Set it to null here.
5761 2006-01-28 Raja R Harinath <harinath@gmail.com>
5763 * typemanager.cs (GenericParameterPosition): New.
5766 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
5768 * doc.cs : To process "include" elements, first we should create
5769 another list than XmlNodeList, because it could result in node
5770 removal, which could result in that the XmlNodeList gives up
5773 (Also made code identical to gmcs again.)
5775 2006-01-25 Miguel de Icaza <miguel@novell.com>
5777 * ecore.cs: Introduce an error report that we were not catching
5778 before, if not silent, we must report the error. Gonzalo ran into
5781 2006-01-23 Miguel de Icaza <miguel@novell.com>
5783 A fix for bug: #76957
5785 * iterators.cs (MoveNextMethod.CreateMethodHost): call
5786 ComputeMethodHost before creating the method, this is a new
5789 * anonymous.cs (AnonymousContainer): Now we track all the scopes
5790 that this method references (RegisterScope). The actual scope
5791 where the method is hosted is computed with the ComputeMethodHost
5792 before we create the method.
5794 Moved the Deepest routine here.
5796 (AnonymousContainer.ComputeMethodHost): New routine used to
5797 compute the proper ScopeInfo that will host the anonymous method.
5799 (ScopeInfo): Deal with multiple roots. The problem was that we
5800 did not have a unique root where all ScopeInfos could be hanged
5801 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
5804 Remove AdjustMethodScope which is now computed at the end. Remove
5805 LinkScope which did a partial link, instead link all ScopeInfos
5806 before code generation from the new "LinkScopes" routine.
5808 Simplify all the Add* routines as they no longer need to maintain
5809 the tree, they just need to record that they are using variables
5812 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
5813 routines to produce the forest of ScopeInfo trees.
5815 * class.cs (TypeContainer.AppendMethod): This is just like
5816 AddMethod, but ensures that an interface implementation method
5817 (IEnumerable.XXX) is not inserted at the beginning of the queue of
5818 methods, but at the end.
5820 We use this functionality to ensure that the generated MoveNext
5821 method in the iterator class is resolved/emitted before the
5822 enumerator methods created.
5824 This is required because the MoveNext method computes the right
5825 ScopeInfo for the method. And the other methods will eventually
5826 need to resolve and fetch information computed from the anonymous
5829 2006-01-21 Raja R Harinath <harinath@gmail.com>
5830 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5833 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
5835 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
5836 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
5838 2006-01-18 Raja R Harinath <rharinath@novell.com>
5840 Fix #76656, cs0231-2.cs.
5841 * cs-parser.jay (formal_parameter_list): Make error case catch
5843 (parenthesized_expression_0): Add CS1026 check.
5844 (invocation_expression): Remove unused { $$ = lexer.Location }.
5846 2006-01-17 Raja R Harinath <rharinath@novell.com>
5849 * cs-parser.jay (statement_expression): Don't list out the
5850 individual statement-expressions. Convert syntax error into
5853 2006-01-16 Raja R Harinath <rharinath@novell.com>
5856 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
5857 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
5858 CheckIntermediateModification.
5859 (FieldExpr.DoResolve): Add new two-argument version that
5860 allows us to resolve the InstanceExpression as an lvalue.
5861 The one-argument variant is now just a wrapper.
5862 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
5863 Resolve the lhs as an lvalue if the it has a value type.
5864 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
5865 from Assign.DoResolve.
5866 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
5867 resolved as an lvalue.
5868 (PropertyExpr.DoResolve): Update.
5869 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
5870 has a value type. Move CS1612 check here from
5871 CheckIntermediateModification.
5872 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
5873 * expression.cs (EmptyExpression.OutAccess): New. Used as the
5874 'right_side' of a ResolveLValue on an 'out' argument.
5875 (EmptyExpression.LValueMemberAccess): New. Used as the
5876 'right_side' of a propagated ResolveLValue on a value type.
5877 (LocalVariableReference.DoResolveBase): Recognize
5878 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
5880 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
5881 EmptyExpression.Null.
5883 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
5885 * typemanager.cs : added IsGenericParameter(). In mcs it always
5887 * doc.cs : for generic parameters, use GenericParameterPosition,
5890 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
5892 * expression.cs: Fix Console.WriteLine ((this = x).foo);
5894 2006-01-12 Miguel de Icaza <miguel@novell.com>
5896 This fixes the problem where we used ldfld instead of ldflda to
5897 load the "THIS" pointer on captured parameters, when THIS is a
5898 value type. See bug #77205.
5900 * iterators.cs (CapturedThisReference.Emit): Pass false to
5901 EmitThis (we do not need the address).
5903 * codegen.cs (EmitThis): it needs to know whether we need the
5904 address of `this' or not. This is used by value types.
5906 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
5907 every other call passes false.
5909 2006-01-12 Raja R Harinath <rharinath@novell.com>
5912 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
5914 * expression.cs (Invocation.OverloadResolve): Update.
5915 (Invocation.DoResolve): Avoid double resolution of invocation.
5917 2006-01-11 Raja R Harinath <rharinath@novell.com>
5920 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
5921 unary negation of floating point types as 0-expr; negation cannot
5922 overflow in floating point types.
5925 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
5926 on operands of 'void' type.
5929 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
5930 and ExclusiveOr for boolean constants too.
5932 2006-01-09 Raja R Harinath <rharinath@novell.com>
5935 * expression.cs (Invocation.OverloadResolve): Replace reflected
5936 override methods with their base virtual methods, rather than
5938 * typemanager.cs (TypeManager.GetOverride): New.
5940 2006-01-05 Jb Evain <jbevain@gmail.com>
5942 * class.cs (Property.Define, Indexer.Define): do not tag the
5943 properties as SpecialName | RTSpecialName.
5945 2006-01-04 Miguel de Icaza <miguel@novell.com>
5947 * class.cs (MethodCore.IsDuplicateImplementation): This method was
5948 doing a low-level comparission of parameter types. It was lacking
5949 a check for __argslist.
5951 2005-12-30 Miguel de Icaza <miguel@novell.com>
5953 * expression.cs (ParameterReference.DoResolveBase): Allow
5954 reference parameters if they are local to this block.
5956 This allows the ref and out parameters of a delegate to be used in
5957 an anonymous method, for example:
5959 delegate void set (out int x);
5961 set s = delegate (out int x){
5965 This is used by functionality introduced late in the C# language.
5967 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
5968 method that take ref and out parameters.
5970 Fixes #77119 which was a late change in the spec.
5972 2005-12-23 Miguel de Icaza <miguel@novell.com>
5974 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
5975 parent if its the same scope. Fixes #77060.
5977 2005-12-21 Miguel de Icaza <miguel@novell.com>
5979 * driver.cs: Report the case of no source files and no -out:
5982 2005-12-20 Raja R Harinath <rharinath@novell.com>
5985 * expression.cs (ComposedCast.GetSignatureForError): Define.
5987 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5991 * namespace.cs (NamespaceEntry): Add extern_aliases as a
5992 ListDictionary, to contain the ExternAliasEntry entries (in
5993 addition to the NamespaceEntry.aliases hashtable). This field is
5994 shared between the original entry and its doppelganger (bodyless
5996 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
5997 extern_aliases field.
5998 (NamespaceEntry.Lookup): Move the IsImplicit check after the
5999 lookup in extern_aliases.
6001 2005-12-16 Raja R Harinath <rharinath@novell.com>
6004 * class.cs (TypeContainer.Mark_HasEquals): New.
6005 (TypeContainer.Mark_HasGetHashCode): New.
6006 (ClassPart): Override them.
6007 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
6010 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
6011 'parent' argument to the base constructor.
6013 Remove all mention of TypeContainer from decl.cs.
6014 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
6015 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
6016 (DeclSpace.DeclSpace): Likewise.
6017 (DeclSpace.DefineMembers): Remove unused argument.
6018 * cs-parser.jay (pop_current_class): Update to changes. Simplify
6019 debugging check -- we don't care if the debug code throws an
6020 InvalidCastException instead of an InternalErrorException.
6021 * class.cs (TypeContainer.DefineMembers): Update to changes.
6022 (TypeContainer.DoDefineMembers): Likewise.
6023 (TypeContainer.GetMethods): Likewise.
6024 (PropertyMember.Define): Likewise.
6025 (MemberBase.Parent): New property that forwards to
6026 MemberCore.Parent, but ensures that we get a TypeContainer.
6027 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
6028 (RootContext.PopulateTypes): Likewise. Remove special case code
6029 for !RootContext.StdLib: DefineMembers is idempotent.
6031 2005-12-14 Miguel de Icaza <miguel@novell.com>
6033 * convert.cs (ExplicitConversionCore): Check the return value from
6034 ExplicitConversionCore which can return null on failure. Fixes #76914
6036 2005-12-13 Marek Safar <marek.safar@seznam.cz>
6038 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
6040 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
6042 * doc.cs : The search for referenced namespace was insufficient to
6043 get global one as it used to do. Fixed bug #76965.
6045 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
6047 * doc.cs : check name in cref in the last phase that whether it is
6050 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6052 * cs-tokenizer.cs : reverted the latest change: it somehow broke
6055 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6057 * doc.cs : so it turned out that we cannot skip override check for
6058 interface members. Fixed bug #76954.
6060 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6062 * cs-tokenizer.cs : fixed bug #75984:
6063 - #warning and #error should not be handled when the source line
6065 - #line is not checked strictly when the source line is disabled.
6066 - #define and #undef is on the other hand checked strictly at any
6069 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
6071 * cs-tokenizer.cs : missing Location (actually, filename) in one of
6074 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6076 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
6078 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
6080 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
6081 (FieldBase.Initializer): Initializer is now optional.
6082 (EventField.Define): Only event field can have initializer.
6084 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
6086 * const.cs (Const): Reuse initializer.
6088 * cs-parser.jay: Updated after FieldBase changes.
6089 Added current_array_type to simplify array initializers.
6091 * ecore.cs (NullCast.IsDefaultValue): Implemented.
6093 * expression.cs, iterators.cs: Updated.
6095 * namespace.cs (NamespaceEntry): Made UsingFound private.
6097 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6099 * parameterCollection.cs: Obsolete, removed.
6100 * parser.cs: Obsolete, removed.
6102 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6105 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
6107 * enum.cs (Enum.Define): Set obsolete context here.
6109 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
6112 - FindDocumentedMember() now expects 1) paramList as null
6113 when "we don't have to check the number of parameters" and
6114 2) Type.EmptyTypes when "there is no arguments".
6115 - Introduced FoundMember struct to hold the exact type which was
6116 used to find the documented member (the above change broke
6117 test-xml-044; it might be better just to use DeclaringType than
6118 what MS does, like this change does, but it depends on usage.)
6120 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
6122 * doc.cs : documented member might be from DeclaringType for nested
6123 types. Fixed bug #76782.
6125 2005-12-03 Ben Maurer <bmaurer@ximian.com>
6127 * anonymous.cs: Have the param code handle leaving copies on the
6128 stack etc. Allows anonymous params to take part in the assignment
6129 code (++, +=, etc). Fixes bug #76550
6131 * expression.cs: Handle the prepare_for_load/leave_copy by passing
6132 it down to the anon code.
6134 * iterators.cs: Use dummy var here
6136 * codegen.cs: Handle new vars
6138 2005-12-01 Marek Safar <marek.safar@seznam.cz>
6141 * class.cs (MethodData.Define): Set proper Obsolete context.
6143 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
6145 (FieldExpr.DoResolve): Ditto.
6147 2005-12-01 Marek Safar <marek.safar@seznam.cz>
6150 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
6151 parent is not obsolete.
6153 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
6155 * doc.cs : (FindDocumentedMember) find parameterless members first
6156 and get CS0419 in the early stage. Fixed first case of bug #76727.
6158 2005-11-30 Marek Safar <marek.safar@seznam.cz>
6161 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
6162 no error was reported.
6164 *expression.cs (Binary.DoResolve): left can be null.
6166 2005-11-22 Marek Safar <marek.safar@seznam.cz>
6169 * class.cs (MethodData.Emit): Parameters should be labeled first.
6171 2005-11-21 Marek Safar <marek.safar@seznam.cz>
6174 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
6176 2005-11-18 Marek Safar <marek.safar@seznam.cz>
6178 * attribute.cs (AreParametersCompliant): Moved to Parameter.
6180 * class.cs (MethodCore): Parameter clean up.
6181 (IMethodData): Added ParameterInfo.
6182 (MethodData): Parameter clean up.
6183 (Indexer.Define): Parameter clean up.
6195 * typemanager.cs: Parameter clean up.
6197 * delegate.cs (Define): Get rid of duplicated code.
6199 * expression.cs (ParameterReference): Removed useless parameters
6201 (Invocation): Ditto.
6203 * parameter.cs (ParamsParameter): New class, params specialization.
6204 (ArglistParameter): Attemp to separate arglist.
6205 (Parameter): Refactored to be reusable and faster.
6206 (Parameter.Modifier): Made understandable.
6207 (Parameters): Changed to be used as a class for `this' assembly
6208 parameters. Refactored to use new specialized classes.
6210 * support.cs (ParameterData): Added Types property.
6211 (InternalParameters): Deleted.
6213 2005-08-20 Martin Baulig <martin@ximian.com>
6215 Merging this patch from GMCS to fix #75867.
6217 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
6218 scope if we don't already have it.
6220 2005-11-17 Martin Baulig <martin@ximian.com>
6223 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
6224 inherit the scope from our parent. Fixes #76653.
6226 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6228 * doc.cs : the previous patch does not actually fix the bug.
6229 PropertyInfo override check is now implemented and really fixed it.
6230 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
6232 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6234 * doc.cs : apply "override filter" also to properties.
6237 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6239 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
6240 no need to check overrides. For classes, omit those results from
6241 interfaces since they must exist in the class. Fixed bug #76726.
6243 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6245 * typemanager.cs : (GetFullNameSignature) differentiate indexers
6246 with different parameters. Fixed the second problem in #76685.
6248 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6250 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
6251 get expected 'protected' access in CheckValidFamilyAccess()).
6254 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6256 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
6257 Fixed bug #76705. CS1569 was incorrectly commented out.
6259 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
6261 * doc.cs : use Invocation.IsOverride() to do real override check.
6262 * expression.cs : made Invocation.IsOverride() internal.
6264 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
6266 * doc.cs : use TypeManager.FindMembers() instead of (possible)
6267 TypeBuilder.FindMembers() and filter overriden base members out.
6270 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6272 * doc.cs : ref/out parameters are represented as '@' (instead of
6273 '&' in type FullName). Fixed bug #76630 (additionally crefs).
6275 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6277 * doc.cs : when there was no '.' in cref to methods in doc comment,
6278 then parameters were missing in the output. Fixed bug #76691.
6280 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6282 * driver.cs : don't output docs when there is an error.
6285 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6288 Now it should detect indexers. Fixed primary concern in bug #76685.
6289 Fixed CS0419 message to not show the identical member signature in
6292 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6294 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
6295 instead of Type.FindMembers() since it does not handle events.
6298 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
6300 * codegen.cs: Fixed typo (speficied -> specified).
6302 2005-11-11 Marek Safar <marek.safar@seznam.cz>
6305 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
6307 2005-11-11 Marek Safar <marek.safar@seznam.cz>
6309 * attribute.cs: Changed error message.
6311 * cs-tokenizer.cs: One more check.
6313 2005-11-10 Marek Safar <marek.safar@seznam.cz>
6315 * statement.cs (Block.Resolve): Ignore empty statement.
6317 2005-11-10 Marek Safar <marek.safar@seznam.cz>
6319 * report.cs: Made error/warning methods more strict to avoid
6322 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
6323 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
6324 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
6325 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
6327 2005-11-08 Marek Safar <marek.safar@seznam.cz>
6329 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
6330 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
6332 * class.cs (TypeContainer.IsComImport): New property.
6333 (Constructor.Define): Create proper ctor for ComImport types.
6335 * expression.cs (New.CheckComImport): Fixed.
6337 2005-11-07 Miguel de Icaza <miguel@novell.com>
6339 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
6340 that a parameter has been captured does not mean that we do not
6341 have to do the rest of the processing. This fixes the second part
6342 of #76592. If there was another anonymous method capturing
6343 values in the past, the Scope would never be set for the second
6344 method that captured the same parameter.
6346 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
6347 properly manipulate the stack. Second part of fix for #76592.
6349 * expression.cs (New): Add support for invoking "new" on
6350 interfaces that have been flagged with the ComImport attribute and
6351 the CoClass. Fixes #76637
6353 * statement.cs (Try.DoEmit): When a variable is captured, do not
6354 try to emit the vi.LocalBuilder variable as it has been captured.
6355 Create a temporary variable and store the results on the
6356 FieldBuilder. Fixes #76642
6358 2005-11-07 Marek Safar <marek.safar@seznam.cz>
6360 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
6362 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
6364 * expression.cs (Binary.DoResolve): Added && optimalization.
6366 * typemanager.cs (AddUserType): Removed useless argument.
6368 2005-11-04 Marek Safar <marek.safar@seznam.cz>
6370 * statement.cs (Block.variables): Uses ListDictionary.
6372 2005-11-03 Marek Safar <marek.safar@seznam.cz>
6375 * class.cs (PartialContainer.EmitType): Customized to emit
6376 security attributes.
6377 (ClassPart.ApplyAttributeBuilder): Transform security attribute
6378 for partial classes.
6380 2005-11-03 Marek Safar <marek.safar@seznam.cz>
6383 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
6384 access has to be fixed.
6386 * typemanager.cs (IsUnmanagedType): Wrong common field type.
6388 2005-11-01 Marek Safar <marek.safar@seznam.cz>
6391 * ecore.cs (NullCast.Reduce): Implemented.
6393 * expression.cs (ArrayCreation.CheckIndices): Correcly check
6396 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
6398 (Foreach.Resolve): Catch null properly.
6400 2005-10-29 Marek Safar <marek.safar@seznam.cz>
6402 * cs-tokenizer.cs: Warning text fix.
6404 * driver.cs: AllWarningNumbers exposed on public interface.
6406 * report.cs (): Reviewed warning numbers.
6407 (IsValidWarning): Use binary search.
6409 2005-10-29 Marek Safar <marek.safar@seznam.cz>
6411 * driver.cs: Implemeted resource visibility.
6412 (Resources): New class for code sharing between /res: and
6415 2005-10-28 Marek Safar <marek.safar@seznam.cz>
6418 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
6421 * convert (Convert.ImplicitReferenceConversion): NullCast holds
6424 * ecore.cs (NullCast): Child is contant only.
6426 * literal.cs (NullLiteral.Reduce): null can be converted to any
6429 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
6431 * driver.cs: Use Encoding.Default as default code page instead
6434 2005-10-27 Raja R Harinath <rharinath@novell.com>
6437 * expression.cs (Invocation.Error_InvalidArguments): Handle
6438 __arglist parameters.
6439 (Invocation.VerifyArgumentsCompat): Likewise.
6440 * support.cs (ReflectionParameters.GetSignatureForError): Print
6441 __arglist parameters.
6442 (InternalParamters.GetSignatureForError): Likewise.
6443 * parameter.cs (Parameters.GetSignatureForError): Likewise.
6445 2005-10-26 Marek Safar <marek.safar@seznam.cz>
6447 * attribute.cs (GetPropertyValue): Made public.
6449 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
6451 Add new property WrapNonExceptionThrows to handle 2.0 assembly
6453 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
6456 * driver.cs: Reflect method name change.
6458 * statement.cs (Try.Resolve): Warn when try has both general
6461 * typemanager.cs: runtime_compatibility_attr_type new predefined
6464 2005-10-26 Raja R Harinath <harinath@gmail.com>
6467 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
6468 treat it as an empty parameter list.
6470 2005-10-26 Raja R Harinath <rharinath@novell.com>
6473 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
6474 ResolveAsTypeStep silent.
6475 * statement.cs (Block.AddConstant): Mark block as used.
6476 (Block.ResolveMeta): Avoid piling on error messages
6477 if a constant initializer resolution fails.
6479 2005-10-25 Raja R Harinath <rharinath@novell.com>
6481 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
6483 (NamespaceEntry.VerifyAllUsing): New.
6484 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
6485 behaviour. Delegates actual resolution of alias to ...
6486 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
6487 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
6489 * driver.cs (Driver.MainDriver): Update.
6491 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
6492 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
6494 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
6496 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
6497 RootNamespace.DefineNamespacesForAll.
6499 2005-10-24 Raja R Harinath <harinath@gmail.com>
6501 * typemanager.cs (assemblies, external_aliases, modules)
6502 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
6503 (ComputeNamespaces, GetRootNamespace): Remove extra staging
6504 overhead. Move resposibility ...
6505 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
6506 * driver.cs, attribute.cs, codegen.cs: Update to changes.
6508 2005-10-23 Raja R Harinath <harinath@gmail.com>
6510 * namespace.cs (RootNamespace.all_namespaces): Renamed from
6511 cached_namespaces. Improve usage.
6512 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
6513 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
6514 Move from GlobalRootNamespace and simplify.
6515 (RootNamespace.Global): Make instance variable.
6516 (RootNamespace.RootNamespace): Add "alias name" parameter.
6517 (GlobalRootNamespace): Simplify drastically.
6518 (Namespace.Lookup): Don't use GetNamespace.
6519 * typemanager.cs (GetRootNamespace): Rename from
6520 ComputeNamespaceForAlias.
6521 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
6523 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6525 * anonymous.cs (AnonymousContainer): Don't crash when container
6528 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6530 * expression.cs (Binary.DoResolve): Warn when comparing same
6533 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6536 * expression.cs (Binary.DoResolve): It looks like there are no
6537 convetsion rules in enum context.
6539 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6541 Add support for extern alias qualifiers.
6542 * typemanager.cs: Move some LookupTypeReflection code
6543 to namespace.cs, to have cleaner code. Added some methods
6544 to help us keep track of the extern aliased references.
6545 * driver.cs: Add suport for extern alias assemblies on command
6546 line and check for their warnings/errors. Also keep track of the
6547 extern aliased assemblies.
6548 * namespace.cs: Move the global functionality of Namespace
6549 to GlobalRootNamespace/RootNamespace. Now the global namespace
6550 is GlobalRootNamespace.Globa. Also the code moved from
6551 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
6552 Finally added LocalAliasEntry (AliasEntry before) and
6553 ExternAliasEntry, to handle alias statements.
6554 * cs-parser.jay: Add support in the grammar for extern alias
6556 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
6557 Update callings to Namespace (now in GlobalRootNamespace).
6559 2005-10-18 Raja R Harinath <rharinath@novell.com>
6562 * class.cs (TypeContainer.DefineType): Move updating of
6563 topological sort earlier in the code.
6564 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
6566 2005-10-18 Marek Safar <marek.safar@seznam.cz>
6569 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
6571 * constant.cs (Constant.TryReduce): Moved from Cast class.
6572 (Reduce): Made little bit more OO and fixed missing conversions.
6574 * ecore.cs (Reduce): Implemented.
6575 (Binary.EnumLiftUp): New method to upgrade values to enum values.
6577 * literal.cs (Reduce): Implemented.
6579 * class.cs: Reverted Miguel's wrong commit.
6581 2005-10-14 Miguel de Icaza <miguel@novell.com>
6583 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
6585 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
6587 * cs-parser.jay, expression.cs : CS0214 was missing error location
6588 for constants. Fixed bug #76404.
6590 2005-10-11 Marek Safar <marek.safar@seznam.cz>
6593 * convert.cs (ExplicitConversionCore): Fixed object->enum
6596 2005-10-10 Raja R Harinath <rharinath@novell.com>
6598 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
6600 (PropertyExpr.EmitCall): Likewise.
6601 * expression.cs (Invocation.EmitArguments): Handle case where
6603 (Invocation.EmitCall): Avoid allocating temporary variable if
6604 there are no arguments.
6606 2005-10-07 Raja R Harinath <rharinath@novell.com>
6609 * convert.cs (ImplicitConversionStandard): Move conversion of
6610 void* to arbitrary pointer types ...
6611 (ExplicitConversionStandard): .. here.
6612 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
6613 error to always print typenames.
6615 2005-10-07 Raja R Harinath <rharinath@novell.com>
6617 * convert.cs (GetConversionOperator): Rename from
6618 GetConversionOperators. Move operator selection code from ...
6619 (UserDefinedConversion): ... here.
6621 2005-10-06 Marek Safar <marek.safar@seznam.cz>
6623 * convert.cs (ExplicitConversionCore): Removed duplicate enum
6626 2005-10-05 Marek Safar <marek.safar@seznam.cz>
6628 * assign.cs (Assign.DoResolve): Error method changed.
6630 * cfold.cs (DoConstantNumericPromotions): Error method changed.
6632 * const.cs (ResolveValue): Reset in_transit immediately.
6634 * constant.cs: Error method changed.
6636 * convert.cs: Removed useless location parameter.
6637 (ExplicitNumericConversion): Don't do double enum check.
6638 (ExplicitConversionCore): Renamed from ExplicitConversion.
6639 (ExplicitUnsafe): Extracted from ExplicitConversion.
6640 (ExplicitConversion): Uses for error reporting.
6642 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
6644 (ResolveBoolean): Uses common error method.
6645 (CastToDecimal): Get rid of ec.
6646 (CastFromDecimal): Optimized.
6647 (ConvCast): Get rid of ec.
6649 * enum.cs (ResolveValue): Reset in_transit immediately.
6650 (Emit): Return after first error.
6652 * expression.cs: Convert changes.
6654 * literal.cs: Error method changed.
6656 * statement.cs: Error method changed.
6658 2005-10-03 Raja R Harinath <rharinath@novell.com>
6660 * support.cs (SeekableStreamReader.Position): Don't error out when
6661 the requested position is just beyond the end of the current
6664 2005-09-28 Raja R Harinath <rharinath@novell.com>
6666 * support.cs (SeekableStreamReader): Simplify drastically. Don't
6667 try to keep in sync with the byte count of the underlying Stream.
6668 However, this limits us to a window size of 2048 characters: i.e.,
6669 the maximum lookahead of our lexer/parser can be 2048 characters.
6671 2005-09-28 Marek Safar <marek.safar@seznam.cz>
6674 * driver.cs: Fix compilation files with full root path.
6676 2005-09-25 Miguel de Icaza <miguel@novell.com>
6678 * report.cs (SymbolRelatedToPreviousError): Format the output so
6679 it does not use an open parenthesis that is never closed.
6681 * driver.cs: Follow coding guidelines
6683 2005-09-27 Marek Safar <marek.safar@seznam.cz>
6686 * const.cs (Const.ResolveValue): Check for assigning non-null
6687 value to reference type.
6689 2005-09-27 Marek Safar <marek.safar@seznam.cz>
6691 * anonymous.cs: Implemented ExprClassName.
6693 * assign.cs (Assign.DoResolve): Don't chrash when type is not
6696 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
6699 * class.cs (StaticClass.DefineContainerMembers): Report protected
6702 * codegen.cs: if(ed) PRODUCTION.
6704 * convert.cs (Error_CannotImplicitConversion): Better error
6707 * cs-parser.jay: More error checks.
6709 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
6711 * driver.cs (CSCParseOption): Enabled wrong option check.
6713 * ecore.cs (Expression.ExprClassName): Turned to property.
6714 (MemberExpr.CheckIntermediateModification): For checking boxed
6715 value types modification.
6717 * statement.cs (Fixed.Resolve): Expression type must be
6718 convertible to fixed type.
6719 (CollectionForeach.GetEnumeratorFilter,TryType):
6720 Small refactoring for easier error checking.
6722 2005-09-26 Marek Safar <marek.safar@seznam.cz>
6724 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
6727 * class.cs (GeneratedBaseInitializer): New class for customization
6728 compiler generated initializers.
6729 (MemberBase.DoDefine): Check Obsolete attribute here.
6730 (FieldMember.DoDefine): Ditto.
6732 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
6735 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
6736 (MemberCore.GetObsoleteAttribute): Removed argument.
6737 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
6738 (MemberCore.CheckObsoleteType): New helper.
6742 * statement.cs: Updates after MemberCore changes.
6744 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
6745 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
6747 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
6748 obsolete attribute for compiler construct.
6749 (As.DoResolve): Cache result.
6751 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
6753 2005-09-26 Raja R Harinath <rharinath@novell.com>
6756 * expression.cs (This.VerifyFixed): In a value type T, the type of
6757 'this' is T&, iow, 'this' is either an out or ref parameter. In a
6758 value type R, 'this' is treated as a value parameter.
6760 2005-09-22 Miguel de Icaza <miguel@novell.com>
6762 * statement.cs (Lock): Use the TemporaryVariable class instead of
6763 manually using local variables as those do not work when variables
6766 * ecore.cs: Moved the TemporaryVariable class from being a nested
6767 class inside Foreach to be a public class that can be employed in
6770 2005-09-19 Marek Safar <marek.safar@seznam.cz>
6772 * cs-parser.jay: interface_accessors replaced by
6773 accessor_declarations.
6775 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
6778 * statement.cs (GotoCase.Resolve): Convert null constant to
6780 (SwitchLabel.ResolveAndReduce): Ditto.
6781 (SwitchLabel.NullStringCase): Custom null stamp.
6782 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
6784 typemanager.cs (CSharpSignature): Don't skip first argument
6787 2005-09-18 Miguel de Icaza <miguel@novell.com>
6789 * driver.cs: Set InEmacs based on the environment variable EMACS.
6791 * location.cs (InEmacs): in this mode, do not report column
6792 location as it confuses Emacs.
6794 2005-09-16 Marek Safar <marek.safar@seznam.cz>
6796 * cfold.cs, constant.cs, convert.cs, ecore.cs,
6797 expression.cs, iterators.cs, literal.cs: Store constants and
6800 * class.cs (MemberBase.ShortName): Pass location.
6802 * cs-parser.jay: Some location fixes.
6804 * ecore.cs (Expression.Location): Made virtual.
6806 2005-09-05 Miguel de Icaza <miguel@novell.com>
6808 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
6809 if the underlying types are the same, otherwise we need to produce
6810 code that will do the proper cast.
6812 This was exposed by Marek's constant rewrite which produced
6813 invalid code for the call site:
6816 void Method (X v) {}
6820 This fixes test-49.cs
6822 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
6824 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
6825 Type/Object should be allowed as well. Fixed bug #75968.
6827 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
6829 * expression.cs : (Binary.DoResolve): when one is enum constant and
6830 another is constant 0, then return enum one *as enum type*.
6833 2005-09-02 Raja R Harinath <rharinath@novell.com>
6835 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
6839 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
6840 flow-branching for LocalVariableReferences in case we were invoked
6841 from a MemberAccess.
6842 * expression.cs (LocalVariableReference.VerifyAssigned): New.
6844 (LocalVariableReference.DoResolveBase): ... this.
6845 (MemberAccess.Resolve): Do the check that was disabled during
6848 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
6851 (PartialContainer.Create): check abstract/sealed/static strictly
6852 but abstract/sealed can exist only at one side. Fixed bug #75883.
6854 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
6857 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
6858 specified, don't default to UnmanagedType.I4.
6860 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
6862 * expression.cs : conditional operator should check possibly
6863 incorrect assign expression. Fixed bug #75946.
6865 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
6867 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
6868 Reverting the change. gmcs is much complex than mcs on this matter.
6870 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
6872 * cs-tokenizer.cs : To read another token ahead of the actual
6873 consumption, use new SavedToken and cache token instead of moving
6874 back the stream with SeekableStreamReader (it seemed problematic).
6876 driver.cs : Thus use StreamReader directly.
6877 * support.cs : Thus removed SeekableStreamReader.
6879 2005-08-30 Raja R Harinath <rharinath@novell.com>
6882 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
6883 (ScopeInfo.EmitScopeType): Use it to construct field names from
6884 names of captured locals.
6887 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
6888 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
6889 Pass 'target_type' to BoxedCast. Don't default to 'object'.
6890 (ExplicitConversion): Remove enum cases already handled by
6891 implicit conversion. Move implicit conversion check to the beginning.
6892 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
6893 * expression.cs (ArrayCreation.EmitDynamicInitializers):
6894 Don't treat System.Enum as a struct.
6896 2005-08-30 Jb Evain <jbevain@gmail.com>
6898 * attribute.cs: handles as expression in parameters.
6900 2005-08-30 Raja R Harinath <rharinath@novell.com>
6903 * class.cs (TypeContainer.VerifyClsName): Don't use a
6904 PartialContainer when verifying CLS compliance.
6905 (AbstractPropertyEventMethod): Set Parent here, ...
6906 (PropertyMethod): ... not here.
6908 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
6910 * attribute.cs : escaped attribute name should not be allowed to be
6911 resolved (e.g. @class as classAttribute). Fixed bug #75930.
6913 2005-08-29 Raja R Harinath <rharinath@novell.com>
6916 * convert.cs (ImplicitStandardConversionExists): Allow zero also
6917 when converting a long constant to unsigned long.
6918 * expression.cs (Invocation.OverloadResolve): Add sanity check to
6919 detect where IsApplicable and VerifyArgumentsCompat disagree.
6921 2005-08-29 Raja R Harinath <rharinath@novell.com>
6922 and Carlos Alberto Cortez <carlos@unixmexico.org>
6925 * class.cs (TypeContainer.CanElideInitializer): New helper.
6926 (TypeContainer.EmitFieldInitializers): Use it to determine if we
6927 can safely emitting the initializer of a field.
6929 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
6931 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
6932 allowed inside a switch (without loop). Fixed bug #75433.
6934 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
6936 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
6937 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
6939 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
6941 * driver.cs : kinda reverting the default encoding changes (not exact
6942 revert since I noticed that "codepage:reset" might not work fine).
6944 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
6946 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
6947 Location. Now getter and setter store location correctly.
6948 (errors/cs0111-12.cs now reports the expected location.)
6950 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
6952 * driver.cs : Use default encoding on the environment.
6953 Removed (now that) extra parameter for SeekableStreamReader.
6954 * support.cs : (SeekableStreamReader) third .ctor() argument for
6955 StreamReader is not required (always true). preamble size could
6956 be acquired in simpler and safe way.
6958 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
6960 * cs-parser.jay: report CS0642 at warning level 3
6961 and report CS0642 for an if else statement also
6962 fixes bug #74745. Patch by John Luke (and a bit
6964 Removed extra CS0642 warning check for "while",
6966 * statement.cs: In Block.Resolve(), CS0642 check
6967 is reimplemented to check a sequence of an empty
6968 statement and a block.
6970 Both fix bug #66777.
6972 2005-08-24 Marek Safar <marek.safar@seznam.cz>
6974 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
6975 detection until I fix it.
6977 * cs-tokenizer.cs: Changed error message.
6979 * cs-parser.jay: Fixed 2 error locations.
6981 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
6982 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
6985 * enum.cs (GetSignatureForError): Fixed.
6987 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
6991 * typemanager.cs (RegisterProperty): Removed.
6993 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
6995 2005-08-24 Raja R Harinath <rharinath@novell.com>
6998 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
6999 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
7001 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7003 * expression.cs : tiny fix is required for not warning positive ulong.
7006 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7008 * expression.cs : add CS0652 check for constant and integral
7009 expression. Fixed bug #53974.
7011 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7013 * expression.cs : in DoNumericPromotions(), check if there is implicit
7014 conversion overload for string (to check CS0034). Fixed bug #52492.
7016 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7018 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
7020 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7022 * ecore.cs : report location when it is *not* Null.
7024 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7030 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
7031 correctly. Fixed bug #75721.
7033 2005-08-23 Raja R Harinath <rharinath@novell.com>
7035 * support.cs (SeekableStreamReader.Position): Avoid an expensive
7036 loop that performs 'min (pos, char_count)'.
7039 * expression.cs (Unary.ResolveOperator): Don't discard implicit
7040 converted value in Operator.OnesComplement.
7042 2005-08-22 Ben Maurer <bmaurer@ximian.com>
7044 * anonymous.cs: If the anon method is pulled into a helper class,
7045 it needs to be `internal' not `private'. Fixes runtime behavior on
7048 2005-08-20 Martin Baulig <martin@ximian.com>
7050 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7051 scope if we don't already have it.
7053 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
7054 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
7057 2005-08-17 Marek Safar <marek.safar@seznam.cz>
7060 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
7063 2005-08-16 Marek Safar <marek.safar@seznam.cz>
7065 The big constants rewrite
7066 Fix #75746, #75685 and more
7067 As a side effect saved 1MB for MWF ;-)
7069 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
7070 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
7071 enum based for corlib compilation.
7073 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
7076 * class.cs (FixedField.Define): Use ResolveAsConstant.
7078 * const.cs (IConstant): Interface constants and enums.
7079 (Const.ResolveValue): New method for constant resolvning.
7080 (ExternalConstant): Constants from imported assemblies.
7082 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
7083 conversion; like enums.
7084 (Constant.ToType): Converts this constant to different type.
7085 (Constant.Increment): Adds 1.
7087 * convert.cs (ImplicitConversionRequired): Simplified.
7089 * cs-parser.jay: Create EnumMember directly.
7091 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
7093 * doc.cs (GenerateEnumDocComment): Removed.
7095 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
7096 (ConvertIntLiteral): Removed.
7097 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
7099 * enum.cs (EnumMember): Implement IConstant.
7100 (Enum.IsValidEnumConstant): Removed.
7101 (Enum.GetNextDefaultValue): Removed.
7102 (Enum.FindMembers): Updated.
7103 (Enum.GenerateDocComment): Iterate enum members.
7105 * expression.cs (Cast.TryReduce): Handle enums correctly.
7106 (New.Constantify): Made public.
7107 (MemberAccess.DoResolve): Removed contant specific if(s).
7109 * literal.cs (NullLiteral): Implement new abstract methods.
7111 * statement.cs (GotoCase.Resolve): Use new constant methods.
7112 (SwitchLabel.ResolveAndReduce): Use new constant methods.
7114 * typemanager.cs (LookupEnum): Removed.
7115 (IsEnumType): Fixed to work with corlib.
7116 (RegisterConstant): Removed.
7117 (LookupConstant): Removed.
7118 (GetConstant): Changed to work with IConstant.
7120 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
7122 * location.cs : Fixed overflown (>255) column number.
7124 2005-08-03 Raja R Harinath <rharinath@novell.com>
7126 First cut of the qualified-alias-member feature.
7127 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
7129 * cs-parser.jay (DOUBLE_COLON): New token.
7130 (namespace_or_type_name): Add rule for recognizing
7131 qualified-alias-members.
7132 (primary_expression): Likewise.
7133 (element_access): Allow QualifiedAliasMember as a possible
7134 type-bearing expression.
7135 (local_variable_type, local_variable_pointer_type): Likewise.
7136 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
7137 aliases in the current and enclosing namespace declarations.
7138 (NamespaceEntry.UsingAlias): Add CS0440 warning.
7139 * decl.cs (MemberName.is_double_colon): New.
7140 (MemberName.MemberName): Add new constructor for alias-member.
7141 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
7142 * expression.cs (QualifiedAliasMember): New expression type.
7144 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7146 * location.cs : it borked when no argument was specified.
7148 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7150 * location.cs : tiny ToString() format fix.
7152 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7154 * statement.cs : oops, it was missing.
7156 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7158 A set of fixes for precise line/column location.
7161 "token" field now holds a file/line "delta", a line number offset
7162 from the segment, and a column number. See also:
7163 http://lists.ximian.com/pipermail/mono-devel-list/2004-
7164 December/009508.html
7165 Removed static IsNull. Use instance IsNull property instead.
7167 For some tokens it stores Location. For Identifier it stores
7168 LocatedToken which is a pair of string name and location.
7169 Column numbers are adjusted only at getChar().
7171 Use Location.ToString() for reporting (it now contains column).
7173 Largely modified to use LocatedToken instead of
7174 string (IDENTIFIER), and to acquire Location from some tokens.
7175 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
7176 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
7178 Now MemberName holds Location. DeclSpace.ctor() receives Location
7179 as a parameter. Removed extra parameters to all derived classes.
7180 Replaced Location.IsNull() with instance property.
7181 * assign.cs, expression.cs :
7182 Added .ctor() overload that omits Location.
7184 Added "nameEscaped" flag that indicates the identifier was escaped
7185 in the source file. This fixes bug #57047.
7187 2005-08-02 Marek Safar <marek.safar@seznam.cz>
7189 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
7190 New method, looking for lo-case imported cls type.
7192 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
7195 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
7197 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
7199 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
7201 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
7203 Optimized to save 3.5 MB for SWF compilation.
7205 2005-08-01 Marek Safar <marek.safar@seznam.cz>
7207 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
7208 (PartialContainer.Create): Moved logic AddToContainer.
7209 (PartialContainer.MarkForDuplicationCheck): Shares name.
7211 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
7214 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
7216 (Namespace.GetSignatureForError): New method.
7218 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
7219 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
7221 2005-08-01 Raja R Harinath <rharinath@novell.com>
7224 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
7225 member lookup rather than qualifier_type, since qualifier_type can
7228 2005-08-01 Marek Safar <marek.safar@seznam.cz>
7230 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
7233 2005-07-31 Miguel de Icaza <miguel@novell.com>
7235 * statement.cs: Copy the local exception into the exception
7236 captured local. Fixes 75674
7238 2005-07-31 Raja R Harinath <harinath@gmail.com>
7241 * expression.cs (Invocation.OverloadResolve): Don't report error
7242 CS1501 if error CS1502 has been reported.
7243 (New.DoResolve): Delegate CS1501 reporting to
7244 Invocation.OverloadResolve.
7247 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
7248 invariant-meaning-in-block property in an enclosing block if
7251 2005-07-29 Marek Safar <marek.safar@seznam.cz>
7253 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
7254 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
7255 (Switch.CheckSwitch): Just save 50kb for SWF.
7257 2005-07-27 Martin Baulig <martin@ximian.com>
7259 * anonymous.cs (CaptureContext.AddField): Added
7260 `AnonymousContainer am' argument; compute its toplevel scope if
7261 it's not already computed. Fixes #75649.
7263 2005-07-26 Raja R Harinath <rharinath@novell.com>
7266 * class.cs (Constructor.Emit): Reset block to null if the block
7269 2005-07-25 Marek Safar <marek.safar@seznam.cz>
7271 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
7273 2005-07-25 Marek Safar <marek.safar@seznam.cz>
7275 * class.cs (MethodData.Define): Check whether accessor implementing
7276 interface is public.
7278 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
7280 2005-07-22 Marek Safar <marek.safar@seznam.cz>
7283 * namespace.cs (LookupType): Moved same type check to...
7285 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
7288 2005-07-21 Raja R Harinath <rharinath@novell.com>
7290 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
7291 already found a typebuilder.
7292 * class.cs (MethodCore.IsDuplicateImplementation): Compare
7293 MemberNames, not strings.
7295 * const.cs (Error_ExpressionMustBeConst):
7296 Rename from Error_EpressionMustBeConst.
7297 * const.cs, class.cs, statement.cd: Update.
7299 2005-07-21 Marek Safar <marek.safar@seznam.cz>
7303 * const.cs (Const.LookupConstantValue): Report missing contant expression
7305 (Error_EpressionMustBeConstant): Only one error method.
7307 * class.cs, statement.c: Updated.
7309 2005-07-20 Raja R Harinath <rharinath@novell.com>
7311 * statement.cs (Block.Flags): Add back HasVarargs.
7312 (Block.flags): Make protected.
7313 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
7315 * typemanager.cs (types, typecontainers, user_types): Remove.
7316 (UserTypes, TypeContainers): Likewise.
7317 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
7318 (CleanUp, Reset): Update.
7319 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
7320 (GetNestedType): Use Type.GetNestedType.
7321 (CoreLookupType): Take two arguments, the namespace and the
7322 basename of the type. Update to use the Namespace.Lookup
7324 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
7325 (RealMemberLookup): Use IsNestedChildOf instead of playing with
7326 string concatenation and substring matches.
7327 * class.cs, enum.cs, delegate.cs: Update to changes.
7329 2005-07-20 Marek Safar <marek.safar@seznam.cz>
7331 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
7332 Expression and made virtual.
7334 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
7335 (ImplicitStandardConversionExists): Fixed `byte' typo ?
7337 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
7339 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
7342 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
7345 2005-07-18 Marek Safar <marek.safar@seznam.cz>
7348 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
7349 AssemblyCultureAttribute is not used on executable.
7352 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
7354 2005-07-16 Raja R Harinath <rharinath@novell.com>
7357 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
7358 New. Reports CS0252/CS0253.
7359 Mostly taken from preliminary patch by Duncak Mak.
7360 (Binary.DoResolveOperator): Store results of operator lookup.
7361 Use them to detect if we need to warn about unintended reference
7364 2005-07-15 Raja R Harinath <rharinath@novell.com>
7367 * namespace.cs (Namespace.Lookup): Add back location parameter.
7368 (Namespace.LookupType): Add CS0436 report. Add location parameter.
7369 * delegate.cs, ecore.cs, expression.cs: Update to changes.
7371 * codegen.cs (EmitContext.DeclSpace): Make readonly.
7372 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
7373 (Namespace.LookupType): ... this.
7374 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
7376 * typemanager.cs (LookupTypeReflection): Remove buggy code that
7377 purported to handle pointers.
7378 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
7381 2005-07-15 Marek Safar <marek.safar@seznam.cz>
7383 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
7386 2005-07-15 Raja R Harinath <rharinath@novell.com>
7388 * namespace.cs (Namespace.Lookup): Drop location parameter.
7389 (NamespaceEntry.LookupAlias): Remove. Merge into ...
7390 (NamespaceEntry.Lookup): ... this.
7391 (NamespaceEntry.Error_AmbiguousTypeReference):
7392 Move here from DeclSpace.
7393 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
7395 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
7396 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
7397 Move to NamespaceEntry.
7398 * delegate.cs, expression.cs: Update to changes.
7400 2005-07-14 Marek Safar <marek.safar@seznam.cz>
7402 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
7403 CheckAttributeType and refactored.
7404 (Attribute.ResolvePossibleAttributeType): Changed to reuse
7405 ResolveAsTypeTerminal error handling.
7406 (ResolveAsTypeTerminal): Introduced because of global attributes extra
7408 (GetSignatureForError): Print errors in same way.
7411 * codegen.cs: Reflect attribute GetSignatureForError change.
7414 * expression.cs: Add silent parameter to ResolveAsTypeStep.
7416 * namespace.cs (UsingEntry): Refactored to make fields private.
7419 statement.cs: Error_UnexpectedKind has extra parameter.
7421 2005-07-14 Raja R Harinath <rharinath@novell.com>
7423 * ecore.cs (IAlias): Remove.
7424 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
7425 that implement the interface.
7426 * namespace.cs (Namespace): Likewise.
7427 (Namespace.declspaces): Renamed from 'defined_names'.
7428 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
7429 DeclSpace instead of an IAlias.
7430 * tree.cs (Tree.AddDecl): Update.
7432 2005-07-12 Raja R Harinath <rharinath@novell.com>
7434 * statement.cs (Block.Flags); Remove HasVarargs.
7435 (Block.HasVarargs): Move to ToplevelBlock.
7436 (Block.ThisVariable, Block.AddThisVariable): Likewise.
7437 (Block.Variables): Make protected. Initialize variable hashtable
7439 (Block.AddVariable): Update.
7440 (Block.Resolve): Update to changes.
7441 (ToplevelBlock.HasVarargs): New boolean.
7442 (ToplevelBlock.ThisVariable): Move here from Block.
7443 (ToplevelBlock.AddThisVariable): Likewise.
7444 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
7445 * expression.cs (This.ResolveBase): Update to changes.
7446 (ArglistAccess.DoResolve): Likewise.
7448 2005-07-11 Marek Safar <marek.safar@seznam.cz>
7451 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
7453 * class.cs (TypeContainer.VerifyMembers): Distinguish between
7454 not used and not used & assigned.
7455 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
7457 2005-07-11 Marek Safar <marek.safar@seznam.cz>
7460 * expression.cs (Is.DoResolve): null is never provided type.
7462 2005-07-08 Marek Safar <marek.safar@seznam.cz>
7465 * cs-parser.jay: Less strict event error rule to catch more errors.
7467 2005-07-08 Martin Baulig <martin@ximian.com>
7469 Fix test-iter-10.cs - distinguish whether we `yield' in a property
7470 gettter (allowed) or setter (not allowed).
7472 * class.cs (Accessor): Implement IIteratorContainer.
7473 (Accessor.Yields): New public field.
7474 (PropertyBase.PropertyMethod.Define): Handle iterators on a
7478 (get_accessor_declaration, set_accessor_declaration): Set the
7479 `yields' flag on the accessor, not the property.
7480 (property_declaration): Do the iterators check on a per-accessor
7481 basis and not for the whole property.
7483 2005-07-08 Martin Baulig <martin@ximian.com>
7485 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
7486 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
7488 2005-07-07 Marek Safar <marek.safar@seznam.cz>
7491 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
7492 (ExtractSecurityPermissionSet): Cope with self referencing security
7493 attributes properly.
7495 * driver.cs (SetOutputFile): Made public property OutputFile.
7497 2005-07-07 Raja R Harinath <rharinath@novell.com>
7500 * class.cs (TypeContainer.first_nonstatic_field): Rename from
7501 has_nonstatic_fields. Make into a FieldBase pointer.
7502 (TypeContainer.AddField): Add CS0282 check.
7503 (TypeContainer.EmitType): Update.
7505 2005-07-06 Miguel de Icaza <miguel@novell.com>
7507 * cs-tokenizer.cs (consume_identifier): Do not create strings to
7508 compare if they start with __.
7510 2005-07-06 Raja R Harinath <rharinath@novell.com>
7512 * statement.cs (Switch.SwitchGoverningType): Only look at
7513 UserCasts that don't need implicit standard conversions to one of
7514 the allowed switch types (Fixes test-322.cs).
7515 (LocalInfo.Resolve): Re-enable sanity-test.
7517 2005-07-06 Marek Safar <marek.safar@seznam.cz>
7519 * cs-tokenizer.cs (consume_identifier): Detect double undescores
7521 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
7523 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
7525 2005-07-06 Raja R Harinath <rharinath@novell.com>
7528 * ecore.cs (SimpleName.GetSignatureForError): Add.
7529 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
7530 (MemberAccess.GetSignatureForError): Add.
7532 2005-07-05 Marek Safar <marek.safar@seznam.cz>
7534 The big error and warning messages review.
7564 * typemanager.cs: Updated.
7566 * class.cs: (MethodCore.SetYields): Moved here to share.
7567 (PropertyMethod.Define): Moved iterator setup here.
7569 * iterators.cs: Add orig_method to have full access to parent
7572 2005-07-05 Raja R Harinath <rharinath@novell.com>
7574 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
7575 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
7576 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
7577 variable of struct type.
7578 * expression.cs (Unary.ResolveOperator): Update to change.
7579 (Indirection.VerifyFixed): Likewise.
7580 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
7581 (ParameterReference.VerifyFixed): Value parameters are fixed.
7582 (This.VerifyFixed): Treat 'this' as a value parameter.
7583 * statement.cs (LocalInfo.IsFixed): Remove.
7585 2005-07-01 Martin Baulig <martin@ximian.com>
7587 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
7588 `ec.EmitThis ()' to get the correct scope.
7590 2005-07-01 Martin Baulig <martin@ximian.com>
7592 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
7593 instance is a ParameterReference; fixes #75299.
7595 2005-07-01 Martin Baulig <martin@ximian.com>
7597 Reverted Marek's latest patch (r46725):
7598 - it contains structural changes which are neither mentioned in
7599 the ChangeLog nor explained anywhere; for example the additional
7600 argument of EmitContext's and Iterator's .ctor's and the
7601 TypeContainer.DefineMembers() change.
7602 - structural changes like this should go in in seperate patches
7603 and not be hidden in a huge patch which just seems to affect
7604 warnings and errors.
7605 a big and hard to understand patch.
7606 - it breaks iterators and causes regressions, for instance in
7609 2005-06-30 Raja R Harinath <rharinath@novell.com>
7612 * expression.cs (Indexers.map): Remove.
7613 (Indexers.Append): Filter out inaccessible setters and getters.
7614 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
7617 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
7619 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
7620 (FieldExpr.Emit, PropertyExpr.Emit): Update.
7621 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
7622 * expression.cs (Invocation.EmitCall): Add CS0120 check.
7624 2005-06-30 Marek Safar <marek.safar@seznam.cz>
7627 * class.cs (FieldBase.GetInitializerExpression): One more field
7630 2005-06-28 Miguel de Icaza <miguel@novell.com>
7632 * pending.cs: Do not define a proxy if the base method is virtual,
7633 it will be picked up by the runtime (bug 75270).
7635 2005-06-08 Martin Baulig <martin@ximian.com>
7637 The big Iterators rewrite :-)
7639 * iterators.cs: Rewrite this to use the anonymous methods framework.
7641 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
7642 before the TypeContainers; see 2test-21.cs.
7645 (TypeContainer.DefineType): Don't create a new EmitContext if we
7646 already have one (this only happens if we're an Iterator).
7647 (TypeContainer.Define): Also call Define() on all our iterators.
7648 (Method.CreateEmitContext): Added support for iterators.
7651 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
7652 (AnonymousContainer.CreateMethodHost): Moved here from
7653 AnonymousMethod and made abstract.
7654 (AnonymousContainer.CreateScopeType): New abstract method.
7655 (AnonymousContainer.IsIterator): New public property.
7656 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
7657 get the ScopeTypeBuilder rather than manually defining it here.
7658 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
7661 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
7662 before RootContext.DefineTypes().
7664 * codegen.cs (EmitContext.RemapToProxy): Removed.
7665 (EmitContext.CurrentAnonymousMethod): Changed type from
7666 AnonymousMethod -> AnonymousContainer.
7667 (EmitContext.ResolveTopBlock): Protect from being called twice.
7668 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
7669 (EmitContext.EmitThis): Removed the iterators hacks; use the
7670 anonymous methods framework for that.
7673 (ToplevelBlock.Container): Make this a property, not a field.
7674 (ToplevelBlock.ReParent): New public method; move the
7675 ToplevelBlock into a new container.
7676 (Foreach.TemporaryVariable): Simplify.
7678 2005-06-05 Martin Baulig <martin@ximian.com>
7680 * statement.cs (LocalInfo.CompilerGenerated): New flag.
7681 (Block.AddTemporaryVariable): New public method; creates a new
7682 `LocalInfo' for a temporary variable.
7683 (Block.EmitMeta): Create the LocalBuilders for all the temporary
7685 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
7686 non-iterator variables.
7688 2005-06-05 Martin Baulig <martin@ximian.com>
7690 * statement.cs (Foreach.TemporaryVariable): Create the
7691 LocalBuilder in the Emit phase and not in Resolve since in some
7692 situations, we don't have an ILGenerator during Resolve; see
7693 2test-19.cs for an example.
7695 2005-06-04 Martin Baulig <martin@ximian.com>
7697 **** Merged r45395 from GCS ****
7699 The big Foreach rewrite - Part II.
7701 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
7702 with `PropertyInfo ienumerator_getcurrent'.
7704 * codegen.cs (VariableStorage): Removed.
7707 (Foreach): Derive from Statement, not ExceptionStatement.
7708 (Foreach.CollectionForeach): New nested class. Moved all the code
7709 dealing with collection foreach here.
7710 (Foreach.ForeachHelperMethods): Removed.
7711 (Foreach.TemporaryVariable): Implement IMemoryLocation.
7713 2005-05-23 Martin Baulig <martin@ximian.com>
7715 * statement.cs (Try.DoResolve): Don't create a `finally' if we
7716 don't need to. Fix #75014.
7718 2005-05-20 Martin Baulig <martin@ximian.com>
7720 Merged r44808 from GMCS.
7722 * class.cs (TypeContainer.CircularDepException): Removed.
7723 (TypeContainer.DefineType): Removed the `InTransit' stuff.
7724 (TypeContainer.CheckRecursiveDefinition): Check for circular class
7725 (CS0146) and interface (CS0529) dependencies here.
7727 2005-06-21 Raja R Harinath <rharinath@novell.com>
7729 * expression.cs (Invocation.EmitCall): Fix initialization
7730 'this_call' to reflect current behaviour. Fix indentation.
7732 * convert.cs (FindMostEncompassedType): Add two trivial special
7733 cases (number_of_types == 0 || number_of_types == 1).
7734 (FindMostEncompasingType): Likewise.
7736 2005-06-17 Raja R Harinath <rharinath@novell.com>
7738 Some cleanups preparing for the fix of #75283.
7739 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
7741 (EventExpr.InstanceResolve): Likewise.
7742 (EventExpr.DoResolve): Remove redundant checks.
7744 2005-06-10 Duncan Mak <duncan@novell.com>
7746 * cs-tokenizer.cs (process_directives): New flag for controlling
7747 the processing of preprocessor directives.
7748 (x_token): After seeing a '#', return Token.NONE instead of going
7749 to handle_preprocessing_directive() when not processing
7750 directives. This avoids unnecessary processing during the token peek in
7755 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
7756 the existing error reporting methods instead of Report.Error.
7758 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
7759 after Raja's rewrite.
7761 2005-06-08 Miguel de Icaza <miguel@novell.com>
7763 * class.cs: Small fix.
7765 2005-06-08 Raja R Harinath <rharinath@novell.com>
7768 * class.cs (GetPartialBases): Fix return value check of
7771 2005-06-07 Raja R Harinath <rharinath@novell.com>
7773 Ensure that partial classes are registered in their enclosing
7774 namespace. Initial part of fix of #75160.
7775 * tree.cs (Tree.RecordDecl): Add new namespace argument.
7776 Register declspace with namespace here, not in
7777 DeclSpace.RecordDecl.
7778 * cs-parser.jay: Pass namespace to RecordDecl.
7779 * class.cs (PartialContainer.Create): Likewise.
7780 (ClassPart.DefineType): New sanity-check. Throws an exception if
7782 * decl.cs (Declspace.RecordDecl): Remove.
7783 * namespace.cs (NamespaceEntry.DefineName): Remove.
7785 2005-06-06 Marek Safar <marek.safar@seznam.cz>
7787 * rootcontext.cs: Reset TargetExt as well.
7789 2005-06-03 Raja R Harinath <rharinath@novell.com>
7791 * ecore.cs (Expression.Resolve): Emit CS0654 error when
7794 2005-06-02 Raja R Harinath <rharinath@novell.com>
7796 Fix #75080, cs0119.cs.
7797 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
7799 (Expression.Resolve): ... this. Use it. Remove bogus code
7800 allowing ExprClass.Type and ExprClass.Namespace for
7801 ResolveFlags.VariableOrValue.
7802 (Expression.Resolve) [1-argument variant]: Change default resolve
7803 flags based on language version.
7804 (Expression.Error_UnexpectedKind): Use a simple string array
7805 rather than an ArrayList.
7806 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
7808 (TypeOfVoid.DoResolve): Likewise.
7809 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
7810 flags argument -- it always has the same value.
7812 2005-05-31 Raja R Harinath <rharinath@novell.com>
7815 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
7816 Use it in the error message.
7817 * assign.cs, expression.cs, statement.cs: Update.
7819 2005-05-30 Raja R Harinath <rharinath@novell.com>
7822 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
7823 the "almostMatchedMember" case too.
7824 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
7825 that failed the accessibility checks to 'almost_match'.
7827 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
7829 * attribute.cs: Use internal MethodBuilder methods to set
7830 ExactSpelling and SetLastError on PInvoke methods, instead
7831 of passing them via charset. Fixes #75060.
7833 2005-05-27 Raja R Harinath <rharinath@novell.com>
7835 * parameter.cs (Parameter): Remove TODO comment.
7836 (Parameter.DefineParameter): Remove Location parameter.
7837 (Parameters.LabelParameters): Likewise.
7838 * class.cs (Constructor.Emit): Update to change.
7839 (MethodData.Emit): Likewise.
7840 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
7841 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
7843 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
7846 Removed Parameters.Location and added Parameter.Location instead.
7847 Removed Location parameter from Emit() and GetSignature().
7854 Modified all related calls.
7856 2005-05-26 Raja R Harinath <rharinath@novell.com>
7858 Improve user-defined conversion handling.
7859 * convert.cs (GetConversionOperators): Rewrite. Return only the
7860 applicable operators.
7861 (AddConversionOperators): New. Helper for GetConversionOperators.
7862 (FindMostEncompassedType, FindMostEncompassingType): Verify that
7863 there is only one most encompassed/encompassing type.
7864 (FindMostSpecificSource, FindMostSpecificTarget): Remove
7865 "applicable operator" handling.
7866 (UserConversion): Move cache here from GetConversionOperators.
7867 Directly cache the chosen operator, rather than the whole
7869 (ExplicitNumericConversion): Fix buggy implementation of Decimal
7870 case. Allow conversion of decimal to sbyte and byte too.
7871 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7872 New static methods. Used to avoid allocating EmptyExpressions in
7875 2005-05-24 Duncan Mak <duncan@novell.com>
7877 * ecore.cs (CastFromDecimal): New class for casting a decimal to
7878 another class, used in Convert.ExplicitNumericConversion.
7879 (CastToDecimal): New class, similar to above, but casts to
7880 System.Decimal, used in Convert.ImplicitNumericConversion and also
7881 in explicit convesion from double/float to decimal.
7883 * convert.cs (ImplicitNumericConversion): Handle implicit
7884 conversions to System.Decimal.
7885 (ExplicitNumericConversion): handle explicit conversions to
7890 2005-05-20 Miguel de Icaza <miguel@novell.com>
7892 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
7893 know the type at this stage, just break through. Fixes #75008
7895 2005-05-19 Martin Baulig <martin@ximian.com>
7898 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
7899 to disable error reporting.
7901 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
7902 here since we don't want to report an error; see the new test-336.cs.
7904 2005-05-19 Raja R Harinath <rharinath@novell.com>
7906 * statement.cs (ToplevelBlock.GetParameterReference)
7907 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
7908 Move here from class Block.
7909 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
7910 * expression.cs (ParameterReference.DoResolveBase): Likewise.
7912 2005-05-18 Martin Baulig <martin@ximian.com>
7917 (FlowBranching.Reachability): Add non-static public And() and Or()
7919 (FlowBranchingSwitch): New class; do the `break_origins' thing
7920 like in FlowBranchingLoop.
7921 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
7922 reachability, not just locals and parameters.
7923 (FlowBranching.MergeChild): Remove some of the hacks for loop and
7924 switch; MergeBreakOrigins() now takes care of that.
7926 2005-05-18 Martin Baulig <martin@ximian.com>
7928 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7929 a loop and may leave it, reset the barrier; fixes #74974.
7931 2005-05-17 Marek Safar <marek.safar@seznam.cz>
7933 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
7936 * cs-parser.jay: Catch more lexical errors.
7938 * report.cs: Add one more Error method.
7941 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
7943 2005-05-17 Martin Baulig <martin@ximian.com>
7945 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
7948 2005-05-16 Raja R Harinath <rharinath@novell.com>
7950 Fix test-382.cs. Emit values of decimal constants.
7951 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
7953 (TypeContainer.AddField): ... this.
7954 (TypeContainer.EmitFieldInitializers): Allow the list of fields
7955 with initializers to include 'Const's.
7956 (ClassPart.RegisterFieldForInitialization): Forward to
7958 * const.cs (Const.Const): Pass initializer to base class.
7959 (Const.Define): In case of decimal constants, register them for
7960 initialization in a static constructor.
7962 2005-05-14 Martin Baulig <martin@ximian.com>
7964 * statement.cs (Block.Resolve): Correctly handle unreachable code;
7965 do not call ResolveUnreachable() on unreachable statements in
7966 here, see the comment in the source code.
7968 2005-05-13 Raja R Harinath <rharinath@novell.com>
7971 * expression.cs (BinaryResolveOperator): If one of the operands of
7972 an equality comparison is 'null' and the other is a pointer type,
7973 convert the null to a NullPointer.
7974 * convert.cs (ImplicitReferenceConversion): If the expression is a
7975 NullLiteral and the target type is a pointer type, return a
7976 NullPointer instead.
7977 (ImplicitConversionStandard): Likewise.
7979 2005-05-13 Marek Safar <marek.safar@seznam.cz>
7981 * cs-parser.jay: Set readonly context based on special constructs.
7983 * expression.cs (LocalVariableReference.DoResolveBase): Improved
7984 readonly variable error handling.
7986 * rootcontext.cs (EmitCode): Don't verify members when error
7989 * statement.cs (LocalInfo): Add reaodnly context information.
7990 (SetReadOnlyContext, GetReadOnlyContext): New methods.
7992 2005-05-13 Raja R Harinath <rharinath@novell.com>
7994 * statement.cs (Block.Resolve): Revert change below. Modify fix
7995 for #74041 to initialize 'resolved' to false only for explicit
7996 blocks. Fixes #74873.
7998 2005-05-12 Raja R Harinath <harinath@gmail.com>
8001 * typemanager.cs (unmanaged_enclosing_types): New.
8002 (IsUnmanagedType): Avoid infloops by using
8003 'unmanaged_enclosing_types' to talk with recursive invocations.
8005 2005-05-13 Martin Baulig <martin@ximian.com>
8007 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
8008 instance variable, not a local. Fix #74873.
8009 (Block.ResolveUnreachable): Set it to true here.
8011 2005-05-11 Duncan Mak <duncan@novell.com>
8013 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
8014 continuing to process for 'arg'.
8015 (handle_preprocessing_directive): Check the argument of the #endif
8016 directive and report error CS1025 if there are any trailing
8019 According to the C# spec, having even whitespace after the #endif
8020 directive is illegal; however, because we call arg.TrimEnd ()
8021 beforehand, we have the same behavior as csc, allowing whitespace
8022 after the directive.
8026 2005-05-11 Marek Safar <marek.safar@seznam.cz>
8030 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
8031 (Constructor.GetObsoleteAttribute): Implemented correctly.
8033 2005-05-10 Martin Baulig <martin@ximian.com>
8035 * support.cs (ReflectionParameters.ParameterModifier): Use
8036 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
8037 and `ParameterAttributes.In'. Fixes #74884.
8039 2005-05-10 Marek Safar <marek.safar@seznam.cz>
8041 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
8043 * expression.cs (Argument.GetParameterModifier): Turned to property.
8044 (Invocation.Error_InvalidArguments): Add more descriptive errors.
8046 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
8049 2005-05-09 Raja R Harinath <rharinath@novell.com>
8052 * decl.cs (MemberCache.AddMethods): Register override methods,
8053 rather than non-override methods.
8054 * typemanager.cs (RegisterOverride): New.
8055 (IsOverride): Update.
8057 2005-05-09 Marek Safar <marek.safar@seznam.cz>
8061 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
8062 recursive declaration.
8064 * statement.cs (Block.ResolveMeta): Report any error in resolving.
8066 2005-05-06 Marek Safar <marek.safar@seznam.cz>
8068 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
8070 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
8072 2005-05-05 Raja R Harinath <rharinath@novell.com>
8075 * decl.cs (DeclSpace.FamilyAccessible):
8076 Use TypeManager.IsNestedFamilyAccessible.
8078 Fix reopened #64812.
8079 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
8082 2005-05-04 Raja R Harinath <rharinath@novell.com>
8083 Abin Thomas <projectmonokochi@rediffmail.com>
8084 Anoob V E <projectmonokochi@rediffmail.com>
8085 Harilal P R <projectmonokochi@rediffmail.com>
8088 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
8089 allow access to all static members.
8091 2005-05-04 Martin Baulig <martin@ximian.com>
8093 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
8095 2005-05-04 Martin Baulig <martin@ximian.com>
8099 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
8100 section at the end; make things work if `default' is not the last
8103 2005-05-04 Martin Baulig <martin@ximian.com>
8107 * statement.cs (Switch): Replaced the `got_default' field with a
8108 `default_section' one.
8109 (Switch.CheckSwitch): Set `default_section' here.
8110 (Switch.Resolve): If we're a constant switch and the constant is
8111 not found, use the default section.
8113 2005-05-03 Martin Baulig <martin@ximian.com>
8115 * expression.cs (ArrayAccess.EmitGetLength): New public method.
8117 * statement.cs (Foreach.ArrayForeach): New nested class.
8118 (Foreach.TemporaryVariable): New nested class.
8119 (Foreach.EmitArrayForeach): Removed; this is now in the new
8122 2005-05-03 Raja R Harinath <rharinath@novell.com>
8124 * pending.cs (BaseImplements): Move the #74773 fix here. This is
8126 (VerifyPendingMethods): Revert change below.
8128 * typemanager.cs (IsOverride, RegisterNonOverride): New.
8129 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
8130 that used to trigger warning -28. Remove warning -28.
8131 * expression.cs (Invocation.OverloadResolve): Use
8132 TypeManager.IsOverride to distinguish override methods.
8135 * pending.cs (VerifyPendingMethods): If a base type implements the
8136 requested interface, don't bother checking individual methods of
8137 the base type. As a side-effect, this prevents the creation of
8138 unnecessary proxies.
8140 2005-05-02 Martin Baulig <martin@ximian.com>
8144 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8145 Also `And' the locals if the old vector is null.
8146 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
8147 null; in this case we basically reset all the variables.
8149 2005-05-02 Martin Baulig <martin@ximian.com>
8153 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
8154 Added `FlowBranching branching' argument; always `and' the
8155 variables instead of `or'ing them unless we're an infinite loop.
8157 * statement.cs (While.Resolve): Create a new sibling unless we're
8160 2005-05-02 Martin Baulig <martin@ximian.com>
8164 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
8165 arguments; use it instead of creating a new TopLevelBlock.
8166 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
8167 our ConstructorInitializer.
8170 (TopLevelBlock.TopLevelBranching): New public property.
8171 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
8172 and create our `TopLevelBranching'.
8174 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
8175 anonymous method host, use `block.TopLevelBranching' rather than
8176 creating a new branching.
8178 2005-04-20 Miguel de Icaza <miguel@novell.com>
8180 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
8181 a ScopeInfo, if any of the current children is a child of the new
8182 entry, move those children there.
8184 2005-04-30 Martin Baulig <martin@ximian.com>
8186 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
8187 at the beginning of a SwitchSection. Fix #73335.
8189 2005-04-27 Marek Safar <marek.safar@seznam.cz>
8192 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
8194 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
8195 (FieldExpr.DoResolve): Obsolete members are ignored for field
8198 2005-04-26 Marek Safar <marek.safar@seznam.cz>
8200 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
8201 of arrays detection.
8203 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
8205 (Field.VerifyClsCompliance): Volatile fields are not compliant.
8207 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
8210 2005-04-25 Ben Maurer <bmaurer@ximian.com>
8212 * cs-parser.jay: Use the prefered version of -unsafe in error
8215 2005-04-22 Marek Safar <marek.safar@seznam.cz>
8217 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
8220 2005-04-20 John Luke <john.luke@gmail.com>
8222 * driver.cs: fix typo in error message, --outout to --output
8224 2005-04-20 Marek Safar <marek.safar@seznam.cz>
8226 * codegen.cs (InRefOutArgumentResolving): New field.
8228 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
8229 fields outside contructor.
8231 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
8233 2005-04-19 Miguel de Icaza <miguel@novell.com>
8235 * anonymous.cs (CaptureContext.EmitParameterInstance): The
8236 parameter code was not completed ever, so it was not as up-to-date
8237 as local variables. Must finish it.
8239 The bug fix was to compare the Toplevel of the block, not the
8240 current block. Thanks for Ben for pointing this out.
8242 2005-04-19 Raja R Harinath <rharinath@novell.com>
8244 * decl.cs (AddMethods): Use the declaring type of the problem
8245 method to determine if we want to squash a warning.
8247 2005-04-19 Marek Safar <marek.safar@seznam.cz>
8249 * attribute.cs: Removed debug output.
8251 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
8253 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
8256 2005-04-18 Raja R Harinath <rharinath@novell.com>
8259 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
8260 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
8261 all null comparisons against reference types.
8263 2005-04-18 Marek Safar <marek.safar@seznam.cz>
8266 * class.cs (TypeContainer.CircularDepException) New nested
8268 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
8269 (TypeContainer.DefineType): Removed error, reset InTransit before
8271 (Class.DefineType): Throw exception when is in Transit.
8272 Catch exception and report error.
8273 (Struct.DefineType): Throw exception when is in Transit.
8274 Catch exception and report error.
8275 (Interface.DefineType): Throw exception when is in Transit.
8276 Catch exception and report error.
8278 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
8279 handle nested exception handlers.
8281 * flowanalysis.cs (InTryWithCatch): New method, search for try with
8284 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
8285 InFinally and InCatch storage.
8287 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
8288 (Catch.Resolve): Set and Restore ec.InCatch.
8289 (Try.Resolve): Set and Restore ec.InFinally.
8290 (Try.HasCatch): True when try has catch.
8292 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
8294 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
8295 for the same event member, so exclude such cases from warning 419.
8298 2005-04-16 Miguel de Icaza <miguel@novell.com>
8300 * expression.cs (Binary.ResolveOperator): Apply patch from John
8301 Luke to fix bug 59864: operators &, | and ^ on enumerations
8302 require that the same enum type on both sides.
8304 * driver.cs: Add warnings to old flag usage, this is to assist
8305 people who produce Makefiles and hope that the Makefiles will be
8308 * class.cs (TypeContainer.EmitType): Moved the definition of the
8309 special $PRIVATE$ field from the resolve phase to the Emit phase.
8310 During resolve we do not know if we are a struct with
8311 HasExplicitLayout, we know this only after the attributes for the
8314 Set the FieldOffset to zero on the dummy field that we create for
8315 the class. Fixes 74590.
8317 2005-04-16 Raja R Harinath <rharinath@novell.com>
8320 * ecore.cs (PropertyExpr.resolved): New.
8321 (DoResolve): Use it to handle a case of double resolution here.
8322 Handle a case of identical-name-and-type-name.
8323 * expression.cs (ArrayCreation.CheckIndices): Avoid double
8324 resolution by storing the results of expression resolution back
8325 into the "probes" array.
8327 2005-04-15 Raja R Harinath <rharinath@novell.com>
8329 Fix cs0208-7.cs and cs0208-8.cs.
8330 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
8331 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
8332 error reporting to point out the reason a struct is not unmanaged.
8334 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8336 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
8337 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
8339 2005-04-13 Raja R Harinath <rharinath@novell.com>
8342 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
8343 IdenticalNameAndTypeName here.
8344 (EventExpr.InstanceResolve): Likewise.
8346 2005-04-13 Marek Safar <marek.safar@seznam.cz>
8348 C# 2.0 DefaultCharSetAttribute implementation
8350 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
8351 which allows us to set GlobalNamespace for every resolve.
8352 (Attribute.ResolveArguments): Cut from Resolve.
8353 (Attribute.GetCharSetValue): Returns CharSet named argument.
8354 (Attribute.DefinePInvokeMethod): Gets default charset from
8356 (GlobalAttribute.ResolveAsTypeStep): Override.
8357 (GlobalAttribute.ResolveArguments): Override.
8359 * class.cs (TypeAttr): Is protected.
8361 * codegen.cs (ModuleClass.DefaultCharSet): New member.
8362 (ModuleClass.DefaultCharSetType): New memeber.
8363 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
8365 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
8366 charset from module.
8368 * delegate.cs (TypeAttr): Override.
8369 (Delegate.DefineType): Use this TypeAttr.
8371 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
8372 at very early stage (before types are defined) to resolve model
8373 module attributes. It will probably not work with corlib but it
8376 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
8377 charset from module.
8379 * typemanager.cs (default_charset_type): New type.
8381 2005-04-13 Raja R Harinath <rharinath@novell.com>
8383 * decl.cs (MemberCache.AddMethods): Don't warn if
8384 System.Object.Finalize has buggy MethodAttributes.
8386 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
8389 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8391 * doc.cs : detect ambiguous reference to overloaded members.
8392 Fixed bug #71603. MS 1.1 csc does not detect it.
8394 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8396 * doc.cs : delegates must not be referenced with parameters.
8399 2005-04-12 Miguel de Icaza <miguel@novell.com>
8401 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
8403 2005-04-10 Miguel de Icaza <miguel@novell.com>
8405 * driver.cs (MainDriver): Stop processing if the CLS stage found
8408 (CompilerCallableEntryPoint.InvokeCompiler): Always
8409 reset after execution; Take a TextWriter argument for the
8412 * report.cs: Use the error stream instead of hardcoding stderr.
8414 2005-04-09 Miguel de Icaza <miguel@novell.com>
8416 * class.cs: Reduce code paths to test, too small of an
8417 optimization to make it worth the extra testing. Always perform
8420 2005-04-08 Raja R Harinath <rharinath@novell.com>
8423 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
8424 operators that had errors reported on them.
8426 2005-04-08 Marek Safar <marek.safar@seznam.cz>
8428 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
8430 (Attribute.Resolve): Add named argument type checking.
8432 * class.cs (FixedField.Define): Use IsPrimitiveType
8434 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
8436 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
8437 unsafe parameter types.
8439 * statement.cs (Using.ResolveExpression): Add better error description.
8441 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
8443 2005-04-08 Raja R Harinath <rharinath@novell.com>
8446 * attribute.cs (Attribute.GetAttributeUsage): Resolve
8447 AttributeUsageAttribute in the emitcontext of the attribute class,
8448 not in the emitcontext of the attributable entity it was attached to.
8449 * cs-parser.jay: Use 'current_class', not 'current_container',
8450 when creating a GlobalAttribute.
8452 2005-04-08 Alp Toker <alp@atoker.com>
8454 * pending.cs: The fix to #58413 failed to compile methods implementing
8455 interfaces with/without params modifiers and vice versa, even though
8456 params modifiers aren't part of the signature. Make the modifier check
8457 less strict as in csc.
8459 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
8460 Anoob V E <projectmonokochi@rediffmail.com>
8461 Harilal P R <projectmonokochi@rediffmail.com>
8464 * pending.cs (TypeAndMethods.mods): New. Store the parameter
8465 modifiers of pending methods.
8466 (PendingImplementation.PendingImplementation): Initialize it.
8467 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
8468 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
8469 with ParameterData. Add check for modifiers.
8470 * class.cs (MethodData.Define): Update to changes.
8472 2005-04-07 Raja R Harinath <rharinath@novell.com>
8474 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
8476 2005-04-07 Marek Safar <marek.safar@seznam.cz>
8478 * class.cs (PropertyMethod.Define): Check private accessor in abstract
8481 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
8484 * typemanager.cs: Registered RequiredAttributeAttribute.
8486 2005-04-06 Marek Safar <marek.safar@seznam.cz>
8488 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
8489 Warning CS0169 is back at level 3.
8490 (IMethodData.SetMemberIsUsed): New method.
8492 * decl.cs (IsUsed): New value; moved from FieldBase.Status
8493 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
8495 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
8497 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
8499 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
8502 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
8505 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
8506 to avoid the problems with nested types.
8508 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
8509 Anoob V.E <projectmonokochi@rediffmail.com>
8510 Harilal P.R <projectmonokochi@rediffmail.com>
8511 Raja R Harinath <rharinath@novell.com>
8514 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
8516 * typemanager (GetConstructor): Make public.
8518 2005-04-05 John Luke <john.luke@gmail.com>
8519 Raja R Harinath <rharinath@novell.com>
8522 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
8523 struct too. Return false quicker in a few cases.
8524 (VerifyUnManaged): Use it.
8526 2005-04-05 Raja R Harinath <rharinath@novell.com>
8529 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
8530 not 'unreachable_seen'.
8532 2005-04-04 Marek Safar <marek.safar@seznam.cz>
8534 * attribute.cs (Attribute.GetValue): Removed unused.
8536 * codegen.cs (CodeGen.TrimExt): Removed unused.
8538 * cs-parser.jay (output): Removed unused.
8540 * cs-tokenizer.cs (hex_digits): Removed unused.
8542 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
8544 * expression.cs (Indirection.LoadExprValue): Removed unused.
8545 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
8547 * iterators.cs (Iterator.param_types): Removed unused.
8549 * statement.cs (Goto.block): Removed unused.
8550 (ToplevelBlock.did): Removed unused.
8551 (Switch.ResolveConstantSwitch): Removed unused.
8553 2005-04-01 Ben Maurer <bmaurer@ximian.com>
8555 * rootcontext.cs: Allow mcs to bootstrap with the compilation
8558 2005-04-01 Raja R Harinath <rharinath@novell.com>
8560 Fix #74232 and cs0208-3.cs.
8561 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
8562 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
8563 unmanaged type. Don't use FieldBuilders when 't' is a
8564 TypeBuilder. Use ModFlags and MemberType fields.
8565 * class.cs (MemberBase.member_type): Rename from MemberType.
8566 (MemberBase.MemberType): New property. Determines member_type on
8568 (MemberBase.DoDefine): Don't initialize MemberType here.
8569 (FieldMember.Define): Likewise.
8571 2005-04-01 Marek Safar <marek.safar@seznam.cz>
8574 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
8575 Attributes are emitted there.
8577 2005-04-01 Raja R Harinath <rharinath@novell.com>
8579 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
8580 keyword in 'partial enum' too.
8581 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
8583 Report from Kamil Skalski <nazgul@omega.pl>.
8586 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
8587 have partial containers too.
8589 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
8590 in block' checks to Block.CheckInvariantMeaningInBlock.
8591 * statement.cs (Block.GetKnownVariableInfo): Make private.
8592 (Block.IsVariableUsedInChildBlock): Remove.
8593 (Block.IsVariableUsedInBlock): Likewise.
8594 (Block.CheckInvariantMeaningInBlock): New. Show location of
8595 conflicting declaration.
8596 (Block.AddVariable): Make error messages less long-winded and more
8597 specific. Show location of conflicting declaration.
8598 * parameter.cs (Parameters.Location): New readonly property.
8600 2005-03-31 Raja R Harinath <rharinath@novell.com>
8602 Clean up semantics of invoking ResolveMemberAccess.
8603 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
8604 can have an instance, ensure that we pass in a non-TypeExpression
8605 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
8606 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
8607 argument. Update to changes and simplify.
8608 (FieldExpr.Emitinstance): Remove CS0120 check.
8609 (PropertyExpr.EmitInstance): Likewise.
8610 * expression.cs (Argument.Resolve): Likewise.
8611 (Invocation.DoResolve): Update to changes in semantics of
8614 2005-03-31 Marek Safar <marek.safar@seznam.cz>
8617 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
8620 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
8622 2005-03-31 Raja R Harinath <rharinath@novell.com>
8624 Fix difference in behaviour with commandline invocation.
8625 * driver.cs (Driver.Reset): New.
8626 (CompilerCallableEntryPoint): Call it.
8628 * statement.cs (If.Resolve): Avoid spurious "uninitialized
8629 variable" warnings if the boolean expression failed to resolve.
8631 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
8633 * attribute.cs: Fix the union of several permissions when some of them
8634 are unrestricted (so the result isn't an unrestricted permission set).
8637 2005-03-30 Raja R Harinath <rharinath@novell.com>
8639 * ecore.cs (MemberExpr): New class. Convert from interface
8641 (MemberExpr.ResolveMemberAccess): Refactor and move here from
8642 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
8644 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
8645 (MethodGroupExpr.IsExplicitImpl): Remove.
8646 (Expression.GetFieldFromEvent): Remove.
8647 (SimpleName.MemberStaticCheck): Remove.
8648 (SimpleName.DoSimpleNameResolve): Update to changes.
8649 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
8650 (MemberAccess.IdenticalNameAndTypeName): Remove.
8651 (MemberAccess.error176): Move to MemberExpr.
8652 (MemberAccess.DoResolve): Update to changes.
8653 (BaseAccess.DoResolve): Likewise.
8655 2005-03-30 Marek Safar <marek.safar@seznam.cz>
8657 C# 2.0 Conditional attribute class implementation
8659 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
8660 Analyzes class whether it has attribute which has ConditionalAttribute
8661 and its condition is not defined.
8663 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
8664 (Class.IsExcluded): New method. Search for at least one defined
8665 condition in ConditionalAttribute of attribute class.
8667 2005-03-30 Raja R Harinath <rharinath@novell.com>
8669 * ecore.cs (PropertyExpr): Derive from Expression, not
8670 ExpressionStatement.
8671 (PropertyExpr.EmitStatement): Remove.
8673 2005-03-29 Raja R Harinath <rharinath@novell.com>
8676 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
8677 internal field "value__" of an enum be private. The examples for
8678 "value__" that I found on MSDN all used FieldAttributes.Private.
8680 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
8681 Don't mention IL method attribute names.
8683 Fix #47991. Remove a TODO.
8684 * statement.cs (Block.Toplevel): Make into a field.
8685 (Block.Parameters): Move into ToplevelBlock.
8686 (Block.known_variables): Rename from child_variable_names.
8687 (Block.Block): Remove variants that take Parameters. Initialize
8688 'Toplevel' with the immediately surrounding toplevel block.
8689 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
8690 LocalInfo parameter.
8691 (Block.GetKnownVariableInfo): New.
8692 (Block.IsVariableNameUsedInChildBlock): Update.
8693 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
8694 the block, even though it may not be in scope.
8695 (Block.AddVariable): Remove Parameters parameter. Use
8696 Toplevel.Parameters instead.
8697 (Block.AddConstant): Remove Parameters parameter.
8698 (Block.GetParameterReference): Update to use Toplevel.Parameters.
8699 (Block.IsParamaterReference): Likewise.
8700 (Block.IsLocalParameter): Likewise. Simplify a lot.
8701 (ToplevelBlock.Parameters): New. Moved from Block.
8702 (ToplevelBlock.ToplevelBlock): Update to changes. Always
8703 initialize Parameters to a non-null value.
8704 * cs-parser.jay: Update to changes.
8705 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
8706 simple names that mean different things in the same block. Use
8707 Block.IsVariableNameUsedInBlock.
8709 2005-03-28 Raja R Harinath <rharinath@novell.com>
8711 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
8712 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
8713 GetTypeHandle. It is possible for a reflected type to derive from
8714 a TypeBuilder (e.g., int[] derives from the TypeBuilder
8715 System.Array during mscorlib compilation).
8716 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
8717 contain a method_hash, don't create one either. Don't create a
8718 deep copy of the base cache's method_hash.
8719 (MemberCache.SetupCache): Rename back from DeepCopy.
8720 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
8721 already initialized. If we see an override function, add its
8722 underlying base virtual function to the member_hash too.
8724 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
8726 2005-03-26 Raja R Harinath <harinath@acm.org>
8729 * assign.cs (Assign.DoResolve): When the RHS of an assignment
8730 fails to resolve, ensure that the LHS is still resolved as an
8733 2005-03-25 Raja R Harinath <harinath@acm.org>
8735 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
8737 (Enum.current_ec): Remove.
8738 (Enum.LookupEnumValue): Remove EmitContext argument.
8739 Just uses the one created during DefineType.
8740 (Enum.FindMembers): Update.
8741 * expression.cs (MemberAccess.DoResolve): Update.
8743 2005-03-22 Marek Safar <marek.safar@seznam.cz>
8745 * assign.cs (Assign.DoResolve): Check for CS1717 when
8746 source and target are same (uses Equals).
8748 * expression.cs (LocalVariableReference, ParameterReference,
8749 This): Implemented Equals, GetHashCode.
8751 * statement.cs (Block.GetParameterReference): Removed useless
8754 2005-03-22 Raja R Harinath <rharinath@novell.com>
8757 * statement.cs (Block.AddVariable): Ensure that we skip implicit
8758 blocks before deciding whether the error is cs0136 or cs0128.
8760 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
8761 (using_alias_directive, using_namespace_directive): Pass
8762 MemberName, not an expression to Namespace.UsingAlias and
8764 (MakeName): Use the MemberName of the namespace.
8765 * namespace.cs (Namespace.MemberName): New.
8766 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
8767 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
8769 * decl.cs (MemberName.Name): Make readonly.
8770 (MemberName.FromDotted): New "constructor".
8771 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
8772 (MemberCore.Name): Compute from MemberName on demand.
8773 (MemberCore.SetMemberName): Provide a way to change the
8775 (MemberCore.AddToContainer): Don't take a fullname parameter.
8776 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
8777 fully qualified name of the container to the member name.
8778 (TypeContainer.AddToTypeContainer): Use a fully qualified name
8779 only if the type is a member of the root container.
8780 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
8781 MemberName.Left rather than searching for an embedded ".".
8782 (PartialContainer.CreatePart): Update to changes in RootContext.
8783 (MemberBase.ShortName): Turn into a property. Use
8784 MemberCore.SetMemberName.
8785 (MemberBase.ExplicitInterfaceName): Remove.
8786 (MemberBase.UpdateMemberName): Remove.
8787 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
8788 (PropertyBase.SetMemberName): New override.
8789 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
8790 (Tree.GetDecl): New.
8791 (Tree.AllDecls): Rename from Decls.
8792 * attribute.cs, enum.cs, report.cs: Update to changes.
8793 * driver.cs (MainDriver): Use MemberName.FromDotted on
8794 RootContext.MainClass.
8796 2005-03-21 Marek Safar <marek.safar@seznam.cz>
8798 * class.cs (FixedField.Define): Check for CS1664 and more sanity
8801 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
8803 2005-03-18 Marek Safar <marek.safar@seznam.cz>
8805 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
8806 property accessor modifiers.
8808 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
8809 fixed buffer attribute (CS1716).
8810 (PropertyMethod.HasCustomAccessModifier): When property accessor
8811 has custom modifier.
8813 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
8815 (PropertyExpr.DoResolveLValue): Add CS0272.
8817 2005-03-17 Miguel de Icaza <miguel@novell.com>
8819 * convert.cs: When converting to a pointer, use the proper Conv.U
8820 or Conv.I depending on the source data type.
8822 * cs-tokenizer.cs: Make the size for large decimal constants,
8825 2005-03-17 Martin Baulig <martin@ximian.com>
8827 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
8828 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
8830 2005-03-17 Martin Baulig <martin@ximian.com>
8832 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
8833 to bool so we can return an error condition.
8834 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
8837 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
8839 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
8842 2005-03-16 Raja R Harinath <rharinath@novell.com>
8844 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
8845 Refactor to avoid traversing the list of assemblies, and to avoid
8846 string concatenation.
8847 * typemanager.cs (guid_attr_type): Remove.
8848 (negative_hits, pointers, references): Remove hashes.
8850 (GetConstructedType): New. Uses type_hash to handle constructed
8851 types (arrays, references, pointers).
8852 (GetReferenceType, GetPointerType): Use it.
8853 (GetNestedType): New. Uses type_hash to handle nested types of
8855 (LookupType, LookupTypeDirect): Remove.
8856 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
8857 'types' hash and LookupTypeReflection directly.
8858 (params_string, params_object): Use GetConstructedType.
8859 * namespace.cs (Namespace.cached_types): New. Cache of reflected
8861 (Namespace.Lookup): Use cached_types.
8862 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
8863 provided by old TypeManager.LookupType.
8864 * rootcontext.cs (MakeFQN): Remove.
8865 * decl.cs (DeclSpace.MakeFQN): Likewise.
8866 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
8867 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
8868 TypeManager.GetConstructedType.
8869 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
8871 2005-03-15 Marek Safar <marek.safar@seznam.cz>
8873 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
8876 * cs-parser.jay: Reports CS1527 for any namespace element.
8878 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
8881 * expression.cs (ParameterReference.IsAssigned): Changed error to
8883 (Error_WrongNumArguments): Moved CS0245 detection here.
8885 * statement.cs (Return.Resolve): Add CS1622 report.
8887 2005-03-11 Marek Safar <marek.safar@seznam.cz>
8889 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
8891 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
8893 * attribute.cs expression.cs: Get rid of some allocations.
8895 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
8897 * doc.cs : just eliminate the latest change.
8899 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
8901 * doc.cs : commented out the latest change. It breaks xml-030.cs
8903 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
8905 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
8906 fail. So invoke CreateType() in FindDocumentedType().
8908 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
8910 * cs-tokenizer.cs : added IsKeyword().
8911 * doc.cs : Detect keyword incorrectly used as identifier.
8912 Allow identifiers prefixed by @.
8914 2005-03-10 Marek Safar <marek.safar@seznam.cz>
8916 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
8917 It caused exception in namespace resolving (again!).
8919 * class.cs (Class.ctor): Removed exit.
8920 (PropertyMethod.ctor): ditto.
8922 * codegen.cs (Codegen.Reset): Reset static data.
8923 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
8925 * cs-tokenizer.cs (Cleanup): Removed.
8927 * driver.cs (GetSystemDir): Rewrote to one line command.
8928 It caused problem with unloaded dynamic modules.
8929 (UnixParseOption): Removed Exit.
8930 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
8931 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
8932 Now can be mcs used as library.
8934 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
8937 * location.cs (Reset): Reset static data.
8939 * namespace.cs (Reset): Reset static data.
8941 * report.cs (Report.Reset): Reset static data.
8943 * rootcontext.cs (RootContext.Reset): Reset static data.
8945 * tree.cs (RootTypes.ctor): Use Location.Null
8947 * typemanager.cs (TypeManager.Reset): Reset static data.
8948 (CoreLookupType): Removed Exit.
8949 (TypeHandle.Reset): Reset static data.
8951 2005-03-10 Raja R Harinath <rharinath@novell.com>
8954 * typemanager.cs (ComputeNamespaces): Import namespaces from
8955 referenced modules too.
8957 2005-03-09 Raja R Harinath <rharinath@novell.com>
8959 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
8962 2005-03-09 Raja R Harinath <rharinath@novell.com>
8964 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
8965 enclosing DeclSpace. This ensures that a name-lookup populates
8966 more caches and there are fewer 'TypeExpression's. Carve out
8967 nested type lookup into ...
8968 (LookupNestedTypeInHierarchy): ... this.
8970 2005-03-09 Raja R Harinath <rharinath@novell.com>
8972 Clean up a few partial-class semantics.
8973 Fixes test-357.cs and cs1618-2.cs.
8974 * cs-parser.jay (struct_declaration): Use 'current_class' as
8975 parent of newly-created struct. Remove call to Register ().
8976 Use 'pop_current_class' to complete handing the current struct.
8977 (interface_declaration): Likewise.
8978 (class_declaration): Likewise.
8979 (enum_declaration): Use 'current_class' as parent of newly created
8981 (delegate_declaration): Likewise.
8982 (pop_current_class): New function. This is used to handle closing
8983 up the 'current_class' and 'current_container', and pointing them
8984 to the enclosing class/container.
8985 (CSharpParser): Initialize 'current_class' too.
8986 * decl.cs (MemberCore): Add check for invariant: a partial
8987 container is not a parsed entity, and thus does not enclose any
8989 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
8990 (DeclSpace.BaseTypeExpr): Use it.
8991 (DeclSpace.LookupType): Add check for invariant.
8992 * class.cs (TypeContainer): Add check for invariant: a nested
8993 class should have the same NamespaceEntry as its enclosing class.
8994 (TypeContainer.EmitFieldInitializers): Make virtual.
8995 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
8997 (TypeContainer.Register): Remove.
8998 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
8999 null. Use TypeResolveEmitContext for resolving base types and
9000 interfaces. Move initialization of Parts.TypeBuilder here from
9002 (TypeContainer.DefineNestedTypes): ... here.
9003 (PartialContainer): Take a Namespace not a NamespaceEntry.
9004 (PartialContainer.Create): Don't use Register. Call the
9005 appropriate Add... function directly.
9006 (ClassPart): Take both the PartialContainer and the enclosing
9007 class as constructor arguments.
9008 (ClassPart.EmitFieldInitializers): Override.
9009 (ClassPart.PartFindNestedTypes): Remove.
9010 (FieldBase.GetInitializerExpression): Resolve the initializer
9011 expression in the emit context of the enclosing class.
9012 * tree.cs (RootTypes): Remove Register ().
9014 2005-03-08 Marek Safar <marek.safar@seznam.cz>
9016 * cs-parser.jay: Removed CS0134.
9018 * driver.cs: Removed CS1901.
9020 * expression.cs (SizeOf.DoResolve): Don't report CS0233
9021 for predefined types.
9023 2005-03-07 Duncan Mak <duncan@novell.com>
9025 * codegen.cs (Save): Catch UnauthorizedAccessException as
9026 well. Fixes bug #73454.
9028 2005-03-07 Marek Safar <marek.safar@seznam.cz>
9030 * cs-tokenizer.cs (xtoken): Add CS1035.
9032 * class.cs (MethodData.Define): Add CS0683.
9033 (FieldMember.ctor): Add CS0681.
9035 2005-03-07 Raja R Harinath <rharinath@novell.com>
9037 * ecore.cs (SimpleName.DoResolve): Rename from
9038 SimpleName.DoResolveAllowStatic.
9039 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
9040 Pass 'intermediate' flag to MemberStaticCheck.
9041 (SimpleName.MemberStaticCheck): Skip "static check" only in case
9042 of "intermediate" lookups via MemberAccess.
9043 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
9044 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
9046 2005-03-07 Raja R Harinath <rharinath@novell.com>
9049 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
9050 slipped in because of variable names that are identical to a
9051 builtin type's BCL equivalent ('string String;', 'int Int32;').
9052 (PropertyExpr.EmitInstance): Likewise.
9054 2005-03-04 Marek Safar <marek.safar@seznam.cz>
9056 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
9058 * report.cs (warning_ignore_table): Made public.
9060 2005-03-04 Raja R Harinath <rharinath@novell.com>
9063 * class.cs (MethodData.Emit): Pass 'container' to
9064 container.GetObsoleteAttribute instead of 'container.Parent'.
9066 2005-03-03 Marek Safar <marek.safar@seznam.cz>
9068 * cs-parser.jay: Add 1534 error test.
9070 * iterators.cs (Yield.CheckContext): Add error 1629.
9071 (Iterator.ctor): Save unsafe modifier.
9072 (MoveNextMethod.DoEmit): Restore unsafe context.
9074 * namespace.cs (UsingAlias): Better error message.
9076 2005-03-03 Dan Winship <danw@novell.com>
9078 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
9079 the warning message [#73219]
9081 2005-03-03 Raja R Harinath <rharinath@novell.com>
9083 Fix compile with MCS 1.0.0.0.
9084 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
9085 w_restore to not depend on string constant folding.
9087 2005-03-03 Raja R Harinath <rharinath@novell.com>
9089 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
9090 CS0246 check to users who passed 'silent = false'.
9091 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
9093 (SimpleName.SimpleNameResolve): Update.
9094 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
9095 (MemberAccess.IdenticalNameAndTypeName): Update.
9096 * doc.cs (FindDocumentedTypeNonArray): Update.
9098 2005-03-03 Raja R Harinath <rharinath@novell.com>
9100 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
9101 * parameters.cs (ComputeAndDefineParameters): Remove.
9102 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
9103 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
9104 Use GetParameterInfo.
9106 2005-03-02 Marek Safar <marek.safar@seznam.cz>
9108 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
9110 2005-03-02 Raja R Harinath <rharinath@novell.com>
9112 Unify DeclSpace.LookupType and DeclSpace.FindType.
9113 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
9114 is in charge of defining nested types on demand.
9115 (DeclSpace.LookupType): Use it when the current_type is a
9116 TypeBuilder. Use LookupTypeDirect for reflected types.
9117 (DeclSpace.FindType): Remove.
9118 (DeclSpace.LookupInterfaceOrClass): Likewise.
9119 (DeclSpace.DefineTypeAndParents): Likewise.
9120 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
9121 DeclSpace.LookupType.
9122 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
9123 * typemanager.cs (LookupType): Simplify.
9124 (AddUserType): Remove type from negative_hits.
9125 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
9126 * class.cs (TypeContainer.FindMembers): Move handling of nested
9128 (TypeContainer.FindMembers_NestedTypes): ... here.
9129 (TypeContainer.FindNestedType): Implement override.
9130 (ClassPart.FindNestedType): Delegate to PartialContainer.
9131 (ClassPart.PartFindNestedType): Looks up the nested types of the
9134 2005-03-02 Martin Baulig <martin@ximian.com>
9136 * class.cs (TypeContainer.DoDefineMembers): We also need a default
9137 static constructor in static classes.
9139 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
9141 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
9142 sizeParamIndex is not specified.
9144 2005-03-01 Marek Safar <marek.safar@seznam.cz>
9147 * report.cs (WarningMessage.IsEnabled): Missing null check.
9149 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9151 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
9152 in the fields and not in the properties.
9154 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
9156 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
9159 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9161 * attribute.cs: Small refactoring (improved robustness).
9162 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
9163 (ValidateGuid): Removed.
9164 (Resolve): Removed referenced to above mentioned.
9165 (GetAttributeUsage): Made private and changed to work without
9167 (GetIndexerAttributeValue): Don't crash.
9168 (GetConditionalAttributeValue): Ditto.
9169 (GetClsCompliantAttributeValue): Ditto.
9170 (ExtractSecurityPermissionSet): All attributes exceptions are
9172 (GetPropertyValue): New helper.
9173 (GetMethodImplOptions): New method.
9174 (DefinePInvokeMethod): Reuse common code. Implemented handling of
9175 some missing properties.
9177 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
9178 (Method.ApplyAttributeBuilder): Updated.
9180 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
9183 2005-02-28 Raja R Harinath <rharinath@novell.com>
9186 * report.cs (Report.SymbolRelatedToPreviousError): Handle
9187 non-simple types (array, pointer, reference).
9189 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9191 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
9193 * class.cs (MethodCore.IsDuplicateImplementation): Special error
9195 (Method.CheckBase): Catch wrong destructor here.
9196 (MethodData.Define): Add errors 550, 668.
9198 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
9200 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
9202 * pending.cs (VerifyPendingMethods): Add error 551.
9204 * typemanager.cs (CSharpName): Next error report helper.
9206 2005-02-25 Marek Safar <marek.safar@seznam.cz>
9208 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
9209 attributes. Removed useless attribute double check.
9210 It saves almost 2MBs for corlib.
9212 2005-02-25 Raja R Harinath <rharinath@novell.com>
9215 * statement.cs (ExpressionStatement.Resolve): Make robust to being
9216 called twice in case of error.
9218 2005-02-23 Chris Toshok <toshok@ximian.com>
9220 Fix compiler portions of #72827.
9221 * statement.cs (Block.Emit): call Begin/EndScope on the
9222 EmitContext instead of the ILGenerator.
9224 * codegen.cs (EmitContext.BeginScope): new method, call
9225 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
9227 (EmitContext.BeginScope): same, but EndScope and CloseScope
9229 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
9230 offset and call the superclass's OpenScope(int) with it.
9231 (SymbolWriter.CloseScope): get the current il
9232 offset and call superclass's CloseScope(int) with it.
9234 2005-02-23 Marek Safar <marek.safar@seznam.cz>
9236 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
9237 CS1677 for out and ref as well.
9239 * class.cs (Method.Define): Add error CS1599 detection.
9241 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
9243 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
9245 * delegate.cs (Delegate.Define): Add error CS1599 detection.
9247 * support.cs.cs (ModifierDesc): New helper method.
9249 2005-02-23 Raja R Harinath <rharinath@novell.com>
9250 Abin Thomas <projectmonokochi@rediffmail.com>
9251 Anoob V E <projectmonokochi@rediffmail.com>
9252 Harilal P R <projectmonokochi@rediffmail.com>
9255 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
9256 MemberLookup (used for error reporting) actually returns a result.
9257 Fix error report number (122, not 112).
9259 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
9260 Anoob V E <projectmonokochi@rediffmail.com>
9261 Harilal P R <projectmonokochi@rediffmail.com>
9264 * pending.cs (PendingImplementation.GetAbstractMethods):
9265 Find NonPublic members too.
9267 2005-02-22 Marek Safar <marek.safar@seznam.cz>
9269 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
9272 * class.cs (MethodCore.CheckMethodAgainstBase):
9273 Add error 239 report.
9275 2005-02-21 Raja R Harinath <rharinath@novell.com>
9278 * expression.cs (Invocation.IsApplicable): Make public.
9279 (Invocation.IsParamsMethodApplicable): Likewise.
9280 * delegate.cs (Delegate.VerifyApplicability): Don't use
9281 Invocation.VerifyArgumentCompat for parameter applicability
9282 testing. Use Invocation.IsApplicable and
9283 Invocation.IsParamsMethodApplicable.
9285 2005-02-21 Marek Safar <marek.safar@seznam.cz>
9287 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
9289 * class.cs (Operator.Define): Add error 217 report.
9291 2005-02-21 Raja R Harinath <rharinath@novell.com>
9293 * namespace.cs (UsingEntry.Resolve): Undo change below.
9295 2005-02-21 Raja R Harinath <rharinath@novell.com>
9298 * ecore.cs (Expression.MemberLookupFailed): Add argument to
9299 disable the error message when the extended MemberLookup also
9301 (Expression.MemberLookupFinal): Update.
9302 (SimpleName.DoSimpleNameResolve): Update.
9303 * expression.cs (MemberAccess.ResolveNamespaceOrType):
9304 Don't use MemberLookupFinal.
9305 (New.DoResolve): Update.
9306 (BaseAccess.CommonResolve): Update.
9308 2005-02-21 Raja R Harinath <rharinath@novell.com>
9311 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
9312 occured previously, don't resolve again.
9314 2005-02-21 Marek Safar <marek.safar@seznam.cz>
9317 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
9318 argument. Call ResolveAttributeUsage for unresolved.
9319 when types doesn't match ctor arguments.
9321 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
9322 for nested attribute classes.
9323 (Class.attribute_usage): Removed.
9324 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
9325 for attribute class.
9327 * ecore.cs (IsAttribute): Removed.
9329 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
9331 * rootcontext.cs (RegisterAttribute): Removed, attributes are
9333 (attribute_types): Removed.
9334 (EmitCode): Global attributes are emited as the latest.
9336 2005-02-18 Marek Safar <marek.safar@seznam.cz>
9338 * class.cs (EmitFieldInitializers): Don't emit field initializer
9339 for default values when optimilization is on.
9341 * constant.cs (Constant.IsDefaultValue): New property.
9343 * driver.cs: Add /optimize handling.
9347 * literal.cs: Implement new IsDefaultValue property.
9349 * rootcontext.cs (Optimize): New field, holds /optimize option.
9351 2005-02-18 Raja R Harinath <rharinath@novell.com>
9353 Fix crasher in re-opened #72347.
9354 * namespace.cs (Namespace.Lookup): Return null if
9355 DeclSpace.DefineType returns null.
9358 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
9360 2005-02-18 Raja R Harinath <rharinath@novell.com>
9362 Fix remainder of #63202. Change semantics of DoResolveLValue: it
9363 now returns null if it cannot resolve to an lvalue.
9364 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
9365 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
9366 returned null. Remove check for SimpleName.
9367 (EventExpr.DoResolveLValue): New.
9368 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
9369 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
9371 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
9373 (Unary.ResolveOperator): Move CS0211 check ...
9374 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
9376 (Unary.DoResolveLValue): Simplify.
9377 (AddressOf.DoResolveLValue): New.
9378 (ArrayAccess.DoResolveLValue): New.
9380 2005-02-16 Marek Safar <marek.safar@seznam.cz>
9382 * attribute.cs (Attribute.Resolve): Add arguments casting for
9383 when types doesn't match ctor arguments.
9385 2005-02-16 Raja R Harinath <rharinath@novell.com>
9387 Fix parts of #63202.
9388 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
9389 lookup of operator in base type. Ensure that all checks happen
9390 when the operator resolves to an "op_..." method.
9392 2005-02-15 Raja R Harinath <rharinath@novell.com>
9395 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
9396 'ignore_cs0104' parameter. Pass it to ...
9397 (NamespaceEntry.Lookup): ... this.
9398 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
9399 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
9400 (TypeLookupExpression.DoResolveAsTypeStep): Update.
9401 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
9402 Update. Request that cs0104 errors be ignored.
9403 (ComposedCast.ResolveAsTypeStep): Update.
9405 2005-02-14 Raja R Harinath <rharinath@novell.com>
9408 * expression.cs (Invocation.BetterFunction): Remove support for
9409 comparing virtual functions and their overrides.
9410 (Invocation.IsOverride): New.
9411 (Invocation.OverloadResolve): Don't consider 'override' functions
9412 during candidate selection. Store them in a lookaside list.
9413 If the selected method is a 'virtual' function, use the list to
9414 find any overrides that are closer to the LHS type.
9416 2005-02-14 Marek Safar <marek.safar@seznam.cz>
9418 * expression.cs (New.DoResolve): Add complex core type reduction.
9419 (New.Constantify): Converts complex core type syntax like 'new int ()'
9422 2005-02-14 Raja R Harinath <rharinath@novell.com>
9424 * decl.cs (EntryType.EntryType): New constructor to create an
9425 updated copy of a cache entry.
9426 (MemberCache.AddMethods): Use it.
9427 (MemberCache.ClearDeclaredOnly): Remove.
9428 (MemberCache.MemberCache): Update.
9430 2005-02-11 Miguel de Icaza <miguel@novell.com>
9432 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
9433 variable. This one is represents the actual low-level declaration
9434 of the method, as opposed to the semantic level `IsStatic'.
9436 An anonymous method which is hosted into a static method might be
9437 actually an instance method. IsStatic would reflect the
9438 container, while MethodIsStatic represents the actual code
9441 * expression.cs (ParameterReference): Use the new MethodIsStatic
9442 instead of IsStatic.
9444 * anonymous.cs (AnonymousMethod.Compatible): Pass the
9445 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
9446 set on the current EmitContext.
9448 * expression.cs (Cast): Overload DoResolveLValue so we can pass
9449 resolve our casted expression as an LValue. This triggers the
9450 proper LValue processing that is later required by Assign.
9454 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
9456 2005-02-11 Marek Safar <marek.safar@seznam.cz>
9458 C# 2.0 Fixed buffer implementation
9460 * anonymous.cs: Update after RegisterHelperClass renaming.
9462 * attribute.cs (AttributeTester.fixed_buffer_cache):
9463 Cache of external fixed buffers.
9464 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
9465 implementation if field is fixed buffer else null.
9468 (TypeContainer.AddField): Accept FieldMember instead of Field.
9469 (FieldBase.IsFieldClsCompliant): Extracted code from
9470 VerifyClsCompliance descendant customization.
9471 (FixedField): New class handles fixed buffer fields.
9472 (FixedFieldExternal): Keeps information about imported fixed
9474 (IFixedField): Make access to internal or external fixed buffer
9477 * cs-parser.jay: Add fixed buffer parsing.
9479 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
9482 * expression.cs (Indirection): Extended implementation to accept
9484 (PointerArithmetic.Emit): Get element from fixed buffer as well.
9485 (ElementAccess.MakePointerAccess): Get type as parameter.
9486 (DoResolve): Add fixed buffer field expression conversion.
9487 (DoResolveLValue): Ditto.
9488 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
9489 (ArrayPtr): Derives from FixedBufferPtr.
9490 (ArrayPtr.Emit): Add extra emit for array elements.
9492 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
9494 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
9495 for compiler generated types.
9496 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
9498 * statement.cs (Fixed): Refactored to be easier add fixed buffer
9499 and consume less memory.
9500 (Fixed.Resolve): Add fixed buffer case.
9502 * typemanager.cs (compiler_generated_attr_ctor,
9503 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
9504 (HasElementType): Add our own implementation to work on every
9507 2005-02-11 Miguel de Icaza <miguel@novell.com>
9509 * anonymous.cs (CaptureContext): Track whether `this' has been
9512 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
9513 only captured `this' if it was implicitly done (instance
9514 methods/variables were used).
9516 * codegen.cs (EmitContext.CaptureThis): New method to flag that
9517 `this' must be captured.
9519 2005-01-30 Miguel de Icaza <miguel@novell.com>
9521 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
9522 is null it means that there has been no need to capture anything,
9523 so we just create a sibling.
9525 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
9527 Just a partial fix. The other half is fairly elusive.
9529 2005-02-10 Raja R Harinath <rharinath@novell.com>
9531 Fix #52586, cs0121-4.cs.
9532 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
9533 and return a hashtable.
9534 (MemberCache.ClearDeclaredOnly): New.
9535 (MemberCache.MemberCache): Update to change. Make a deep copy of
9536 the method_hash of a base type too.
9537 (MemberCache.AddMethods): Adapt to having a deep copy of the base
9538 type methods. Overwrite entries with the same MethodHandle so
9539 that the ReflectedType is correct. The process leaves in base
9540 virtual functions and their overrides as distinct entries.
9541 (CacheEntry): Now a class instead of a struct. It shouldn't alter
9542 matters since it was boxed in a ArrayList before.
9543 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
9545 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
9546 case of a virtual function and its override (choose the overload
9548 (Invocation.OverloadResolve): Avoid 'override' members during
9549 'applicable_type' calculation.
9551 2005-02-09 Raja R Harinath <rharinath@novell.com>
9553 Combine two near-redundant caches.
9554 * typemanager.cs (method_params): Rename from method_internal_params.
9555 (TypeManager.GetParameterData): New. Replace
9556 Invocation.GetParameterData.
9557 (TypeManager.LookupParametersByBuilder): Remove.
9558 * expression.cs (Invocation.method_parameter_cache): Remove.
9559 (Invocation.GetParameterData): Remove.
9561 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
9564 2005-02-08 Raja R Harinath <rharinath@novell.com>
9567 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
9568 TypeManager.multicast_delegate_type is null, resolve it by looking
9569 up "System.MulticastDelegate".
9570 * rootcontext.cs (RootContext.ResolveCore): Simplify.
9572 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
9573 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
9574 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
9577 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
9578 (LabeledStatement.AddReference): New. Set 'referenced'.
9579 (Goto.Resolve): Use it.
9581 2005-02-05 John Luke <john.luke@gmail.com>
9583 * driver.cs: remove duplicate -doc line in Usage ()
9585 2005-02-04 Raja R Harinath <rharinath@novell.com>
9587 * location.cs (Location.AddFile): Fix CS2002 error report.
9589 2005-02-02 Martin Baulig <martin@ximian.com>
9591 * delegate.cs (Delegate.DefineType): Report an internal error if
9592 TypeManager.multicast_delegate_type is null. See bug #72015 for
9595 2005-02-02 Raja R Harinath <rharinath@novell.com>
9597 Fix a crasher in a variant of #31984.
9598 * const.cs (Constant.CheckBase): New override that defers the
9599 new-or-override check in case the base type hasn't been populated
9601 (Constant.Define): Ensure the new-or-override check is performed.
9603 2005-02-01 Duncan Mak <duncan@ximian.com>
9605 * const.cs (LookupConstantValue): Check that `ce' is not null
9606 before calling GetValue ().
9608 2005-02-01 Raja R Harinath <rharinath@novell.com>
9610 Fix test-334.cs (#69519).
9611 * cs-parser.jay (using_alias_directive): Pass in an expression to
9612 NamespaceEntry.UsingAlias.
9613 (using_namespace_directive): Pass in an expression to
9614 NamespaceEntry.Using.
9615 (namespace_name): Don't flatten to a string.
9616 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
9617 (NamespaceEntry.AliasEntry.Resolve): Lookup using
9619 (NamespaceEntry.UsingEntry): Likewise.
9620 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
9622 (NamespaceEntry.LookupForUsing): Remove.
9623 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
9625 (NamespaceEntry.Lookup): Remove support for dotted names.
9627 2005-02-01 Raja R Harinath <rharinath@novell.com>
9629 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
9631 (NamespaceEntry.ImplicitParent): Compute on demand.
9632 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
9633 parallels the current.
9634 (NamespaceEntry.LookupForUsing): Use it.
9635 (NamespaceEntry.Lookup): If the current namespace-entry is
9636 implicit, don't search aliases and using tables.
9638 2005-02-01 Raja R Harinath <rharinath@novell.com>
9641 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
9643 (TypeContainer.BaseCache): Compute on demand.
9644 (TypeContainer.FindMembers): Define constants and types if they're
9645 not already created.
9646 (FieldMember.Define): Move resetting of ec.InUnsafe before error
9648 * const.cs (Constant.Define): Make idempotent.
9650 2005-01-29 Miguel de Icaza <miguel@novell.com>
9652 * pending.cs: Produce better code (no nops produced by using Ldarg
9655 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
9656 i - 1' it should be arg + 1.
9660 2005-01-28 Raja R Harinath <rharinath@novell.com>
9662 * attribute.cs (Attribute.CheckAttributeType): Make private
9664 (Attribute.ResolveType): Make virtual.
9665 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
9666 handling of RootContext.Tree.Types.
9668 2005-01-27 Raja R Harinath <rharinath@novell.com>
9670 Update attribute-handling to use the SimpleName/MemberAccess
9672 * cs-parser.jay (attribute): Pass in an expression to the
9673 constructors of Attribute and GlobalAttribute.
9674 * attribute.cs (Attribute): Take an expression for the name.
9675 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
9676 passed in attribute name expression.
9677 (Attribute.CheckAttributeType): Use it.
9678 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
9679 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
9680 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
9681 argument to prevent error messages if the lookup fails.
9683 2005-01-27 Marek Safar <marek.safar@seznam.cz>
9685 * expression.cs (Indirection): Implemented IVariable interface
9686 to support indirection in AddressOf operator.
9687 (PointerArithmetic.Emit): Add optimalization for case where
9688 result can be precomputed.
9690 2005-01-26 Martin Baulig <martin@ximian.com>
9692 * class.cs (TypeContainer.AttributeTargets): Return the correct
9693 AttributeTargets depending on our `Kind' instead of throwing an
9694 exception; fixes #71632.
9696 2005-01-26 Marek Safar <marek.safar@seznam.cz>
9699 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
9702 2005-01-25 Raja R Harinath <rharinath@novell.com>
9705 * expression.cs (MemberAccess.DoResolve): Don't complain with
9706 cs0572 when the LHS of a member access has identical name and type
9709 2005-01-25 Marek Safar <marek.safar@seznam.cz>
9712 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
9714 Create custom PermissionSet only for PermissionSetAttribute.
9716 2005-01-24 Marek Safar <marek.safar@seznam.cz>
9719 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
9720 delegates in static class.
9722 2005-01-24 Martin Baulig <martin@ximian.com>
9724 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9725 merging an implicit block, just use its reachability.
9727 * statement.cs (Block.Resolve): Make the unreachable code check
9728 work wrt. implicit blocks; see test-337 from #63842.
9730 2005-01-21 Alp Toker <alp@atoker.com>
9732 * cs-parser.jay: destructor_declaration's container is PartialContainer
9733 not Class when partial types are used, so use Kind prop instead of
9736 2005-01-22 Miguel de Icaza <miguel@ximian.com>
9738 * cs-parser.jay: Improve error reporting when an interface
9741 2005-01-20 Dick Porter <dick@ximian.com>
9743 * support.cs: SeekableStreamReader fix from Sandor Dobos
9744 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
9745 chars are read. Fixes bug 70369.
9747 2005-01-20 Raja R Harinath <rharinath@novell.com>
9749 * cs-parser.jay (catch_clause): Simplify current_block handling
9752 2005-01-17 Miguel de Icaza <miguel@ximian.com>
9754 * convert.cs (ImplicitStandardConversionExists): Synchronize the
9755 code with ImplicitStandardConversion to handle the implicit
9756 conversion of method groups into valid delegate invocations.
9758 The problem is that in parameter handling we were using this code
9759 path. Fixes bug #64698
9761 2005-01-19 Raja R Harinath <rharinath@novell.com>
9763 * cs-parser.jay: Fix several infelicities.
9764 - Avoid assigning to the parser value stack. Code like
9765 '$3 = null' is unclean. Synthesize a value for the code block
9767 - Avoid using oob_stack for storing location information. Use ...
9768 (_mark_): ... this. New (empty) rule. Saves the current location
9770 (foreach_statement): Avoid using oob_stack for current_block
9771 handling. Use technique used in for_statement and
9772 using_statement. Synthesize a value for the code block to store
9773 additional intermediate information.
9775 2005-01-13 Miguel de Icaza <miguel@ximian.com>
9777 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
9778 of a different type is only allowed to private fields of a
9779 containing type, not on fields of a base class.
9781 See test-174.cs and error cs0122-9.cs
9783 2005-01-13 Raja R Harinath <rharinath@novell.com>
9785 Fix test-335.cs (bug #58126).
9786 * cs-parser.jay (argument): Split out non-expression parts of the
9787 rule into 'non_simple_argument'.
9788 (invocation_expression): Support parenthesized invocations with
9789 multiple arguments, and with single non-simple arguments.
9791 2005-01-13 Raja R Harinath <rharinath@novell.com>
9793 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
9796 2005-01-12 Raja R Harinath <rharinath@novell.com>
9798 Fix cs0038-1.cs, cs1640-6.cs.
9799 * ecore.cs (Expression.Resolve): Remove special-case for
9800 SimpleName in error-handling.
9801 (Expression.almostMatchedMembers): Relax access permission to
9803 (Expression.MemberLookupFailed): Handle duplicates in
9804 almostMatchedMembers list.
9805 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
9806 * expression.cs (New.DoResolve): Report CS1540 for more cases.
9807 * typemanager.cs (GetFullNameSignature): Use the MethodBase
9808 overload if the passed in MemberInfo is a MethodBase.
9810 2005-01-12 Marek Safar <marek.safar@seznam.cz>
9813 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
9814 for non-CAS & merge permission sets properly.
9816 2005-01-11 Raja R Harinath <rharinath@novell.com>
9818 Improve standard-compliance of simple name and member access
9819 resolution. Fixes bugs #52697, #57200, #67520, #69519.
9820 * ecore.cs (FullNamedExpression): New abstract base class
9821 for Namespaces and TypeExpressions.
9822 (ResolveFlags.SimpleName): Remove.
9823 (SimpleName): Remove support for dotted names.
9824 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
9825 DeclSpace.FindType and DeclSpace.LookupType.
9826 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
9827 (Expression.ExprClassName): Make member function.
9828 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
9829 a namespace. Remove creation of dotted "SimpleName"s.
9830 (MemberAccess.DoResolve): Likewise.
9831 * decl.cs (DeclSpace.Cache): Make private.
9832 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
9833 (DeclSpace.FindType): Update.
9834 (DeclSpace.LookupType): Move here from RootContext. Return a
9835 FullNamedExpression.
9836 * namespace.cs (Namespace): Derive from FullNamedExpression
9837 so that it can be part of expression resolution.
9838 (Namespace.Lookup): Return an FullNamedExpression.
9839 (NamespaceEntry.LookupAlias): Lookup aliases only in current
9841 * rootcontext.cs (NamespaceLookup): Remove.
9842 (LookupType): Move to DeclSpace.
9843 * attribute.cs (CheckAttributeType): Update.
9844 * doc.cs (FindDocumentedType): Remove allowAlias argument.
9845 (FindDocumentedTypeNonArray): Likewise.
9847 2005-01-11 Raja R Harinath <rharinath@novell.com>
9849 Fix cs0509.cs, cs1632.cs.
9850 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
9851 is the same as IsInterface.
9852 (TypeContainer.GetClassBases): Likewise.
9853 * statement.cs (LabeledStatement.ig): New field.
9854 (LabeledStatement.LabelTarget): Save ILGenerator which created the
9856 (LabeledStatement.DoEmit): Check that the label was created with
9857 the same ILGenerator.
9859 2005-01-10 Marek Safar <marek.safar@seznam.cz>
9862 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
9863 accessors to its properties.
9865 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
9866 from accessors to property.
9868 2005-01-10 Marek Safar <marek.safar@seznam.cz>
9871 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
9874 2005-01-08 Miguel de Icaza <miguel@ximian.com>
9876 * attribute.cs: Check for null and empty strings.
9878 I have lost another battle to Paolo.
9880 2005-01-07 Marek Safar <marek.safar@seznam.cz>
9883 * class.cs (PropertyMethod): Set Parent field in ctors.
9884 (SetMethod.InternalParameters): Add unsafe switch hack.
9885 Override MarkForDuplicationCheck where it is appropriate.
9887 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
9888 It says whether container allows members with the same name.
9890 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
9891 Removed is_method parameter.
9893 2005-01-06 Duncan Mak <duncan@ximian.com>
9895 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
9896 because the previous change led to incorrect reporting of CS1032
9897 ("Cannot define/undefine preprocessor symbols after first token in
9898 file"). Instead of using `tokens_seen' as the only flag that
9899 triggers CS1040, introduce `comments_seen'. This new flag is used
9900 to signify having seen comments on the current line, so it is
9901 unset after a newline.
9903 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
9905 * doc.cs : When searching for a type, find nested type too.
9906 This fixes bug #71040.
9908 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
9911 - Warn missing member comment on those classes which also does not
9912 have doc comments. Fixed bug #71041.
9913 - Don't warn missing doc comment on default constructor.
9916 2005-01-06 Duncan Mak <duncan@ximian.com>
9918 * cs-tokenizer.cs (xtoken): After handling traditional C-style
9919 comments, set `tokens_seen' to true. This allows us to detect
9920 misplaced preprocessor directives (i.e. not at the beginning of
9921 the a line, nor after whitespaces). In that case, report error
9922 CS1040. This fixes bug #56460.
9924 * cs-parser.jay (interface_member_declaration): Add checks for
9925 IsExplicitImpl, and report CS0541 error if an interface member is
9926 defined as an explicit interface declaration.
9928 2005-01-06 Marek Safar <marek.safar@seznam.cz>
9931 * class.cs (PropertyMethod): Set Parent field in ctors.
9932 (SetMethod.InternalParameters): Add unsafe switch hack.
9934 * decl.cs (MemberCore.Parent): Cannot be readonly.
9936 2005-01-06 Raja R Harinath <rharinath@novell.com>
9938 * decl.cs (DeclSpace.ResolveType): Remove.
9939 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
9940 Merge in code from ...
9941 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
9942 * class.cs, enum.cs: Update to changes.
9944 2005-01-06 Miguel de Icaza <miguel@ximian.com>
9946 * anonymous.cs: Ensure that we init the scope of our parent if it
9947 has not been initialized yet.
9949 2004-12-30 Duncan Mak <duncan@ximian.com>
9951 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
9952 if field.FieldBuilder is null. Fixes #70758.
9954 * convert.cs: Fixed some typos and updated some of the comments.
9955 (ImplicitStandardConversionExists):
9956 (TryImplicitIntConversion): If `target_type' is an interface and
9957 the type of `ic' implements this interface, return true or a new
9958 BoxedCast instead of null. This fixes #70468.
9960 2004-12-29 Duncan Mak <duncan@ximian.com>
9962 * expression.cs (Argument.Emit): Check that Expr is
9963 IMemoryLocation before casting to it, and report CS1510 otherwise.
9967 2004-12-21 Ben Maurer <bmaurer@ximian.com>
9969 * statement.cs (Block.ThisVariable): remove the recursion here, to
9970 make the --profile more sane.
9972 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
9974 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
9975 assembly, by JB Evain.
9977 2004-12-17 Raja R Harinath <rharinath@novell.com>
9979 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
9980 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
9981 "parent" refers to enclosing type/class. "base" refers to superclass.
9983 2004-12-17 Raja R Harinath <rharinath@novell.com>
9985 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9986 Ensure that we only have GlobalAttributes.
9987 * attribute.cs (Attribute.Emit): Make non-virtual.
9988 (GlobalAttribute.Emit): Remove.
9989 (Attribute.Resolve): Make virtual.
9990 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
9991 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
9992 the argument. Don't create one.
9993 (Attribute.GetObsoleteAttribute): Likewise.
9994 (Attribute.GetClsCompliantAttributeValue): Likewise.
9995 * class.cs, decl.cs: Update to changes.
9997 2004-12-17 Marek Safar <marek.safar@seznam.cz>
9999 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
10001 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
10003 * statement.cs (Foreach.Resolve): Add error 186 report.
10005 2004-12-16 Marek Safar <marek.safar@seznam.cz>
10007 * expression.cs (Conditional.DoResolve): Add warning 429.
10009 * statement.cs (If.Resolve): Add warning 665.
10011 2004-12-16 Raja R Harinath <rharinath@novell.com>
10013 New invariant: RootContext.Tree.Types.NamespaceEntry == null
10014 except when in the parser, and in GlobalAttribute.
10015 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
10016 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
10017 RootContext.Tree.Types.NamespaceEntry once work is done.
10018 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
10019 and resets RootContext.Tree.Types.NamespaceEntry.
10021 2004-12-15 Marek Safar <marek.safar@seznam.cz>
10023 * cs-parser.jay: Don't create a block for every variable.
10025 2004-12-14 Miguel de Icaza <miguel@ximian.com>
10027 * location.cs: Provide extra information.
10029 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
10030 variables from the captured environment, it is the ldarg_0.
10032 2004-12-14 Marek Safar <marek.safar@seznam.cz>
10034 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
10037 * class.cs: Changed warning level for 169 to avoid developer
10038 displeasure from warning flooding. It will be changed back when they
10039 fix most of current BCL warnings.
10041 * RootContext.cs: Pushed default WarningLevel to 3.
10043 * statement.cs: Removed unused variable.
10045 2004-12-14 Marek Safar <marek.safar@seznam.cz>
10047 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
10048 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
10049 Add error 502 report.
10050 (StaticClass.DefineType): Add error 441 report.
10051 (Class.AllowedModifiersProp): New virtual property as temporary
10052 extension to AllowedModifiers.
10053 (Class.DefineType): Add error 418 report. Moved ModFlags check here
10054 to share implementation with StaticClass and don't call virtual
10057 * driver.cs (MainDriver): Add error 1558 test.
10059 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
10060 report. Moved error 36 test here.
10062 * statement.cs (Throw.Resolve): Add error 724 report.
10064 * typemanager.cs: Add out_attribute_type core type.
10066 2004-12-13 Marek Safar <marek.safar@seznam.cz>
10068 * class.cs (TypeContainer.VerifyClsCompliance): Add error
10070 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
10072 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
10075 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
10077 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
10078 Add error 3023 report.
10079 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
10081 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
10084 2004-12-12 John Luke <john.luke@gmail.com>
10086 * driver.cs (AddArgs): take -- into account when
10087 adding arguments, fixes bug 65710
10089 2004-12-12 Martin Baulig <martin@ximian.com>
10091 * expression.cs (Unary.TryReduceNegative): Added support for
10092 SByteConstant and ByteConstant.
10093 (Unary.Reduce): Check error values from TryReduceNegative().
10095 2004-12-10 Marek Safar <marek.safar@seznam.cz>
10097 * attributes.cs (Attribute.Resolve): Avoid multiple error report
10098 and report exception as error 182.
10100 2004-12-10 Raja R Harinath <rharinath@novell.com>
10102 * driver.cs (Main): Fix message when there are warnings.
10104 2004-12-09 Miguel de Icaza <miguel@ximian.com>
10106 * delegate.cs: Fixed my fix from yesterday, sorry about that.
10108 2004-12-09 Marek Safar <marek.safar@seznam.cz>
10110 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
10111 Reduced number of warnings.
10113 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
10115 2004-12-08 Miguel de Icaza <miguel@ximian.com>
10117 * driver.cs: Removed message.
10119 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
10121 2004-12-08 <vargaz@freemail.hu>
10123 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
10125 2004-12-08 Martin Baulig <martin@ximian.com>
10127 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
10128 instead of a CS3002 for properties and indexer.
10130 2004-12-08 Martin Baulig <martin@ximian.com>
10132 * decl.cs (MemberName.ToString): Make this work again.
10134 2004-12-08 Marek Safar <marek.safar@seznam.cz>
10136 * attribute.cs (Resolve): Add error 591 detection.
10138 * class.cs (FieldMember.Define): Add error 1547 detection.
10139 (Indexer.Define): Add error 620 detection.
10140 (Operator.Define): Add error 590 detection.
10142 * ecore.cs: Missing argument for error 79.
10144 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
10147 2004-12-07 Marek Safar <marek.safar@seznam.cz>
10150 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
10153 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
10155 * cs-parser.jay : handle doc comments on implicit/explicit operators.
10156 Some operator comments were suppressed.
10157 * doc.cs : Implicit/explicit operator name in doc comments are like
10158 "op_Explicit(type)~returnType", so added suffix handling.
10160 2004-12-07 Martin Baulig <martin@ximian.com>
10163 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
10164 (MemberCore.GetClsCompliantAttributeValue): Likewise.
10165 (DeclSpace.ec): New protected field; store the EmitContext here.
10166 (DeclSpace.EmitContext): New public property; moved here from
10168 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
10171 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
10172 (Enum.Emit): Don't create a new EmitContext.
10174 * delegate.cs (Delegate.DefineType): Always create the
10177 * iterators.cs (Iterators.DefineIterator): Create a new
10178 EmitContext and store it in `ec'.
10180 2004-08-24 Martin Baulig <martin@ximian.com>
10183 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
10184 this for accessibility checks.
10185 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
10186 IsNestedFamilyAccessible.
10187 (TypeManager.IsSubclassOf): New method, do what the name actually
10190 2004-12-06 Raja R Harinath <rharinath@novell.com>
10192 Fix crash on cs0657-17.cs.
10193 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10194 Use RootContext.Tree.Types, not 'new RootTypes ()'.
10195 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
10196 the case where the NamespaceEntry gets overwritten.
10198 2004-12-06 Marek Safar <marek.safar@seznam.cz>
10200 Fixed #69195, #56821
10201 * ecore.cs (ResolveBoolean): Tiny refactoring.
10203 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
10204 of right expression resolving when left is false constant and
10205 operator is LogicalAnd OR true constant and operator is LogicalOr.
10207 * statement.cs (ResolveUnreachable): Always reports warning.
10209 2004-12-05 Miguel de Icaza <miguel@ximian.com>
10211 * class.cs: Distinguish between 1721 and 1722 (just a little help
10212 for the programmer).
10214 2004-12-03 Miguel de Icaza <miguel@ximian.com>
10216 * delegate.cs: Only allow this on new versions of the language.
10218 2004-12-02 Duncan Mak <duncan@ximian.com>
10220 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
10222 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
10223 here as a static method. Take an additional bool out parameter
10224 `must_do_cs1540_check' for signaling to InstanceResolve.
10225 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
10226 member field from PropertyExpr class and made it an argument of
10227 the method instead.
10228 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
10229 check for MarshalByRefObject, and report CS0122 instead of CS1540.
10230 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
10231 and `remove_accessor' as well as InstanceResolve: report CS0122
10236 2004-12-03 Raja R Harinath <rharinath@novell.com>
10238 Fix test-327.cs, test-328.cs, and put in early infrastructure
10239 for eventually fixing #52697.
10240 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
10241 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
10242 from other methods.
10243 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
10244 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
10245 (VerifyUsing, error246): Update.
10246 * rootcontext.cs (RootContext.NamespaceLookup): Just use
10247 'NamespaceEntry.LookupNamespaceOrType'.
10249 2004-12-03 Martin Baulig <martin@ximian.com>
10251 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10252 method as our child, call AnonymousMethod.Compatible() on it.
10254 2004-12-03 Raja R Harinath <rharinath@novell.com>
10256 Disable XML documentation support in 'basic' profile.
10257 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
10258 Redirect XmlElement to System.Object.
10259 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
10260 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
10261 * mcs.exe.sources: Add doc-bootstrap.cs.
10262 * doc-bootstrap.cs: New file. Contains empty stub implementation
10265 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
10267 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
10268 comments are allowed.
10270 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10272 * delegate.cs: Add checks for subtypes in paramaters and return values
10273 in VerifyMethod () to add support for Covariance/Contravariance
10276 2004-12-02 Miguel de Icaza <miguel@ximian.com>
10278 * report.cs: Remove extra closing parenthesis.
10280 * convert.cs (Error_CannotImplicitConversion): If the name of the
10281 types are the same, provide some extra information.
10283 * class.cs (FieldBase): Use an unused bit field from the field to
10284 encode the `has_offset' property from the FieldMember. This saves
10285 a couple of Ks on bootstrap compilation.
10287 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10288 method as our child, return the AnonymousMethod resolved
10291 * expression.cs (New.DoResolve): Allow return values from
10292 NewDelegate to also include AnonymousMethods.
10296 2004-12-02 Marek Safar <marek.safar@seznam.cz>
10299 * attribute.cs (Resolve): Improved implementation of params
10300 attribute arguments.
10302 * support.cs (ParameterData): Add HasParams to be faster.
10304 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
10306 all things are for /doc support:
10308 * doc.cs: new file that supports XML documentation generation.
10309 * mcs.exe.sources: added doc.cs.
10311 Handle /doc command line option.
10312 Report error 2006 instead of 5 for missing file name for /doc.
10313 Generate XML documentation when required, after type resolution.
10315 Added support for picking up documentation (/// and /** ... */),
10316 including a new XmlCommentState enumeration.
10318 Added lines to fill Documentation element for field, constant,
10319 property, indexer, method, constructor, destructor, operator, event
10320 and class, struct, interface, delegate, enum.
10321 Added lines to warn incorrect comment.
10323 Added Documentation field (passed only when /doc was specified).
10325 Added DocComment, DocCommentHeader, GenerateDocComment() and
10326 OnGenerateDocComment() and some supporting private members for
10327 /doc feature to MemberCore.
10329 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
10331 Added overriden DocCommentHeader.
10333 Added overriden DocCommentHeader and GenerateDocComment().
10335 2004-12-01 Miguel de Icaza <miguel@ximian.com>
10337 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
10338 unwrapping the enumeration values, chain to
10339 DoConstantNumericPromotions again, so we can promote things to the
10340 fundamental types (takes care of enums that are bytes, sbytes).
10344 2004-12-01 Raja R Harinath <rharinath@novell.com>
10346 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
10347 Fix long-standing bug in type-lookup. Use FindType instead of
10348 LookupType when ec.ResolvingTypeTree.
10349 (Attribute.ResolveType, Attribute.Resolve)
10350 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
10352 (Attributes.Search): Remove internal version. Update.
10353 (Attributes.SearchMulti): Update.
10354 (Attributes.GetClsCompliantAttribute): Remove.
10355 (Attributes.GetIndexerNameAttribute): Remove.
10356 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
10357 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
10358 * class.cs (Indexer.Define): Likewise.
10360 2004-12-01 Marek Safar <marek.safar@seznam.cz>
10363 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
10364 MarshallByReference members access.
10366 * expression.cs: Use CheckMarshallByRefAccess;
10367 Better error CS0197 message.
10369 * report.cs: Print whole related error message.
10371 2004-11-30 Raja R Harinath <rharinath@novell.com>
10373 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
10374 the current directory to help debugging.
10376 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10378 * class (GetClassBases): Better error 60 report.
10379 (EventProperty): Disabled warning 67 detection.
10381 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10384 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
10386 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
10389 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10392 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
10394 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
10396 2004-11-26 Miguel de Icaza <miguel@ximian.com>
10398 * attribute.cs (Attribute.Resolve): Refine error reporting and
10399 report a cs0117 if the identifier does not exist, to distinguish
10400 from 0617 which is a miss-use of the actual identifier.
10402 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
10403 between cs0070 and cs0079.
10405 * class.cs (MemberBase.DoDefine): When reporting a wrong
10406 accessibility level, we use MethodCore to compare instead of
10407 Method (this was a regression in some refactoring effort).
10409 So now we correctly report cs0056 again.
10411 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
10412 testing the target_type (which was known to be object_type) and
10413 not the source type (which is anonymous_method).
10415 Fixed reporting of error cs1660.
10417 * expression.cs (UserCast.Source): Expose the underlying cast.
10419 * statement.cs (Switch.SwitchGoverningType): Sort the list of
10420 allowed types to find a match to int32 first (most common).
10422 In addition, it ignores any ImplicitUserConversions that did an
10423 internal implicit conversion (as the switch statement allows only
10424 one integral conversion to exist).
10426 * class.cs (PartialContainer.Create): rename `name' to
10427 `member_name' for clarity. Then replace the string calls with a
10428 call to MemberName.GetPartialName, as now using
10429 MemberName.ToString is an error (this is due to the side effects
10430 it had, that were fixed in the past).
10432 This will restore the error reporting on a number of partial class
10433 errors that were missusing this (and getting an exception as a
10434 results, which is now just a plain textual warning, because
10435 yyparse debug output would crash otherwise).
10437 2004-11-26 Raja R Harinath <rharinath@novell.com>
10439 * Makefile (PROGRAM_INSTALL_DIR): Remove.
10441 2004-11-25 Ben Maurer <bmaurer@ximian.com>
10443 * rootcontext.cs (LookupType): Make sure to cache lookups that
10444 don't give us a negative result. This saves about 5% of corlib
10447 2004-11-25 Miguel de Icaza <miguel@ximian.com>
10449 * report.cs (AbstractMessage.Print): messages are sent to stderr
10451 * class.cs (TypeContainer.GetClassBases): It is an error to have a
10452 non-interface in the list of interfaces (at this point, either
10453 parent was properly set, or a base class is being listed in the
10454 interfaces section).
10456 This flags error 1722, and resolves the crash from bug 69259.
10458 2004-11-25 Ben Maurer <bmaurer@ximian.com>
10460 * statement.cs (Using.EmitExpressionFinally): make this work right
10461 for valuetypes. Fixes 69926.
10463 2004-11-25 Miguel de Icaza <miguel@ximian.com>
10465 * const.cs (Const.ChangeType): Cope with the "0 literal can be
10466 converted to an enum" here, before we try to change the underlying
10467 type. This code exists, but it is a different code path than the
10468 one used while encoding constants.
10470 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
10471 old bug: when converting from the null literal to a pointer,
10472 return an EmptyCast, not the NullLiteral.
10474 This fixes #69921, the recent null_type changes probably made this
10475 bug more prominent.
10477 (ImplicitReferenceConversionExists): In addition, resynchronized
10478 the code here, so it matches the same code in
10479 ImplicitReferenceConversionExists for the `from any class-type S
10480 to any interface-type T'.
10483 2004-11-25 Marek Safar <marek.safar@seznam.cz>
10485 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
10487 2004-11-24 Miguel de Icaza <miguel@ximian.com>
10489 * cs-parser.jay: Use verbosity accordingly.
10491 2004-11-24 Marek Safar <marek.safar@seznam.cz>
10493 * expression.cs (Unary.ResolveOperator): Do not report warning;
10494 AddressOf reads from variable.
10496 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
10498 2004-11-24 Marek Safar <marek.safar@seznam.cz>
10502 * attribute.cs (Attributable): Removed CheckTargets.
10503 (Attributes.Emit): Explicit attribute targets are tested here.
10505 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
10506 not enabled for interfaces.
10508 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
10509 (GetAssemblyName): Ouch next bug there.
10511 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10513 * expression.cs: Error 275 added.
10515 2004-11-23 Marek Safar <marek.safar@seznam.cz>
10517 Fix bug #69177 (Implemented decimal constant support)
10519 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
10520 (BinaryFold): Add DecimalConstant.
10522 * const.cs (Define): Decimal constant
10524 (ChangeType): Add decimal type handling.
10525 (LookupConstantValue): Don't set value for decimal type but
10526 emit DecimalConstantAttribute. Needed for constant optimization.
10528 * constant.cs (ToDecimal): New method.
10529 (ConvertToDecimal): New method.
10530 (IntConstant): Implemented ConvertToDecimal.
10531 (DecimalConstant.Emit): Emit optimized version for decimals in
10534 * expression.cs (ResolveOperator): Changed order of constant
10535 reduction to work correctly with native types which have
10536 overloaded operators.
10537 (ResolveMemberAccess): Extract constant value from attribute
10540 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
10542 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
10543 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
10544 (ChangeType): Decimal is special.
10545 (TypeToCoreType): Add decimal type.
10547 2004-11-22 Marek Safar <marek.safar@seznam.cz>
10549 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
10552 2004-11-22 Marek Safar <marek.safar@seznam.cz>
10554 * class.cs (EventField.ApplyAttributeBuilder): Fix error
10557 2004-11-19 Marek Safar <marek.safar@seznam.cz>
10559 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
10561 * pending.cs (PendingImplementation): Grab only interfaces.
10563 2004-11-19 Marek Safar <marek.safar@seznam.cz>
10565 * statement.cs (ForeachHelperMethods): Add location member and
10566 error 202 detection.
10568 2004-11-19 Raja R Harinath <rharinath@novell.com>
10570 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
10571 automatically handled by executable.make.
10572 (PROGRAM): Make profile-specific.
10574 2004-11-18 Marek Safar <marek.safar@seznam.cz>
10576 * expression.cs (DoResolveBase): Fixed wrong warning for out
10579 2004-11-18 Martin Baulig <martin@ximian.com>
10581 Merged latest changes into gmcs. Please keep this comment in
10582 here, it makes it easier for me to see what changed in MCS since
10583 the last time I merged.
10585 2004-11-17 Raja R Harinath <rharinath@novell.com>
10587 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
10588 (TypeHandle.GetMemberCache): New.
10589 (TypeHandle.TypeHandle): Update.
10590 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
10591 (TypeManager.LookupParentInterfacesCache):
10592 Rename from LookupInterfaceCache. Optimize slightly.
10593 (TypeManager.MemberLookup_FindMembers): Update.
10594 * decl.cs (MemberCache.MemberCache): Set Container to null in the
10595 multi-type variant.
10596 (AddCacheContents): Rename from AddHashtable.
10597 * class.cs (TypeContainer.parent_container): Remove.
10598 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
10599 (TypeContainer.DoDefineMembers): Don't initialize it.
10600 Update to name changes.
10602 2004-11-17 Miguel de Icaza <miguel@ximian.com>
10604 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
10605 that factors the code to check access modifiers on override.
10607 (PropertyBase): Use the code here.
10609 Patch from Lluis S'anchez, fixes bug #69361.
10611 2004-11-15 Miguel de Icaza <miguel@ximian.com>
10613 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
10614 routine that is used to report the use of a captured variable
10615 whose address has been taken.
10617 There are two checks: one when variables are being captured and
10618 the other check is when the address of a variable is taken.
10620 (because an anonymous methods might be resolved before *or* after
10621 the address has been taken) and
10623 * expression.cs (Conditional.DoResolve): Remove the special
10624 casing that Martin added to trueExpr and falseExpr being both
10625 NullLiteral. We get the right behavior now just by introducing
10626 the null_type into the compiler.
10628 * convert.cs (ExplicitConversion): Change the code to use
10629 null_type instead of testing `expr is NullLiteral'.
10630 (ImplicitConversionStandard): use null_type too.
10631 (ImplicitReferenceConversionExists): use null_type too.
10632 (ImplicitReferenceConversion): use null_type too.
10634 * literal.cs: The type of `NullLiteral' is now null_type instead
10636 (Resolve): Set the type here.
10638 * typemanager.cs: Introduce null_type.
10640 2004-11-17 Martin Baulig <martin@ximian.com>
10642 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
10643 direction, like FindMembers() does. Fixes #69546, testcase is in
10646 2004-11-16 Martin Baulig <martin@ximian.com>
10648 This is based on a patch from Marek Safar, see bug #69082.
10649 Fixes bugs #63705 and #67130.
10651 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
10652 method; create a MemberCache for an interface type and cache the
10655 * decl.cs (IMemberContainer.ParentContainer): Removed.
10656 (IMemberContainer.ParentCache): New property.
10657 (MemberCache.SetupCacheForInterface): Removed.
10658 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
10659 to create a cache for an interface's "parent".
10661 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
10664 2004-11-16 Martin Baulig <martin@ximian.com>
10666 Merged back from gmcs; these changes already went into gmcs a
10667 couple of weeks ago.
10670 (TypeManager.AddUserType): Removed the `ifaces' argument.
10671 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
10673 (TypeManager.AddUserInterface): Removed.
10674 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
10676 (TypeManager.GetInterfaces): Likewise.
10677 (TypeManager.GetExplicitInterfaces): Likewise.
10679 * ecore.cs (TypeExpr.GetInterfaces): Removed.
10681 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
10682 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
10684 2004-11-14 Ben Maurer <bmaurer@ximian.com>
10686 * statement.cs: Avoid adding bools to a hashtable.
10688 2004-11-07 Miguel de Icaza <miguel@ximian.com>
10690 * expression.cs (Invocation.OverloadResolve): Flag error if we are
10691 calling an unsafe method from a safe location.
10693 2004-11-06 Marek Safar <marek.safar@seznam.cz>
10696 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
10698 2004-11-06 Miguel de Icaza <miguel@ximian.com>
10700 * namespace.cs (VerifyUsing): use GetPartialName instead of
10703 2004-11-05 Miguel de Icaza <miguel@ximian.com>
10705 * statement.cs (Return.Resolve): Fix regression in typo: if
10706 `in_exc', we have to request a NeedReturnLabel, this was a typo
10707 introduced in the anonymous method check-in. Fixes #69131.
10709 * Indexers were using the ShortName when defining themselves,
10710 causing a regression in the compiler bootstrap when applying the
10711 patch from 2004-11-02 (first part), now they use their full name
10712 and the bug is gone.
10714 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
10716 * driver.cs: Strip the path from the names of embedded resources. Fixes
10719 2004-11-04 Raja R Harinath <rharinath@novell.com>
10721 Fix error message regression: cs0104-2.cs.
10722 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
10723 (AliasEntry.Resolve): Update.
10724 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
10726 (RootContext.LookupType): Update.
10728 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
10730 * cs-parser.jay: Add support for handling accessor modifiers
10731 * class: Add support port accessor modifiers and error checking,
10732 define PropertyMethod.Define as virtual (not abstract anymore)
10733 * ecore.cs: Add checking for proeprties access with access modifiers
10734 * iterators.cs: Modify Accessor constructor call based in the modified
10736 2004-11-02 Ben Maurer <bmaurer@ximian.com>
10738 * expression.cs (StringConcat): Handle being called twice,
10739 as when we have a concat in a field init with more than two
10742 2004-11-02 Miguel de Icaza <miguel@ximian.com>
10744 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
10745 special case explicit implementations, we should always produce
10746 the .property or .event declaration.
10748 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
10749 since it will not return correct data if people use this
10750 unresolved in the presence of using statements (see test-313).
10752 * class.cs (MethodData.Define): If we are an explicit interface
10753 implementation, set the method name to the full name of the
10754 interface plus the name of the method.
10756 Notice that using the method.MethodName.GetFullName() does not
10757 work, as it will only contain the name as declared on the source
10758 file (it can be a shorthand in the presence of using statements)
10759 and not the fully qualifed type name, for example:
10763 class D : ICloneable {
10764 object ICloneable.Clone () {
10768 Would produce a method called `ICloneable.Clone' instead of
10769 `System.ICloneable.Clone'.
10771 * namespace.cs (Alias.Resolve): Use GetPartialName.
10773 2004-11-01 Marek Safar <marek.safar@seznam.cz>
10775 * cs-parser.jay: Add error 1055 report.
10777 2004-11-01 Miguel de Icaza <miguel@ximian.com>
10779 * assign.cs (Assign.DoResolve): Only do the transform of
10780 assignment into a New if the types are compatible, if not, fall
10781 through and let the implicit code deal with the errors and with
10782 the necessary conversions.
10784 2004-11-01 Marek Safar <marek.safar@seznam.cz>
10786 * cs-parser.jay: Add error 1031 report.
10788 * cs-tokenizer.cs: Add location for error 1038.
10790 2004-10-31 Marek Safar <marek.safar@seznam.cz>
10792 * cs-parser.jay: Add error 1016 report.
10794 2004-10-31 Marek Safar <marek.safar@seznam.cz>
10796 * cs-parser.jay: Add errors 1575,1611 report.
10798 2004-10-31 Marek Safar <marek.safar@seznam.cz>
10800 * cs-parser.jay: Add error 1001 report.
10802 2004-10-31 Marek Safar <marek.safar@seznam.cz>
10805 * attribute.cs (GetMarshal): Add method argument for
10806 caller identification.
10808 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
10809 agument for GetMarshal and RuntimeMissingSupport.
10811 2004-10-31 Marek Safar <marek.safar@seznam.cz>
10813 * attribute.cs (ExtractSecurityPermissionSet): Removed
10814 TypeManager.code_access_permission_type.
10816 * typemanager.cs: Removed TypeManager.code_access_permission_type.
10818 2004-10-27 Miguel de Icaza <miguel@ximian.com>
10820 * expression.cs (LocalVariableReference.DoResolveLValue): Check
10821 for obsolete use of a variable here. Fixes regression on errors
10822 cs0619-25 and cs0619-26.
10824 2004-10-27 Marek Safar <marek.safar@seznam.cz>
10826 Fix #62358, implemented security attribute encoding.
10828 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
10829 Tests permitted SecurityAction for assembly or other types.
10830 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
10831 data from SecurityPermissionAttribute to PermisionSet class.
10833 * class.cs (ApplyAttributeBuilder): Added special handling
10834 for System.Security.Permissions.SecurityAttribute based types.
10836 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
10837 special handling for System.Security.Permissions.SecurityAttribute
10840 * enum.cs (ApplyAttributeBuilder): Added special handling
10841 for System.Security.Permissions.SecurityAttribute based types.
10843 * parameter.cs (ApplyAttributeBuilder): Added special handling
10844 for System.Security.Permissions.SecurityAttribute based types.
10846 * rootcontext.cs: Next 2 core types.
10848 * typemanager.cs (TypeManager.security_permission_attr_type):
10849 Built in type for the SecurityPermission Attribute.
10850 (code_access_permission_type): Build in type.
10852 2004-10-17 Miguel de Icaza <miguel@ximian.com>
10854 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
10855 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
10856 all of this information into
10857 EmitContext.EmitCapturedVariableInstance.
10859 * codegen.cs (EmitCapturedVariableInstance): move here the
10860 funcionality of emitting an ldarg.0 in the presence of a
10861 remapping. This centralizes the instance emit code.
10863 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
10864 then emit a load of this: it means that we have reached the
10865 topmost ScopeInfo: the one that contains the pointer to the
10866 instance of the class hosting the anonymous method.
10868 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
10869 captures to the topmost CaptureContext.
10871 2004-10-12 Miguel de Icaza <miguel@ximian.com>
10873 * expression.cs (LocalVariableReference): Move the knowledge about
10874 the iterators into codegen's EmitCapturedVariableInstance.
10876 2004-10-11 Miguel de Icaza <miguel@ximian.com>
10878 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
10879 all code paths return a value from an anonymous method (it is the
10880 same as the 161 error, but for anonymous methods).
10882 2004-10-08 Miguel de Icaza <miguel@ximian.com>
10884 The introduction of anonymous methods in the compiler changed
10885 various ways of doing things in the compiler. The most
10886 significant one is the hard split between the resolution phase
10887 and the emission phases of the compiler.
10889 For instance, routines that referenced local variables no
10890 longer can safely create temporary variables during the
10891 resolution phase: they must do so from the emission phase,
10892 since the variable might have been "captured", hence access to
10893 it can not be done with the local-variable operations from the runtime.
10897 (Block.Flags): New flag `IsTopLevel' to indicate that this block
10898 is a toplevel block.
10900 (ToplevelBlock): A new kind of Block, these are the blocks that
10901 are created by the parser for all toplevel method bodies. These
10902 include methods, accessors and anonymous methods.
10904 These contain some extra information not found in regular blocks:
10905 A pointer to an optional CaptureContext (for tracking captured
10906 local variables and parameters). A pointer to the parent
10909 (Return.Resolve): Catch missmatches when returning a value from an
10910 anonymous method (error 1662).
10911 Invoke NeedReturnLabel from the Resolve phase instead of the emit
10914 (Break.Resolve): ditto.
10916 (SwitchLabel): instead of defining the labels during the
10917 resolution phase, we now turned the public ILLabel and ILLabelCode
10918 labels into methods called GetILLabelCode() and GetILLabel() that
10919 only define the label during the Emit phase.
10921 (GotoCase): Track the SwitchLabel instead of the computed label
10922 (its contained therein). Emit the code by using
10923 SwitchLabel.GetILLabelCode ().
10925 (LocalInfo.Flags.Captured): A new flag has been introduce to track
10926 whether the Local has been captured or not.
10928 (LocalInfo.IsCaptured): New property, used to tell whether the
10929 local has been captured.
10931 * anonymous.cs: Vastly updated to contain the anonymous method
10934 The main classes here are: CaptureContext which tracks any
10935 captured information for a toplevel block and ScopeInfo used to
10936 track the activation frames for various local variables.
10938 Each toplevel block has an optional capture context associated
10939 with it. When a method contains an anonymous method both the
10940 toplevel method and the anonymous method will create a capture
10941 context. When variables or parameters are captured, they are
10942 recorded on the CaptureContext that owns them, for example:
10946 MyDelegate d = delegate {
10951 Here `a' will be recorded as captured on the toplevel
10952 CapturedContext, the inner captured context will not have anything
10953 (it will only have data if local variables or parameters from it
10954 are captured in a nested anonymous method.
10956 The ScopeInfo is used to track the activation frames for local
10957 variables, for example:
10959 for (int i = 0; i < 10; i++)
10960 for (int j = 0; j < 10; j++){
10961 MyDelegate d = delegate {
10966 At runtime this captures a single captured variable `i', but it
10967 captures 10 different versions of the variable `j'. The variable
10968 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
10969 recorded on a child.
10971 The toplevel ScopeInfo will also track information like the `this'
10972 pointer if instance variables were referenced (this is necessary
10973 as the anonymous method lives inside a nested class in the host
10974 type of the method).
10976 (AnonymousMethod): Expanded to track the Toplevel, implement
10977 `AnonymousMethod.Compatible' to tell whether an anonymous method
10978 can be converted to a target delegate type.
10980 The routine now also produces the anonymous method content
10982 (AnonymousDelegate): A helper class that derives from
10983 DelegateCreation, this is used to generate the code necessary to
10984 produce the delegate for the anonymous method that was created.
10986 * assign.cs: API adjustments for new changes in
10987 Convert.ImplicitStandardConversionExists.
10989 * class.cs: Adjustments to cope with the fact that now toplevel
10990 blocks are of type `ToplevelBlock'.
10992 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
10993 insteda of standard blocks.
10995 Flag errors if params arguments are passed to anonymous methods.
10997 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
10998 `CurrentAnonymousMethod' which points to the current Anonymous
10999 Method. The variable points to the AnonymousMethod class that
11000 holds the code being compiled. It is set in the new EmitContext
11001 created for the anonymous method.
11003 (EmitContext.Phase): Introduce a variable and an enumeration to
11004 assist in enforcing some rules about when and where we are allowed
11005 to invoke certain methods (EmitContext.NeedsReturnLabel is the
11006 only one that enfonces this right now).
11008 (EmitContext.HaveCaptureInfo): new helper method that returns
11009 whether we have a CapturedContext initialized.
11011 (EmitContext.CaptureVariable): New method used to register that a
11012 LocalInfo must be flagged for capturing.
11014 (EmitContext.CapturedParameter): New method used to register that a
11015 parameters must be flagged for capturing.
11017 (EmitContext.CapturedField): New method used to register that a
11018 field must be flagged for capturing.
11020 (EmitContext.HaveCapturedVariables,
11021 EmitContext.HaveCapturedFields): Return whether there are captured
11022 variables or fields.
11024 (EmitContext.EmitMethodHostInstance): This is used to emit the
11025 instance for the anonymous method. The instance might be null
11026 (static methods), this (for anonymous methods that capture nothing
11027 and happen to live side-by-side with the current method body) or a
11028 more complicated expression if the method has a CaptureContext.
11030 (EmitContext.EmitTopBlock): Routine that drives the emission of
11031 code: it will first resolve the top block, then emit any metadata
11032 and then emit the code. The split is done so that we can extract
11033 any anonymous methods and flag any captured variables/parameters.
11035 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
11036 during this phase, the ILGenerator should not be used as labels
11037 and local variables declared here might not be accessible to any
11038 code that is part of an anonymous method.
11040 Exceptions to this include the temporary variables that are
11041 created by some statements internally for holding temporary
11044 (EmitContext.EmitMeta): New routine, in charge of emitting all the
11047 (EmitContext.TemporaryReturn): This method is typically called
11048 from the Emit phase, and its the only place where we allow the
11049 ReturnLabel to be defined other than the EmitMeta. The reason is
11050 that otherwise we would have to duplicate a lot of logic in the
11051 Resolve phases of various methods that today is on the Emit
11054 (EmitContext.NeedReturnLabel): This no longer creates the label,
11055 as the ILGenerator is not valid during the resolve phase.
11057 (EmitContext.EmitThis): Extended the knowledge in this class to
11058 work in anonymous methods in addition to iterators.
11060 (EmitContext.EmitCapturedVariableInstance): This emits whatever
11061 code is necessary on the stack to access the instance to a local
11062 variable (the variable will be accessed as a field).
11064 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
11065 EmitContext.EmitAddressOfParameter): Routines to support
11066 parameters (not completed at this point).
11068 Removals: Removed RemapLocal and RemapLocalLValue. We probably
11069 will also remove the parameters.
11071 * convert.cs (Convert): Define a `ConstantEC' which points to a
11072 null. This is just to prefity some code that uses
11073 ImplicitStandardConversion code and do not have an EmitContext
11076 The idea is to flag explicitly that at that point in time, it is
11077 known that the conversion will not trigger the delegate checking
11078 code in implicit conversions (which requires a valid
11081 Everywhere: pass new EmitContext parameter since
11082 ImplicitStandardConversionExists now requires it to check for
11083 anonymous method conversions.
11085 (Convert.ImplicitStandardConversionExists): If the type of an
11086 expression is the anonymous_method_type, and the type is a
11087 delegate, we invoke the AnonymousMethod.Compatible method to check
11088 whether an implicit conversion is possible.
11090 (Convert.ImplicitConversionStandard): Only do implicit method
11091 group conversions if the language level is not ISO_1.
11093 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
11094 MethodInfo for the Invoke method. used by Delegate and
11097 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
11098 method conversions if the target type is a delegate.
11100 Removed extra debugging nops.
11102 (LocalVariableReference): Turn the `local_info' into a public
11105 Add `prepared' field, the same hack used for FieldExprs to cope
11106 with composed assignments, as Local variables do not necessarily
11107 operate purely on the stack as they used to: they can be captured
11110 Add `temp' for a temporary result, like fields.
11112 Refactor DoResolve and DoResolveLValue into DoResolveBase.
11114 It now copes with Local variables that are captured and emits the
11115 proper instance variable to load it from a field in the captured
11118 (ParameterReference.DoResolveBase): During the resolve phase,
11119 capture parameters if we are in an anonymous method.
11121 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
11122 anonymous method, use the EmitContext helper routines to emit the
11123 parameter reference.
11125 * iterators.cs: Set RemapToProxy to true/false during the
11128 * parameters.cs (GetParameterByName): New helper method.
11130 * typemanager.cs (anonymous_method_type) a new type that
11131 represents an anonyous method. This is always an internal type,
11132 used as a fencepost to test against the anonymous-methodness of an
11135 2004-10-20 Marek Safar <marek.safar@seznam.cz>
11137 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
11139 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
11141 2004-10-18 Martin Baulig <martin@ximian.com>
11143 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
11144 `Type' directly, but call ResolveType() on it.
11145 (Catch.Resolve): Likewise.
11146 (Foreach.Resolve): Likewise.
11148 2004-10-18 Martin Baulig <martin@ximian.com>
11150 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
11151 `Type' directly, but call ResolveType() on it.
11152 (Probe.DoResolve): Likewise.
11153 (ArrayCreation.LookupType): Likewise.
11154 (TypeOf.DoResolve): Likewise.
11155 (SizeOf.DoResolve): Likewise.
11157 2004-10-18 Martin Baulig <martin@ximian.com>
11159 * expression.cs (Invocation.BetterFunction): Put back
11160 TypeManager.TypeToCoreType().
11162 2004-10-18 Raja R Harinath <rharinath@novell.com>
11164 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
11167 2004-10-18 Martin Baulig <martin@ximian.com>
11169 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
11170 `Type' directly, but call ResolveType() on it.
11172 2004-10-18 Martin Baulig <martin@ximian.com>
11174 * class.cs (FieldMember.Define): Don't access the TypeExpr's
11175 `Type' directly, but call ResolveType() on it.
11176 (MemberBase.DoDefine): Likewise.
11178 * expression.cs (New.DoResolve): Don't access the TypeExpr's
11179 `Type' directly, but call ResolveType() on it.
11180 (ComposedCast.DoResolveAsTypeStep): Likewise.
11182 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
11183 `Type' directly, but call ResolveType() on it.
11185 2004-10-17 John Luke <john.luke@gmail.com>
11187 * class.cs (Operator.GetSignatureForError): use CSharpName
11189 * parameter.cs (Parameter.GetSignatureForError): Returns
11190 correct name even if was not defined.
11192 2004-10-13 Raja R Harinath <rharinath@novell.com>
11195 * class.cs (TypeContainer.EmitContext): New property.
11196 (DefineNestedTypes): Create an emitcontext for each part.
11197 (MethodCore.DoDefineParameters): Use container's emitcontext.
11198 Pass type array to InternalParameters.
11199 (MemberBase.DoDefine): Use container's emitcontext.
11200 (FieldMember.Define): Likewise.
11201 (Event.Define): Likewise.
11202 (SetMethod.GetParameterInfo): Change argument to EmitContext.
11203 Pass type array to InternalParameters.
11204 (SetIndexerMethod.GetParameterInfo): Likewise.
11205 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
11206 * delegate.cs (Define): Pass emitcontext to
11207 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
11208 array to InternalParameters.
11209 * expression.cs (ParameterReference.DoResolveBase): Pass
11210 emitcontext to GetParameterInfo.
11211 (ComposedCast.DoResolveAsTypeStep): Remove check on
11212 ec.ResolvingTypeTree.
11213 * parameter.cs (Parameter.Resolve): Change argument to
11214 EmitContext. Use ResolveAsTypeTerminal.
11215 (Parameter.GetSignature): Change argument to EmitContext.
11216 (Parameters.ComputeSignature): Likewise.
11217 (Parameters.ComputeParameterTypes): Likewise.
11218 (Parameters.GetParameterInfo): Likewise.
11219 (Parameters.ComputeAndDefineParameterTypes): Likewise.
11220 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
11221 * support.cs (InternalParameters..ctor): Remove variant that takes
11223 * typemanager.cs (system_intptr_expr): New.
11224 (InitExpressionTypes): Initialize it.
11226 2004-10-12 Chris Toshok <toshok@ximian.com>
11228 * cs-parser.jay: fix location for try_statement and catch_clause.
11230 2004-10-11 Martin Baulig <martin@ximian.com>
11232 * report.cs: Don't make --fatal abort on warnings, we have
11233 -warnaserror for that.
11235 2004-10-07 Raja R Harinath <rharinath@novell.com>
11237 More DeclSpace.ResolveType avoidance.
11238 * decl.cs (MemberCore.InUnsafe): New property.
11239 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
11240 with newly created EmitContext.
11241 (FieldMember.Define): Likewise.
11242 * delegate.cs (Delegate.Define): Likewise.
11243 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
11244 only if normal name-lookup fails.
11245 (TypeExpr.DoResolve): Enable error-checking.
11246 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
11247 (SizeOf.DoResolve): Likewise.
11248 (ComposedCast.DoResolveAsTypeStep): Likewise.
11249 (StackAlloc.DoResolve): Likewise.
11250 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
11251 (Block.Unsafe): New property.
11252 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
11253 (Unsafe): Set 'unsafe' flag of contained block.
11254 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
11255 (Fixed.Resolve): Likewise.
11256 (Catch.Resolve): Likewise.
11257 (Using.ResolveLocalVariableDecls): Likewise.
11258 (Foreach.Resolve): Likewise.
11260 2004-10-05 John Luke <john.luke@gmail.com>
11262 * cs-parser.jay: add location to error CS0175
11264 2004-10-04 Miguel de Icaza <miguel@ximian.com>
11266 * ecore.cs (Expression.Constantity): Add support for turning null
11269 * const.cs (Const.Define): Allow constants to be reference types
11270 as long as the value is Null.
11272 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
11274 * namespace.cs (NamespaceEntry.Using): No matter which warning
11275 level is set, check if this namespace name has already been added.
11277 2004-10-03 Ben Maurer <bmaurer@ximian.com>
11279 * expression.cs: reftype [!=]= null should always use br[true,false].
11282 2004-10-03 Marek Safar <marek.safar@seznam.cz>
11285 * attribute.cs: Enum conversion moved to
11286 GetAttributeArgumentExpression to be applied to the all
11289 2004-10-01 Raja R Harinath <rharinath@novell.com>
11291 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
11292 * class.c (TypeContainer.DefineType): Flag error if
11293 base types aren't accessible due to access permissions.
11294 * decl.cs (DeclSpace.ResolveType): Move logic to
11295 Expression.ResolveAsTypeTerminal.
11296 (DeclSpace.ResolveTypeExpr): Thin layer over
11297 Expression.ResolveAsTypeTerminal.
11298 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
11299 Refactor code into NestedAccess. Use it.
11300 (DeclSpace.NestedAccess): New.
11301 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
11302 argument to silence errors. Check access permissions.
11303 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
11304 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
11305 (Cast.DoResolve): Likewise.
11306 (New.DoResolve): Likewise.
11307 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
11308 (TypeOf.DoResolve): Likewise.
11310 * expression.cs (Invocation.BetterConversion): Return the Type of
11311 the better conversion. Implement section 14.4.2.3 more faithfully.
11312 (Invocation.BetterFunction): Make boolean. Make correspondence to
11313 section 14.4.2.2 explicit.
11314 (Invocation.OverloadResolve): Update.
11315 (Invocation): Remove is_base field.
11316 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
11317 (Invocation.Emit): Likewise.
11319 2004-09-27 Raja R Harinath <rharinath@novell.com>
11321 * README: Update to changes.
11323 2004-09-24 Marek Safar <marek.safar@seznam.cz>
11325 * cs-parser.jay: Reverted 642 warning fix.
11327 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11330 * decl.cs (FindMemberWithSameName): Indexer can have more than
11333 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11335 * expression.cs (LocalVariableReference.DoResolveLValue):
11336 Do not report warning 219 for out values.
11337 (EmptyExpression.Null): New member to avoid extra allocations.
11339 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11341 * cs-parser.jay: Fix wrong warning 642 report.
11343 * cs-tokenizer.cs (CheckNextToken): New helper;
11344 Inspect next character if is same as expected.
11346 2004-09-23 Martin Baulig <martin@ximian.com>
11348 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
11349 (Convert.ImplicitReferenceConversionExists): Likewise.
11351 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11353 * class.cs (Operator.Define): Add error 448 and 559 report.
11355 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11357 * class.cs (MemberBase.IsTypePermitted): New protected
11358 method for checking error CS0610.
11360 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11362 * class.cs (TypeContainer.HasExplicitLayout): New property
11363 Returns whether container has StructLayout attribute set Explicit.
11364 (FieldMember): New abstract class for consts and fields.
11365 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
11366 (Field): Reuse FieldMember.
11368 * const.cs (Const): Reuse FieldMember.
11370 * rootcontext.cs: EmitConstants call moved to class.
11372 2004-09-22 Martin Baulig <martin@ximian.com>
11374 Thanks to Peter Sestoft for this bug report.
11376 * expression.cs (Conditional): If both the `trueExpr' and the
11377 `falseExpr' is a NullLiteral, return a NullLiteral.
11379 2004-09-22 Martin Baulig <martin@ximian.com>
11381 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
11382 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
11383 for the "get_Current" call.
11385 2004-09-22 Martin Baulig <martin@ximian.com>
11387 Marek and me just fixed one of our oldest bugs: #28562 :-)
11389 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
11391 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
11392 we're an EnumConstant, just return that.
11393 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
11394 an EnumConstant. In this case, we need to use GetValueAsEnumType()
11395 to get the value which'll actually be written into the attribute.
11396 However, we have to use GetValue() to access the attribute's value
11399 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11401 * constant.cs (Constant.IsNegative): New abstract property
11404 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
11405 (StackAlloc.DoResolve): Reused IsNegative.
11407 2004-09-21 Martin Baulig <martin@ximian.com>
11409 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
11410 if we're used in an iterator, we may be called from different
11413 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
11414 we actually have an exception block.
11416 2004-09-20 John Luke <jluke@cfl.rr.com>
11418 * class.cs, cs-parser.jay: Improve the error report for 1520:
11419 report the actual line where the error happens, not where the
11420 class was declared.
11422 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
11423 Pass location information that was available elsewhere.
11425 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
11427 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
11428 runtime to delay sign assemblies.
11430 2004-09-19 Miguel de Icaza <miguel@ximian.com>
11432 * cs-parser.jay: Do not report the stack trace, this is barely
11435 2004-08-22 John Luke <john.luke@gmail.com>
11437 * driver.cs : check that a resource id is not already used
11438 before adding it, report CS1508 if it is, bug #63637
11440 2004-09-19 Miguel de Icaza <miguel@ximian.com>
11442 * ecore.cs: Removed dead code.
11444 2004-09-18 Marek Safar <marek.safar@seznam.cz>
11446 * class.cs: Do not report warning CS0067 on the interfaces.
11448 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11450 * cs-parser.jay: Add error 504 report.
11452 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11454 * rootcontext.cs: WarningLevel is 4 by default now.
11456 * statement.cs (Fixed.Resolve): Do not null
11459 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11462 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
11463 deep search when property is not virtual.
11464 (PropertyExpr.ResolveAccessors): Make one call for both
11467 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11470 * statement.cs: Error 152 report constains also location.
11472 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11475 * const.cs: Explicitly set constant as static.
11477 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11480 * cs-parser.jay: Add error 1017 report.
11482 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11484 Fixed bug #59980, #64224
11485 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
11487 * typemanager.cs (IsSpecialMethod): Simplified
11489 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11491 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
11492 condition with better params.
11494 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11497 * attribute.cs (Resolve): Property has to have both
11500 2004-09-14 Martin Baulig <martin@ximian.com>
11502 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
11504 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11507 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
11508 called and is obsolete then this member suppress message
11509 when call is inside next [Obsolete] method or type.
11511 * expression.cs: Use TestObsoleteMethodUsage member.
11513 2004-09-14 Martin Baulig <martin@ximian.com>
11515 * cs-parser.jay: Sync a bit with the GMCS version.
11517 2004-09-14 Martin Baulig <martin@ximian.com>
11519 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
11520 (CSharpParser.yacc_verbose_flag): New public field.
11522 * genericparser.cs: Removed.
11524 2004-09-14 Raja R Harinath <rharinath@novell.com>
11526 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
11528 2004-09-13 Marek Safar <marek.safar@seznam.cz>
11530 * class.cs (MethodCore.CheckBase): Fix bug #65757.
11532 2004-09-10 Martin Baulig <martin@ximian.com>
11534 Backported my MemberName changes from GMCS into MCS.
11536 - we are now using a special `MemberName' class instead of using
11537 strings; in GMCS, the `MemberName' also contains the type
11540 - changed the grammar rules a bit:
11541 * the old `member_name' is now a `namespace_or_type_name':
11542 The rule is that we use `namespace_or_type_name' everywhere
11543 where we expect either a "member name" (GetEnumerator) or a
11544 "member name" with an explicit interface name
11545 (IEnumerable.GetEnumerator).
11546 In GMCS, the explicit interface name may include type arguments
11547 (IEnumerable<T>.GetEnumerator).
11548 * we use `member_name' instead of just `IDENTIFIER' for
11550 The rule is that we use `member_name' wherever a member may
11551 have type parameters in GMCS.
11553 * decl.cs (MemberName): New public class.
11554 (MemberCore.MemberName): New public readonly field.
11555 (MemberCore.ctor): Take a `MemberName' argument, not a string.
11556 (DeclSpace): Likewise.
11558 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
11559 * enum.cs (Enum.ctor): Likewise.
11561 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
11563 (AliasEntry.ctor): Take a MemberName, not an Expression.
11564 (AliasEntry.UsingAlias): Likewise.
11566 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
11567 (IMethodData.MemberName): Changed type from string to MemberName.
11568 (MemberBase.ExplicitInterfaceName): Likewise.
11569 (AbstractPropertyEventMethod.SetupName): Make this private.
11570 (AbstractPropertyEventMethod.ctor): Added `string prefix'
11571 argument; compute the member name here.
11572 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
11573 on the `member.MemberName' and the `prefix'.
11575 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
11577 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
11578 thus, we get a `MemberName' instead of a `string'. These
11579 declarations may have type parameters in GMCS.
11580 (interface_method_declaration, delegate_declaration): Likewise.
11581 (class_declaration, interface_declaration): Likewise.
11582 (method_header): Use `namespace_or_type_name' instead of
11583 `member_name'. We may be an explicit interface implementation.
11584 (property_declaration, event_declaration): Likewise.
11585 (member_name): This is now just an `IDENTIFIER', not a
11586 `namespace_or_type_name'.
11587 (type_name, interface_type): Removed.
11588 (namespace_or_type_name): Return a MemberName, not an Expression.
11589 (primary_expression): Use `member_name' instead of `IDENTIFIER';
11590 call GetTypeExpression() on the MemberName to get an expression.
11591 (IndexerDeclaration.interface_type): Changed type from string to
11593 (MakeName): Operate on MemberName's instead of string's.
11595 2004-09-13 Raja R Harinath <rharinath@novell.com>
11598 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
11599 (NamespaceEntry.Lookup): Add new argument to flag if we want the
11600 lookup to avoid symbols introduced by 'using'.
11601 * rootcontext.cs (NamespaceLookup): Update.
11603 2004-09-12 Marek Safar <marek.safar@seznam.cz>
11605 * class.cs (TypeContainer.DoDefineMembers): Do not call
11606 DefineDefaultConstructor for static classes.
11608 2004-09-12 Marek Safar <marek.safar@seznam.cz>
11610 * attribute.cs (Attribute.Resolve): Add error 653 report.
11612 * class.cs (Class.ApplyAttributeBuilder): Add error 641
11614 (Method.ApplyAttributeBuilder): Add error 685 report.
11615 (Operator.Define): Add error 564 report.
11617 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
11619 * expression.cs (Invocation.DoResolve): Add error
11620 245 and 250 report.
11622 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
11625 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11627 * class.cs (ConstructorInitializer.Resolve):
11628 Wrong error number (515->516).
11630 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11632 * class.cs (Indexer.Define): Add error 631 report.
11634 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11636 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
11638 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11640 * expression.cs (Probe.DoResolve): Add error CS0241 report.
11642 2004-09-10 Marek Safar <marek.safar@seznam.cz>
11644 * cs-parser.jay: Added error CS0241 report.
11646 2004-09-10 Raja R Harinath <rharinath@novell.com>
11648 * cs-parser.jay (fixed_statement): Introduce a scope for the
11649 declaration in the 'fixed' statement.
11651 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11653 * cs-parser.jay: Added CS0230 error report.
11655 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11657 * cs-parser.jay: Added errors CS0231 and CS0257 report.
11659 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11661 * expression.cs (Argument.Resolve): Added error CS0192 and
11664 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11666 C# 2.0 #pragma warning feature
11668 * cs-tokenizer.cs (PreProcessPragma): New method;
11669 Handles #pragma directive.
11671 * report.cs (WarningRegions): New class; Support
11672 class for #pragma warning directive. It tests whether
11673 warning is enabled for a given line.
11675 2004-09-08 Miguel de Icaza <miguel@ximian.com>
11677 * const.cs: Add more descriptive error report, tahnks to
11680 2004-09-08 Marek Safar <marek.safar@seznam.cz>
11682 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
11684 2004-09-07 Miguel de Icaza <miguel@ximian.com>
11686 * expression.cs: Apply patch from Ben: Remove dead code from
11687 ArrayCreation, and remove the TurnintoConstant call in const.cs,
11688 as that code just threw an exception anwyays.
11690 * const.cs: Remove the call to the turnintoconstant, for details
11693 * literal.cs: The type of the null-literal is the null type; So
11694 we use a placeholder type (literal.cs:System.Null, defined here)
11697 * expression.cs (Conditional.DoResolve): Remove some old code that
11698 is no longer needed, conversions have been fixed.
11700 (ArrayCreationExpression.DoResolve): Return false if we fail to
11701 resolve the inner expression.
11703 2004-09-07 Raja R Harinath <rharinath@novell.com>
11706 * cs-parser.jay (delegate_declaration): Record a delegate
11707 declaration as a type declaration.
11708 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
11710 2004-09-06 Miguel de Icaza <miguel@ximian.com>
11712 * parameter.cs: Do not crash if the type can not be resolved.
11714 * expression.cs: Report errors with unsafe pointers, fixes #64896
11716 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
11718 * expression.cs: Pointer arith always needs to do a conv.i
11719 if the operand is a long. fix 65320
11721 2004-09-04 Marek Safar <marek.safar@seznam.cz>
11723 Fixed cs0619-37.cs, cs0619-38.cs
11725 * enum.cs (GetObsoleteAttribute): Removed.
11727 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
11728 on Enum member is double staged. The first is tested member
11731 2004-09-04 Marek Safar <marek.safar@seznam.cz>
11733 Fixed #56986, #63631, #65231
11735 * class.cs: (TypeContainer.AddToMemberContainer): New method,
11736 adds member to name container.
11737 (TypeContainer.AddToTypeContainer): New method, adds type to
11739 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
11740 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
11741 AddOperator): Simplified by reusing AddToMemberContainer.
11742 (TypeContainer.UserDefinedStaticConstructor): Changed to property
11744 (Method.CheckForDuplications): Fixed implementation to test all
11746 (MemberBase): Detection whether member is explicit interface
11747 implementation is now in constructor.
11748 (MemberBase.UpdateMemberName): Handles IndexerName.
11749 (Accessor): Changed to keep also location information.
11750 (AbstractPropertyEventMethod): Is derived from MemberCore.
11751 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
11752 will be emited or not.
11753 (PropertyBase.AreAccessorsDuplicateImplementation):
11754 Tests whether accessors are not in collision with some method.
11755 (Operator): Is derived from MethodCore to simplify common
11758 * decl.cs (Flags.TestMethodDuplication): Test for duplication
11760 (DeclSpace.AddToContainer): Adds the member to defined_names
11761 table. It tests for duplications and enclosing name conflicts.
11763 * enum.cs (EnumMember): Clean up to reuse the base structures
11765 2004-09-03 Martin Baulig <martin@ximian.com>
11767 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
11768 into TypeContainer, to make partial classes work again.
11770 2004-09-03 Martin Baulig <martin@ximian.com>
11772 * rootcontext.cs (RootContext.V2): Removed.
11774 2004-03-23 Martin Baulig <martin@ximian.com>
11776 * expression.cs (Invocation.OverloadResolve): Added `bool
11777 may_fail' argument and use it instead of the Location.IsNull() hack.
11779 2004-09-03 Martin Baulig <martin@ximian.com>
11781 Merged latest changes into gmcs. Please keep this comment in
11782 here, it makes it easier for me to see what changed in MCS since
11783 the last time I merged.
11785 2004-09-03 Raja R Harinath <rharinath@novell.com>
11788 * expression.cs (BetterConversion): Don't allow either conversion
11789 to be null. Remove redundant implicit conversion test when 'q ==
11790 null' -- when this function is invoked, we already know that the
11791 implicit conversion exists.
11792 (BetterFunction): Assume that 'best' is non-null. Remove
11793 redundant reimplementation of IsApplicable when 'best' is null.
11794 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
11795 number of arguments.
11796 (IsAncestralType): Extract from OverloadResolve.
11797 (OverloadResolve): Make robust to the MethodGroupExpr being
11798 unsorted. Implement all the logic of Section 14.5.5.1, and
11799 support overloading of methods from multiple applicable types.
11800 Clean up logic somewhat. Don't pass null methods to BetterFunction.
11802 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
11803 (RealError, Warning): Append type of report to related symbol.
11805 2004-09-03 Marek Safar <marek.safar@seznam.cz>
11807 * enum.cs: Fixed CLS-Compliance checks for enum members.
11808 Error tests cs3008-8.cs, cs3014-8.cs
11810 2004-09-02 Marek Safar <marek.safar@seznam.cz>
11812 Fixed bug #62342, #63102
11813 * class.cs: ImplementIndexer uses member.IsExplicitImpl
11814 like ImplementMethod.
11816 2004-09-02 Marek Safar <marek.safar@seznam.cz>
11818 * attribute.cs (Attribute.GetAttributeArgumentExpression):
11821 2004-09-02 Martin Baulig <martin@ximian.com>
11823 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
11824 TypeManager.GetArgumentTypes() rather than calling GetParameters()
11827 2004-09-01 Marek Safar <marek.safar@seznam.cz>
11829 C# 2.0 Static classes implemented
11831 * class.cs (TypeContainer): instance_constructors,
11832 initialized_fields, initialized_static_fields,
11833 default_constructor, base_inteface_types are protected to be
11834 accessible from StaticClass.
11835 (TypeContainer.DefineDefaultConstructor): New virtual method
11836 for custom default constructor generating
11837 (StaticClass): New class to handle "Static classes" feature.
11839 * cs-parser.jay: Handle static keyword on class like instance
11842 * driver.cs: Added "/langversion" command line switch with two
11843 options (iso-1, default).
11845 2004-08-31 Marek Safar <marek.safar@seznam.cz>
11847 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
11849 2004-08-31 Miguel de Icaza <miguel@ximian.com>
11851 * delegate.cs: Style.
11853 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
11855 * delegate.cs: Add seperate instance expr field for miguel.
11857 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
11859 * PointerArithmetic (Resolve): make sure we are not doing
11860 pointer arith on void*. Also, make sure we are resolved
11861 by not setting eclass until resolve.
11863 All callers: Make sure that PointerArithmetic gets resolved.
11865 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
11867 * ArrayCreation (LookupType): If the type does not resolve
11868 to an array, give an error.
11870 2004-08-27 Marek Safar <marek.safar@seznam.cz>
11872 * statement.cs (Try.Resolve): Fixed bug #64222
11874 2004-08-27 Martin Baulig <martin@ximian.com>
11877 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
11880 2004-08-26 Marek Safar <marek.safar@seznam.cz>
11882 * ecore.cs (Constantify): Get underlying type via
11883 System.Enum.GetUnderlyingType to avoid StackOverflow on the
11884 Windows in special cases.
11886 2004-08-26 Marek Safar <marek.safar@seznam.cz>
11888 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
11889 for obtaining also private methods.
11890 (GetRemoveMethod): Used GetRemoveMethod (true)
11891 for obtaining also private methods.
11893 2004-08-24 Martin Baulig <martin@ximian.com>
11895 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
11896 MethodAttributes.HideBySig for operators.
11898 2004-08-23 Martin Baulig <martin@ximian.com>
11900 Back to the old error reporting system :-)
11902 * report.cs (Message): Removed.
11903 (Report.MessageData, ErrorData, WarningData): Removed.
11904 (Report.Error, Warning): Back to the old system.
11906 2004-08-23 Martin Baulig <martin@ximian.com>
11908 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
11910 * class.cs (TypeContainer.ParentContainer): New public virtual
11911 method; replaces the explicit interface implementation.
11912 (ClassPart.ParentContainer): Override.
11914 2004-08-23 Martin Baulig <martin@ximian.com>
11916 * statement.cs (Switch): Added support for constant switches; see
11917 #59428 or test-285.cs.
11919 2004-08-22 Marek Safar <marek.safar@seznam.cz>
11922 * statement.cs (GetEnumeratorFilter): Removed useless
11923 logic because C# specs is strict. GetEnumerator must be
11926 2004-08-22 Martin Baulig <martin@ximian.com>
11928 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11929 a switch and may break, reset the barrier. Fixes #59867.
11931 2004-08-22 Marek Safar <marek.safar@seznam.cz>
11933 CLS-Compliance speed up (~5% for corlib)
11935 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
11936 New method. Tests container for CLS-Compliant names
11938 * class.cs (TypeContainer.VerifyClsName): New method.
11939 Checks whether container name is CLS Compliant.
11940 (Constructor): Implements IMethodData.
11942 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
11943 low-case table for CLS Compliance test.
11944 (MemberCache.VerifyClsParameterConflict): New method.
11945 Checks method parameters for CS3006 error.
11947 * enum.cs (EnumMember): Is derived from MemberCore.
11948 (Enum.VerifyClsName): Optimized for better performance.
11950 2004-08-06 Marek Safar <marek.safar@seznam.cz>
11952 * report.cs: Renamed Error_T to Error and changed all
11955 2004-08-06 Marek Safar <marek.safar@seznam.cz>
11957 * class.cs (TypeContainer.IndexerArrayList): New inner class
11958 container for indexers.
11959 (TypeContainer.DefaultIndexerName): New constant for default
11960 indexer name. Replaced all "Item" with this constant.
11961 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
11963 * typemanager.cs (TypeManager.default_member_ctor): Cache here
11964 DefaultMemberAttribute constructor.
11966 2004-08-05 Martin Baulig <martin@ximian.com>
11968 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
11971 2004-08-05 Marek Safar <marek.safar@seznam.cz>
11973 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
11974 multi platforms problem.
11976 * compiler.csproj: Included shared files.
11978 2004-08-04 Marek Safar <marek.safar@seznam.cz>
11980 Fix bug 60333, 55971 in the more general way
11981 * attribute.cs (Attribute.GetAttributeArgumentExpression):
11982 Added arg_type argument for constant conversion.
11983 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
11985 2004-08-04 Marek Safar <marek.safar@seznam.cz>
11988 * class.cs (TypeContainer ): New inner classes MethodArrayList,
11989 OperatorArrayList, MethodCoreArrayList for typecontainer
11990 containers. Changed class member types to these new types.
11991 (MethodArrayList.DefineMembers): Added test for CS0659.
11993 2004-08-04 Miguel de Icaza <miguel@ximian.com>
11995 * cfold.cs: Synchronize the folding with the code in expression.cs
11996 Binary.DoNumericPromotions for uint operands.
11998 * attribute.cs: Revert patch from Raja, it introduced a regression
11999 while building Blam-1.2.1 (hard to isolate a test case).
12001 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12005 (TypeContainer.Define): Renamed to DefineContainerMembers because of
12007 (MethodCore.parent_method): New member. The method we're overriding
12008 if this is an override method.
12009 (MethodCore.CheckBase): Moved from Method class and made common.
12010 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
12012 (MethodCore.CheckForDuplications): New abstract method. For custom
12013 member duplication search in a container
12014 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
12015 method and its return type.
12016 (Event.conflict_symbol): New member. Symbol with same name in the
12020 (MemberCache.FindMemberWithSameName): New method. The method
12021 is looking for conflict with inherited symbols.
12023 2004-08-04 Martin Baulig <martin@ximian.com>
12025 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
12027 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
12029 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12031 * report.cs (Message): New enum for better error, warning reference in
12033 (MessageData): New inner abstract class. It generally handles printing of
12034 error and warning messages.
12035 Removed unused Error, Warning, Message methods.
12037 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12039 Fix for cs0592-8.cs test
12041 (Attributable.ValidAttributeTargets): Made public.
12042 (Attribute.ExplicitTarget): New member for explicit target value.
12043 (Attribute.CheckTargets): Now we translate explicit attribute
12044 target to Target here.
12046 2004-08-03 Ben Maurer <bmaurer@ximian.com>
12048 * ecore.cs (MethodGroupExpr): new IsBase property.
12050 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
12052 * delegate.cs (DelegateCreation): store a MethodGroupExpr
12053 rather than an instance expr.
12055 (DelegateCreation.Emit): Use the method group rather than
12056 the instance expression. Also, if you have base.Foo as the
12057 method for a delegate, make sure to emit ldftn, not ldftnvirt.
12059 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
12061 (NewDelegate.DoResolve): Only check for the existance of Invoke
12062 if the method is going to be needed. Use MethodGroupExpr.
12064 (NewDelegate.Emit): Remove, DelegateCreation implements this.
12066 * expression.cs: For pointer arith., make sure to use
12067 the size of the type, not the size of the pointer to
12070 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12073 * class.cs (Class): Added error CS0502 test.
12075 2004-08-03 John Luke <jluke@cfl.rr.com>
12076 Raja R Harinath <rharinath@novell.com>
12079 * attribute.cs (Attribute.complained_before): New flag.
12080 (Attribute.ResolveType, Attribute.Resolve),
12081 (Attribute.DefinePInvokeMethod): Set it.
12082 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
12084 2004-08-03 Martin Baulig <martin@ximian.com>
12086 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
12087 use a user-defined operator; we still need to do numeric
12088 promotions in case one argument is a builtin type and the other
12089 one has an implicit conversion to that type. Fixes #62322.
12091 2004-08-02 Martin Baulig <martin@ximian.com>
12093 * statement.cs (LocalInfo.Flags): Added `IsThis'.
12094 (LocalInfo.IsThis): New public property.
12095 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
12097 2004-08-01 Martin Baulig <martin@ximian.com>
12099 * class.cs (TypeContainer.GetClassBases): Don't set the default
12100 here since we may get called from GetPartialBases().
12101 (TypeContainer.DefineType): If GetClassBases() didn't return a
12102 parent, use the default one.
12104 2004-07-30 Duncan Mak <duncan@ximian.com>
12106 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
12108 2004-07-30 Martin Baulig <martin@ximian.com>
12110 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
12112 * class.cs (SourceMethod): New public class, derive from the
12113 symbol writer's ISourceMethod.
12114 (Method): Use the new symbol writer API.
12116 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
12117 as argument and use the new symbol writer.
12120 (SourceFile): Implement the symbol writer's ISourceFile.
12121 (Location.SymbolDocument): Removed.
12122 (Location.SourceFile): New public property.
12124 * symbolwriter.cs: Use the new symbol writer API.
12126 2004-07-30 Raja R Harinath <rharinath@novell.com>
12128 * Makefile (install-local): Remove. Functionality moved to
12131 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
12133 * Makefile: Install mcs.exe.config file together with mcs.exe.
12134 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
12135 correct runtime version.
12137 2004-07-25 Martin Baulig <martin@ximian.com>
12140 (TypeContainer.RegisterOrder): Removed, this was unused.
12141 (TypeContainer, interface_order): Removed.
12142 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
12143 TypeContainer as argument since we can also be called with a
12144 `PartialContainer' for a partial class/struct/interface.
12145 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
12146 of checking whether we're an `Interface' - we could be a
12147 `PartialContainer'.
12148 (PartialContainer.Register): Override; call
12149 AddClass()/AddStruct()/AddInterface() on our parent.
12151 * cs-parser.jay (interface_member_declaration): Add things to the
12152 `current_container', not the `current_class'.
12154 * rootcontext.cs (RegisterOrder): The overloaded version which
12155 takes an `Interface' was unused, removed.
12157 * typemanager.cs (TypeManager.LookupInterface): Return a
12158 `TypeContainer', not an `Interface'.
12159 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
12160 contain a `PartialContainer' for an interface, so check it's
12161 `Kind' to figure out what it is.
12163 2004-07-25 Martin Baulig <martin@ximian.com>
12165 * class.cs (Class.DefaultTypeAttributes): New public constant.
12166 (Struct.DefaultTypeAttributes): Likewise.
12167 (Interface.DefaultTypeAttributes): Likewise.
12168 (PartialContainer.TypeAttr): Override this and add the
12169 DefaultTypeAttributes.
12171 2004-07-25 Martin Baulig <martin@ximian.com>
12173 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
12174 we can just use the `Parent' field instead.
12176 2004-07-25 Martin Baulig <martin@ximian.com>
12178 * class.cs (TypeContainer.Emit): Renamed to EmitType().
12180 2004-07-25 Martin Baulig <martin@ximian.com>
12182 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
12183 our parts before defining any methods.
12184 (TypeContainer.VerifyImplements): Make this virtual.
12185 (ClassPart.VerifyImplements): Override and call VerifyImplements()
12186 on our PartialContainer.
12188 2004-07-25 Martin Baulig <martin@ximian.com>
12190 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
12192 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
12193 argument, we can just use the `Parent' field instead.
12196 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
12197 (MemberBase.DoDefine): Likewise.
12199 2004-07-24 Martin Baulig <martin@ximian.com>
12201 * decl.cs (MemberCore.Parent): New public field.
12202 (DeclSpace.Parent): Moved to MemberCore.
12204 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
12205 (MemberBase.ctor): Added TypeContainer argument, pass it to our
12207 (FieldBase, Field, Operator): Likewise.
12208 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
12209 (EventField, Event): Likewise.
12211 2004-07-23 Martin Baulig <martin@ximian.com>
12213 * class.cs (PartialContainer): New public class.
12214 (ClassPart): New public class.
12215 (TypeContainer): Added support for partial classes.
12216 (TypeContainer.GetClassBases): Splitted some of the functionality
12217 out into GetNormalBases() and GetPartialBases().
12219 * cs-tokenizer.cs (Token.PARTIAL): New token.
12220 (Tokenizer.consume_identifier): Added some hacks to recognize
12221 `partial', but only if it's immediately followed by `class',
12222 `struct' or `interface'.
12224 * cs-parser.jay: Added support for partial clases.
12226 2004-07-23 Martin Baulig <martin@ximian.com>
12228 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
12229 a `DeclSpace' and also made it readonly.
12230 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
12231 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
12232 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
12234 * cs-parser.jay: Pass the `current_class', not the
12235 `current_container' (at the moment, this is still the same thing)
12236 to a new Method, Property, Event, Indexer or Constructor.
12238 2004-07-23 Martin Baulig <martin@ximian.com>
12240 * cs-parser.jay (CSharpParser): Added a new `current_class' field
12241 and removed the `current_interface' one.
12242 (struct_declaration, class_declaration, interface_declaration):
12243 Set `current_class' to the newly created class/struct/interface;
12244 set their `Bases' and call Register() before parsing their body.
12246 2004-07-23 Martin Baulig <martin@ximian.com>
12248 * class.cs (Kind): New public enum.
12249 (TypeContainer): Made this class abstract.
12250 (TypeContainer.Kind): New public readonly field.
12251 (TypeContainer.CheckDef): New public method; moved here from
12253 (TypeContainer.Register): New public abstract method.
12254 (TypeContainer.GetPendingImplementations): New public abstract
12256 (TypeContainer.GetClassBases): Removed the `is_class' and
12257 `is_iface' parameters.
12258 (TypeContainer.DefineNestedTypes): Formerly known as
12260 (ClassOrStruct): Made this class abstract.
12262 * tree.cs (RootTypes): New public type.
12264 2004-07-20 Martin Baulig <martin@ximian.com>
12266 * tree.cs (Tree.RecordNamespace): Removed.
12267 (Tree.Namespaces): Removed.
12269 * rootcontext.cs (RootContext.IsNamespace): Removed.
12271 * cs-parser.jay (namespace_declaration): Just create a new
12272 NamespaceEntry here.
12274 2004-07-20 Martin Baulig <martin@ximian.com>
12276 * statement.cs (ExceptionStatement): New abstract class. This is
12277 now used as a base class for everyone who's using `finally'.
12278 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
12279 our local variables before using them.
12281 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
12282 virtual method. This is used by Yield.Resolve() to "steal" an
12283 outer block's `finally' clauses.
12284 (FlowBranchingException): The .ctor now takes an ExceptionStatement
12287 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
12288 version which takes an ExceptionStatement. This version must be
12289 used to create exception branchings.
12292 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
12293 (Iterator.EmitMoveNext): Added exception support; protect the
12294 block with a `fault' clause, properly handle 'finally' clauses.
12295 (Iterator.EmitDispose): Run all the `finally' clauses here.
12297 2004-07-20 Martin Baulig <martin@ximian.com>
12299 * iterator.cs: This is the first of a set of changes in the
12300 iterator code. Match the spec more closely: if we're an
12301 IEnumerable, then GetEnumerator() must be called. The first time
12302 GetEnumerator() is called, it returns the current instance; all
12303 subsequent invocations (if any) must create a copy.
12305 2004-07-19 Miguel de Icaza <miguel@ximian.com>
12307 * expression.cs: Resolve the constant expression before returning
12310 2004-07-19 Martin Baulig <martin@ximian.com>
12312 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
12313 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
12314 the return type of the new EmitContext.
12316 2004-07-18 Martin Baulig <martin@ximian.com>
12318 * class.cs (Property.Define): Fix iterators.
12320 * iterators.cs (Iterator.Define): Moved the
12321 `container.AddInterator (this)' call here from the .ctor; only do
12322 it if we resolved successfully.
12324 2004-07-17 Miguel de Icaza <miguel@ximian.com>
12326 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
12327 `true' for preprocessing directives that we parse. The return
12328 value indicates whether we should return to regular tokenizing or
12329 not, not whether it was parsed successfully.
12331 In the past if we were in: #if false ... #line #endif, we would
12332 resume parsing after `#line'. See bug 61604.
12334 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
12335 building: IsEnumType should return true only for enums, not for
12336 enums or System.Enum itself. This fixes #61593.
12338 Likely what happened is that corlib was wrong: mcs depended on
12339 this bug in some places. The bug got fixed, we had to add the
12340 hack, which caused bug 61593.
12342 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
12343 that was a workaround for the older conditions.
12345 2004-07-16 Ben Maurer <bmaurer@ximian.com>
12347 * assign.cs: IAssignMethod has a new interface, as documented
12348 inline. All assignment code now uses this new api.
12350 * ecore.cs, expression.cs: All classes which implement
12351 IAssignMethod now use the new interface.
12353 * expression.cs (Invocation): add a hack to EmitCall so that
12354 IndexerAccess can be the target of a compound assignment without
12355 evaluating its arguments twice.
12357 * statement.cs: Handle changes in Invocation api.
12359 2004-07-16 Martin Baulig <martin@ximian.com>
12361 * iterators.cs: Rewrote this. We're now using one single Proxy
12362 class for both the IEnumerable and the IEnumerator interface and
12363 `Iterator' derives from Class so we can use the high-level API.
12365 * class.cs (TypeContainer.AddIterator): New method.
12366 (TypeContainer.DoDefineType): New protected virtual method, which
12367 is called from DefineType().
12368 (TypeContainer.DoDefineMembers): Call DefineType() and
12369 DefineMembers() on all our iterators.
12370 (TypeContainer.Emit): Call Emit() on all our iterators.
12371 (TypeContainer.CloseType): Call CloseType() on all our iterators.
12373 * codegen.cs (EmitContext.CurrentIterator): New public field.
12375 2004-07-15 Martin Baulig <martin@ximian.com>
12378 (TypeManager.not_supported_exception_type): New type.
12380 2004-07-14 Martin Baulig <martin@ximian.com>
12382 * iterators.cs: Use real error numbers.
12384 2004-07-14 Martin Baulig <martin@ximian.com>
12386 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
12387 requires this to be a System.Collection.IEnumerable and not a
12388 class implementing that interface.
12389 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
12391 2004-07-13 Marek Safar <marek.safar@seznam.cz>
12393 * class.cs: Fixed previous fix, it broke some error tests.
12395 2004-07-12 Martin Baulig <martin@ximian.com>
12397 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
12400 2004-07-09 Miguel de Icaza <miguel@ximian.com>
12402 * assign.cs (LocalTemporary): Add new argument: is_address,If
12403 `is_address' is true, then the value that we store is the address
12404 to the real value, and not the value itself.
12406 * ecore.cs (PropertyExpr): use the new local temporary
12407 stuff to allow us to handle X.Y += z (where X is a struct)
12409 2004-07-08 Martin Baulig <martin@ximian.com>
12411 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
12412 not always return, just like we're doing in Using.Resolve().
12414 2004-07-07 Miguel de Icaza <miguel@ximian.com>
12416 * cs-parser.jay (fixed_statement): flag this as Pinned.
12418 2004-07-06 Miguel de Icaza <miguel@ximian.com>
12420 * typemanager.cs (TypeManager): Removed MakePinned method, this
12421 mechanism is replaced with the .NET 2.x compatible mechanism of
12422 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
12424 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
12425 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
12426 `IsFixed' property which has a different meaning.
12428 2004-07-02 Raja R Harinath <rharinath@novell.com>
12430 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
12431 visible from inside a nested class, not just the names of the
12432 immediately enclosing class.
12433 Fix for bug #60730.
12435 2004-06-24 Raja R Harinath <rharinath@novell.com>
12437 * expression.cs (BetterConversion): Remove buggy special-case
12438 handling of "implicit constant expression conversions". At this
12439 point, we already know that the conversion is possible -- we're
12440 only checking to see which is better.
12442 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12444 * cs-parser.jay: Added error CS0210 test.
12446 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12448 * cs-parser.jay: Added error CS0134 test.
12450 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12453 * cs-parser.jay: Added error CS0145 test.
12455 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12457 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
12459 2004-06-23 Ben Maurer <bmaurer@ximian.com>
12461 * expression.cs (StackAlloc.Resolve): The argument may not
12462 be a constant; deal with this case.
12464 2004-06-23 Marek Safar <marek.safar@seznam.cz>
12466 * attribute.cs (IndexerName_GetIndexerName): Renamed to
12467 GetIndexerAttributeValue.
12468 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
12470 * class.cs (Indexer.Define): Added error tests for CS0415,
12473 2004-06-23 Miguel de Icaza <miguel@ximian.com>
12475 * attribute.cs (Attribute.Resolve): Keep field code in sync with
12478 2004-06-23 Martin Baulig <martin@ximian.com>
12480 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
12481 neither return nor throw, reset the barrier as well. Fixes #60457.
12483 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
12485 * class.cs : EventAttributes is now set to None by default.
12486 This fixes bug #60459.
12488 2004-06-18 Marek Safar <marek.safar@seznam.cz>
12491 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12492 Don't throw exception but return null (it's sufficient now).
12494 2004-06-18 Marek Safar <marek.safar@seznam.cz>
12496 * typemanager.cs (GetArgumentTypes): Faster implementation.
12498 2004-06-18 Martin Baulig <martin@ximian.com>
12500 * attribute.cs (Attribute.Resolve): Check whether we're an
12501 EmptyCast which a Constant child. Fixes #60333.
12503 2004-06-17 Ben Maurer <bmaurer@ximian.com>
12505 * statement.cs (EmitCollectionForeach): Account for the fact that
12506 not all valuetypes are in areas which we can take the address of.
12507 For these variables, we store to a temporary variable. Also, make
12508 sure that we dont emit a `callvirt' on a valuetype method.
12510 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12512 * expression.cs (StackAlloc.DoReSolve): Added test for
12513 negative parameter (CS0247).
12515 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12518 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
12520 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12523 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
12526 2004-06-14 Marek Safar <marek.safar@seznam.cz>
12528 Fix bug #58254 & cs1555.cs, cs1556.cs
12529 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
12531 2004-06-14 Marek Safar <marek.safar@seznam.cz>
12533 * cs-parser.jay: Added error CS1669 test for indexers.
12535 2004-06-11 Martin Baulig <martin@ximian.com>
12537 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
12538 call this twice: for params and varargs methods.
12540 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12543 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
12545 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12547 * attribute.cs (Attribute.GetValidTargets): Made public.
12550 (AbstractPropertyEventMethod): New class for better code sharing.
12551 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
12553 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
12555 2004-06-11 Raja R Harinath <rharinath@novell.com>
12558 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
12559 that the call to Resolve is part of a MemberAccess.
12560 (Expression.Resolve): Use it for SimpleName resolution.
12561 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
12562 Add 'intermediate' boolean argument.
12563 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
12564 error message when the SimpleName can be resolved ambiguously
12565 between an expression and a type.
12566 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
12568 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
12569 call on the left-side.
12571 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12574 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
12576 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12578 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
12580 2004-06-11 Martin Baulig <martin@ximian.com>
12582 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
12583 varargs methods if applicable.
12585 2004-06-11 Martin Baulig <martin@ximian.com>
12587 * expression.cs (Invocation.EmitCall): Don't use
12588 `method.CallingConvention == CallingConventions.VarArgs' since the
12589 method could also have `CallingConventions.HasThis'.
12591 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12593 * class.cs (Event.GetSignatureForError): Implemented.
12594 Fixed crash in error test cs3010.cs
12596 2004-06-10 Miguel de Icaza <miguel@ximian.com>
12598 * cs-tokenizer.cs: Change the way we track __arglist to be
12599 consistent with the other keywords.
12601 2004-06-09 Miguel de Icaza <miguel@ximian.com>
12603 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
12606 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
12608 * codegen.cs: Check that all referenced assemblies have a strongname
12609 before strongnaming the compiled assembly. If not report error CS1577.
12610 Fix bug #56563. Patch by Jackson Harper.
12611 * typemanager.cs: Added a method to return all referenced assemblies.
12612 Fix bug #56563. Patch by Jackson Harper.
12614 2004-06-08 Marek Safar <marek.safar@seznam.cz>
12617 (Method.ApplyAttributeBuilder): Moved and added conditional
12618 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
12621 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
12623 2004-06-08 Marek Safar <marek.safar@seznam.cz>
12626 * class.cs: (EventField.attribute_targets): Changed default target.
12628 2004-06-08 Martin Baulig <martin@ximian.com>
12630 * expression.cs (Invocation.EmitCall): Enable varargs methods.
12632 2004-06-08 Martin Baulig <martin@ximian.com>
12634 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
12636 2004-06-07 Martin Baulig <martin@ximian.com>
12638 Added support for varargs methods.
12640 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
12643 * cs-parser.jay: Added support for `__arglist'.
12645 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
12647 * expression.cs (Argument.AType): Added `ArgList'.
12648 (Invocation): Added support for varargs methods.
12649 (ArglistAccess): New public class.
12650 (Arglist): New public class.
12652 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
12654 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
12655 a method's top-level block if the method has varargs.
12657 * support.cs (ReflectionParameters, InternalParameters): Added
12658 support for varargs methods.
12660 2004-06-07 Miguel de Icaza <miguel@ximian.com>
12662 * class.cs: Provide location in indexer error report.
12664 * driver.cs: Use standard names.
12666 * namespace.cs: Catch the use of using after a namespace has been
12667 declared also on using aliases.
12669 2004-06-03 Raja R Harinath <rharinath@novell.com>
12672 * typemanager.cs (closure_private_ok, closure_invocation_type)
12673 (closure_qualifier_type, closure_invocation_assembly)
12674 (FilterWithClosure): Move to ...
12675 (Closure): New internal nested class.
12676 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
12677 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
12678 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
12679 (MemberLookup, MemberLookupFailed): Use it.
12680 * expression.cs (New.DoResolve): Treat the lookup for the
12681 constructor as being qualified by the 'new'ed type.
12682 (Indexers.GetIndexersForTypeOrInterface): Update.
12684 2004-06-03 Marek Safar <marek.safar@seznam.cz>
12687 (GetConditionalAttributeValue): New method. Returns
12688 condition of ConditionalAttribute.
12689 (SearchMulti): New method. Returns all attributes of type 't'.
12690 Use it when attribute is AllowMultiple = true.
12691 (IsConditionalMethodExcluded): New method.
12694 (Method.IsExcluded): Implemented. Returns true if method has conditional
12695 attribute and the conditions is not defined (method is excluded).
12696 (IMethodData): Extended interface for ConditionalAttribute support.
12697 (PropertyMethod.IsExcluded): Implemented.
12700 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
12703 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
12706 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
12708 * expression.cs (ArrayCreationExpression): Make this just an
12709 `expression'. It can't be a statement, so the code here was
12712 2004-06-02 Marek Safar <marek.safar@seznam.cz>
12715 * typemanager.cs (GetFullNameSignature): New method for
12718 2004-06-02 Marek Safar <marek.safar@seznam.cz>
12721 * class.cs (MemberBase.GetSignatureForError): New virtual method.
12722 Use this method when MethodBuilder is null.
12723 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
12724 Added test for error CS0626 (MONO reports error for this situation).
12725 (IMethodData.GetSignatureForError): Extended interface.
12727 2004-06-01 Marek Safar <marek.safar@seznam.cz>
12730 (AttributeTester.GetObsoleteAttribute): Returns instance of
12731 ObsoleteAttribute when type is obsolete.
12734 (TypeContainer.VerifyObsoleteAttribute): Override.
12735 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
12736 (MethodCode.VerifyObsoleteAttribute): Override.
12737 (MemberBase.VerifyObsoleteAttribute): Override.
12740 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
12741 and report proper error.
12744 Delegate.VerifyObsoleteAttribute): Override.
12747 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
12748 and report proper error.
12749 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
12752 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
12756 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
12757 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
12758 Added test for ObsoleteAttribute.
12761 (Catch): Derived from Statement.
12763 2004-06-01 Marek Safar <marek.safar@seznam.cz>
12765 Fixed bug #59071 & cs0160.cs
12767 * statement.cs (Try.Resolve): Check here whether order of catch
12768 clauses matches their dependencies.
12770 2004-05-31 Miguel de Icaza <miguel@ximian.com>
12772 * Reverted patch to namespace.cs (Use lookuptypedirect). This
12773 caused a regression: #59343. Referencing nested classes from an
12774 assembly stopped working.
12776 2004-05-31 Martin Baulig <martin@ximian.com>
12778 MCS is now frozen for beta 2.
12780 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
12782 * convert.cs: add a trivial cache for overload operator resolution.
12784 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
12786 * decl.cs: If possible, use lookuptypedirect here. We can only do
12787 this if there is no `.' after the namespace. Avoids using
12788 LookupType, which does lots of slow processing.
12789 (FindNestedType) New method, does what it says :-).
12790 * namespace.cs: use LookupTypeDirect.
12791 * rootcontext.cs: use membercache, if possible.
12792 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
12794 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
12797 According to the spec,
12799 In a member access of the form E.I, if E is a single identifier,
12800 and if the meaning of E as a simple-name (§7.5.2) is a constant,
12801 field, property, localvariable, or parameter with the same type as
12802 the meaning of E as a type-name (§3.8), then both possible
12803 meanings of E are permitted.
12805 We did not check that E as a simple-name had the same type as E as
12808 This trivial check gives us 5-7% on bootstrap time.
12810 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
12812 * expression.cs (Invocation.OverloadResolve): Avoid the
12813 use of hashtables and boxing here by allocating on demand.
12815 2004-05-30 Martin Baulig <martin@ximian.com>
12817 * rootcontext.cs (RootContext.LookupType): Don't cache things if
12818 we're doing a silent lookup. Don't try to lookup nested types in
12819 TypeManager.object_type (thanks to Ben Maurer).
12821 2004-05-30 Martin Baulig <martin@ximian.com>
12823 Committing a patch from Ben Maurer.
12825 * rootcontext.cs (RootContext.LookupType): Cache negative results.
12827 2004-05-29 Martin Baulig <martin@ximian.com>
12829 * class.cs (IMethodData.ShouldIgnore): New method.
12831 * typemanager.cs (TypeManager.MethodFlags): Don't take a
12832 `Location' argument, we don't need it anywhere. Use
12833 `IMethodData.ShouldIgnore ()' instead of
12834 `MethodData.GetMethodFlags ()'.
12835 (TypeManager.AddMethod): Removed.
12836 (TypeManager.AddMethod2): Renamed to AddMethod.
12838 2004-05-29 Martin Baulig <martin@ximian.com>
12840 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
12842 * convert.cs (Convert.ImplicitReferenceConversion): If we're
12843 converting from a class type S to an interface type and we already
12844 have an object on the stack, don't box it again. Fixes #52578.
12846 2004-05-29 Martin Baulig <martin@ximian.com>
12848 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12849 Added support for `params' parameters. Fixes #59267.
12851 2004-05-29 Martin Baulig <martin@ximian.com>
12853 * literal.cs (NullPointer): Provide a private .ctor which sets
12854 `type' to TypeManager.object_type. Fixes #59048.
12856 2004-05-29 Martin Baulig <martin@ximian.com>
12858 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
12859 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
12861 * ecore.cs (EventExpr.instance_expr): Make the field private.
12863 2004-05-26 Marek Safar <marek.safar@seznam.cz>
12865 Fixed bug #50080 & cs0214-2.cs
12866 * expression.cs (Cast.DoResolve): Check unsafe context here.
12868 * statement.cs (Resolve.DoResolve): Likewise.
12870 2004-05-26 Martin Baulig <martin@ximian.com>
12872 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
12874 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
12875 (RootContext.LookupType): Pass down the `silent' flag.
12877 2004-05-25 Martin Baulig <martin@ximian.com>
12880 (MethodGroupExpr.IdenticalTypeName): New public property.
12881 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
12882 expression actually refers to a type.
12884 2004-05-25 Martin Baulig <martin@ximian.com>
12886 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
12887 for #56176 and made it actually work.
12889 2004-05-25 Martin Baulig <martin@ximian.com>
12891 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
12892 (FieldExpr, PropertyExpr): Override and implement
12893 CacheTemporaries. Fixes #52279.
12895 2004-05-25 Miguel de Icaza <miguel@ximian.com>
12897 * location.cs: In the new compiler listing a file twice is a
12898 warning, not an error.
12900 2004-05-24 Martin Baulig <martin@ximian.com>
12902 * enum.cs (Enum.DefineType): For the `BaseType' to be a
12903 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
12905 2004-05-24 Martin Baulig <martin@ximian.com>
12907 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
12908 walking the `using' list. Fixes #53921.
12910 2004-05-24 Martin Baulig <martin@ximian.com>
12912 * const.cs (Const.LookupConstantValue): Added support for
12913 EmptyCast's; fixes #55251.
12915 2004-05-24 Martin Baulig <martin@ximian.com>
12917 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
12918 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
12919 which does the CS0135 check. The reason is that we first need to
12920 check whether the variable actually exists.
12922 2004-05-24 Martin Baulig <martin@ximian.com>
12924 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
12925 than RootContext.LookupType() to find the explicit interface
12926 type. Fixes #58584.
12928 2004-05-24 Raja R Harinath <rharinath@novell.com>
12930 * Makefile: Simplify. Use executable.make.
12931 * mcs.exe.sources: New file. List of sources of mcs.exe.
12933 2004-05-24 Anders Carlsson <andersca@gnome.org>
12937 Use the invariant culture when doing String.Compare for CLS case
12940 2004-05-23 Martin Baulig <martin@ximian.com>
12942 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
12943 don't have any dots. Fixes #52622, added cs0246-8.cs.
12945 * namespace.cs (NamespaceEntry.Lookup): Likewise.
12947 2004-05-23 Marek Safar <marek.safar@seznam.cz>
12949 * class.cs (MemberBase.Define): Reuse MemberType member for
12950 resolved type. Other methods can use it too.
12952 2004-05-23 Martin Baulig <martin@ximian.com>
12954 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
12955 the variable also exists in the current block (otherwise, we need
12956 to report a CS0103). Fixes #58670.
12958 2004-05-23 Martin Baulig <martin@ximian.com>
12960 * flowanalysis.cs (Reachability.Reachable): Compute this
12961 on-the-fly rather than storing it as a field.
12963 2004-05-23 Martin Baulig <martin@ximian.com>
12965 * flowanalysis.cs (Reachability.And): Manually compute the
12966 resulting `barrier' from the reachability.
12968 2004-05-23 Marek Safar <marek.safar@seznam.cz>
12971 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
12972 instance of ObsoleteAttribute when symbol is obsolete.
12975 (IMethodData): Extended interface for ObsoleteAttribute support.
12977 2004-05-22 Marek Safar <marek.safar@seznam.cz>
12979 * attribute.cs: Fix bug #55970
12981 2004-05-22 Marek Safar <marek.safar@seznam.cz>
12985 (GetObsoleteAttribute): New method. Creates the instance of
12987 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
12988 ObsoleteAttribute when member is obsolete.
12989 (AttributeTester.Report_ObsoleteMessage): Common method for
12990 Obsolete error/warning reporting.
12993 (TypeContainer.base_classs_type): New member for storing parent type.
12996 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
12997 for this MemberCore.
12999 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13001 * attribute.cs, const.cs: Fix bug #58590
13003 2004-05-21 Martin Baulig <martin@ximian.com>
13005 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
13006 out parameters if the end of the method is unreachable. Fixes
13009 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13011 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
13012 Hari was right, why extra method.
13014 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13016 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
13018 2004-05-20 Martin Baulig <martin@ximian.com>
13020 Merged this back from gmcs to keep the differences to a minumum.
13022 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
13023 instead of a Declspace.
13024 (Attribute.ResolveType): Likewise.
13025 (Attributes.Search): Likewise.
13026 (Attributes.Contains): Likewise.
13027 (Attributes.GetClsCompliantAttribute): Likewise.
13029 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
13031 (MethodData.ApplyAttributes): Take an EmitContext instead of a
13034 2004-05-19 Marek Safar <marek.safar@seznam.cz>
13036 Fix bug #58688 (MCS does not report error when the same attribute
13039 * attribute.cs (Attribute.Emit): Distinction between null and default.
13041 2004-05-19 Raja R Harinath <rharinath@novell.com>
13043 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
13044 of a top-level attribute without an attribute target.
13045 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
13047 (Attribute.Conditional_GetConditionName),
13048 (Attribute.Obsolete_GetObsoleteMessage): Update.
13049 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
13050 part of ScanForIndexerName.
13051 (Attribute.CanIgnoreInvalidAttribute): New function.
13052 (Attribute.ScanForIndexerName): Move to ...
13053 (Attributes.ScanForIndexerName): ... here.
13054 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
13055 (Attributes.Search): New internal variant that can choose not to
13056 complain if types aren't resolved. The original signature now
13058 (Attributes.GetClsCompliantAttribute): Use internal variant, with
13059 complaints suppressed.
13060 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
13061 only if it not useful.
13062 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
13063 top-level for attributes that are shared between the assembly
13064 and a top-level class.
13065 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
13066 * class.cs: Update to reflect changes.
13067 (DefineIndexers): Fuse loops.
13068 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
13069 a couple more variants of attribute names.
13071 2004-05-18 Marek Safar <marek.safar@seznam.cz>
13073 Fix bug #52585 (Implemented explicit attribute declaration)
13076 (Attributable.ValidAttributeTargets): New abstract method. It gets
13077 list of valid attribute targets for explicit target declaration.
13078 (Attribute.Target): It holds target itself.
13079 (AttributeSection): Removed.
13080 (Attribute.CheckTargets): New method. It checks whether attribute
13081 target is valid for the current element.
13084 (EventProperty): New class. For events that are declared like
13085 property (with add and remove accessors).
13086 (EventField): New class. For events that are declared like field.
13089 * cs-parser.jay: Implemented explicit attribute target declaration.
13091 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
13092 Override ValidAttributeTargets.
13095 (ReturnParameter): Class for applying custom attributes on
13097 (ParameterAtribute): New class. Class for applying custom
13098 attributes on the parameter type.
13100 2004-05-17 Miguel de Icaza <miguel@ximian.com>
13102 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
13105 (Method): Allow UNSAFE here.
13107 * modifiers.cs: Support unsafe reporting.
13109 2004-05-17 Marek Safar <marek.safar@seznam.cz>
13111 * decl.cs: Fix bug #58478.
13113 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13115 * statement.cs: When checking for unreachable code on an EmptyStatement,
13116 set the location. Fixes bug #58488.
13118 2004-05-13 Miguel de Icaza <miguel@ximian.com>
13120 * driver.cs: Add -pkg handling.
13122 From Gonzalo: UseShelLExecute=false
13124 2004-05-12 Marek Safar <marek.safar@seznam.cz>
13127 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
13129 (Attribute.IsClsCompliaceRequired): Moved to base for better
13131 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
13132 when attribute is AttributeUsageAttribute.
13133 (Attribute.GetValidTargets): Simplified.
13134 (Attribute.GetAttributeUsage): New method returns AttributeUsage
13135 attribute for this type.
13136 (Attribute.ApplyAttributes): Method renamed to Emit and make
13138 (GlobalAttributeSection): New class for special handling of global
13139 attributes (assembly, module).
13140 (AttributeSection.Emit): New method.
13142 * class.cs: Implemented Attributable abstract methods.
13143 (MethodCore.LabelParameters): Moved to Parameter class.
13144 (Accessor): Is back simple class.
13145 (PropertyMethod): Implemented Attributable abstract class.
13146 (DelegateMethod): Implemented Attributable abstract class.
13147 (Event): New constructor for disctintion between normal Event
13148 and Event with accessors.
13150 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
13152 * codegen.cs, const.cs, decl.cs, delegate.cs:
13153 (CommonAssemblyModulClass): Implemented Attributable abstract class
13156 * enum.cs: Implement IAttributeSupport interface.
13157 (EnumMember): New class for emum members. Implemented Attributable
13161 (ParameterBase): Is abstract.
13162 (ReturnParameter): New class for easier [return:] attribute handling.
13164 * typemanager.cs: Removed builder_to_attr.
13166 2004-05-11 Raja R Harinath <rharinath@novell.com>
13169 * attribute.cs (Attribute.GetPositionalValue): New function.
13170 * class.cs (TypeContainer.VerifyMembers): New function.
13171 (TypeContainer.Emit): Use it.
13172 (ClassOrStruct): New base class for Class and Struct.
13173 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
13174 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
13176 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
13177 then each non-static field should have a FieldOffset attribute.
13178 Otherwise, none of the fields should have a FieldOffset attribute.
13179 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
13180 and FieldOffset attributes.
13181 * typemanager.cs (TypeManager.struct_layout_attribute_type)
13182 (TypeManager.field_offset_attribute_type): New core types.
13183 (TypeManager.InitCoreTypes): Initialize them.
13185 2004-05-11 Michal Moskal <malekith@pld-linux.org>
13187 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
13188 Return correct type.
13191 2004-05-09 Miguel de Icaza <miguel@ximian.com>
13193 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
13194 be implicitly converted to ulong.
13196 * expression.cs: The logic for allowing operator &, | and ^ worked
13197 was wrong, it worked before because we did not report an error in
13198 an else branch. Fixes 57895.
13200 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
13201 allow volatile fields to be reference types.
13203 2004-05-07 Miguel de Icaza <miguel@ximian.com>
13205 * driver.cs: Add support for /debug-
13207 2004-05-07 Raja R Harinath <rharinath@novell.com>
13209 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
13210 Add a 'complain' parameter to silence errors.
13211 (Attribute.Resolve): Update to changes. Put in sanity check to catch
13212 silently overlooked type-resolutions.
13213 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
13214 to reflect changes.
13215 (Attributes.Search): New function.
13216 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
13217 (Attributes.GetAttributeFullName): Remove hack.
13218 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
13219 Update to reflect changes.
13220 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13221 Use Attributes.Search instead of nested loops.
13223 2004-05-07 Marek Safar <marek.safar@seznam.cz>
13226 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
13227 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
13228 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
13230 * report.cs: (Report.Warning): Renamed to Warning_T because of
13231 parameter collision.
13233 2004-05-05 Raja R Harinath <rharinath@novell.com>
13235 * expression.cs (MemberAccess.ResolveMemberAccess):
13236 Exit with non-zero status after Report.Error.
13237 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
13239 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
13241 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
13243 * support.cs: Don't hang when the file is empty.
13245 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
13247 * support.cs: In SeekableStreamReader, compute the preamble size of the
13248 underlying stream. Position changes should take into account that initial
13251 2004-05-03 Todd Berman <tberman@sevenl.net>
13253 * driver.cs: remove unused GetSysVersion function.
13255 2004-05-03 Todd Berman <tberman@sevenl.net>
13257 * driver.cs: Remove the hack from saturday, as well as the hack
13258 from jackson (LoadAssemblyFromGac), also adds the CWD to the
13259 link_paths to get that bit proper.
13261 2004-05-01 Todd Berman <tberman@sevenl.net>
13263 * driver.cs: Try a LoadFrom before a Load, this checks the current
13264 path. This is currently a bug in mono that is be fixed, however, this
13265 provides a workaround for now. This will be removed when the bug
13268 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
13270 * CryptoConvert.cs: Updated to latest version. Fix issue with
13271 incomplete key pairs (#57941).
13273 2004-05-01 Todd Berman <tberman@sevenl.net>
13275 * driver.cs: Remove '.' from path_chars, now System.* loads properly
13278 2004-04-30 Jackson Harper <jackson@ximian.com>
13280 * codegen.cs: Open keys readonly.
13282 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13284 * typemanager.cs: don't report cyclic struct layout when a struct
13285 contains 2 or more fields of the same type. Failed for Pango.AttrShape
13286 which has 2 Pango.Rectangle fields.
13288 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
13290 * expression.cs: Handle IntPtr comparisons with IL code
13291 rather than a method call.
13293 2004-04-29 Martin Baulig <martin@ximian.com>
13295 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
13296 the list of PropertyInfo's in class hierarchy and find the
13297 accessor. Fixes #56013.
13299 2004-04-29 Martin Baulig <martin@ximian.com>
13301 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
13303 2004-04-29 Martin Baulig <martin@ximian.com>
13305 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13307 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
13309 2004-04-29 Martin Baulig <martin@ximian.com>
13311 * class.cs (ConstructorInitializer.Resolve): Check whether the
13312 parent .ctor is accessible. Fixes #52146.
13314 2004-04-29 Martin Baulig <martin@ximian.com>
13316 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13318 * statement.cs (Using.EmitLocalVariableDecls): Use
13319 TypeManager.idisposable_type, not typeof (IDisposable).
13320 (Foreach.EmitCollectionForeach): Added support for valuetypes.
13322 2004-04-29 Martin Baulig <martin@ximian.com>
13324 * class.cs (Event.Define): Don't emit the field and don't set
13325 RTSpecialName and SpecialName for events on interfaces. Fixes
13328 2004-04-29 Raja R Harinath <rharinath@novell.com>
13330 Refactor Attribute.ApplyAttributes.
13331 * attribute.cs (Attributable): New base class for objects that can
13332 have Attributes applied on them.
13333 (Attribute): Make AttributeUsage fields public.
13334 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
13335 (Attribute.IsInternalCall): New property.
13336 (Attribute.UsageAttr): Convert to a public read-only property.
13337 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
13338 (Attribute.ResolveType, Attribute.Resolve)
13339 (Attribute.ScanForIndexerName): Update to reflect changes.
13340 (Attribute.CheckAttributeTarget): Re-format.
13341 (Attribute.ApplyAttributes): Refactor, to various
13342 Attributable.ApplyAttributeBuilder methods.
13343 * decl.cs (MemberCore): Make Attributable.
13344 * class.cs (Accessor): Make Attributable.
13345 (MethodData.ApplyAttributes): Use proper attribute types, not
13347 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
13348 (TypeContainer.ApplyAttributeBuilder)
13349 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
13350 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
13351 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
13352 (Operator.ApplyAttributeBuilder): New factored-out methods.
13353 * const.cs (Const.ApplyAttributeBuilder): Likewise.
13354 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
13355 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
13356 * parameter.cs (ParameterBase): New Attributable base class
13357 that can also represent Return types.
13358 (Parameter): Update to the changes.
13360 2004-04-29 Jackson Harper <jackson@ximian.com>
13362 * driver.cs: Prefer the corlib system version when looking for
13363 assemblies in the GAC. This is still a hack, but its a better hack
13366 2004-04-29 Marek Safar <marek.safar@seznam.cz>
13368 * decl.cs, enum.cs: Improved error 3005 reporting.
13370 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
13371 (related_symbols): New private member for list of symbols
13372 related to reported error/warning.
13374 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
13376 2004-04-29 Martin Baulig <martin@ximian.com>
13378 * ecore.cs (Expression.Constantify): If we're an enum and
13379 TypeManager.TypeToCoreType() doesn't give us another type, use
13380 t.UnderlyingSystemType. Fixes #56178.
13382 2004-04-29 Martin Baulig <martin@ximian.com>
13384 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
13385 interfaces and for each interface, only add members directly
13386 declared in that interface. Fixes #53255.
13388 2004-04-28 Martin Baulig <martin@ximian.com>
13390 * expression.cs (ConditionalLogicalOperator): Use a temporary
13391 variable for `left' to avoid that we evaluate it more than once;
13394 2004-04-28 Martin Baulig <martin@ximian.com>
13396 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
13399 2004-04-28 Martin Baulig <martin@ximian.com>
13401 * statement.cs (LocalInfo.Resolve): Check whether the type is not
13404 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
13405 whether the type is not void (CS1547).
13407 2004-04-28 Martin Baulig <martin@ximian.com>
13409 * expression.cs (Unary.DoResolveLValue): Override this and report
13410 CS0131 for anything but Operator.Indirection.
13412 2004-04-28 Martin Baulig <martin@ximian.com>
13414 Committing a patch from Ben Maurer; see bug #50820.
13416 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13419 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13422 2004-04-28 Martin Baulig <martin@ximian.com>
13424 Committing a patch from Ben Maurer; see bug #50820.
13426 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13429 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13432 2004-04-28 Martin Baulig <martin@ximian.com>
13434 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
13435 (Block.AddLabel): Call DoLookupLabel() to only search in the
13438 2004-04-28 Martin Baulig <martin@ximian.com>
13440 * cfold.cs (ConstantFold.BinaryFold): Added special support for
13441 comparing StringConstants and NullLiterals in Equality and Inequality.
13443 2004-04-28 Jackson Harper <jackson@ximian.com>
13445 * driver.cs: Attempt to load referenced assemblies from the
13446 GAC. This is the quick and dirty version of this method that
13447 doesnt take into account versions and just takes the first
13448 canidate found. Will be good enough for now as we will not have more
13449 then one version installed into the GAC until I update this method.
13451 2004-04-28 Martin Baulig <martin@ximian.com>
13453 * typemanager.cs (TypeManager.CheckStructCycles): New public
13454 static method to check for cycles in the struct layout.
13456 * rootcontext.cs (RootContext.PopulateTypes): Call
13457 TypeManager.CheckStructCycles() for each TypeContainer.
13458 [Note: We only need to visit each type once.]
13460 2004-04-28 Martin Baulig <martin@ximian.com>
13462 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
13464 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
13465 success and added `out object value'. Use a `bool resolved' field
13466 to check whether we've already been called rather than
13467 `ConstantValue != null' since this breaks for NullLiterals.
13469 2004-04-28 Raja R Harinath <rharinath@novell.com>
13471 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
13472 setting of this flag, since the 'set' method may be non-public.
13474 2004-04-28 Raja R Harinath <rharinath@novell.com>
13476 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
13477 check on current_vector.Block.
13479 2004-04-27 Martin Baulig <martin@ximian.com>
13481 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
13482 a field initializer. Fixes #56459.
13484 2004-04-27 Martin Baulig <martin@ximian.com>
13486 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
13487 we're not attempting to use an indexer. Fixes #52154.
13489 2004-04-27 Martin Baulig <martin@ximian.com>
13491 * statement.cs (Return): Don't create a return label if we don't
13492 need it; reverts my change from January 20th. Thanks to Ben
13495 2004-04-27 Martin Baulig <martin@ximian.com>
13497 According to the spec, `goto' can only leave a nested scope, but
13500 * statement.cs (Block.LookupLabel): Only lookup in the current
13501 block, don't recurse into parent or child blocks.
13502 (Block.AddLabel): Check in parent and child blocks, report
13503 CS0140/CS0158 if we find a duplicate.
13504 (Block): Removed this indexer for label lookups.
13505 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
13506 this already does the error reporting for us.
13509 (FlowBranching.UsageVector.Block): New public variable; may be null.
13510 (FlowBranching.CreateSibling): Added `Block' argument.
13511 (FlowBranching.LookupLabel): New public virtual method. Lookup a
13512 label for the target of a `goto' and check whether we're not
13513 leaving a `finally'.
13515 2004-04-27 Martin Baulig <martin@ximian.com>
13517 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13518 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
13521 2004-04-27 Martin Baulig <martin@ximian.com>
13523 * statement.cs (Block.AddLabel): Also check for implicit blocks
13524 and added a CS0158 check.
13526 2004-04-27 Martin Baulig <martin@ximian.com>
13528 * flowanalysis.cs (FlowBranchingLoop): New class.
13529 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
13530 UsageVector's instead of an ArrayList.
13531 (FlowBranching.Label): Likewise.
13532 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
13533 (FlowBranching.AddBreakVector): New method.
13535 2004-04-27 Miguel de Icaza <miguel@ximian.com>
13537 * attribute.cs: Small regression fix: only convert the type if we
13538 the type is different, fixes System.Drawing build.
13540 2004-04-27 Martin Baulig <martin@ximian.com>
13542 * attribute.cs (Attribute.Resolve): If we have a constant value
13543 for a named field or property, implicity convert it to the correct
13546 2004-04-27 Raja R Harinath <rharinath@novell.com>
13548 * statement.cs (Block.Block): Implicit blocks share
13549 'child_variable_names' fields with parent blocks.
13550 (Block.AddChildVariableNames): Remove.
13551 (Block.AddVariable): Mark variable as "used by a child block" in
13552 every surrounding block.
13553 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
13554 been used in a child block, complain about violation of "Invariant
13555 meaning in blocks" rule.
13556 * cs-parser.jay (declare_local_variables): Don't use
13557 AddChildVariableNames.
13558 (foreach_statement): Don't create an implicit block: 'foreach'
13559 introduces a scope.
13561 2004-04-23 Miguel de Icaza <miguel@ximian.com>
13563 * convert.cs (ImplicitNumericConversion): 0 is also positive when
13564 converting from 0L to ulong. Fixes 57522.
13566 2004-04-22 Marek Safar <marek.safar@seznam.cz>
13568 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
13569 derived class hides via 'new' keyword field from base class (test-242.cs).
13570 TODO: Handle this in the more general way.
13572 * class.cs (CheckBase): Ditto.
13574 2004-04-22 Marek Safar <marek.safar@seznam.cz>
13576 * decl.cs (caching_flags): New member for storing cached values
13578 (MemberCore.Flags): New enum where bit flags for caching_flags
13580 (MemberCore.cls_compliance): Moved to caching_flags.
13581 (DeclSpace.Created): Moved to caching_flags.
13583 * class.cs: Use caching_flags instead of DeclSpace.Created
13585 2004-04-21 Miguel de Icaza <miguel@ximian.com>
13587 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
13588 if we are only a derived class, not a nested class.
13590 * typemanager.cs: Same as above, but do this at the MemberLookup
13591 level (used by field and methods, properties are handled in
13592 PropertyExpr). Allow for the qualified access if we are a nested
13595 2004-04-21 Marek Safar <marek.safar@seznam.cz>
13597 * class.cs: Refactoring.
13598 (IMethodData): New inteface; Holds links to parent members
13599 to avoid member duplication (reduced memory allocation).
13600 (Method): Implemented IMethodData interface.
13601 (PropertyBase): New inner classes for get/set methods.
13602 (PropertyBase.PropertyMethod): Implemented IMethodData interface
13603 (Event): New inner classes for add/remove methods.
13604 (Event.DelegateMethod): Implemented IMethodData interface.
13606 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
13607 EmitContext (related to class.cs refactoring).
13609 2004-04-21 Raja R Harinath <rharinath@novell.com>
13611 * delegate.cs (Delegate.VerifyApplicability): If the number of
13612 arguments are the same as the number of parameters, first try to
13613 verify applicability ignoring any 'params' modifier on the last
13617 2004-04-16 Raja R Harinath <rharinath@novell.com>
13619 * class.cs (TypeContainer.AddIndexer): Use
13620 'ExplicitInterfaceName' to determine if interface name was
13621 explicitly specified. 'InterfaceType' is not initialized at this time.
13622 (TypeContainer.DefineIndexers): Remove use of temporary list. The
13623 Indexers array is already in the required order. Initialize
13624 'IndexerName' only if there are normal indexers.
13625 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
13626 (TypeContainer.Emit): Emit DefaultMember attribute only if
13627 IndexerName is initialized.
13630 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
13632 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
13635 2004-04-15 Raja R Harinath <rharinath@novell.com>
13637 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
13641 * attribute.cs (Attribute.Resolve): Check for duplicate named
13645 2004-04-15 Miguel de Icaza <miguel@ximian.com>
13647 * iterators.cs (MarkYield): track whether we are in an exception,
13648 and generate code accordingly. Use a temporary value to store the
13649 result for our state.
13651 I had ignored a bit the interaction of try/catch with iterators
13652 since their behavior was not entirely obvious, but now it is
13653 possible to verify that our behavior is the same as MS .NET 2.0
13657 2004-04-14 Miguel de Icaza <miguel@ximian.com>
13659 * iterators.cs: Avoid creating temporaries if there is no work to
13662 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
13663 Enumerations, use TypeManager.EnumToUnderlying and call
13666 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
13669 (This.Emit): Use EmitContext.EmitThis to emit our
13672 (This.EmitAssign): Ditto.
13674 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
13675 codepaths, we will move all the functionality into
13678 (FieldExpr.EmitAssign): Ditto.
13680 This fixes several hidden bugs that I uncovered while doing a code
13681 review of this today.
13683 * codegen.cs (EmitThis): reworked so the semantics are more clear
13684 and also support value types "this" instances.
13686 * iterators.cs: Changed so that for iterators in value types, we
13687 do not pass the value type as a parameter.
13689 Initialization of the enumerator helpers is now done in the caller
13690 instead of passing the parameters to the constructors and having
13691 the constructor set the fields.
13693 The fields have now `assembly' visibility instead of private.
13695 2004-04-11 Miguel de Icaza <miguel@ximian.com>
13697 * expression.cs (Argument.Resolve): Check if fields passed as ref
13698 or out are contained in a MarshalByRefObject.
13700 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
13701 another compiler type.
13703 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
13705 * class.cs (Indexer.Define): use the new name checking method.
13706 Also, return false on an error.
13707 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
13708 (is_identifier_[start/part]_character): make static.
13710 2004-04-10 Miguel de Icaza <miguel@ximian.com>
13712 * expression.cs (Binary.ResolveOperator): Do no append strings
13713 twice: since we can be invoked more than once (array evaluation)
13714 on the same concatenation, take care of this here. Based on a fix
13715 from Ben (bug #56454)
13717 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
13719 * codegen.cs: Fix another case where CS1548 must be reported (when
13720 delay-sign isn't specified and no private is available #56564). Fix
13721 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
13722 error when MCS is used on the MS runtime and we need to delay-sign
13723 (which seems unsupported by AssemblyBuilder - see #56621).
13725 2004-04-08 Marek Safar <marek.safar@seznam.cz>
13727 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
13728 (TypeManager.ComputeNamespaces): Faster implementation for
13731 * compiler.csproj: Updated AssemblyName to mcs.
13733 2004-04-07 Miguel de Icaza <miguel@ximian.com>
13735 * rootcontext.cs: Add new types to the boot resolution.
13737 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
13738 MulticastDelegate is not allowed.
13740 * typemanager.cs: Add new types to lookup: System.TypedReference
13743 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
13744 check for TypedReference or ArgIterator, they are not allowed.
13746 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
13747 makes us properly catch 1510 in some conditions (see bug 56016 for
13750 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
13752 * CryptoConvert.cs: update from corlib version
13755 2004-04-05 Miguel de Icaza <miguel@ximian.com>
13757 * class.cs (Indexer.Define): Check indexername declaration
13759 2004-04-05 Marek Safar <marek.safar@seznam.cz>
13761 * attribute.cs (IsClsCompliant): Fixed problem with handling
13762 all three states (compliant, not-compliant, undetected).
13764 2004-03-30 Marek Safar <marek.safar@seznam.cz>
13766 * attribute.cs (Attribute): Location is now public.
13767 (Resolve): Store resolved arguments (pos_values) in attribute class.
13768 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
13769 (GetClsCompliantAttributeValue): New method that gets
13770 CLSCompliantAttribute value.
13771 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
13772 if exists else null.
13773 (AttributeTester): New class for CLS-Compliant verification routines.
13775 * class.cs (Emit): Add CLS-Compliant verification.
13776 (Method.GetSignatureForError): Implemented.
13777 (Constructor.GetSignatureForError): Implemented
13778 (Constructor.HasCompliantArgs): Returns if constructor has
13779 CLS-Compliant arguments.
13780 (Constructor.Emit): Override.
13781 (Construcor.IsIdentifierClsCompliant): New method; For constructors
13782 is needed to test only parameters.
13783 (FieldBase.GetSignatureForError): Implemented.
13784 (TypeContainer): New member for storing base interfaces.
13785 (TypeContainer.FindMembers): Search in base interfaces too.
13787 * codegen.cs (GetClsComplianceAttribute): New method that gets
13788 assembly or module CLSCompliantAttribute value.
13789 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
13791 (ModuleClass.Emit): Add error 3012 test.
13793 * const.cs (Emit): Override and call base for CLS-Compliant tests.
13795 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
13796 state for all decl types.
13797 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
13798 if CLS-Compliant tests are required.
13799 (IsClsCompliaceRequired): New method. Analyze whether code
13800 must be CLS-Compliant.
13801 (IsExposedFromAssembly): New method. Returns true when MemberCore
13802 is exposed from assembly.
13803 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
13804 value or gets cached value.
13805 (HasClsCompliantAttribute): New method. Returns true if MemberCore
13806 is explicitly marked with CLSCompliantAttribute.
13807 (IsIdentifierClsCompliant): New abstract method. This method is
13808 used to testing error 3005.
13809 (IsIdentifierAndParamClsCompliant): New method. Common helper method
13810 for identifier and parameters CLS-Compliant testing.
13811 (VerifyClsCompliance): New method. The main virtual method for
13812 CLS-Compliant verifications.
13813 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
13814 null. I don't know why is null (too many public members !).
13815 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
13816 and get value of first CLSCompliantAttribute that found.
13818 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
13819 (VerifyClsCompliance): Override and add extra tests.
13821 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
13822 clscheck- disable CLS-Compliant verification event if assembly is has
13823 CLSCompliantAttribute(true).
13825 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
13826 ApllyAttribute is now called in emit section as in the other cases.
13827 Possible future Emit integration.
13828 (IsIdentifierClsCompliant): New override.
13829 (VerifyClsCompliance): New override.
13830 (GetEnumeratorName): Returns full enum name.
13832 * parameter.cs (GetSignatureForError): Implemented.
13834 * report.cs (WarningData): New struct for Warning message information.
13835 (LocationOfPreviousError): New method.
13836 (Warning): New method. Reports warning based on the warning table.
13837 (Error_T): New method. Reports error based on the error table.
13839 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
13840 verifications are done here.
13842 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
13844 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
13845 CLSCompliantAttribute.
13846 (all_imported_types): New member holds all imported types from other
13848 (LoadAllImportedTypes): New method fills static table with exported types
13849 from all referenced assemblies.
13850 (Modules): New property returns all assembly modules.
13852 2004-03-30 Miguel de Icaza <miguel@ximian.com>
13854 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
13855 throwing a parser error.
13857 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
13858 which removes the hardcoded get_/set_ prefixes for properties, as
13859 IL allows for the properties to be named something else.
13863 * expression.cs: Do not override operand before we know if it is
13864 non-null. Fix 56207
13866 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
13868 * typemanager.cs: support for pinned variables.
13870 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
13872 * decl.cs, typemanager.cs: Avoid using an arraylist
13873 as a buffer if there is only one result set.
13875 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
13877 * expression.cs: Make sure you cant call a static method
13878 with an instance expression, bug #56174.
13880 2004-03-29 Miguel de Icaza <miguel@ximian.com>
13882 * class.cs (IsDuplicateImplementation): Improve error reporting to
13883 flag 663 (method only differs in parameter modifier).
13885 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
13886 in preprocessor directives.
13888 * location.cs (LookupFile): Allow for the empty path.
13890 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
13891 better approach for some of that patch, but its failing with the
13892 CharSet enumeration. For now try/catch will do.
13894 * typemanager.cs: Do not crash if a struct does not have fields.
13897 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
13899 * expression.cs: cs0213, cant fix a fixed expression.
13902 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
13904 * cs-parser.jay: detect invalid embeded statements gracefully.
13907 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
13909 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
13912 the invocation type may not be a subclass of the tye of the item/
13913 The type of the item must be a subclass of the invocation item.
13918 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
13920 * attribute.cs: Added methods to get a string and a bool from an
13921 attribute. Required to information from AssemblyKeyFileAttribute,
13922 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
13923 * codegen.cs: Modified AssemblyName creation to include support for
13924 strongnames. Catch additional exceptions to report them as CS1548.
13925 * compiler.csproj: Updated include CryptoConvert.cs.
13926 * compiler.csproj.user: Removed file - user specific configuration.
13927 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
13928 Mono.Security assembly. The original class is maintained and tested in
13929 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
13930 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
13931 like CSC 8.0 (C# v2) supports.
13932 * Makefile: Added CryptoConvert.cs to mcs sources.
13933 * rootcontext.cs: Added new options for strongnames.
13935 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
13937 * driver.cs: For --expect-error, report error code `2'
13938 if the program compiled with no errors, error code `1' if
13939 it compiled with an error other than the one expected.
13941 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
13943 * compiler.csproj: Updated for Visual Studio .NET 2003.
13944 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
13945 * compiler.sln: Updated for Visual Studio .NET 2003.
13947 2004-03-24 Ravi Pratap M <ravi@ximian.com>
13949 * expression.cs: Fix bug #47234. We basically need to apply the
13950 rule that we prefer the conversion of null to a reference type
13951 when faced with a conversion to 'object' (csc behaviour).
13953 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
13955 * statement.cs: Shorter form for foreach, eliminates
13956 a local variable. r=Martin.
13958 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
13960 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
13961 checks if we can use brtrue/brfalse to test for 0.
13962 * expression.cs: use the above in the test for using brtrue/brfalse.
13963 cleanup code a bit.
13965 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
13967 * expression.cs: Rewrite string concat stuff. Benefits:
13969 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
13970 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
13971 rather than a concat chain.
13973 * typemanager.cs: Add lookups for more concat overloads.
13975 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
13977 * expression.cs: Emit shorter il code for array init.
13994 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
13996 * statement.cs: Before, two switch blocks would be merged if the
13997 total size of the blocks (end_item - begin_item + 1) was less than
13998 two times the combined sizes of the blocks.
14000 Now, it will only merge if after the merge at least half of the
14005 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
14007 * class.cs : csc build fix for GetMethods(). See bug #52503.
14009 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
14011 * expression.cs: Make sure fp comparisons work with NaN.
14012 This fixes bug #54303. Mig approved this patch a long
14013 time ago, but we were not able to test b/c the runtime
14016 2004-03-19 Miguel de Icaza <miguel@ximian.com>
14018 * ecore.cs (TypExpr.GetHashCode): implement this overload.
14020 2004-03-19 Martin Baulig <martin@ximian.com>
14022 * class.cs (MemberCore.IsDuplicateImplementation): Report the
14023 error here and not in our caller.
14025 2004-03-19 Martin Baulig <martin@ximian.com>
14027 * interface.cs: Completely killed this file.
14028 (Interface): We're now a TypeContainer and live in class.cs.
14030 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
14031 argument; we're now also called for interfaces.
14032 (TypeContainer.DefineMembers): Allow this method being called
14034 (TypeContainer.GetMethods): New public method; formerly known as
14035 Interface.GetMethod(). This is used by PendingImplementation.
14036 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
14037 it's now private and non-static.
14038 (Interface): Moved this here; it's now implemented similar to
14040 (Method, Property, Event, Indexer): Added `bool is_interface'
14041 argument to their .ctor's.
14042 (MemberBase.IsInterface): New public field.
14044 * cs-parser.jay: Create normal Method, Property, Event, Indexer
14045 instances instead of InterfaceMethod, InterfaceProperty, etc.
14046 (opt_interface_base): Removed; we now use `opt_class_base' instead.
14047 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
14049 2004-03-19 Martin Baulig <martin@ximian.com>
14051 * class.cs (MethodCore.IsDuplicateImplementation): New private
14052 method which does the CS0111 checking.
14053 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
14054 Use IsDuplicateImplementation().
14056 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
14058 * decl.cs (FindMemberToOverride): New method to find the correct
14059 method or property to override in the base class.
14061 - Make Method/Property use the above method to find the
14062 version in the base class.
14063 - Remove the InheritableMemberSignatureCompare as it is now
14066 This patch makes large code bases much faster to compile, as it is
14067 O(n) rather than O(n^2) to do this validation.
14069 Also, it fixes bug 52458 which is that nested classes are not
14070 taken into account when finding the base class member.
14072 Reviewed/Approved by Martin.
14074 2004-03-17 Marek Safar <marek.safar@seznam.cz>
14076 * interface.cs: In all interface classes removed redundant
14077 member initialization.
14079 2004-03-16 Martin Baulig <martin@ximian.com>
14081 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
14083 2004-03-15 Miguel de Icaza <miguel@ximian.com>
14085 * decl.cs (DefineTypeAndParents): New helper method to define a
14086 type's containers before the type itself is defined; This is a
14087 bug exposed by the recent changes to Windows.Forms when an
14088 implemented interface was defined inside a class that had not been
14091 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
14093 (Check): Loop correctly to report errors modifiers
14094 (UNSAFE was not in the loop, since it was the same as TOP).
14096 * interface.cs: Every interface member now takes a ModFlags,
14097 instead of a "is_new" bool, which we set on the base MemberCore.
14099 Every place where we called "UnsafeOk" in the interface, now we
14100 call the proper member (InterfaceMethod.UnsafeOK) instead to get
14101 the unsafe settings from the member declaration instead of the
14102 container interface.
14104 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
14106 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
14107 `set_indexer_name' to the pending bits (one per type).
14109 We fixed a bug today that was picking the wrong method to
14110 override, since for properties the existing InterfaceMethod code
14111 basically ignored the method name. Now we make sure that the
14112 method name is one of the valid indexer names.
14114 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
14116 * support.cs (SeekableStreamReader): Keep track of stream byte
14117 positions and don't mix them with character offsets to the buffer.
14119 Patch from Gustavo Giráldez
14121 2004-03-15 Marek Safar <marek.safar@seznam.cz>
14123 * interface.cs (InterfaceSetGetBase): Removed double member
14124 initialization, base class does it as well.
14126 2004-03-13 Martin Baulig <martin@ximian.com>
14128 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
14129 when compiling corlib.
14131 2004-03-13 Miguel de Icaza <miguel@ximian.com>
14133 * convert.cs (ExplicitConversion): We were reporting an error on
14134 certain conversions (object_type source to a value type, when the
14135 expression was `null') before we had a chance to pass it through
14136 the user defined conversions.
14138 * driver.cs: Replace / and \ in resource specifications to dots.
14141 * class.cs: Add check for duplicate operators. Fixes 52477
14143 2004-03-11 Miguel de Icaza <miguel@ximian.com>
14145 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
14146 that are in the middle of the statements, not only at the end.
14149 * class.cs (TypeContainer.AddField): No longer set the
14150 `HaveStaticConstructor' flag, now we call it
14151 `UserDefineStaticConstructor' to diferentiate the slightly
14152 semantic difference.
14154 The situation is that we were not adding BeforeFieldInit (from
14155 Modifiers.TypeAttr) to classes that could have it.
14156 BeforeFieldInit should be set to classes that have no static
14161 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
14163 And most importantly Zoltan's comment:
14165 http://bugzilla.ximian.com/show_bug.cgi?id=44229
14167 "I think beforefieldinit means 'it's ok to initialize the type sometime
14168 before its static fields are used', i.e. initialization does not need
14169 to be triggered by the first access to the type. Setting this flag
14170 helps the JIT to compile better code, since it can run the static
14171 constructor at JIT time, and does not need to generate code to call it
14172 (possibly lots of times) at runtime. Unfortunately, mcs does not set
14173 this flag for lots of classes like String.
14175 csc sets this flag if the type does not have an explicit static
14176 constructor. The reasoning seems to be that if there are only static
14177 initalizers for a type, and no static constructor, then the programmer
14178 does not care when this initialization happens, so beforefieldinit
14181 This bug prevents the AOT compiler from being usable, since it
14182 generates so many calls to mono_runtime_class_init that the AOT code
14183 is much slower than the JITted code. The JITted code is faster,
14184 because it does not generate these calls if the vtable is type is
14185 already initialized, which is true in the majority of cases. But the
14186 AOT compiler can't do this."
14188 2004-03-10 Miguel de Icaza <miguel@ximian.com>
14190 * class.cs (MethodData.Emit): Refactor the code so symbolic
14191 information is generated for destructors; For some reasons we
14192 were taking a code path that did not generate symbolic information
14195 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
14197 * class.cs: Create a Constructor.CheckBase method that
14198 takes care of all validation type code. The method
14199 contains some code that was moved from Define.
14201 It also includes new code that checks for duplicate ctors.
14202 This fixes bug #55148.
14204 2004-03-09 Joshua Tauberer <tauberer@for.net>
14206 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
14207 a { ... }-style array creation invokes EmitStaticInitializers
14208 which is not good for reference-type arrays. String, decimal
14209 and now null constants (NullCast) are not counted toward
14210 static initializers.
14212 2004-03-05 Martin Baulig <martin@ximian.com>
14214 * location.cs (SourceFile.HasLineDirective): New public field;
14215 specifies whether the file contains or is referenced by a "#line"
14217 (Location.DefineSymbolDocuments): Ignore source files which
14218 either contain or are referenced by a "#line" directive.
14220 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
14222 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
14223 direct access to our parent, so check the method inline there.
14225 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
14227 * expression.cs (Invocation.EmitCall): Miguel's last commit
14228 caused a regression. If you had:
14233 In Foo the implict this would be null.
14235 2004-02-27 Miguel de Icaza <miguel@ximian.com>
14237 * expression.cs (Invocation.EmitCall): If the method is not
14238 virtual, do not emit a CallVirt to it, use Call.
14240 * typemanager.cs (GetFullNameSignature): Improve the method to
14241 cope with ".ctor" and replace it with the type name.
14243 * class.cs (ConstructorInitializer.Resolve): Now the method takes
14244 as an argument the ConstructorBuilder where it is being defined,
14245 to catch the recursive constructor invocations.
14247 2004-02-26 Miguel de Icaza <miguel@ximian.com>
14249 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
14250 routines to check if a type is an enumerable/enumerator allow
14251 classes that implement the IEnumerable or IEnumerator interfaces.
14253 * class.cs (Property, Operator): Implement IIteratorContainer, and
14254 implement SetYields.
14256 (Property.Define): Do the block swapping for get_methods in the
14257 context of iterators. We need to check if Properties also
14258 include indexers or not.
14260 (Operator): Assign the Block before invoking the
14261 OperatorMethod.Define, so we can trigger the Iterator code
14264 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
14265 Property and Operator classes are not created when we parse the
14266 declarator but until we have the block completed, so we use a
14267 singleton SimpleIteratorContainer.Simple to flag whether the
14268 SetYields has been invoked.
14270 We propagate this setting then to the Property or the Operator to
14271 allow the `yield' to function.
14273 2004-02-25 Marek Safar <marek.safar@seznam.cz>
14275 * codegen.cs: Implemented attribute support for modules.
14276 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
14277 Assembly/Module functionality.
14279 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
14280 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
14281 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
14283 2004-02-16 Marek Safar <marek.safar@seznam.cz>
14285 * interface.cs (FindMembers): The operation is performed on all base
14286 interfaces and not only on the first. It is required for future CLS Compliance patch.
14288 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
14290 * statement.cs, codegen.cs:
14291 This patch deals with patterns such as:
14293 public class List : IEnumerable {
14295 public MyEnumerator GetEnumerator () {
14296 return new MyEnumerator(this);
14299 IEnumerator IEnumerable.GetEnumerator () {
14303 public struct MyEnumerator : IEnumerator {
14308 Before, there were a few things we did wrong:
14309 1) we would emit callvirt on a struct, which is illegal
14310 2) we emited ldarg when we needed to emit ldarga
14311 3) we would mistakenly call the interface methods on an enumerator
14312 type that derived from IEnumerator and was in another assembly. For example:
14314 public class MyEnumerator : IEnumerator
14316 Would have the interface methods called, even if there were public impls of the
14317 method. In a struct, this lead to invalid IL code.
14319 2004-02-11 Marek Safar <marek.safar@seznam.cz>
14321 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
14324 * delegate.cs (Define): Fixed crash when delegate type is undefined.
14326 2004-02-11 Miguel de Icaza <miguel@ximian.com>
14328 * cs-parser.jay: Fix small regression: we were not testing V2
14329 compiler features correctly.
14331 * interface.cs: If the emit context is null, then create one
14333 2004-02-09 Marek Safar <marek.safar@seznam.cz>
14335 * decl.cs (GetSignatureForError): New virtual method to get full name
14336 for error messages.
14338 * attribute.cs (IAttributeSupport): New interface for attribute setting.
14339 Now it is possible to rewrite ApplyAttributes method to be less if/else.
14341 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
14342 Duplicated members and code in these classes has been removed.
14343 Better encapsulation in these classes.
14345 2004-02-07 Miguel de Icaza <miguel@ximian.com>
14347 * assign.cs (Assign.DoResolve): When dealing with compound
14348 assignments, there is a new rule in ECMA C# 2.4 (might have been
14349 there before, but it is documented here) that states that in:
14353 If b is of type int, and the `op' is a shift-operator, then the
14354 above is evaluated as:
14358 * expression.cs (Binary.ResolveOperator): Instead of testing for
14359 int/uint/long/ulong, try to implicitly convert to any of those
14360 types and use that in pointer arithmetic.
14362 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
14363 method to print information for from the type, not from the
14364 null-method we were given.
14366 2004-02-01 Duncan Mak <duncan@ximian.com>
14368 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
14369 parsing for cmd, fixes bug #53694.
14371 2004-02-04 Marek Safar <marek.safar@seznam.cz>
14373 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
14374 in the member name duplication tests. Property and operator name duplication
14375 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
14377 2004-02-03 Marek Safar <marek.safar@seznam.cz>
14379 * interface.cs (PopulateMethod): Fixed crash when interface method
14380 returns not existing type (error test cs0246-3.cs).
14382 2004-02-02 Ravi Pratap M <ravi@ximian.com>
14384 * cs-parser.jay (interface_accessors): Re-write actions to also
14385 store attributes attached to get and set methods. Fix spelling
14388 (inteface_property_declaration): Modify accordingly.
14390 (InterfaceAccessorInfo): New helper class to store information to pass
14391 around between rules that use interface_accessors.
14393 * interface.cs (Emit): Apply attributes on the get and set
14394 accessors of properties and indexers too.
14396 * attribute.cs (ApplyAttributes): Modify accordingly to use the
14397 right MethodBuilder when applying attributes to the get and set accessors.
14399 2004-01-31 Miguel de Icaza <miguel@ximian.com>
14401 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
14403 2004-01-26 Miguel de Icaza <miguel@ximian.com>
14405 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
14407 2004-01-25 Miguel de Icaza <miguel@ximian.com>
14409 * cs-parser.jay: Remove YIELD token, instead use the new grammar
14410 changes that treat `yield' specially when present before `break'
14411 or `return' tokens.
14413 * cs-tokenizer.cs: yield is no longer a keyword.
14415 2004-01-23 Marek Safar <marek.safar@seznam.cz>
14417 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
14418 setting for default constructors.
14419 For default constructors are almost every time set wrong Modifier. The
14420 generated IL code has been alright. But inside mcs this values was
14421 wrong and this was reason why several of my CLS Compliance tests
14424 2004-01-22 Martin Baulig <martin@ximian.com>
14426 * cs-parser.jay (namespace_or_type_name): Return an Expression,
14427 not a QualifiedIdentifier. This is what `type_name_expression'
14428 was previously doing.
14429 (type_name_expression): Removed; the code is now in
14430 `namespace_or_type_name'.
14431 (qualified_identifier): Removed, use `namespace_or_type_name'
14433 (QualifiedIdentifier): Removed this class.
14435 2004-01-22 Martin Baulig <martin@ximian.com>
14437 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
14438 not a string as alias name.
14440 2004-01-21 Miguel de Icaza <miguel@ximian.com>
14442 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
14443 #52730 bug, and instead compute correctly the need to use a
14444 temporary variable when requesting an address based on the
14445 static/instace modified of the field and the constructor.
14447 2004-01-21 Martin Baulig <martin@ximian.com>
14449 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
14450 class and namespace before looking up aliases. Fixes #52517.
14452 2004-01-21 Martin Baulig <martin@ximian.com>
14454 * flowanalysis.cs (UsageVector.Merge): Allow variables being
14455 assinged in a 'try'; fixes exception4.cs.
14457 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14458 * class.cs : Implemented parameter-less constructor for TypeContainer
14460 * decl.cs: Attributes are now stored here. New property OptAttributes
14462 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
14464 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
14466 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14468 * typemanager.cs (CSharpSignature): Now reports also inner class name.
14469 (CSharpSignature): New method for indexer and property signature.
14471 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14473 * pending.cs (IsVirtualFilter): Faster implementation.
14475 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14477 * typemanager.cs: Avoid inclusion of same assembly more than once.
14479 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14481 * cs-parser.jay: Fixed problem where the last assembly attribute
14482 has been applied also to following declaration (class, struct, etc.)
14484 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14486 * class.cs: Added error CS0538, CS0539 reporting.
14487 Fixed crash on Microsoft runtime when field type is void.
14489 * cs-parser.jay: Added error CS0537 reporting.
14491 * pending.cs: Added error CS0535 reporting.
14492 Improved error report for errors CS0536, CS0534.
14494 2004-01-20 Miguel de Icaza <miguel@ximian.com>
14496 Merge a few bits from the Anonymous Method MCS tree.
14498 * statement.cs (ToplevelBlock): New class for toplevel methods,
14499 will hold anonymous methods, lifted variables.
14501 * cs-parser.jay: Create toplevel blocks for delegates and for
14502 regular blocks of code.
14504 2004-01-20 Martin Baulig <martin@ximian.com>
14506 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
14507 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
14508 and `NeedExplicitReturn'; added `IsLastStatement'.
14509 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
14510 have a `ReturnLabel' or we're not unreachable.
14512 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
14513 child's reachability; don't just override ours with it. Fixes
14514 #58058 (lluis's example).
14515 (FlowBranching): Added public InTryOrCatch(), InCatch(),
14516 InFinally(), InLoop(), InSwitch() and
14517 BreakCrossesTryCatchBoundary() methods.
14519 * statement.cs (Return): Do all error checking in Resolve().
14520 Unless we are the last statement in a top-level block, always
14521 create a return label and jump to it.
14522 (Break, Continue): Do all error checking in Resolve(); also make
14523 sure we aren't leaving a `finally'.
14524 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
14525 statement in a top-level block.
14526 (Block.Flags): Added `IsDestructor'.
14527 (Block.IsDestructor): New public property.
14529 2004-01-20 Martin Baulig <martin@ximian.com>
14531 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
14533 2004-01-20 Martin Baulig <martin@ximian.com>
14535 * statement.cs (Statement.ResolveUnreachable): New public method.
14536 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
14537 (Block.Resolve): Resolve unreachable statements.
14539 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
14541 * expression.cs: We need to fix the case where we do
14542 not have a temp variable here.
14544 * assign.cs: Only expression compound assignments need
14545 temporary variables.
14547 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
14549 * flowanalysis.cs: Reduce memory allocation in a few ways:
14550 - A block with no variables should not allocate a bit
14552 - A method with no out parameters does not need any tracking
14553 for assignment of the parameters, so we need not allocate
14556 public readonly Type[] VariableTypes;
14557 public readonly string[] VariableNames;
14558 Are redundant. The data is already stored in the variable
14559 map, so we need not allocate another array for it.
14560 - We need to add alot of checks for if (params | locals) == null
14561 due to the first two changes.
14563 2004-01-18 Miguel de Icaza <miguel@ximian.com>
14565 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
14566 implement IMemoryLocation, we store a copy on a local variable and
14567 take the address of it. Patch from Benjamin Jemlich
14569 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
14570 to use a special "type_name_expression" rule which reduces the
14571 number of "QualifiedIdentifier" classes created, and instead
14572 directly creates MemberAccess expressions.
14574 2004-01-17 Miguel de Icaza <miguel@ximian.com>
14576 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
14577 that fixes #52853. Null literal assignment to ValueType
14579 * class.cs (MethodData.Emit): Instead of checking the name of the
14580 method to determine if its a destructor, create a new derived
14581 class from Method called Destructor, and test for that.
14583 * cs-parser.jay: Create a Destructor object instead of a Method.
14585 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
14589 2004-01-16 Miguel de Icaza <miguel@ximian.com>
14591 * expression.cs (Binary.ResolveOperator): Perform an implicit
14592 conversion from MethodGroups to their delegate types on the
14593 Addition operation.
14595 * delegate.cs: Introduce a new class DelegateCreation that is the
14596 base class for `NewDelegate' and `ImplicitDelegateCreation',
14597 factor some code in here.
14599 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
14600 conversion from MethodGroups to compatible delegate types.
14602 * ecore.cs (Expression.Resolve): Do not flag error 654
14603 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
14604 we allow conversions from MethodGroups to delegate types now.
14606 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
14607 assignments in v2 either.
14609 2004-01-10 Miguel de Icaza <miguel@ximian.com>
14611 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
14612 static read-only fields in ctors.
14614 Applied patch from Benjamin Jemlich
14616 * expression.cs (UnaryMutator): Avoid leaking local variables.
14618 2004-01-09 Miguel de Icaza <miguel@ximian.com>
14620 * cs-tokenizer.cs (IsCastToken): Allow the various native types
14621 here to return true, as they can be used like this:
14623 (XXX) int.MEMBER ()
14625 Fixed 49836 and all the other dups
14627 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
14629 * driver.cs: Implement /win32res and /win32icon.
14631 2004-01-08 Miguel de Icaza <miguel@ximian.com>
14633 * cs-parser.jay: Add a rule to improve error handling for the
14634 common mistake of placing modifiers after the type.
14636 2004-01-07 Miguel de Icaza <miguel@ximian.com>
14638 * cs-parser.jay (interface_event_declaration): Catch
14639 initialization of events on interfaces, and report cs0068
14641 * cs-parser.jay (interface_event_declaration): Catch
14642 initialization of events.
14644 * ecore.cs: Better report missing constructors.
14646 * expression.cs (Binary.ResolveOperator): My previous bug fix had
14647 the error reporting done in the wrong place. Fix.
14649 * expression.cs (Binary.ResolveOperator): Catch the
14650 operator + (E x, E y) error earlier, and later allow for implicit
14651 conversions in operator +/- (E e, U x) from U to the underlying
14654 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
14655 52596, if the container class is abstract, the default constructor
14656 is protected otherwise its public (before, we were always public).
14658 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
14661 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
14662 Jemlich that fixes bug #52597, MCS was generating invalid code for
14663 idisposable structs. Thanks to Ben for following up with this
14666 2004-01-06 Miguel de Icaza <miguel@ximian.com>
14668 * driver.cs: Allow assemblies without code to be generated, fixes
14671 2004-01-07 Nick Drochak <ndrochak@gol.com>
14673 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
14675 2004-01-05 Miguel de Icaza <miguel@ximian.com>
14677 * cs-parser.jay: Add rules to improve error reporting if fields or
14678 methods are declared at the namespace level (error 116)
14680 * Add rules to catch event add/remove
14682 2004-01-04 David Sheldon <dave-mono@earth.li>
14684 * expression.cs: Added matching ")" to error message for
14687 2004-01-03 Todd Berman <tberman@gentoo.org>
14689 * ecore.cs, attribute.cs:
14690 Applying fix from #52429.
14692 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
14694 * ecore.cs, expression.cs, statement.cs:
14695 Total rewrite of how we handle branching. We
14696 now handle complex boolean expressions with fewer
14697 jumps. As well if (x == 0) no longer emits a ceq.
14699 if (x is Foo) is much faster now, because we generate
14702 Overall, we get a pretty big improvement on our benchmark
14703 tests. The code we generate is smaller and more readable.
14705 I did a full two-stage bootstrap. The patch was reviewed
14706 by Martin and Miguel.
14708 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
14710 * cs-parser.jay: Make primary_expression not take a QI.
14711 we dont need this because the member_access rule covers
14712 us here. So we replace the rule with just IDENTIFIER.
14714 This has two good effects. First, we remove a s/r conflict.
14715 Second, we allocate many fewer QualifiedIdentifier objects.
14717 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
14719 * attribute.cs: Handle MarshalAs attributes as pseudo, and
14720 set the correct information via SRE. This prevents
14721 hanging on the MS runtime. Fixes #29374.
14723 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
14725 * convert.cs: correctly handle conversions to value types
14726 from Enum and ValueType as unboxing conversions.
14728 Fixes bug #52569. Patch by Benjamin Jemlich.
14730 2004-01-02 Ravi Pratap <ravi@ximian.com>
14732 * expression.cs (BetterConversion): Prefer int -> uint
14733 over int -> ulong (csc's behaviour). This fixed bug #52046.
14735 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
14737 * decl.cs (MemberCache.FindMembers): now returns a
14740 * typemanager.cs: In general, go with with ^^.
14741 (CopyNewMethods): take an IList.
14742 (RealMemberLookup): Only allocate an arraylist
14743 if we copy from two sets of methods.
14745 This change basically does two things:
14746 1) Fewer array lists allocated due to CopyNewMethods.
14747 2) the explicit cast in MemberList costed ALOT.
14749 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
14751 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
14752 a hashtable to avoid needless string allocations when an identifier is
14753 used more than once (the common case).
14755 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
14757 * pending.cs: MS's TypeBuilder.GetInterfaces ()
14758 is broken, it will not return anything. So, we
14759 have to use the information we have in mcs to
14762 * typemanager.cs: Add a cache for GetInterfaces,
14763 since this will now be used more often (due to ^^)
14765 (GetExplicitInterfaces) New method that gets the
14766 declared, not effective, interfaces on a type
14767 builder (eg, if you have interface IFoo, interface
14768 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
14771 This patch makes MCS able to bootstrap itself on
14774 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
14776 * expression.cs: Remove the Nop's that Miguel put
14779 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
14781 * report.cs, codegen.cs: Give the real stack trace to
14782 the error when an exception is thrown.
14784 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
14786 * decl.cs: only allocate hashtables for ifaces if
14789 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
14791 * expression.cs: fix the error from cs0121-2.cs
14792 (a parent interface has two child interfaces that
14793 have a function with the same name and 0 params
14794 and the function is called through the parent).
14796 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
14798 * class.cs, rootcontext.cs, typmanager.cs: do not
14801 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
14803 * codegen.cs: remove stack for the ec flow branching.
14804 It is already a linked list, so no need.
14806 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
14808 * Makefile: Allow custom profiler here.
14810 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
14812 * typemanager.cs (LookupType):
14813 - Use a static char [], because split takes
14814 a param array for args, so it was allocating
14816 - Do not store true in a hashtable, it boxes.
14818 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
14820 * flowanalysis.cs: bytify common enums.
14822 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
14824 * modifiers.cs: Add a new set of flags for the
14825 flags allowed on explicit interface impls.
14826 * cs-parser.jay: catch the use of modifiers in
14827 interfaces correctly.
14828 * class.cs: catch private void IFoo.Blah ().
14830 All related to bug #50572.
14832 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
14834 * decl.cs: Rewrite the consistant accessability checking.
14835 Accessability is not linear, it must be implemented in
14836 a tableish way. Fixes #49704.
14838 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
14840 * expression.cs: Handle negation in a checked context.
14841 We must use subtraction from zero. Fixes #38674.
14843 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
14845 * class.cs: Ignore static void main in DLLs.
14846 * rootcontext.cs: Handle the target type here,
14847 since we are have to access it from class.cs
14848 * driver.cs: account for the above.
14850 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
14852 * report.cs: Give line numbers and files if available.
14854 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
14856 * driver.cs: Implement /addmodule.
14858 * typemanager.cs: Change 'modules' field so it now contains Modules not
14861 2003-12-20 Martin Baulig <martin@ximian.com>
14863 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
14864 (FieldBase.IsAssigned): Removed this field.
14865 (FieldBase.SetAssigned): New public method.
14866 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
14868 2003-12-20 Martin Baulig <martin@ximian.com>
14870 * expression.cs (LocalVariableReference.DoResolve): Don't set
14871 `vi.Used' if we're called from DoResolveLValue().
14873 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
14874 returns the usage vector it just merged into the current one -
14875 pass this one to UsageWarning().
14876 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
14877 of the `EmitContext', don't call this recursively on our children.
14879 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
14881 * driver.cs: Implement /target:module.
14883 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
14885 * support.cs (CharArrayHashtable): New helper class.
14887 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
14888 char arrays, not strings, so we can avoid creating a string in
14889 consume_identifier if the identifier is a keyword.
14891 2003-12-16 Martin Baulig <martin@ximian.com>
14893 * statement.cs (LocalInfo.Assigned): Removed this property.
14894 (LocalInfo.Flags): Removed `Assigned'.
14895 (LocalInfo.IsAssigned): New public method; takes the EmitContext
14896 and uses flow analysis.
14897 (Block.UsageWarning): Made this method private.
14898 (Block.Resolve): Call UsageWarning() if appropriate.
14900 * expression.cs (LocalVariableReference.DoResolve): Always set
14901 LocalInfo.Used here.
14903 2003-12-13 Martin Baulig <martin@ximian.com>
14905 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
14906 any value here; we're now using flow analysis to figure out
14907 whether a statement/block returns a value.
14909 2003-12-13 Martin Baulig <martin@ximian.com>
14911 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
14913 (FlowBranching.MergeFinally): Don't call
14914 `branching.CheckOutParameters()' here, this is called in
14916 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
14917 when adding the `finally' vector.
14919 2003-12-13 Martin Baulig <martin@ximian.com>
14922 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
14923 actually work and also fix #48962.
14925 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
14927 * decl.cs: Do not check System.Object for nested types,
14928 since we know it does not have any. Big bang for buck:
14931 Run 1: 8.35 seconds
14932 Run 2: 8.32 seconds
14933 corlib: 17.99 seconds
14935 Run 1: 8.17 seconds
14936 Run 2: 8.17 seconds
14937 corlib: 17.39 seconds
14939 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
14941 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
14942 time we are returning 0 members, so we save alot here.
14944 2003-12-11 Martin Baulig <martin@ximian.com>
14946 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
14947 `MergeChild()', also just take the `FlowBranching' as argument;
14948 call Merge() on it and return the result.
14949 (FlowBranching.Merge): We don't need to do anything if we just
14952 2003-12-11 Martin Baulig <martin@ximian.com>
14954 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
14955 them in an `ArrayList' to reduce memory usage. Thanks to Ben
14956 Maurer for this idea.
14958 2003-12-11 Martin Baulig <martin@ximian.com>
14960 * flowanalysis.cs (MergeResult): This class is now gone; we now
14961 use the `UsageVector' for this. The reason for this is that if a
14962 branching just has one sibling, we don't need to "merge" them at
14963 all - that's the next step to do.
14964 (FlowBranching.Merge): We now return a `UsageVector' instead of a
14967 2003-12-11 Martin Baulig <martin@ximian.com>
14969 Reworked flow analyis and made it more precise and bug-free. The
14970 most important change is that we're now using a special `Reachability'
14971 class instead of having "magic" meanings of `FlowReturns'. I'll
14972 do some more cleanups and optimizations and also add some more
14973 documentation this week.
14975 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
14976 largely reworked this class.
14977 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
14978 the new `Reachability' class instead of having "magic" values here.
14979 (FlowBranching): We're now using an instance of `Reachability'
14980 instead of having separate `Returns', `Breaks' etc. fields.
14982 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
14983 based on flow analysis; ignore the return value of block.Emit ().
14985 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
14987 * driver.cs typemanager.cs: Find the mono extensions to corlib even
14988 if they are private.
14990 2003-12-09 Martin Baulig <martin@ximian.com>
14992 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
14993 call them directly on the UsageVector.
14995 2003-12-09 Martin Baulig <martin@ximian.com>
14997 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
14998 Changed return type from `FlowReturns' to `Reachability'.
15000 2003-12-09 Martin Baulig <martin@ximian.com>
15002 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
15003 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
15004 `Reachable' fields with a single `Reachability' one.
15006 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15008 * class.cs (FindMembers): Remove foreach's.
15013 Run 1: 8.74 seconds
15014 Run 2: 8.71 seconds
15017 Run 1: 8.64 seconds
15018 Run 2: 8.58 seconds
15021 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15026 This patch does a few things:
15027 1. EmptyStatement is now a singleton, so it is never reallocated.
15028 2. All blah is EmptyStatement constructs have been changed to
15029 blah == EmptyStatement.Value, which is much faster and valid
15030 now that EmptyStatement is a singleton.
15031 3. When resolving a block, rather than allocating a new array for
15032 the non-empty statements, empty statements are replaced with
15033 EmptyStatement.Value
15034 4. Some recursive functions have been made non-recursive.
15035 Mainly the performance impact is from (3), however (1) and (2) are needed for
15036 this to work. (4) does not make a big difference in normal situations, however
15037 it makes the profile look saner.
15042 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15043 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15044 Total memory allocated: 56397 KB
15047 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
15048 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
15049 Total memory allocated: 55666 KB
15051 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15053 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
15054 than the hashtable in a hashtable version
15056 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
15057 we always end up concating a string. This results in a huge perf
15058 loss, because many strings have to be tracked by the GC. In this
15059 patch, we first use a hashtable that works with two keys, so that
15060 the strings do not need to be concat'ed.
15064 Run 1: 8.74 seconds
15065 Run 2: 8.71 seconds
15068 Run 1: 8.65 seconds
15069 Run 2: 8.56 seconds
15071 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15073 * Makefile: Add a new target `do-time' that does a quick and simple
15074 profile, leaving easy to parse output.
15076 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
15078 * codegen.cs (Init): Create the dynamic assembly with
15079 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
15081 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
15083 * support.cs: Make the PtrHashtable use only one
15084 instance of its comparer.
15086 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
15088 * typemanager.cs: Fix lookup of GetNamespaces.
15090 2003-11-29 Miguel de Icaza <miguel@ximian.com>
15092 * expression.cs: Removed redundant line.
15094 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
15095 ArrayLists, use for loops with bounds.
15097 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
15100 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
15101 arraylists, use for loop with bounds.
15103 The above three changes give us a 0.071 second performance
15104 improvement out of 3.294 seconds down to 3.223. On my machine
15105 the above changes reduced the memory usage by 1,387 KB during
15106 compiler bootstrap.
15108 * cs-parser.jay (QualifiedIdentifier): New class used to represent
15109 QualifiedIdentifiers. Before we created a new string through
15110 concatenation, and mostly later on, the result would be
15111 manipulated by DecomposeQI through string manipulation.
15113 This reduced the compiler memory usage for bootstrapping from
15114 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
15115 compile times in 0.05 seconds.
15117 2003-11-28 Dick Porter <dick@ximian.com>
15119 * support.cs: Do string compares with the Invariant culture.
15127 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
15128 the comparison is done with the Invariant culture.
15130 2003-11-27 Miguel de Icaza <miguel@ximian.com>
15132 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
15133 GetEnumerator method.
15135 (ProbeCollectionType): Iterate starting at the most specific type
15136 upwards looking for a GetEnumerator
15138 * expression.cs: Shift count can be up to 31 for int/uint and 63
15141 2003-11-26 Miguel de Icaza <miguel@ximian.com>
15143 * statement.cs (Block.LookupLabel): Also look for the label on the
15144 children blocks. Use a hash table to keep track of visited
15147 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
15148 we actually did transform the other operand, otherwise fall back
15149 to the common codepath that casts to long.
15151 * cs-tokenizer.cs: Use the same code pattern as the int case.
15152 Maybe I should do the parsing myself, and avoid depending on the
15153 Parse routines to get this done.
15155 2003-11-25 Miguel de Icaza <miguel@ximian.com>
15157 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
15158 which fixes bug 51347. This time test it.
15160 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
15161 attributes for example can not tell the difference between these.
15162 The difference was only a syntax feature of the language.
15164 * attribute.cs: Apply attributes to delegates.
15166 * delegate.cs: Call the apply attributes method.
15168 2003-11-24 Miguel de Icaza <miguel@ximian.com>
15170 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
15171 comparing 0 vs Byte.MinValue, not the value
15173 (ImplicitConversionRequired): When reporting a conversion error,
15174 use error 31 to print out the constant error instead of the
15177 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
15178 which fixes bug 51347.
15180 2003-11-22 Miguel de Icaza <miguel@ximian.com>
15182 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
15183 which fixes the -warnaserror command line option.
15185 2003-11-21 Miguel de Icaza <miguel@ximian.com>
15187 * cfold.cs (DoNumericPromotions): During constant folding of
15188 additions on UIntConstant, special case intconstants with
15189 IntConstants like we do on the expression binary operator.
15191 2003-11-12 Miguel de Icaza <miguel@ximian.com>
15193 * convert.cs (ImplicitReferenceConversion): We were missing a case
15194 (System.Enum are not value types or class types, so we need to
15195 classify them separatedly).
15197 * driver.cs: We do not support error 2007.
15199 2003-11-12 Jackson Harper <jackson@ximian.com>
15201 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
15202 system directory. Also use the full file name so users can
15203 libraries names mscorlib-o-tron.dll in a non system dir.
15205 2003-11-10 Martin Baulig <martin@ximian.com>
15207 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
15208 (TypeManager.InitCoreTypes): Initialize them here, but instead of
15209 calling `ResolveType()' on them, directly assign their `Type'.
15211 2003-11-08 Martin Baulig <martin@ximian.com>
15213 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
15214 return value and the `out parent' parameter.
15215 (TypeContainer.DefineType): Moved the CS0644 check into
15216 GetClassBases(). Don't pass the interface types to the
15217 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
15218 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
15220 * ecore.cs (TypeExpr.IsAttribute): New property.
15221 (TypeExpr.GetInterfaces): New method.
15223 * interface.cs (Interface.GetInterfaceTypeByName): Return a
15224 TypeExpr instead of a Type.
15225 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
15226 (Interface.DefineType): Don't pass the interface types to the
15227 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
15228 them later and then call `TypeBulider.AddInterfaceImplementation()'.
15230 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
15231 instead of a `Type[]'.
15232 (TypeManager.RegisterBuilder): Likewise.
15233 (TypeManager.AddUserInterface): Likewise.
15234 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
15235 `Type[]' and also return a `TypeExpr[]'.
15236 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
15238 2003-11-08 Martin Baulig <martin@ximian.com>
15240 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
15243 2003-11-08 Martin Baulig <martin@ximian.com>
15245 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
15246 TypeManager.ResolveExpressionTypes().
15248 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
15249 instead of an Expression.
15250 (TypeExpr): This is now an abstract base class for `TypeExpression'.
15251 (TypeExpression): New public class; formerly known as `TypeExpr'.
15253 * expression.cs (ComposedCast): Derive from TypeExpr.
15255 * typemanager.cs (TypeManager.system_*_expr): These are now
15256 TypExpr's instead of Expression's.
15257 (TypeManager.ResolveExpressionTypes): New public static function;
15258 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
15261 2003-11-06 Miguel de Icaza <miguel@ximian.com>
15263 * expression.cs (New.DoResolve): Do not dereference value that
15264 might be a null return.
15266 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
15267 sure that the constant value has the right type. Fixes an
15268 unreported bug, similar to 50425.
15270 * const.cs (Const.LookupConstantValue): Call
15271 ImplicitStandardConversionExists before doing a conversion to
15272 avoid havng the TypeManager.ChangeType do conversions.
15274 Reduced the number of casts used
15276 (Const.ChangeType): New routine to enable reuse of the constant
15277 type changing code from statement.
15279 * typemanager.cs (ChangeType): Move common initialization to
15280 static global variables.
15284 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
15285 every value type to go through, even if it was void. Fix that.
15287 * cs-tokenizer.cs: Use is_identifier_start_character on the start
15288 character of the define, and the is_identifier_part_character for
15289 the rest of the string.
15291 2003-11-05 Miguel de Icaza <miguel@ximian.com>
15293 * expression.cs (UnaryMutator.EmitCode): When I updated
15294 LocalVariableReference.DoResolve, I overdid it, and dropped an
15295 optimization done on local variable references.
15297 2003-11-04 Miguel de Icaza <miguel@ximian.com>
15299 * ecore.cs: Convert the return from Ldlen into an int.
15301 2003-10-20 Miguel de Icaza <miguel@ximian.com>
15303 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
15304 the accessibility, this is a special case for toplevel non-public
15305 classes (internal for instance).
15307 2003-10-20 Nick Drochak <ndrochak@gol.com>
15309 * ecore.cs: Fix typo and build. Needed another right paren.
15311 2003-10-19 Miguel de Icaza <miguel@ximian.com>
15313 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
15314 `internal' case regular and protected, but not allowing protected
15315 to be evaluated later. Bug 49840
15317 2003-10-15 Miguel de Icaza <miguel@ximian.com>
15319 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
15320 to kb.Nlast, and not the kb.nFirst to isolate the switch
15323 Extract the underlying type, so enumerations of long/ulong are
15324 treated like long/ulong.
15326 2003-10-14 Miguel de Icaza <miguel@ximian.com>
15328 * expression.cs (New): Overload the meaning of RequestedType to
15329 track the possible creation of the NewDelegate type, since
15330 DoResolve is invoked more than once for new constructors on field
15333 See bugs: #48800 and #37014
15335 * cs-parser.jay (declare_local_constants): Take an arraylist
15336 instead of a single constant.
15338 (local_constant_declaration): It should take a
15339 constant_declarators, not a constant_declarator. Fixes 49487
15341 * convert.cs: Fix error report.
15343 2003-10-13 Jackson Harper <jackson@ximian.com>
15345 * typemanager.cs (TypeToCoreType): Add float and double this fixes
15348 2003-10-09 Martin Baulig <martin@ximian.com>
15350 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
15352 (MethodCore.DoDefineParameters): Removed the TypeContainer
15353 argument; use the DeclSpace which was passed to the .ctor instead.
15354 (MethodCore.CheckParameter): Take a DeclSpace instead of a
15355 TypeContainer; we only need a DeclSpace here.
15357 2003-10-09 Martin Baulig <martin@ximian.com>
15359 * class.cs (MethodData): Added additional `DeclSpace ds' argument
15361 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
15362 EmitContext's .ctor.
15364 2003-10-09 Martin Baulig <martin@ximian.com>
15366 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
15367 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
15368 AsAccessible(), moved them as well.
15370 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
15372 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
15374 * cs-parser.jay : Renamed yyName to yyNames related to jay.
15376 2003-10-07 Miguel de Icaza <miguel@ximian.com>
15378 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
15379 generation for >=, as spotted by Paolo, bug 48679.
15380 Patch from David Waite.
15382 * cs-tokenizer.cs: Add handling for #pragma.
15384 * cs-parser.jay: Allow for both yield and yield return in the
15385 syntax. The anti-cobolization of C# fight will go on!
15387 * class.cs (TypeBuilder.DefineType): Catch error condition here
15388 (Parent.DefineType erroring out and returning null).
15390 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15391 coping with enumerations variables, we were mistakenly processing
15392 them as a regular value type instead of built-in types. Fixes the
15395 * typemanager.cs (IsBuiltinOrEnum): New method.
15397 2003-09-30 Miguel de Icaza <miguel@ximian.com>
15399 * cs-parser.jay: Upgrade: yield now needs the return clause.
15401 2003-09-19 Martin Baulig <martin@ximian.com>
15403 * decl.cs (MemberCache.SetupCacheForInterface): Take a
15404 `MemberCache parent' argument. Normally, an interface doesn't
15405 have a parent type except System.Object, but we use this in gmcs
15406 for generic type parameters.
15408 2003-09-18 Martin Baulig <martin@ximian.com>
15410 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
15411 on `type.IsInterface'; don't check whether the type has a parent
15412 to determine whether it's an interface.
15414 2003-09-15 Martin Baulig <martin@ximian.com>
15416 * class.cs (TypeContainer.DefineType): Added an error flag to
15417 avoid reporting duplicate CS0146's ("class definition is
15420 * driver.cs (Driver.MainDriver): Abort if
15421 RootContext.ResolveTree() reported any errors.
15423 2003-09-07 Martin Baulig <martin@ximian.com>
15425 * report.cs (Error, Warning): Added overloaded versions which take
15426 a `params object[] args' and call String.Format().
15428 2003-09-07 Martin Baulig <martin@ximian.com>
15430 * decl.cs (DeclSpace..ctor): Don't call
15431 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
15432 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
15433 (DeclSpace.RecordDecl): New method.
15435 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
15437 2003-09-02 Ravi Pratap <ravi@ximian.com>
15439 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
15440 value attributes to be applied to ParameterBuilders.
15442 * class.cs (MethodCore.LabelParameters): Make static and more
15443 generic so that it can be used from other places - like interface
15444 methods, for instance.
15446 * interface.cs (Interface.Emit): Call LabelParameters before
15447 emitting attributes on the InterfaceMethod.
15449 2003-08-26 Martin Baulig <martin@ximian.com>
15451 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
15452 resolving aliases; fixes #47927.
15454 2003-08-26 Martin Baulig <martin@ximian.com>
15456 * statement.cs (Using.DoResolve): This is internally emitting a
15457 try/finally clause, so we need to set ec.NeedExplicitReturn if we
15458 do not always return. Fixes #47681.
15460 2003-08-26 Martin Baulig <martin@ximian.com>
15462 * decl.cs (MemberCore): Moved WarningNotHiding(),
15463 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
15465 (AdditionResult): Make this nested in DeclSpace.
15466 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
15467 argument; call NamespaceEntry.Define() unless we're nested in a
15470 * namespace.cs (Namespace.DefineName): New public function. This
15471 is called from DeclSpace's .ctor to add
15472 (Namespace.Lookup): Include DeclSpaces in the lookup.
15474 * class.cs (Operator): Derive from MemberBase, not MemberCore.
15476 * const.cs (Const): Derive from MemberBase, not MemberCore.
15478 2003-08-25 Martin Baulig <martin@ximian.com>
15480 * convert.cs (Convert.ExplicitReferenceConversion): When
15481 converting from an interface type to a class, unbox if the target
15482 type is a struct type. Fixes #47822.
15484 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15486 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
15489 2003-08-22 Martin Baulig <martin@ximian.com>
15491 * class.cs (TypeManager.DefineType): When defining a nested type,
15492 call DefineType() on our parent; fixes #47801.
15494 2003-08-22 Martin Baulig <martin@ximian.com>
15496 * class.cs (MethodData.Define): While checking if a method is an
15497 interface implementation, improve the test a bit more to fix #47654.
15499 2003-08-22 Martin Baulig <martin@ximian.com>
15501 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
15502 correctly; fixes #47722.
15504 2003-08-22 Martin Baulig <martin@ximian.com>
15506 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
15507 LocalVariableReference, ensure it's not read-only. Fixes #47536.
15509 * statement.cs (Fixed.DoResolve): Make all variables read-only.
15511 2003-08-22 Martin Baulig <martin@ximian.com>
15513 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
15514 can only be assigned in static constructors. Fixes #47161.
15516 2003-08-22 Martin Baulig <martin@ximian.com>
15518 Rewrote and improved the flow analysis code.
15520 * flowbranching.cs (FlowBranching): Make this class abstract.
15521 (FlowBranching.CreateBranching): New static function to create a
15522 new flow branching.
15523 (FlowBranchingBlock, FlowBranchingException): New classes.
15524 (FlowBranching.UsageVector.Type): New public readonly field.
15525 (FlowBranching.UsageVector.Breaks): Removed the setter.
15526 (FlowBranching.UsageVector.Returns): Removed the setter.
15527 (FlowBranching.UsageVector): Added Break(), Return(),
15528 NeverReachable() and Throw() methods to modify the reachability.
15529 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
15530 done by FlowBranching.Merge().
15531 (FlowBranching.UsageVector.MergeChild): New method; merges the
15532 merge result into the current vector.
15533 (FlowBranching.Merge): New abstract method to merge a branching.
15535 2003-08-12 Martin Baulig <martin@ximian.com>
15537 * expression.cs (Indirection.CacheTemporaries): Create the
15538 LocalTemporary with the pointer type, not its element type.
15540 2003-08-10 Miguel de Icaza <miguel@ximian.com>
15542 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
15543 token was a keyword or not.
15545 Add `error' options where an IDENTIFIER was expected; Provide
15546 CheckToken and CheckIdentifierToken convenience error reporting
15549 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
15551 * decl.cs: Rename `NamespaceEntry Namespace' public field into
15552 NameSpaceEntry NameSpaceEntry.
15554 (LookupInterfaceOrClass): Avoid creating a full qualified name
15555 from namespace and name: avoid doing lookups when we know the
15556 namespace is non-existant. Use new Tree.LookupByNamespace which
15557 looks up DeclSpaces based on their namespace, name pair.
15559 * driver.cs: Provide a new `parser verbose' to display the
15560 exception thrown during parsing. This is turned off by default
15561 now, so the output of a failure from mcs is more graceful.
15563 * namespace.cs: Track all the namespaces defined in a hashtable
15566 (IsNamespace): New method
15568 2003-08-09 Miguel de Icaza <miguel@ximian.com>
15570 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
15571 we know that we need to concatenate (full typename can never be
15576 * statement.cs: Use a bitfield; Do not initialize to null things
15577 which are done by the constructor by default.
15579 * cs-parser.jay: bug fix, parameter was 4, not 3.
15581 * expression.cs: Just use the property;
15583 * statement.cs: No need for GetVariableInfo method.
15585 2003-08-08 Martin Baulig <martin@ximian.com>
15587 * flowanalysis.cs (FlowReturns): This is now nested in the
15588 `FlowBranching' class.
15589 (MyBitVector): Moved this here from statement.cs.
15590 (FlowBranching.SiblingType): New enum type.
15591 (FlowBranching.CreateSibling): Added `SiblingType' argument.
15593 2003-08-07 Martin Baulig <martin@ximian.com>
15595 * flowanalysis.cs (FlowBranchingType): This is now nested in the
15596 `FlowBranching' class and called `BranchingType'.
15598 2003-08-07 Martin Baulig <martin@ximian.com>
15600 * flowanalysis.cs: Moved all the control flow analysis code into
15603 2003-08-07 Martin Baulig <martin@ximian.com>
15605 * assign.cs (Assign.DoResolve): `target' must either be an
15606 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
15609 2003-08-07 Miguel de Icaza <miguel@ximian.com>
15611 * expression.cs (BinaryMethod): This kind of expression is created by the
15612 Binary class if it determines that the operator has to be handled
15615 (BinaryDelegate): This kind of expression is created if we are
15616 dealing with a + or - operator on delegates.
15618 (Binary): remove method, argumetns, and DelegateOperator: when
15619 dealing with methods,
15621 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
15623 * statement.cs (Block): use bitfields for the three extra booleans
15624 we had in use. Remove unused topblock parameter.
15626 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
15628 * assign.cs: Drop extra unneeded tests.
15630 2003-08-06 Miguel de Icaza <miguel@ximian.com>
15632 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
15634 * statement.cs (Foreach): Use VariableStorage instead of
15637 * codegen.cs (VariableStorage): New class used by clients that
15638 require a variable stored: locals or fields for variables that
15639 need to live across yield.
15641 Maybe provide a convenience api for EmitThis+EmitLoad?
15643 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
15646 2003-08-05 Miguel de Icaza <miguel@ximian.com>
15648 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
15649 RemapParameterLValue): New methods that are used to turn a
15650 precomputed FieldInfo into an expression like this:
15654 The idea is to use this instead of making LocalVariableReference
15655 have more than one meaning.
15657 * cs-parser.jay: Add error production to BASE.
15659 * ecore.cs: Deal with TypeManager.GetField returning null, which
15660 is now a valid return value.
15662 (FieldExprNoAddress): New expression for Fields whose address can
15665 * expression.cs (LocalVariableReference): During the resolve
15666 phases, create new expressions if we are in a remapping context.
15667 Remove code that dealt with remapping here.
15669 (ParameterReference): same.
15671 (ProxyInstance): New expression, like the `This' expression, but
15672 it is born fully resolved. We know what we are doing, so remove
15673 the errors that are targeted to user-provided uses of `this'.
15675 * statement.cs (Foreach): our variable is now stored as an
15676 Expression; During resolution, follow the protocol, dont just
15677 assume it will return this.
15679 2003-08-06 Martin Baulig <martin@ximian.com>
15681 * support.cs (SeekableStreamReader.cs): New public class.
15683 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
15684 SeekableStreamReader instead of the normal StreamReader.
15686 2003-08-04 Martin Baulig <martin@ximian.com>
15688 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
15689 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
15690 deambiguate casts and delegate invocations.
15691 (parenthesized_expression): Use the new tokens to ensure this is
15692 not a cast of method invocation.
15694 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
15695 when reading a `)' and Deambiguate_CloseParens () was previously
15698 * expression.cs (ParenthesizedExpression): New class. This is
15699 just used for the CS0075 test.
15700 (Binary.DoResolve): Check for CS0075.
15702 2003-07-29 Ravi Pratap <ravi@ximian.com>
15704 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
15705 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
15706 reference comparison.
15708 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
15709 examine the ReturnType for equality - this is necessary in the
15710 cases of implicit and explicit operators whose signature also
15711 includes the return type.
15713 2003-07-26 Miguel de Icaza <miguel@ximian.com>
15715 * namespace.cs: Cache the result of the namespace computation,
15716 instead of computing it every time.
15718 2003-07-24 Miguel de Icaza <miguel@ximian.com>
15720 * decl.cs: Use a global arraylist that we reuse over invocations
15721 to avoid excesive memory consumption. Reduces memory usage on an
15722 mcs compile by one meg (45 average).
15724 * typemanager.cs (LookupTypeReflection): In .NET pointers are
15725 private, work around that.
15727 2003-07-23 Miguel de Icaza <miguel@ximian.com>
15729 * literal.cs (IntLiteral): Define Zero and One static literals.
15731 * cs-parser.jay (integer_literal): use static literals to reduce
15732 memory usage for the most used literals (0, 1 and -1). 211kb
15733 reduced in memory usage.
15735 Replace all calls to `new ArrayList' with `new
15736 ArrayList(4)' which is a good average number for most allocations,
15737 and also requires only 16 bytes of memory for its buffer by
15740 This reduced MCS memory usage in seven megabytes for the RSS after
15743 2003-07-28 Ravi Pratap <ravi@ximian.com>
15745 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
15746 handle params methods the correct way by forming only one
15747 applicable set with params and normal methods in them. Earlier we
15748 were looking at params methods only if we found no normal methods
15749 which was not the correct thing to do.
15751 (Invocation.BetterFunction): Take separate arguments indicating
15752 when candidate and the best method are params methods in their
15755 This fixes bugs #43367 and #46199.
15757 * attribute.cs: Documentation updates.
15759 (CheckAttribute): Rename to CheckAttributeTarget.
15760 (GetValidPlaces): Rename to GetValidTargets.
15762 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
15763 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
15767 2003-07-28 Martin Baulig <martin@ximian.com>
15769 * class.cs (TypeContainer.DefineMembers): Use the base type's full
15770 name when looking up the base class of a nested class. Fixes #46977.
15772 2003-07-26 Martin Baulig <martin@ximian.com>
15774 * expression.cs (Indexers.Indexer): New nested struct; contains
15775 getter, setter and the indexer's type.
15776 (Indexers.Properties): This is now an ArrayList of
15777 Indexers.Indexer's.
15778 (IndexerAccess.DoResolveLValue): Correctly set the type if the
15779 indexer doesn't have any getters.
15781 * assign.cs (Assign.DoResolve): Also do the implicit conversions
15782 for embedded property and indexer assignments.
15784 2003-07-26 Martin Baulig <martin@ximian.com>
15786 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
15787 preprocessor directive is not the first non-whitespace character
15790 2003-07-26 Martin Baulig <martin@ximian.com>
15792 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
15793 namespace parsing, follow the spec more closely.
15795 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
15796 NamespaceEntry.Lookup().
15798 2003-07-25 Martin Baulig <martin@ximian.com>
15800 * MethodCore.cs (OverridesSomething): New public field; it's set
15801 from TypeContainer.DefineMembers if this method overrides
15802 something (which doesn't need to be a method). Fix #39462.
15804 2003-07-25 Ravi Pratap <ravi@ximian.com>
15806 * typemanager.cs (GetMembers): Ensure that the list of members is
15807 reversed. This keeps things in sync.
15809 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
15810 find an AttributeUsage attribute.
15812 * expression.cs (Invocation.OverloadResolve): Perform the check
15813 which disallows Invoke to be directly called on a Delegate.
15815 (Error_InvokeOnDelegate): Report error cs1533.
15817 2003-07-25 Martin Baulig <martin@ximian.com>
15819 * expression.cs (Indexers.GetIndexersForType): Only look in the
15820 interface hierarchy if the requested type is already an
15821 interface. Fixes #46788 while keeping #46502 fixed.
15823 2003-07-25 Martin Baulig <martin@ximian.com>
15825 * class.cs (TypeContainer.DefineMembers): Check whether all
15826 readonly fields have been assigned and report warning CS0649 if
15829 * statement.cs (LocalInfo.IsFixed): Always return true if this is
15832 2003-07-24 Ravi Pratap <ravi@ximian.com>
15834 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
15835 returned from GetMethods to make things consistent with the
15836 assumptions MCS makes about ordering of methods.
15838 This should comprehensively fix bug #45127 and it does :-)
15840 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
15841 ordering is actually reverse.
15843 * Clean up some debug messages I left lying around.
15845 * interface.cs (Populate*): Get rid of code which emits attributes
15846 since the stage in which we emit attributes is the 'Emit' stage,
15847 not the define stage.
15849 (Emit): Move attribute emission for interface members here.
15851 2003-07-22 Ravi Pratap <ravi@ximian.com>
15853 * expression.cs (Invocation.OverloadResolve): Follow the spec more
15854 closely: we eliminate methods in base types when we have an
15855 applicable method in a top-level type.
15857 Please see section 14.5.5.1 for an exact description of what goes
15860 This fixes bug #45127 and a host of other related to corlib compilation.
15862 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
15863 array is the method corresponding to the top-level type (this is
15864 because of the changes made to icall.c) so we change this
15867 (MethodGroupExpr.Name): This too.
15869 * typemanager.cs (GetElementType): New method which does the right
15870 thing when compiling corlib.
15872 * everywhere: Make use of the above in the relevant places.
15874 2003-07-22 Martin Baulig <martin@ximian.com>
15876 * cs-parser.jay (invocation_expression): Moved
15877 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
15878 `cast_expression', but create a InvocationOrCast which later
15879 resolves to either an Invocation or a Cast.
15881 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
15882 method; call this before EmitStatement() to make sure that this
15883 expression can be used as a statement.
15885 * expression.cs (InvocationOrCast): New class; resolves to either
15886 an Invocation or a Cast.
15888 * statement.cs (StatementExpression): Call ResolveStatement() on
15889 the ExpressionStatement before emitting it.
15891 2003-07-21 Martin Baulig <martin@ximian.com>
15893 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
15894 `ref' and `out' attributes match; fixes #46220.
15895 (MemberAccess.ResolveMemberAccess): You can't reference a type
15896 through an expression; fixes #33180.
15897 (Indexers.GetIndexersForType): Don't return the indexers from
15898 interfaces the class implements; fixes #46502.
15900 2003-07-21 Martin Baulig <martin@ximian.com>
15902 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
15903 CS0661 checks; fixes bug #30442.
15905 2003-07-21 Martin Baulig <martin@ximian.com>
15907 * decl.cs (AdditionResult): Added `Error'.
15909 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
15911 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
15912 makes cs0031.cs actually work.
15914 2003-07-20 Martin Baulig <martin@ximian.com>
15916 * namespace.cs: Fixed that bug which caused a crash when compiling
15917 the debugger's GUI.
15919 2003-07-20 Miguel de Icaza <miguel@ximian.com>
15921 * typemanager.cs (LookupTypeReflection): Never expose types which
15922 are NotPublic, NestedPrivate, NestedAssembly, or
15923 NestedFamANDAssem. We used to return these, and later do a check
15924 that would report a meaningful error, but the problem is that we
15925 would not get the real match, if there was a name override.
15927 2003-07-18 Miguel de Icaza <miguel@ximian.com>
15929 * namespace.cs (Namespace, Name): Do not compute the namespace
15930 name dynamically, compute it in the constructor. This reduced
15931 memory usage by 1697 KB.
15933 * driver.cs: Use --pause to pause at the end.
15935 2003-07-17 Peter Williams <peter@newton.cx>
15937 * Makefile: Change the name of the test target so that it doesn't
15938 conflict with the recursive test target.
15940 2003-07-17 Miguel de Icaza <miguel@ximian.com>
15942 * expression.cs (LocalVariableReference.Emit, EmitAssign,
15943 AddressOf): Do not use EmitThis, that was wrong, use the actual
15946 2003-07-15 Miguel de Icaza <miguel@ximian.com>
15948 * class.cs (MethodData.Define): While checking if a method is an
15949 interface implementation, improve the test: If we are not public
15950 (use new test here: use the computed MethodAttributes directly,
15951 instead of the parsed modifier flags) check if the `implementing'
15952 method comes from an interface or not.
15954 * pending.cs (VerifyPendingMethods): Slightly better error
15957 * makefile: add test target that does the mcs bootstrap.
15959 2003-07-16 Ravi Pratap <ravi@ximian.com>
15961 * interface.cs (Define): Do nothing here since there are no
15962 members to populate etc. Move the attribute emission out of here
15963 since this was just totally the wrong place to put it. Attribute
15964 application happens during the 'Emit' phase, not in the 'Define'
15967 (Emit): Add this method and move the attribute emission here
15969 * rootcontext.cs (EmitCode): Call the Emit method on interface
15972 2003-07-14 Ravi Pratap M <ravi@ximian.com>
15974 * expression.cs (OverloadResolve): Report error only if Location
15975 is not 'Null' which means that there was a probe going on.
15977 2003-07-14 Martin Baulig <martin@ximian.com>
15979 * expression.cs (ConditionalLogicalOperator): New public class to
15980 implement user defined conditional logical operators.
15981 This is section 14.11.2 in the spec and bug #40505.
15983 2003-07-14 Martin Baulig <martin@ximian.com>
15985 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
15987 2003-07-14 Martin Baulig <martin@ximian.com>
15989 * codegen.cs (EmitContext.InFixedInitializer): New public field.
15991 * ecore.cs (IVariable.VerifyFixed): New interface method.
15993 * expression.cs (Unary.ResolveOperator): When resolving the `&'
15994 operator, check whether the variable is actually fixed. Fixes bug
15995 #36055. Set a variable definitely assigned when taking its
15996 address as required by the spec.
15998 * statement.cs (LocalInfo.IsFixed): New field.
15999 (LocalInfo.MakePinned): Set `IsFixed' to true.
16001 2003-07-14 Ravi Pratap M <ravi@ximian.com>
16003 * attribute.cs (Attribute.Resolve): While doing a Member lookup
16004 for .ctors, ensure that we only ask for members declared in the
16005 attribute type (BindingFlags.DeclaredOnly).
16009 * expression.cs (Error_WrongNumArguments): Report error 1501
16010 correctly the way CSC does.
16012 2003-07-13 Martin Baulig <martin@ximian.com>
16014 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
16015 lookup on the fully qualified name, to make things like "X.X" work
16016 where "X.X" is a fully qualified type name, but we also have a
16017 namespace "X" in the using list. Fixes #41975.
16019 2003-07-13 Martin Baulig <martin@ximian.com>
16021 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
16022 function. If we're a CompoundAssign, we need to create an embedded
16023 CompoundAssign, not an embedded Assign.
16024 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
16027 2003-07-13 Martin Baulig <martin@ximian.com>
16029 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
16030 work to fix bug #46088.
16032 2003-07-13 Ravi Pratap <ravi@ximian.com>
16034 * class.cs (Operator.Emit): Do not emit attributes here - it is
16035 taken care of by the Method class that we delegate too. This takes
16036 care of bug #45876.
16038 2003-07-10 Martin Baulig <martin@ximian.com>
16040 * expression.cs (TypeOfVoid): New class.
16041 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
16043 2003-07-10 Martin Baulig <martin@ximian.com>
16045 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
16048 2003-07-10 Martin Baulig <martin@ximian.com>
16050 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
16051 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
16053 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
16055 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
16057 2003-07-10 Martin Baulig <martin@ximian.com>
16059 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
16060 of decimal. Fixes #42850.
16062 NOTE: I also fixed the created byte blob, but this doesn't work on
16063 the MS runtime and csc never produces any byte blobs for decimal
16066 2003-07-10 Martin Baulig <martin@ximian.com>
16068 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
16069 structs; fixes #32068.
16070 (Block.AddChildVariableNames): Fixed #44302.
16072 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16074 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
16076 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16078 * attribute.cs: And this test is onger needed.
16080 2003-07-08 Martin Baulig <martin@ximian.com>
16082 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
16083 inaccessible types. Fixes #36313.
16085 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
16087 * namespace.cs (NamespaceEntry): Create implicit entries for all
16088 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
16089 implicit entries for N1.N2 and N1.
16091 2003-07-08 Martin Baulig <martin@ximian.com>
16093 Rewrote the handling of namespaces to fix a lot of the issues
16094 wrt. `using' aliases etc.
16096 * namespace.cs (Namespace): Splitted this class into a
16097 per-assembly `Namespace' and a per-file `NamespaceEntry'.
16099 * typemanager.cs (TypeManager.IsNamespace): Removed.
16100 (TypeManager.ComputeNamespaces): Only compute namespaces from
16101 loaded assemblies here, not the namespaces from the assembly we're
16102 currently compiling.
16104 2003-07-08 Martin Baulig <martin@ximian.com>
16106 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
16108 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16110 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
16113 I thought about the memory savings here, but LookupTypeReflection
16114 is used under already very constrained scenarios. Compiling
16115 corlib or mcs only exposes one hit, so it would not really reduce
16116 any memory consumption.
16118 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16120 * typemanager.cs: fixes bug #45889 by only adding public types from
16121 other assemblies to the list of known types.
16123 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16125 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
16126 on the type we resolved.
16128 2003-07-05 Martin Baulig <martin@ximian.com>
16130 * pending.cs (PendingImplementation.ParentImplements): Don't
16131 create the proxy if the parent is abstract.
16133 * class.cs (TypeContainer.DefineIndexers): Process explicit
16134 interface implementations first. Fixes #37714.
16136 2003-07-04 Miguel de Icaza <miguel@ximian.com>
16138 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
16139 defined recursively; but since we modify the input parameters
16140 (left is set to `this' temporarily), we reset this value if the
16141 left_is_explicit is false, which gives the original semantics to
16144 * literal.cs (NullPointer): new class used to represent a null
16145 literal in a pointer context.
16147 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
16148 type is a pointer, use a NullPointer object instead of a
16149 NullLiteral. Closes 43687
16151 (ExplicitConversion): Convert pointer values using
16152 the conv opcode to the proper type.
16154 * ecore.cs (New): change ValueTypeVariable property into a method,
16155 that returns whether the valuetype is suitable for being used.
16157 * expression.cs (Binary.DoNumericPromotions): Only return if we
16158 the int constant was a valid uint, and we can return both left and
16159 right as uints. If not, we continue processing, to trigger the
16160 type conversion. This fixes 39018.
16162 * statement.cs (Block.EmitMeta): During constant resolution, set
16163 the CurrentBlock property on the emitcontext, so that we resolve
16164 constants propertly.
16166 2003-07-02 Martin Baulig <martin@ximian.com>
16168 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
16169 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
16171 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
16172 than emitting it here.
16174 * statement.cs: Fixed some more flow analysis bugs.
16176 2003-07-02 Martin Baulig <martin@ximian.com>
16178 * class.cs (MethodData.Define): When implementing interface
16179 methods, set Final unless we're Virtual.
16181 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
16182 check work for interface methods.
16184 2003-07-01 Martin Baulig <martin@ximian.com>
16186 * ecore.cs (EmitContext.This): Replaced this property with a
16187 GetThis() method which takes a Location argument. This ensures
16188 that we get the correct error location for a CS0188.
16190 2003-07-01 Miguel de Icaza <miguel@ximian.com>
16192 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
16193 ImplicitStandardConversion.
16195 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
16197 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
16199 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
16202 2003-06-30 Miguel de Icaza <miguel@ximian.com>
16204 * class.cs (Constructor.Define): Turn off initlocals for unsafe
16207 (MethodData.Define): Turn off initlocals for unsafe methods.
16209 2003-06-29 Miguel de Icaza <miguel@ximian.com>
16211 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
16212 complete; Fixes #37521.
16214 * delegate.cs: Use Modifiers.TypeAttr to compute the
16215 TypeAttributes, instead of rolling our own. This makes the flags
16216 correct for the delegates.
16218 2003-06-28 Miguel de Icaza <miguel@ximian.com>
16220 * class.cs (Constructor.Define): Set the private flag for static
16221 constructors as well.
16223 * cs-parser.jay (statement_expression): Set the return value to
16224 null, to avoid a crash when we catch an error.
16226 2003-06-24 Miguel de Icaza <miguel@ximian.com>
16228 * cs-parser.jay: Applied patch from Jackson that adds support for
16229 extern and unsafe modifiers to destructor declarations.
16231 * expression.cs: Report error 21 if the user is trying to index a
16234 * driver.cs: Add an error message, suggested by the bug report.
16236 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
16237 if we do not have a ": this ()" constructor initializer. Fixes 45149
16239 2003-06-14 Miguel de Icaza <miguel@ximian.com>
16241 * namespace.cs: Add some information to reduce FAQs.
16243 2003-06-13 Miguel de Icaza <miguel@ximian.com>
16245 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
16246 underlying enumeration types. Fixes #43915.
16248 * expression.cs: Treat ushort/short as legal values to be used in
16249 bitwise operations.
16251 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
16253 * delegate.cs: transfer custom attributes for paramenters from
16254 the delegate declaration to Invoke and BeginInvoke.
16256 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
16258 * attribute.cs: handle custom marshalers and emit marshal info
16261 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
16263 * makefile.gnu: Added anonymous.cs to the compiler sources.
16265 2003-05-28 Miguel de Icaza <miguel@ximian.com>
16267 * iterators.cs: Change the name of the proxy class to include two
16270 * cs-parser.jay: Update grammar to include anonymous methods.
16272 * anonymous.cs: new file.
16274 2003-05-27 Miguel de Icaza <miguel@ximian.com>
16276 * class.cs (Field.Define): Add missing test for pointers and
16279 2003-05-27 Ravi Pratap <ravi@ximian.com>
16281 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
16282 we use the stobj opcode.
16284 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
16285 since it wasn't the correct fix.
16287 It still is puzzling that we are required to use stobj for IntPtr
16288 which seems to be a ValueType.
16290 2003-05-26 Miguel de Icaza <miguel@ximian.com>
16292 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
16293 during regular simple name resolution. Now, the trick is that
16294 instead of returning for processing the simplename, we do a
16295 TypeManager.LookupType (ie, a rooted lookup as opposed to a
16296 contextual lookup type). If a match is found, return that, if
16297 not, return for further composition.
16299 This fixes long-standing 30485.
16301 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16302 using the address to initialize an object, do an Stobj instead of
16303 using the regular Stelem.
16305 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
16306 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
16307 Because if we are a BaseIndexerAccess that value will be true.
16310 * statement.cs (GotoCase.Resolve): Return after reporting an
16311 error, do not attempt to continue.
16313 * expression.cs (PointerArithmetic.Emit): If our operand is a
16314 long, convert our constants to match the operand before
16315 multiplying. Convert to I type before adding. Fixes 43670.
16317 2003-05-14 Ravi Pratap <ravi@ximian.com>
16319 * enum.cs (ImplicitConversionExists) : Rename to
16320 ImplicitEnumConversionExists to remove ambiguity.
16322 * ecore.cs (NullCast): New type of cast expression class which
16323 basically is very similar to EmptyCast with the difference being
16324 it still is a constant since it is used only to cast a null to
16326 (eg. (string) null)
16328 * convert.cs (ImplicitReferenceConversion): When casting a null
16329 literal, we return a NullCast.
16331 * literal.cs (NullLiteralTyped): Remove - I don't see why this
16332 should be around anymore.
16334 The renaming (reported was slightly wrong). Corrections:
16336 ConvertImplicitStandard -> ImplicitConversionStandard
16337 ConvertExplicitStandard -> ExplicitConversionStandard
16339 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
16340 before passing them in !
16342 * convert.cs (ImplicitConversionStandard): When comparing for
16343 equal expr and target types, ensure that expr is not a
16346 In general, we must not be checking (expr_type ==
16347 target_type) in the top level conversion methods
16348 (ImplicitConversion, ExplicitConversion etc). This checking is
16349 done in the methods that they delegate to.
16351 2003-05-20 Miguel de Icaza <miguel@ximian.com>
16353 * convert.cs: Move Error_CannotConvertType,
16354 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
16355 ImplicitNumericConversion, ImplicitConversionExists,
16356 ImplicitUserConversionExists, StandardConversionExists,
16357 FindMostEncompassedType, FindMostSpecificSource,
16358 FindMostSpecificTarget, ImplicitUserConversion,
16359 ExplicitUserConversion, GetConversionOperators,
16360 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
16361 TryImplicitIntConversion, Error_CannotConvertImplicit,
16362 ConvertImplicitRequired, ConvertNumericExplicit,
16363 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
16364 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
16367 Perform the following renames:
16369 StandardConversionExists -> ImplicitStandardConversionExists
16370 ConvertImplicit -> ImplicitConversion
16371 ConvertImplicitStandard -> ImplicitStandardConversion
16372 TryImplicitIntConversion -> ImplicitIntConversion
16373 ConvertImplicitRequired -> ImplicitConversionRequired
16374 ConvertNumericExplicit -> ExplicitNumericConversion
16375 ConvertReferenceExplicit -> ExplicitReferenceConversion
16376 ConvertExplicit -> ExplicitConversion
16377 ConvertExplicitStandard -> ExplicitStandardConversion
16379 2003-05-19 Martin Baulig <martin@ximian.com>
16381 * statement.cs (TypeInfo.StructInfo): Made this type protected.
16382 (TypeInfo): Added support for structs having structs as fields.
16384 * ecore.cs (FieldExpr): Implement IVariable.
16385 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
16386 VariableInfo for the field.
16388 2003-05-18 Martin Baulig <martin@ximian.com>
16390 * expression.cs (This.DoResolve): Report a CS0027 if we're
16391 emitting a field initializer.
16393 2003-05-18 Martin Baulig <martin@ximian.com>
16395 * expression.cs (This.ResolveBase): New public function.
16396 (This.DoResolve): Check for CS0188.
16398 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
16401 * ecore.cs (MethodGroupExpr.DoResolve): Set the
16402 `instance_expression' to null if we don't have any non-static
16405 2003-05-18 Martin Baulig <martin@ximian.com>
16407 Reworked the way how local variables and parameters are handled by
16408 the flow analysis code.
16410 * statement.cs (TypeInfo, VariableMap): New public classes.
16411 (VariableInfo): New public class. This is now responsible for
16412 checking whether a variable has been assigned. It is used for
16413 parameters and local variables.
16414 (Block.EmitMeta): Take the InternalParameters as argument; compute
16415 the layout of the flow vectors here.
16416 (Block.LocalMap, Block.ParameterMap): New public properties.
16417 (FlowBranching): The .ctor doesn't get the InternalParameters
16418 anymore since Block.EmitMeta() now computes the layout of the flow
16420 (MyStructInfo): This class is now known as `StructInfo' and nested
16421 in `TypeInfo'; we don't access this directly anymore.
16423 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
16424 property and removed IsAssigned(), IsFieldAssigned(),
16425 SetAssigned() and SetFieldAssigned(); we now call them on the
16426 VariableInfo so we don't need to duplicate this code everywhere.
16428 * expression.cs (ParameterReference): Added `Block block' argument
16430 (LocalVariableReference, ParameterReference, This): The new
16431 VariableInfo class is now responsible for all the definite
16434 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
16435 IsParameterAssigned, SetParameterAssigned): Removed.
16437 2003-05-18 Martin Baulig <martin@ximian.com>
16439 * typemanager.cs (InitCoreTypes): Try calling
16440 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
16441 the 3-args-version. Corlib now also needs our `void_type'.
16442 (GetMethod): Added overloaded version which takes an optional
16443 `bool report_errors' to allow lookups of optional methods.
16445 2003-05-12 Martin Baulig <martin@ximian.com>
16447 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
16448 only used for locals and not for parameters.
16450 2003-05-12 Miguel de Icaza <miguel@ximian.com>
16452 * support.cs (InternalParameters.ParameterType): Return the
16453 ExternalType of the parameter.
16455 * parameter.cs (Parameter.ExternalType): drop the two arguments,
16458 2003-05-11 Miguel de Icaza <miguel@ximian.com>
16460 * class.cs (MethodData.Define): Do not set the `newslot' on
16461 interface members, if they are also flagged as "override".
16463 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
16464 better code for ++i and i++. This only works for static fields
16465 and local variables.
16467 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
16468 want to pull the DeclSpace out of the builder_to_declspace instead
16469 of the TypeBuilder (like in TypeContainer.FindMembers).
16471 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
16472 instead of LookupTypeContainer. Fixes the crash on .NET for
16473 looking up interface members.
16475 * const.cs: Create our own emit context during the Definition
16476 stage, so that constants are evaluated in the proper context, when
16477 a recursive definition happens.
16479 2003-05-11 Martin Baulig <martin@ximian.com>
16481 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
16482 new block for a switch section.
16483 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
16484 the adding/lookup in the switch block. Fixes #39828.
16486 2003-05-09 Miguel de Icaza <miguel@ximian.com>
16488 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
16489 functionality: I needed to convert the data after I had performed
16490 the add/sub operation into the operands type size.
16492 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
16493 pass the type for the box operation, otherwise the resulting
16494 object would have been of type object.
16496 (BoxedCast): Add constructor to specify the type to box as.
16498 2003-05-07 Miguel de Icaza <miguel@ximian.com>
16500 * iterators.cs: I was reusing the `count' variable inadvertently,
16501 take steps to not allow this to happen.
16503 2003-05-06 Miguel de Icaza <miguel@ximian.com>
16505 * attribute.cs (Attribute.Resolve): Params attributes are encoded
16506 by creating an array at the point where the params starts and
16507 putting all those arguments there, then adjusting the size of the
16510 2003-05-05 Miguel de Icaza <miguel@ximian.com>
16512 * expression.cs (New.AddressOf): Implement interface
16513 IMemoryLocation. This is used when the `new' operator is used in
16514 the context of an invocation to a method on a value type.
16516 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
16519 * namespace.cs: Also check the using aliases here.
16521 * driver.cs: Move the test for using validity after the types have
16522 been entered, so we do a single pass that also includes the using
16525 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
16526 in the regular case. CreateSiblingForFinally is doing extra
16529 * attribute.cs (GetAttributeArgumentExpression): Store the result
16530 on an out value, and use the return value to indicate failure
16531 instead of using null (which is a valid return for Constant.GetValue).
16533 * statement.cs: Perform the analysis flow for the increment
16534 portion after the statement, because this will be the real flow of
16535 execution. Fixes #42385
16537 * codegen.cs (EmitContext.EmitArgument,
16538 EmitContext.EmitStoreArgument): New helper functions when the
16539 RemapToProxy flag is set.
16541 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
16544 Add support for remapping parameters.
16546 * iterators.cs: Propagate parameter values; Store parameter
16547 values in the proxy classes.
16549 2003-05-04 Miguel de Icaza <miguel@ximian.com>
16551 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
16552 need a proxy reference; I do not know what I was thinking
16554 * cs-parser.jay (constructor_initializer): catch another error,
16555 and display nice message.
16557 (field_declaration): catch void field declaration
16558 to flag a better error.
16560 * class.cs (MemberBase.CheckBase): Report an error instead of a
16561 warning if a new protected member is declared in a struct.
16562 (Field.Define): catch the error of readonly/volatile.
16564 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
16566 (FieldExpr.AddressOf): ditto. Catch error where the address of a
16567 volatile variable is taken
16569 2003-05-02 Miguel de Icaza <miguel@ximian.com>
16571 * statement.cs (Fixed.Resolve): Report an error if we are not in
16574 2003-05-01 Miguel de Icaza <miguel@ximian.com>
16576 * typemanager.cs: reuse the code that handles type clashes for
16577 delegates and enumerations.
16579 * class.cs (Report28): Always report.
16581 * expression.cs (EncodeAsAttribute): Allow nulls here.
16583 2003-04-28 Miguel de Icaza <miguel@ximian.com>
16585 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
16586 the functionality for testing whether an expression is valid for
16587 an attribute here. Also handle the case of arrays of elements
16590 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
16591 encoding a linear array into an array of objects that are suitable
16592 to be passed to an CustomAttributeBuilder.
16594 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
16596 * ecore.cs: (FieldExpr): Handle field remapping here.
16598 * iteratators.cs: Pass the instance variable (if the method is an
16599 instance method) to the constructors, so we can access the field
16600 variables on the class.
16602 TODO: Test this with structs. I think the THIS variable on
16603 structs might have to be a pointer, and not a refenrece
16605 2003-04-27 Miguel de Icaza <miguel@ximian.com>
16607 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
16608 local variables to fields in a proxy class.
16610 * iterators.cs (PopulateProxy): Rename our internal fields to
16612 Create a <THIS> field if we are an instance method, so we can
16613 reference our parent container variables.
16614 (MapVariable): Called back from the EmitContext code to enter a
16615 new variable to field mapping into the proxy class (we just create
16619 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
16620 for using the remapped locals to fields.
16622 I placed the code here, because that gives the same semantics to
16623 local variables, and only changes the Emit code.
16625 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
16626 statements inside iterators.
16627 (VariableInfo): Add a FieldBuilder for the cases when we are
16628 remapping local variables to fields in a proxy class
16630 * ecore.cs (SimpleNameResolve): Avoid testing two times for
16631 current_block != null.
16633 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
16634 not cope with strings, as it has been moved to the
16635 TableSwitchEmit. Fixed bug in switch generation.
16637 * expression.cs (New.DoResolve): Provide more context for the user
16638 when reporting an error.
16640 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
16643 * expression.cs (MemberAccess.DoResolve): When we get a type back,
16644 check the permissions for it. Note than in a type-resolution
16645 context the check was already present in DeclSpace.ResolveType,
16646 but was missing from the MemberAccess.
16648 (ArrayCreation.CheckIndices): warn if the user has
16649 more nested levels of expressions, but there are no more
16650 dimensions specified. Avoids crash on bug 41906.
16652 2003-04-26 Miguel de Icaza <miguel@ximian.com>
16654 * statement.cs (Block): replace Implicit bool, for a generic
16656 New flag: `Unchecked'. This is used during the EmitMeta phase
16657 (which is out-of-line with the regular Resolve/Emit process for a
16658 statement, as this is done ahead of time, but still gets a chance
16659 to call constant resolve).
16661 (Block.Flags): new enum for adding a new flag.
16663 (Block.EmitMeta): track the state of unchecked.
16665 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
16666 to enable constant resolution to work there as well.
16668 2003-04-22 Miguel de Icaza <miguel@ximian.com>
16670 * typemanager.cs (ienumerable_type): Also look up
16671 System.Collections.IEnumerable.
16673 2003-04-21 Miguel de Icaza <miguel@ximian.com>
16675 TODO: Test more than one conditional per method.
16677 * class.cs (Indexer.Define): Report the location where the user is
16678 referencing the unsupported feature.
16680 (MethodData): Overload the use of `conditionals' to
16681 minimize the creation of needless ArrayLists. This saves roughly
16682 212kb on my machine.
16684 (Method): Implement the new IIteratorContainer interface.
16685 (Method.SetYields): Implement the method by setting the ModFlags
16686 to contain METHOD_YIELDS.
16688 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
16689 which just got set to null.
16691 * iterators.cs: New file.
16693 (Yield, YieldBreak): New statements.
16695 * statement.cs (Return.Resolve): Flag an error if we are used in
16696 an iterator method.
16698 * codegen.cs (InIterator): New flag set if the code is being
16699 compiled in an iterator method.
16701 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
16702 internal modifier, and we just use it to avoid adding extra
16703 fields, as this is seldom used.
16705 * cs-parser.jay: Add yield_statement (yield and yield break).
16707 * driver.cs: New flag -v2 to turn on version 2 features.
16709 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
16710 hashtable when v2 is enabled.
16712 2003-04-20 Miguel de Icaza <miguel@ximian.com>
16714 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
16715 there is already a namespace defined with this name.
16717 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
16718 people upgraded their corlibs.
16720 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
16721 always use fully qualified types, no need to use the compiler
16724 (TypeManager.IsNamespace): Use binarysearch.
16726 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
16727 AddDelegate): I did not quite use the new IsValid API properly: I
16728 have to pass the short-name and the fullname. I was passing only
16729 the basename instead of the fullname sometimes.
16731 (TypeContainer.DefineType): call NamespaceClash.
16733 * interface.cs (Interface.DefineType): use NamespaceClash before
16736 * delegate.cs (Delegate.DefineType): use NamespaceClash before
16739 * enum.cs: (Enum.DefineType): use NamespaceClash before
16742 * typemanager.cs (: 3-line patch that gives us some tasty 11%
16743 speed increase. First, use the negative_hits cache when we get a
16744 negative. Second, add the type with its full original name
16745 instead of the new . and + encoded name (reflection uses + to
16746 separate type from a nested type). Use LookupTypeReflection
16747 directly which bypasses the type->name hashtable (that we already
16748 know does not contain the type.
16750 * decl.cs (DeclSpace.ResolveTypeExpr): track the
16751 location/container type.
16753 * driver.cs: When passing utf8, use directly the UTF8Encoding.
16755 2003-04-19 Miguel de Icaza <miguel@ximian.com>
16757 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
16759 * delegate.cs (NewDelegate.Resolve): Test whether an instance
16760 method is being referenced in the method group from a static
16761 context, and report error 120 if so.
16763 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
16766 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
16767 is created, we create the A namespace).
16769 * cs-parser.jay: A namespace also introduces a DeclarationFound.
16772 2003-04-18 Miguel de Icaza <miguel@ximian.com>
16774 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
16775 invocation to ModuleBuilder.GetType with the same values will
16776 return a new type instance, so we need to cache its return
16779 * expression.cs (Binary.ResolveOperator): Only allow the compare
16780 operators on enums if they are of the same type.
16782 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
16783 types of ValueType on their own case. Before we were giving them
16784 the same treatment as objects.
16786 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
16787 fullname. Short name is used to compare against container name.
16788 Fullname is used to check against defined namespace names.
16790 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
16791 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
16793 (Method.CheckBase): Call parent.
16794 (MemberBase.CheckBase): Check for protected members on sealed
16796 (PropertyBase.CheckBase): Call parent.
16797 (Field.Define): Call parent.
16799 * report.cs: Negative error codes are now mapped to 8000 - code,
16800 so that the display is render more nicely.
16802 * typemanager.cs: Do not use try/catch, instead report a regular
16805 (GetPointerType, GetReferenceType): These methods provide
16806 mechanisms to obtain the T* and T& from a T. We had the code
16807 previously scattered around the code base, and it also used
16808 TypeManager.LookupType that would go through plenty of caches.
16809 This one goes directly to the type source.
16811 In some places we did the Type.GetType followed by
16812 ModuleBuilder.GetType, but not in others, so this unifies the
16813 processing as well.
16815 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
16816 statements now that we have namespace information.
16818 * typemanager.cs (IsNamespace): New method, returns whether the
16819 string presented is a namespace or not.
16821 (ComputeNamespaces): New public entry point, computes the list of
16822 available namespaces, using the GetNamespaces API call in Mono, or
16823 the slower version in MS.NET.
16825 Now before we start the semantic analysis phase, we have a
16826 complete list of namespaces including everything that the user has
16829 Deleted old code to cache namespaces in .nsc files.
16831 2003-04-17 Miguel de Icaza <miguel@ximian.com>
16833 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
16834 class/struct location definition Location for the implicit
16835 constructor location.
16837 (Operator.Define): Use the location of the operator for the
16838 implicit Method definition.
16840 (Constructor.Emit): use the constructor location for the implicit
16841 base initializer constructor.
16843 * ecore.cs: Remove ITypeExpression. This interface is now gone,
16844 and the Expression class now contains two new methods:
16846 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
16847 isolate type lookup from the rest of the resolution process.
16849 Since we use Expressions to hold type definitions due to the way
16850 we parse the input we have historically overloaded Resolve to
16851 perform the Type lookups if a special flag is passed. Now this is
16852 eliminated and two methods take their place.
16854 The differences in the two methods between xStep and xTerminal is
16855 that xStep is involved in our current lookup system that uses
16856 SimpleNames to compose a name, while xTerminal is used just to
16857 catch the case where the simplename lookup failed.
16859 2003-04-16 Miguel de Icaza <miguel@ximian.com>
16861 * expression.cs (ResolveMemberAccess): Remove redundant code.
16862 TypeExpr expressions are always born fully resolved.
16864 * interface.cs (PopulateMethod): Do not lookup the types twice.
16865 We were doing it once during SemanticAnalysis and once during
16868 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
16869 in local variable type definitions, were being returned as a
16870 SimpleName (we decomposed everything into a string), that is
16871 because primary_expression was being used instead of a type in the
16872 grammar (reduce/reduce conflicts).
16874 The part that was wrong is that we converted the expression into a
16875 string (an oversimplification in one hand, compounded with primary
16876 expressions doing string concatenation).
16882 Would return "A.B.C[]" as a SimpleName. This stopped things like
16883 using clauses from working on this particular context. And a type
16884 was being matched directly against "A.B.C[]".
16886 We now use the correct approach, and allow for ComposedCast to be
16887 part of the unary expression. So the "A.B.C []" become a composed
16888 cast of "A.B.C" (as a nested group of MemberAccess with a
16889 SimpleName at the end) plus the rank composition "[]".
16893 2003-04-10 Miguel de Icaza <miguel@ximian.com>
16895 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
16896 for the access level checking.
16898 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
16899 `TypeContainer container', because I kept getting confused when I
16900 was debugging this code.
16902 * expression.cs (Indexers): Instead of tracking getters/setters,
16903 we now track them in parallel. We create one arraylist less, but
16904 most importantly it is possible now for the LValue code to find a
16905 matching get for a set.
16907 (IndexerAccess.DoResolveLValue): Update the code.
16908 GetIndexersForType has been modified already to extract all the
16909 indexers from a type. The code assumed it did not.
16911 Also make the code set the correct return type for the indexer.
16912 This was fixed a long time ago for properties, but was missing for
16913 indexers. It used to be void_type.
16915 (Binary.Emit): Test first for doubles instead of
16916 floats, as they are more common.
16918 (Binary.EmitBranchable): Use the .un version of the branch opcodes
16919 when dealing with floats and the <=, >= operators. This fixes bug
16922 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
16923 to load the array value by emitting a load on the foreach variable
16924 type. This was incorrect.
16926 We now emit the code to load an element using the the array
16927 variable type, and then we emit the conversion operator.
16931 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
16933 * attribute.cs: Avoid allocation of ArrayLists in the common case.
16935 2003-04-09 Miguel de Icaza <miguel@ximian.com>
16937 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
16938 test for protection before we test for signatures.
16940 (MethodSignature.ToString): implement.
16942 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
16943 to the case where we reduced into a LongConstant.
16945 * decl.cs (CheckAccessLevel): If the type is an array, we can not
16946 depend on whether the information is acurrate, because the
16947 Microsoft runtime will always claim that the array type is public,
16948 regardless of the real state.
16950 If the type is a pointer, another problem happens: the type is
16951 reported as non-public in Microsoft.
16953 In both cases we have to call CheckAccessLevel recursively with
16954 the underlying type as the argument to be tested.
16956 2003-04-08 Miguel de Icaza <miguel@ximian.com>
16958 * assign.cs (Assign.Emit): If we are dealing with a compound
16959 assignment expression, we should use the code path that stores the
16960 intermediate result in a temporary value. This fixes #40903.
16962 *expression.cs (Indirection.ToString): Provide ToString method for
16965 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
16967 * class.cs: Null out fields holding references to Block objects so
16968 they can be garbage collected.
16970 * expression.cs (OverloadResolve): Remove unused local.
16972 2003-04-07 Martin Baulig <martin@ximian.com>
16974 * codegen.cs (EmitContext.CurrentFile): New public field.
16975 (EmitContext.Mark): Use the CurrentFile to check whether the
16976 location is in the correct file.
16977 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
16979 2003-04-07 Martin Baulig <martin@ximian.com>
16981 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
16983 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
16984 location. [FIXME: The location argument which gets passed to this
16985 method is sometimes wrong!]
16987 2003-04-07 Nick Drochak <ndrochak@gol.com>
16989 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
16991 2003-04-07 Miguel de Icaza <miguel@ximian.com>
16993 * expression.cs (Indirection.EmitAssign): We were using the
16994 temporary, but returning immediately instead of continuing the
16997 2003-04-06 Martin Baulig <martin@ximian.com>
16999 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
17000 if it's a nested child, but also deriving from the outer class.
17003 * typemanager.cs (IsNestedChildOf): Make this work if it's a
17004 nested child, but also deriving from the outer class. See
17006 (FilterWithClosure): We may access private members of the outer
17007 class if we're a nested child and deriving from the outer class.
17008 (RealMemberLookup): Only set `closure_private_ok' if the
17009 `original_bf' contained BindingFlags.NonPublic.
17011 2003-04-05 Martin Baulig <martin@ximian.com>
17013 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
17015 2003-04-02 Miguel de Icaza <miguel@ximian.com>
17017 * class.cs (Event.Define): Do not allow abstract events to have
17020 2003-04-01 Miguel de Icaza <miguel@ximian.com>
17022 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
17023 block in event declarations.
17025 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
17026 value type, get its address.
17028 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
17029 leaving a class on the stack instead of a boolean value (int
17030 0/1). Change the code so we compare against null, and then the
17031 result against zero.
17033 * class.cs (TypeContainer.GetClassBases): We were checking for the
17034 parent class being sealed too late.
17036 * expression.cs (Binary.Emit): For <= and >= when dealing with
17037 floating point values, use cgt.un and clt.un instead of cgt and
17040 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
17042 * statement.cs: Apply the same optimization as MS: skip the
17043 GetEnumerator returning an IEnumerator, and use the one returning a
17044 CharEnumerator instead. This allows us to avoid the try-finally block
17047 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
17049 * cs-parser.jay: Attributes cannot be applied to
17050 namespaces. Fixes #40473
17052 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17055 (Add*): check if the name is valid using the full name for constants,
17056 fields, properties and events.
17058 2003-03-28 Miguel de Icaza <miguel@ximian.com>
17060 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
17061 char constants to be part of the enumeration.
17063 * expression.cs (Conditional.DoResolve): Add support for operator
17064 true. Implements the missing functionality from 14.12
17066 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
17067 operator true/false as required by the spec.
17069 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
17070 implicit conversion to boolean.
17072 * statement.cs (Statement.ResolveBoolean): A boolean expression is
17073 also one where the type implements `operator true'.
17075 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
17076 get an expression that will invoke operator true based on an
17079 (GetConversionOperators): Removed the hack that called op_True
17082 (Expression.ResolveBoolean): Move this from Statement.
17084 2003-03-17 Miguel de Icaza <miguel@ximian.com>
17086 * ecore.cs (FieldExpr): do not allow initialization of initonly
17087 fields on derived classes
17089 2003-03-13 Martin Baulig <martin@ximian.com>
17091 * statement.cs (Block.Emit): Call ig.BeginScope() and
17092 ig.EndScope() when compiling with debugging info; call
17093 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
17095 2003-03-08 Miguel de Icaza <miguel@ximian.com>
17097 * expression.cs (Indexers): Do not construct immediately, allow
17098 for new members to be appended as we go. Fixes 38143
17100 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17102 * expression.cs: save/restore context when resolving an unchecked
17105 2003-03-05 Miguel de Icaza <miguel@ximian.com>
17107 * cfold.cs: Catch division by zero in modulus operator during
17110 2003-03-03 Miguel de Icaza <miguel@ximian.com>
17112 * interface.cs (Interface.DefineMembers): Avoid defining members
17115 2003-02-27 Miguel de Icaza <miguel@ximian.com>
17117 * driver.cs: handle the +/- options for -noconfig
17119 * statement.cs (Unckeched.Resolve): Also track the state of
17120 unchecked in the Resolve phase.
17122 2003-02-27 Martin Baulig <martin@ximian.com>
17124 * ecore.cs (Expression.MemberLookup): Don't create a
17125 MethodGroupExpr for something which is not a method. Fixes #38291.
17127 2003-02-25 Miguel de Icaza <miguel@ximian.com>
17129 * class.cs (MemberBase.CheckParameters): Also check that the type
17130 is unmanaged if it is a pointer.
17132 * expression.cs (SizeOf.Resolve): Add location information.
17134 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
17135 a managed type is declared.
17137 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
17138 parameter modifiers as well. Fixes bug 38606
17140 * class.cs: Very sad. Am backing out the speed up changes
17141 introduced by the ArrayList -> Array in the TypeContainer, as they
17142 were not actually that much faster, and introduced a bug (no error
17143 reports on duplicated methods).
17145 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
17146 source first, this will guarantee that we have a valid expression
17147 before calling in lower levels functions that will require a
17148 resolved object. Then use this original_source in the
17149 target.ResolveLValue instead of the original source that was
17152 Another change. Use target.Resolve instead of LValueResolve.
17153 Although we are resolving for LValues, we will let the Assign code
17154 take care of that (it will be called again from Resolve). This
17155 basically allows code like this:
17157 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
17158 class Y { void A (X x) { x [0] += o; }
17160 The problem was that the indexer was trying to resolve for
17161 set_Item (idx, object o) and never finding one. The real set_Item
17162 was set_Item (idx, X). By delaying the process we get the right
17167 2003-02-23 Martin Baulig <martin@ximian.com>
17169 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
17170 while calling DoEmit ().
17172 * codegen.cs (EmitContext.Mark): Don't mark locations in other
17173 source files; if you use the #line directive inside a method, the
17174 compiler stops emitting line numbers for the debugger until it
17175 reaches the end of the method or another #line directive which
17176 restores the original file.
17178 2003-02-23 Martin Baulig <martin@ximian.com>
17180 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
17182 2003-02-23 Martin Baulig <martin@ximian.com>
17184 * statement.cs (Block.AddChildVariableNames): We need to call this
17185 recursively, not just for our immediate children.
17187 2003-02-23 Martin Baulig <martin@ximian.com>
17189 * class.cs (Event.Define): Always make the field private, like csc does.
17191 * typemanager.cs (TypeManager.RealMemberLookup): Make events
17192 actually work, fixes bug #37521.
17194 2003-02-23 Miguel de Icaza <miguel@ximian.com>
17196 * delegate.cs: When creating the various temporary "Parameters"
17197 classes, make sure that we call the ComputeAndDefineParameterTypes
17198 on those new parameters (just like we do with the formal ones), to
17199 allow them to be resolved in the context of the DeclSpace.
17201 This fixes the bug that Dick observed in Bugzilla #38530.
17203 2003-02-22 Miguel de Icaza <miguel@ximian.com>
17205 * expression.cs (ResolveMemberAccess): When resolving a constant,
17206 do not attempt to pull a constant if the value was not able to
17207 generate a valid constant.
17209 * const.cs (LookupConstantValue): Do not report more errors than required.
17211 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17213 * expression.cs: fixes bug #38328.
17215 2003-02-18 Miguel de Icaza <miguel@ximian.com>
17217 * class.cs: Changed all the various members that can be part of a
17218 class from being an ArrayList to be an Array of the right type.
17219 During the DefineType type_list, interface_list, delegate_list and
17220 enum_list are turned into types, interfaces, delegates and enums
17223 And during the member population, indexer_list, event_list,
17224 constant_list, field_list, instance_constructor_list, method_list,
17225 operator_list and property_list are turned into their real arrays.
17227 Although we could probably perform this operation earlier, for
17228 good error reporting we need to keep the lists and remove the
17229 lists for longer than required.
17231 This optimization was triggered by Paolo profiling the compiler
17232 speed on the output of `gen-sample-program.pl' perl script.
17234 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
17235 not crash in methods like MemberLookupFailed that use this field.
17237 This problem arises when the compiler fails to resolve a type
17238 during interface type definition for example.
17240 2003-02-18 Miguel de Icaza <miguel@ximian.com>
17242 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
17243 inherit from System.Object, so we have to stop at null, not only
17244 when reaching System.Object.
17246 2003-02-17 Miguel de Icaza <miguel@ximian.com>
17248 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
17249 DeclaredOnly because the parent indexer might have had a different
17250 name, but did not loop until the top of the hierarchy was reached.
17252 The problem this one fixes is 35492: when a class implemented an
17253 indexer from an interface, we were getting the interface method
17254 (which was abstract) and we were flagging an error (can not invoke
17257 This also keeps bug 33089 functioning, and test-148 functioning.
17259 * typemanager.cs (IsSpecialMethod): The correct way of figuring
17260 out if a method is special is to see if it is declared in a
17261 property or event, or whether it is one of the predefined operator
17262 names. This should fix correctly #36804.
17264 2003-02-15 Miguel de Icaza <miguel@ximian.com>
17266 The goal here is to remove the dependency on EmptyCast.Peel ().
17267 Killing it completely.
17269 The problem is that currently in a number of places where
17270 constants are expected, we have to "probe" for an EmptyCast, and
17271 Peel, which is not the correct thing to do, as this will be
17272 repetitive and will likely lead to errors.
17274 The idea is to remove any EmptyCasts that are used in casts that
17275 can be reduced to constants, so we only have to cope with
17278 This bug hunt was triggered by Bug 37363 and the desire to remove
17279 the duplicate pattern where we were "peeling" emptycasts to check
17280 whether they were constants. Now constants will always be
17283 * ecore.cs: Use an enumconstant here instead of wrapping with
17286 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
17287 throwing me off. By handling this we can get rid of a few hacks.
17289 * statement.cs (Switch): Removed Peel() code.
17291 2003-02-14 Miguel de Icaza <miguel@ximian.com>
17293 * class.cs: Location information for error 508
17295 * expression.cs (New.DoResolve): Add a guard against double
17296 resolution of an expression.
17298 The New DoResolve might be called twice when initializing field
17299 expressions (see EmitFieldInitializers, the call to
17300 GetInitializerExpression will perform a resolve on the expression,
17301 and later the assign will trigger another resolution
17303 This leads to bugs (#37014)
17305 * delegate.cs: The signature for EndInvoke should contain any ref
17306 or out parameters as well. We were not doing this in the past.
17308 * class.cs (Field.Define): Do not overwrite the type definition
17309 inside the `volatile' group. Turns out that volatile enumerations
17310 were changing the type here to perform a validity test, which
17313 2003-02-12 Miguel de Icaza <miguel@ximian.com>
17315 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
17316 and structs, we do not want to load the instance variable
17318 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
17319 enum_type has to be handled like an object reference (implicit
17320 conversions exists from this to object), but the regular IsClass
17321 and IsValueType tests will never return true for this one.
17323 Also we use TypeManager.IsValueType instead of type.IsValueType,
17324 just for consistency with the rest of the code (this is only
17325 needed if we ever use the construct exposed by test-180.cs inside
17326 corlib, which we dont today).
17328 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
17330 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
17333 2003-02-09 Martin Baulig <martin@ximian.com>
17335 * namespace.cs (Namespace..ctor): Added SourceFile argument.
17336 (Namespace.DefineNamespaces): New static public method; this is
17337 called when we're compiling with debugging to add all namespaces
17338 to the symbol file.
17340 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
17341 pass it to the Namespace's .ctor.
17343 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
17344 and MethodBase arguments; pass the namespace ID to the symwriter;
17345 pass the MethodBase instead of the token to the symwriter.
17346 (SymbolWriter.DefineNamespace): New method to add a namespace to
17349 2003-02-09 Martin Baulig <martin@ximian.com>
17351 * symbolwriter.cs: New file. This is a wrapper around
17352 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
17353 methods here in near future.
17355 2003-02-09 Martin Baulig <martin@ximian.com>
17357 * codegen.cs (EmitContext.Mark): Just pass the arguments to
17358 ILGenerator.MarkSequencePoint() which are actually used by the
17361 2003-02-09 Martin Baulig <martin@ximian.com>
17363 * location.cs (SourceFile): New public sealed class. This
17364 contains the name and an index which is used in the location's token.
17365 (Location): Reserve an appropriate number of bits in the token for
17366 the source file instead of walking over that list, this gives us a
17367 really huge performance improvement when compiling with debugging.
17369 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
17370 `SourceFile' argument instead of a string.
17371 (Driver.ProcessFile): Add all the files via Location.AddFile(),
17372 but don't parse/tokenize here, we need to generate the list of all
17373 source files before we do that.
17374 (Driver.ProcessFiles): New static function. Parses/tokenizes all
17377 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
17378 instead of a string.
17380 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
17383 2003-02-09 Martin Baulig <martin@ximian.com>
17385 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
17386 filename on `#line default'.
17388 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
17390 * statement.cs: don't clear the pinned var when the fixed statement
17391 returns from the method (fixes bug#37752).
17393 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
17395 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
17398 2003-02-07 Martin Baulig <martin@ximian.com>
17400 * driver.cs: Removed the `--debug-args' command line argument.
17402 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
17403 automatically by the AsssemblyBuilder.
17404 (CodeGen.InitializeSymbolWriter): We don't need to call any
17405 initialization function on the symbol writer anymore. This method
17406 doesn't take any arguments.
17408 2003-02-03 Miguel de Icaza <miguel@ximian.com>
17410 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
17411 from referenced assemblies as well.
17413 2003-02-02 Martin Baulig <martin@ximian.com>
17415 * class.cs (MethodData.Emit): Generate debugging info for external methods.
17417 2003-02-02 Martin Baulig <martin@ximian.com>
17419 * class.cs (Constructor.Emit): Open the symbol writer before
17420 emitting the constructor initializer.
17421 (ConstructorInitializer.Emit): Call ec.Mark() to allow
17422 single-stepping through constructor initializers.
17424 2003-01-30 Miguel de Icaza <miguel@ximian.com>
17426 * class.cs: Handle error 549: do not allow virtual methods in
17429 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
17431 * decl.cs: Check access levels when resolving types
17433 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
17435 * statement.cs: Add parameters and locals set in catch blocks that might
17436 return to set vector
17438 2003-01-29 Miguel de Icaza <miguel@ximian.com>
17440 * class.cs (Operator): Set the SpecialName flags for operators.
17442 * expression.cs (Invocation.DoResolve): Only block calls to
17443 accessors and operators on SpecialName methods.
17445 (Cast.TryReduce): Handle conversions from char constants.
17448 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
17450 * statement.cs: small memory and time optimization in FlowBranching.
17452 2003-01-28 Pedro Mart <yoros@wanadoo.es>
17454 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
17455 problem that the last fix but in the other sid (Set).
17457 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
17458 access when there is no indexer in the hierarchy.
17460 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
17462 * class.cs: Combine some if statements.
17464 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17466 * driver.cs: fixed bug #37187.
17468 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
17470 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
17471 any indexer, it's needed to build a list with all the indexers in the
17472 hierarchy (AllGetters), else we have problems. Fixes #35653.
17474 2003-01-23 Miguel de Icaza <miguel@ximian.com>
17476 * class.cs (MethodData.Define): It is wrong for an interface
17477 implementation to be static in both cases: explicit and implicit.
17478 We were only handling this in one case.
17480 Improve the if situation there to not have negations.
17482 * class.cs (Field.Define): Turns out that we do not need to check
17483 the unsafe bit on field definition, only on usage. Remove the test.
17485 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17487 * driver.cs: use assembly.Location instead of Codebase (the latest
17488 patch made mcs fail when using MS assemblies).
17490 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
17492 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
17493 get the path to *corlib.dll.
17495 2003-01-21 Nick Drochak <ndrochak@gol.com>
17499 * typemanager.cs: Remove compiler warnings
17501 2003-01-20 Duncan Mak <duncan@ximian.com>
17503 * AssemblyInfo.cs: Bump the version number to 0.19.
17505 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17507 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
17509 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
17511 * class.cs (Constructor::Emit): Emit debugging info for constructors.
17513 2003-01-17 Miguel de Icaza <miguel@ximian.com>
17515 * cs-parser.jay: Small fix: we were not comparing the constructor
17516 name correctly. Thanks to Zoltan for the initial pointer.
17518 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
17520 * cs-tokenizer.cs: Set file name when specified with #line
17522 2003-01-15 Miguel de Icaza <miguel@ximian.com>
17524 * cs-parser.jay: Only perform the constructor checks here if we
17525 are named like the class; This will help provider a better
17526 error. The constructor path is taken when a type definition is
17527 not found, but most likely the user forgot to add the type, so
17528 report that rather than the constructor error.
17530 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
17532 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
17535 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17537 * cs-parser.jay: Add cleanup call.
17539 2003-01-13 Duncan Mak <duncan@ximian.com>
17541 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
17542 consistent with other methods.
17544 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17546 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
17548 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
17550 * attribute.cs: only set GuidAttr to true when we have a
17553 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17557 * typemanager.cs: fixes to allow mcs compile corlib with the new
17558 Type.IsSubclassOf fix.
17560 2003-01-08 Miguel de Icaza <miguel@ximian.com>
17562 * expression.cs (LocalVariableReference.DoResolve): Classify a
17563 constant as a value, not as a variable. Also, set the type for
17566 * cs-parser.jay (fixed_statement): take a type instead of a
17567 pointer_type, so we can produce a better error message later.
17569 * statement.cs (Fixed.Resolve): Flag types that are not pointers
17572 (For.DoEmit): Make inifinite loops have a
17573 non-conditional branch back.
17575 (Fixed.DoEmit): First populate the pinned variables, then emit the
17576 statement, then clear the variables. Before I was emitting the
17577 code once for each fixed piece.
17580 2003-01-08 Martin Baulig <martin@ximian.com>
17582 * statement.cs (FlowBranching.MergeChild): A break in a
17583 SWITCH_SECTION does not leave a loop. Fixes #36155.
17585 2003-01-08 Martin Baulig <martin@ximian.com>
17587 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
17588 lives in the same number space than `param_map'. Fixes #36154.
17590 2003-01-07 Miguel de Icaza <miguel@ximian.com>
17592 * cs-parser.jay (constructor_declaration): Set the
17593 Constructor.ModFlags before probing for it. This makes the
17594 compiler report 514, 515 and 132 (the code was there, but got
17597 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
17598 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
17599 (GotoCase.Resolve): Set `Returns' to ALWAYS.
17601 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
17603 * enum.cs: create the enum static fields using the enum type.
17605 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
17607 * class.cs: don't try to create the ParamBuilder for the return
17608 type if it's not needed (and handle it breaking for the ms runtime
17611 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
17613 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
17615 2002-12-29 Miguel de Icaza <miguel@ximian.com>
17617 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
17618 the command. This showed up while compiling the JANET source
17619 code, which used \r as its only newline separator.
17621 2002-12-28 Miguel de Icaza <miguel@ximian.com>
17623 * class.cs (Method.Define): If we are an operator (because it
17624 reuses our code), then set the SpecialName and HideBySig. #36128
17626 2002-12-22 Miguel de Icaza <miguel@ximian.com>
17628 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
17629 exception, report error 120 `object reference required'.
17631 * driver.cs: Add --pause option, used during to measure the size
17632 of the process as it goes with --timestamp.
17634 * expression.cs (Invocation.DoResolve): Do not allow methods with
17635 SpecialName to be invoked.
17637 2002-12-21 Miguel de Icaza <miguel@ximian.com>
17639 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
17640 number before adding it.
17642 2002-12-21 Ravi Pratap <ravi@ximian.com>
17644 * ecore.cs (StandardImplicitConversion): When in an unsafe
17645 context, we allow conversion between void * to any other pointer
17646 type. This fixes bug #35973.
17648 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
17650 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
17651 is not thrown when extensionless outputs are used
17653 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17655 * rootcontext.cs: fixed compilation of corlib.
17657 2002-12-19 Miguel de Icaza <miguel@ximian.com>
17659 * attribute.cs (Attributes.Contains): Add new method.
17661 * class.cs (MethodCore.LabelParameters): if the parameter is an
17662 `out' parameter, check that no attribute `[In]' has been passed.
17664 * enum.cs: Handle the `value__' name in an enumeration.
17666 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
17668 * decl.cs: Added special case to allow overrides on "protected
17671 2002-12-18 Ravi Pratap <ravi@ximian.com>
17673 * attribute.cs (Attributes.AddAttributeSection): Rename to this
17674 since it makes much more sense.
17676 (Attributes.ctor): Don't require a Location parameter.
17678 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
17680 * attribute.cs (ApplyAttributes): Remove extra Location parameters
17681 since we already have that information per attribute.
17683 * everywhere : make appropriate changes.
17685 * class.cs (LabelParameters): Write the code which actually
17686 applies attributes to the return type. We can't do this on the MS
17687 .NET runtime so we flag a warning in the case an exception is
17690 2002-12-18 Miguel de Icaza <miguel@ximian.com>
17692 * const.cs: Handle implicit null conversions here too.
17694 2002-12-17 Ravi Pratap <ravi@ximian.com>
17696 * class.cs (MethodCore.LabelParameters): Remove the extra
17697 Type [] parameter since it is completely unnecessary. Instead
17698 pass in the method's attributes so that we can extract
17699 the "return" attribute.
17701 2002-12-17 Miguel de Icaza <miguel@ximian.com>
17703 * cs-parser.jay (parse): Use Report.Error to flag errors instead
17704 of ignoring it and letting the compile continue.
17706 * typemanager.cs (ChangeType): use an extra argument to return an
17707 error condition instead of throwing an exception.
17709 2002-12-15 Miguel de Icaza <miguel@ximian.com>
17711 * expression.cs (Unary.TryReduce): mimic the code for the regular
17712 code path. Perform an implicit cast in the cases where we can
17713 implicitly convert to one of the integral types, and then reduce
17714 based on that constant. This fixes bug #35483.
17716 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17718 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
17720 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17722 * namespace.cs: fixed bug #35489.
17724 2002-12-12 Miguel de Icaza <miguel@ximian.com>
17726 * class.cs: Remove some dead code.
17728 * cs-parser.jay: Estimate the number of methods needed
17729 (RootContext.MethodCount);
17731 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
17732 numbers instead of StringBuilders.
17734 * support.cs (PtrHashtable): Add constructor with initial size;
17735 We can now reduce reallocations of the method table.
17737 2002-12-10 Ravi Pratap <ravi@ximian.com>
17739 * attribute.cs (ApplyAttributes): Keep track of the emitted
17740 attributes on a per-target basis. This fixes bug #35413.
17742 2002-12-10 Miguel de Icaza <miguel@ximian.com>
17744 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
17745 default to the Windows 1252 encoding.
17747 (UnixParseOption): Support version, thanks to Alp for the missing
17750 * AssemblyInfo.cs: Add nice assembly information.
17752 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
17755 * cs-parser.jay: Allow a trailing comma before the close bracked
17756 in the attribute_section production.
17758 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
17759 address of the instance was being taken, I will take this out,
17760 because we take the address of the object immediately here.
17762 2002-12-09 Ravi Pratap <ravi@ximian.com>
17764 * typemanager.cs (AreMultipleAllowed): Take care of the most
17765 obvious case where attribute type is not in the current assembly -
17768 2002-12-08 Miguel de Icaza <miguel@ximian.com>
17770 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
17771 definitions, instead of doing that afterwards.
17773 Also we use a nice little hack, depending on the constructor, we
17774 know if we are a "composed" name or a simple name. Hence, we
17775 avoid the IndexOf test, and we avoid
17777 * codegen.cs: Add code to assist in a bug reporter to track down
17778 the source of a compiler crash.
17780 2002-12-07 Ravi Pratap <ravi@ximian.com>
17782 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
17783 types have been emitted for a given element and flag an error
17784 if something which does not have AllowMultiple set is used more
17787 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
17788 attribute types and their corresponding AllowMultiple properties
17790 (AreMultipleAllowed): Check the property for a given type.
17792 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
17793 property in the case we have a TypeContainer.
17795 (Attributes.AddAttribute): Detect duplicates and just skip on
17796 adding them. This trivial fix catches a pretty gross error in our
17797 attribute emission - global attributes were being emitted twice!
17799 Bugzilla bug #33187 is now fixed.
17801 2002-12-06 Miguel de Icaza <miguel@ximian.com>
17803 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
17804 instead of pp_and).
17806 * expression.cs (Binary.ResolveOperator): I can only use the
17807 Concat (string, string, string) and Concat (string, string,
17808 string, string) if the child is actually a concatenation of
17811 2002-12-04 Miguel de Icaza <miguel@ximian.com>
17813 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
17814 context where we need a 2-character lookahead.
17816 * pending.cs (PendingImplementation): Rework so we can keep track
17817 of interface types all the time, and flag those which were
17818 implemented by parents as optional.
17820 2002-12-03 Miguel de Icaza <miguel@ximian.com>
17822 * expression.cs (Binary.ResolveOperator): Use
17823 String.Concat(string,string,string) or
17824 String.Concat(string,string,string,string) when possible.
17826 * typemanager: More helper methods.
17829 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
17831 * pending.cs: remove the bogus return from GetMissingInterfaces()
17832 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
17834 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17836 * namespace.cs: avoid duplicated 'using xxx' being added to
17837 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
17838 when we get more than one 'using' statement for the same namespace.
17839 Report a CS0105 warning for it.
17841 2002-11-30 Miguel de Icaza <miguel@ximian.com>
17843 * cs-tokenizer.cs (consume_identifier): use read directly, instead
17844 of calling getChar/putback, uses internal knowledge of it.
17846 (xtoken): Reorder tokenizer so most common patterns are checked
17847 first. This reduces the compilation time in another 5% (from 8.11s
17848 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
17850 The parsing time is 22% of the compilation in mcs, and from that
17851 64% is spent on the tokenization process.
17853 I tried using a binary search for keywords, but this is slower
17854 than the hashtable. Another option would be to do a couple of
17857 * Not use a StringBuilder, instead use an array of chars,
17858 with a set value. Notice that this way we could catch
17859 the 645 error without having to do it *afterwards*.
17861 * We could write a hand-parser to avoid the hashtable
17862 compares altogether.
17864 The identifier consumption process takes 37% of the tokenization
17865 time. Another 15% is spent on is_number. 56% of the time spent
17866 on is_number is spent on Int64.Parse:
17868 * We could probably choose based on the string length to
17869 use Int32.Parse or Int64.Parse and avoid all the 64-bit
17872 Another 3% is spend on wrapping `xtoken' in the `token' function.
17874 Handle 0xa0 as whitespace (#34752)
17876 2002-11-26 Miguel de Icaza <miguel@ximian.com>
17878 * typemanager.cs (IsCLRType): New routine to tell whether a type
17879 is one of the builtin types.
17881 Maybe it needs to use TypeCodes to be faster. Maybe we could use
17882 typecode in more places instead of doing pointer comparissions.
17883 We could leverage some knowledge about the way the typecodes are
17886 New code to cache namespaces in assemblies, it is currently not
17887 invoked, to be used soon.
17889 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
17891 * expression.cs (Binary.ResolveOperator): specially handle
17892 strings, and do not perform user-defined operator overloading for
17895 2002-11-24 Miguel de Icaza <miguel@ximian.com>
17897 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
17898 internalcall as it is a pretty simple operation; Avoid whenever
17899 possible to call Char.IsLetter.
17901 (consume_identifier): Cut by half the number of
17902 hashtable calls by merging the is_keyword and GetKeyword behavior.
17904 Do not short-circuit, because if we do, we
17905 report errors (ie, #if false && true would produce an invalid
17909 2002-11-24 Martin Baulig <martin@ximian.com>
17911 * expression.cs (Cast.TryReduce): If we're in checked syntax,
17912 check constant ranges and report a CS0221. Fixes #33186.
17914 2002-11-24 Martin Baulig <martin@ximian.com>
17916 * cs-parser.jay: Make this work for uninitialized variable
17917 declarations in the `for' initializer. Fixes #32416.
17919 2002-11-24 Martin Baulig <martin@ximian.com>
17921 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
17922 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
17924 2002-11-24 Martin Baulig <martin@ximian.com>
17926 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
17927 argument; if true, we also check for user-defined conversions.
17928 This is only needed if both arguments are of a user-defined type.
17929 Fixes #30443, added test-175.cs.
17930 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
17932 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
17934 2002-11-24 Martin Baulig <martin@ximian.com>
17936 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
17937 function to get the store opcode.
17938 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
17939 only emit the Ldelema if the store opcode is Stobj. You must run
17940 both test-34 and test-167 to test this. Fixes #34529.
17942 2002-11-23 Martin Baulig <martin@ximian.com>
17944 * ecore.cs (Expression.MemberLookup): Added additional
17945 `qualifier_type' argument which is used when we're being called
17946 from MemberAccess.DoResolve() and null if we're called from a
17948 (Expression.MemberLookupFailed): New method to report errors; this
17949 does the CS1540 check and reports the correct error message.
17951 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
17952 argument for the CS1540 check and redone the way how we're dealing
17953 with private members. See the comment in the source code for details.
17954 (FilterWithClosure): Reverted this back to revision 1.197; renamed
17955 `closure_start_type' to `closure_qualifier_type' and check whether
17956 it's not null. It was not this filter being broken, it was just
17957 being called with the wrong arguments.
17959 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
17960 and pass it the correct `qualifier_type'; this also does the error
17963 2002-11-22 Miguel de Icaza <miguel@ximian.com>
17965 * expression.cs (Invocation.EmitParams): If the we are dealing
17966 with a non-built-in value type, load its address as well.
17968 (ArrayCreation): Use a a pretty constant instead
17969 of the hardcoded value 2. Use 6 instead of 2 for the number of
17970 static initializers.
17972 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
17973 because they are not really value types, just glorified integers.
17975 * driver.cs: Do not append .exe, the CSC compiler does not do it.
17977 * ecore.cs: Remove redundant code for enumerations, make them use
17978 the same code path as everything else, fixes the casting issue
17979 with enumerations in Windows.Forms.
17981 * attribute.cs: Do only cast to string if it is a string, the
17982 validation happens later.
17984 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
17985 people upgrade their corlibs.
17987 * ecore.cs: Oops, enumerations were not following the entire code path
17989 2002-11-21 Miguel de Icaza <miguel@ximian.com>
17991 * typemanager.cs (FilterWithClosure): Commented out the test for
17992 1540 in typemanager.cs, as it has problems when accessing
17993 protected methods from a parent class (see test-174.cs).
17995 * attribute.cs (Attribute.ValidateGuid): new method.
17996 (Attribute.Resolve): Use above.
17998 2002-11-19 Miguel de Icaza <miguel@ximian.com>
18000 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
18002 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
18003 handling for enumerations, as we only needed the TypeContainer
18004 functionality to begin with (this is required for the fix below to
18005 work for enums that reference constants in a container class for
18008 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
18010 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
18011 a valid TypeBuilder to perform lookups on.o
18013 * class.cs (InheritableMemberSignatureCompare): Use true in the
18014 call to GetGetMethod and GetSetMethod, because we are comparing
18015 the signature, and we need to get the methods *even* if they are
18018 (PropertyBase.CheckBase): ditto.
18020 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
18021 GotoCase.Resolve): Use Peel on EmpytCasts.
18023 * ecore.cs (EmptyCast): drop child, add Peel method.
18025 2002-11-17 Martin Baulig <martin@ximian.com>
18027 * ecore.cs (EmptyCast.Child): New public property.
18029 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
18030 label resolved to an EmptyCast. Fixes #34162.
18031 (GotoCase.Resolve): Likewise.
18032 (Block.EmitMeta): Likewise.
18034 2002-11-17 Martin Baulig <martin@ximian.com>
18036 * expression.cs (Invocation.BetterConversion): Prefer int over
18037 uint; short over ushort; long over ulong for integer literals.
18038 Use ImplicitConversionExists instead of StandardConversionExists
18039 since we also need to check for user-defined implicit conversions.
18040 Fixes #34165. Added test-173.cs.
18042 2002-11-16 Martin Baulig <martin@ximian.com>
18044 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
18045 with the `true' and `false' literals. Fixes #33151.
18047 2002-11-16 Martin Baulig <martin@ximian.com>
18049 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
18050 October 22nd; don't do the cs1540 check for static members.
18052 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
18053 now using our own filter here and doing the cs1540 check again.
18055 2002-11-16 Martin Baulig <martin@ximian.com>
18057 * support.cs (InternalParameters): Don't crash if we don't have
18058 any fixed parameters. Fixes #33532.
18060 2002-11-16 Martin Baulig <martin@ximian.com>
18062 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
18063 when looking up static methods to make this work on Windows.
18066 2002-11-16 Martin Baulig <martin@ximian.com>
18068 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
18069 a setter rather than using PropertyInfo.CanWrite.
18071 2002-11-15 Nick Drochak <ndrochak@gol.com>
18073 * class.cs: Allow acces to block member by subclasses. Fixes build
18076 2002-11-14 Martin Baulig <martin@ximian.com>
18078 * class.cs (Constructor.Emit): Added the extern/block check.
18081 2002-11-14 Martin Baulig <martin@ximian.com>
18083 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
18084 iteration while looking for indexers, this is needed because the
18085 indexer may have a different name in our base classes. Fixed the
18086 error reporting (no indexers at all, not get accessor, no
18087 overloaded match). Fixes bug #33089.
18088 (IndexerAccess.DoResolveLValue): Likewise.
18090 2002-11-14 Martin Baulig <martin@ximian.com>
18092 * class.cs (PropertyBase.CheckBase): Make this work for multiple
18093 indexers. Fixes the first part of bug #33089.
18094 (MethodSignature.InheritableMemberSignatureCompare): Added support
18097 2002-11-13 Ravi Pratap <ravi@ximian.com>
18099 * attribute.cs (Attribute.Resolve): Catch the
18100 NullReferenceException and report it since it isn't supposed to
18103 2002-11-12 Miguel de Icaza <miguel@ximian.com>
18105 * expression.cs (Binary.EmitBranchable): Also handle the cases for
18106 LogicalOr and LogicalAnd that can benefit from recursively
18107 handling EmitBranchable. The code now should be nice for Paolo.
18109 2002-11-08 Miguel de Icaza <miguel@ximian.com>
18111 * typemanager.cs (LookupType): Added a negative-hit hashtable for
18112 the Type lookups, as we perform quite a number of lookups on
18113 non-Types. This can be removed once we can deterministically tell
18114 whether we have a type or a namespace in advance.
18116 But this might require special hacks from our corlib.
18120 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
18121 and double which avoids a conversion from an integer to a double.
18123 * expression.cs: tiny optimization, avoid calling IsConstant,
18124 because it effectively performs the lookup twice.
18126 2002-11-06 Miguel de Icaza <miguel@ximian.com>
18128 But a bogus return here to keep the semantics of the old code
18129 until the Mono runtime is fixed.
18131 * pending.cs (GetMissingInterfaces): New method used to remove all
18132 the interfaces that are already implemented by our parent
18133 classes from the list of pending methods.
18135 * interface.cs: Add checks for calls after ResolveTypeExpr.
18137 2002-11-05 Miguel de Icaza <miguel@ximian.com>
18139 * class.cs (Class.Emit): Report warning 67: event not used if the
18140 warning level is beyond 3.
18142 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
18143 being a NullLiteral.
18145 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
18148 * class.cs (TypeContainer.GetClassBases): Cover a missing code
18149 path that might fail if a type can not be resolved.
18151 * expression.cs (Binary.Emit): Emit unsigned versions of the
18154 * driver.cs: use error 5.
18156 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
18158 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
18160 2002-11-01 Miguel de Icaza <miguel@ximian.com>
18162 * cs-parser.jay (switch_section): A beautiful patch from Martin
18163 Baulig that fixed 33094.
18165 2002-10-31 Miguel de Icaza <miguel@ximian.com>
18167 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
18168 Check whether the base is abstract and report an error if so.
18170 * expression.cs (IndexerAccess.DoResolveLValue,
18171 IndexerAccess.DoResolve): ditto.
18173 (Invocation.DoResolve): ditto.
18175 (Invocation.FullMethodDesc): Improve the report string.
18177 * statement.cs (Block): Eliminate IsVariableDefined as it is
18178 basically just a wrapper for GetVariableInfo.
18180 * ecore.cs (SimpleName): Use new
18182 * support.cs (ReflectionParamter.ParameterType): We unwrap the
18183 type, as we return the actual parameter ref/unref state on a
18186 2002-10-30 Miguel de Icaza <miguel@ximian.com>
18188 * support.cs: Return proper flags REF/OUT fixing the previous
18191 * expression.cs: Reverted last patch, that was wrong. Is_ref is
18192 not used to mean `ref' but `ref or out' in ParameterReference
18194 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
18195 full type signature instead of calling TypeManger.CSharpName
18198 * support.cs (InternalParameters.ParameterDesc): Do not compare
18199 directly to the modflags, because REF/OUT will actually be bitsets
18202 * delegate.cs (VerifyMethod): Check also the modifiers.
18204 * cs-tokenizer.cs: Fix bug where floating point values with an
18205 exponent where a sign was missing was ignored.
18207 * driver.cs: Allow multiple assemblies to be specified in a single
18210 2002-10-28 Miguel de Icaza <miguel@ximian.com>
18212 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
18213 because identifiers after a parenthesis would end up in this kind
18214 of production, and we needed to desamiguate it for having casts
18217 (UserDefinedType *) xxx
18219 2002-10-24 Miguel de Icaza <miguel@ximian.com>
18221 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
18222 we should set on the Bindingflags.NonPublic, but not turn on
18223 private_ok. private_ok controls whether a Private member is
18224 returned (this is chekced on the filter routine), while the
18225 BindingFlags.NonPublic just controls whether private/protected
18226 will be allowed. This fixes the problem part of the problem of
18227 private properties being allowed to be used in derived classes.
18229 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
18230 so we can call the children DoResolveLValue method (this will
18231 properly signal errors on lvalue assignments to base properties)
18233 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
18234 getter are null, and we have a property info, we know that this
18235 happened because the lookup failed, so we report an error 122 for
18236 protection level violation.
18238 We also silently return if setter and getter are null in the
18239 resolve functions, this condition only happens if we have flagged
18240 the error before. This is the other half of the problem.
18242 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
18243 not have accessibility information, that is why we were returning
18244 true in the filter function in typemanager.cs.
18246 To properly report 122 (property is inaccessible because of its
18247 protection level) correctly, we report this error in ResolveAccess
18248 by failing if both the setter and the getter are lacking (ie, the
18251 DoResolve and DoLResolve have been modified to check for both
18252 setter/getter being null and returning silently, the reason being
18253 that I did not want to put the knowledge about this error in upper
18256 int old = Report.Errors;
18257 x = new PropertyExpr (...);
18258 if (old != Report.Errors)
18263 So the property expr is returned, but it is invalid, so the error
18264 will be flagged during the resolve process.
18266 * class.cs: Remove InheritablePropertySignatureCompare from the
18267 class, as we no longer depend on the property signature to compute
18268 whether it is possible to implement a method or not.
18270 The reason is that calling PropertyInfo.GetGetMethod will return
18271 null (in .NET, in Mono it works, and we should change this), in
18272 cases where the Get Method does not exist in that particular
18277 class X { public virtual int A { get { return 1; } } }
18279 class Z : Y { public override int A { get { return 2; } } }
18281 Would fail in Z because the parent (Y) would not have the property
18282 defined. So we avoid this completely now (because the alternative
18283 fix was ugly and slow), and we now depend exclusively on the
18286 (PropertyBase.CheckBase): Use a method-base mechanism to find our
18287 reference method, instead of using the property.
18289 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
18290 routines are gone now.
18292 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
18293 names, they were incorrectly named.
18295 * cs-tokenizer.cs: Return are more gentle token on failure.
18297 * pending.cs (PendingImplementation.InterfaceMethod): This routine
18298 had an out-of-sync index variable, which caused it to remove from
18299 the list of pending methods the wrong method sometimes.
18301 2002-10-22 Miguel de Icaza <miguel@ximian.com>
18303 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
18304 CanWrite, because those refer to this particular instance of the
18305 property, and do not take into account the fact that we can
18306 override single members of a property.
18308 Constructor requires an EmitContext. The resolution process does
18309 not happen here, but we need to compute the accessors before,
18310 because the resolution does not always happen for properties.
18312 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
18313 subclass, before we did not update this flag, but we did update
18316 (GetAccessors): Drop this routine, as it did not work in the
18317 presence of partially overwritten set/get methods.
18319 Notice that this broke the cs1540 detection, but that will require
18322 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18326 * driver.cs: issue a warning instead of an error if we don't support
18327 debugging for the platform. Also ignore a couple of errors that may
18328 arise when trying to write the symbols. Undo my previous patch.
18330 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18332 * driver.cs: ignore /debug switch except for Unix platforms.
18334 2002-10-23 Nick Drochak <ndrochak@gol.com>
18336 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
18338 2002-10-21 Miguel de Icaza <miguel@ximian.com>
18340 * driver.cs: Do not make mcs-debug conditional, so we do not break
18341 builds that use it.
18343 * statement.cs (UsageVector.MergeChildren): I would like Martin to
18344 review this patch. But basically after all the children variables
18345 have been merged, the value of "Breaks" was not being set to
18346 new_breaks for Switch blocks. I think that it should be set after
18347 it has executed. Currently I set this to the value of new_breaks,
18348 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
18349 conservative, but I do not understand this code very well.
18351 I did not break anything in the build, so that is good ;-)
18353 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
18355 2002-10-20 Mark Crichton <crichton@gimp.org>
18357 * cfold.cs: Fixed compile blocker. Really fixed it this time.
18359 2002-10-20 Nick Drochak <ndrochak@gol.com>
18361 * cfold.cs: Fixed compile blocker.
18363 2002-10-20 Miguel de Icaza <miguel@ximian.com>
18365 * driver.cs: I was chekcing the key, not the file.
18367 2002-10-19 Ravi Pratap <ravi@ximian.com>
18369 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
18370 message that we were generating - we just need to silently return
18373 2002-10-19 Miguel de Icaza <miguel@ximian.com>
18375 * class.cs (Event.Define): Change my previous commit, as this
18376 breaks the debugger. This is a temporary hack, as it seems like
18377 the compiler is generating events incorrectly to begin with.
18379 * expression.cs (Binary.ResolveOperator): Added support for
18380 "U operator - (E x, E y)"
18382 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
18385 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
18386 init-only variables, but this path did not take into account that
18387 there might be also instance readonly variables. Correct this
18390 This fixes bug 32253
18392 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
18395 * driver.cs: Change the extension for modules to `netmodule'
18397 * cs-parser.jay: Improved slightly the location tracking for
18398 the debugger symbols.
18400 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
18401 modifiers that were specified instead of the hardcoded value
18402 (FamAndAssem). This was basically ignoring the static modifier,
18403 and others. Fixes 32429.
18405 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
18406 fixed a bug in the process (32476)
18408 * expression.cs (ArrayAccess.EmitAssign): Patch from
18409 hwang_rob@yahoo.ca that fixes bug 31834.3
18411 2002-10-18 Miguel de Icaza <miguel@ximian.com>
18413 * driver.cs: Make the module extension .netmodule.
18415 2002-10-16 Miguel de Icaza <miguel@ximian.com>
18417 * driver.cs: Report an error if the resource file is not found
18418 instead of crashing.
18420 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
18421 false, like Emit does.
18423 2002-10-16 Nick Drochak <ndrochak@gol.com>
18425 * typemanager.cs: Remove unused private member. Also reported mcs
18426 bug to report this as a warning like csc.
18428 2002-10-15 Martin Baulig <martin@gnome.org>
18430 * statement.cs (Statement.Emit): Made this a virtual method; emits
18431 the line number info and calls DoEmit().
18432 (Statement.DoEmit): New protected abstract method, formerly knows
18433 as Statement.Emit().
18435 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
18437 2002-10-11 Miguel de Icaza <miguel@ximian.com>
18439 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
18440 have fixed a remaining problem: not every AddXXXX was adding a
18441 fully qualified name.
18443 Now everyone registers a fully qualified name in the DeclSpace as
18444 being defined instead of the partial name.
18446 Downsides: we are slower than we need to be due to the excess
18447 copies and the names being registered this way.
18449 The reason for this is that we currently depend (on the corlib
18450 bootstrap for instance) that types are fully qualified, because
18451 we dump all the types in the namespace, and we should really have
18452 types inserted into the proper namespace, so we can only store the
18453 basenames in the defined_names array.
18455 2002-10-10 Martin Baulig <martin@gnome.org>
18457 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
18458 from bug #31834, see the bug report for a testcase which is
18461 2002-10-10 Martin Baulig <martin@gnome.org>
18463 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
18464 flow analysis code for this.
18466 * statement.cs (Do, While, For): Tell the flow analysis code about
18468 (FlowBranching.UsageVector): Added support for infinite loops.
18469 (Block.Resolve): Moved the dead code elimination here and use flow
18472 2002-10-09 Miguel de Icaza <miguel@ximian.com>
18474 * class.cs (Field.Define): Catch cycles on struct type
18477 * typemanager.cs (IsUnmanagedtype): Do not recursively check
18478 fields if the fields are static. We only need to check instance
18481 * expression.cs (As.DoResolve): Test for reference type.
18483 * statement.cs (Using.ResolveExpression): Use
18484 ConvertImplicitRequired, not ConvertImplicit which reports an
18486 (Using.ResolveLocalVariableDecls): ditto.
18488 * expression.cs (Binary.ResolveOperator): Report errors in a few
18489 places where we had to.
18491 * typemanager.cs (IsUnmanagedtype): Finish implementation.
18493 2002-10-08 Miguel de Icaza <miguel@ximian.com>
18495 * expression.cs: Use StoreFromPtr instead of extracting the type
18496 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
18498 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
18499 an enumeration value to a System.Enum, but System.Enum is not a
18500 value type, but an class type, so we need to box.
18502 (Expression.ConvertExplicit): One codepath could return
18503 errors but not flag them. Fix this. Fixes #31853
18505 * parameter.cs (Resolve): Do not allow void as a parameter type.
18507 2002-10-06 Martin Baulig <martin@gnome.org>
18509 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
18510 if it's a class type and not a struct. Fixes #31815.
18512 2002-10-06 Martin Baulig <martin@gnome.org>
18514 * statement.cs: Reworked the flow analysis code a bit to make it
18515 usable for dead code elimination.
18517 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18519 * cs-parser.jay: allow empty source files. Fixes bug #31781.
18521 2002-10-04 Miguel de Icaza <miguel@ximian.com>
18523 * expression.cs (ComposedCast.DoResolveType): A quick workaround
18524 to fix the test 165, will investigate deeper.
18526 2002-10-04 Martin Baulig <martin@gnome.org>
18528 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
18529 finally blocks actually work.
18530 (Try.Resolve): We don't need to create a sibling for `finally' if
18531 there is no finally block.
18533 2002-10-04 Martin Baulig <martin@gnome.org>
18535 * class.cs (Constructor.Define): The default accessibility for a
18536 non-default constructor is private, not public.
18538 2002-10-04 Miguel de Icaza <miguel@ximian.com>
18540 * class.cs (Constructor): Make AllowedModifiers public, add
18543 * cs-parser.jay: Perform the modifiers test here, as the
18544 constructor for the Constructor class usually receives a zero
18545 because of the way we create it (first we create, later we
18546 customize, and we were never checking the modifiers).
18548 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
18549 is a version of LookupTypeReflection that includes the type-name
18550 cache. This can be used as a fast path for functions that know
18551 the fully qualified name and are only calling into *.GetType() to
18552 obtain a composed type.
18554 This is also used by TypeManager.LookupType during its type
18557 (LookupType): We now also track the real type name, as sometimes
18558 we can get a quey for the real type name from things like
18559 ComposedCast. This fixes bug 31422.
18561 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
18562 complete type fullname, it does not have to go through the type
18563 resolution system to obtain the composed version of the type (for
18564 obtaining arrays or pointers).
18566 (Conditional.Emit): Use the EmitBoolExpression to
18567 generate nicer code, as requested by Paolo.
18569 (ArrayCreation.CheckIndices): Use the patch from
18570 hwang_rob@yahoo.ca to validate the array initializers.
18572 2002-10-03 Miguel de Icaza <miguel@ximian.com>
18574 * class.cs (ConstructorInitializer.Emit): simplify code by using
18575 Invocation.EmitCall, and at the same time, fix the bugs in calling
18576 parent constructors that took variable arguments.
18578 * ecore.cs (Expression.ConvertNumericExplicit,
18579 Expression.ImplicitNumericConversion): Remove the code that
18580 manually wrapped decimal (InternalTypeConstructor call is now gone
18583 * expression.cs (Cast.TryReduce): Also handle decimal types when
18584 trying to perform a constant fold on the type.
18586 * typemanager.cs (IsUnmanagedtype): Partially implemented.
18588 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
18589 that only turned off an error report, and did nothing else.
18591 2002-10-02 Miguel de Icaza <miguel@ximian.com>
18593 * driver.cs: Handle and ignore /fullpaths
18595 2002-10-01 Miguel de Icaza <miguel@ximian.com>
18597 * expression.cs (Binary.ResolveOperator): Catch the case where
18598 DoNumericPromotions returns true,
18600 (Binary.DoNumericPromotions): Simplify the code, and the tests.
18602 2002-09-27 Miguel de Icaza <miguel@ximian.com>
18604 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
18607 2002-09-26 Miguel de Icaza <miguel@ximian.com>
18609 * ecore.cs (ConvertNumericExplicit): It is not enough that the
18610 conversion exists, but it is also required that the conversion be
18611 performed. This manifested in "(Type64Enum) 2".
18613 * class.cs (TypeManager.AddMethod): The fix is not to change
18614 AddEnum, because that one was using a fully qualified name (every
18615 DeclSpace derivative does), but to change the AddMethod routine
18616 that was using an un-namespaced name. This now correctly reports
18617 the duplicated name.
18619 Revert patch until I can properly fix it. The issue
18620 is that we have a shared Type space across all namespaces
18621 currently, which is wrong.
18623 Options include making the Namespace a DeclSpace, and merge
18624 current_namespace/current_container in the parser.
18626 2002-09-25 Miguel de Icaza <miguel@ximian.com>
18628 * cs-parser.jay: Improve error reporting when we get a different
18629 kind of expression in local_variable_type and
18630 local_variable_pointer_type.
18632 Propagate this to avoid missleading errors being reported.
18634 * ecore.cs (ImplicitReferenceConversion): treat
18635 TypeManager.value_type as a target just like object_type. As
18640 Is valid, and needs to result in the int 1 being boxed before it
18641 is assigned to the value type v.
18643 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
18644 to validate the enumeration name.
18646 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
18647 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
18648 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
18650 * ecore.cs (TryImplicitIntConversion): When doing an
18651 implicit-enumeration-conversion, check if the type is 64-bits and
18652 perform a conversion before passing to EnumConstant.
18654 2002-09-23 Miguel de Icaza <miguel@ximian.com>
18656 * decl.cs (Error_AmbiguousTypeReference); New routine used to
18657 report ambiguous type references. Unlike the MS version, we
18658 report what the ambiguity is. Innovation at work ;-)
18660 (DeclSpace.FindType): Require a location argument to
18661 display when we display an ambiguous error.
18663 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
18665 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
18667 * expression.cs (EmitDynamicInitializers): Apply patch from
18668 hwang_rob@yahoo.ca that fixes the order in which we emit our
18671 2002-09-21 Martin Baulig <martin@gnome.org>
18673 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
18674 delegate takes no arguments.
18676 2002-09-20 Miguel de Icaza <miguel@ximian.com>
18678 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
18681 * expression.cs: Extract the underlying type.
18683 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
18685 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
18687 2002-09-19 Miguel de Icaza <miguel@ximian.com>
18689 * class.cs (TypeContainer.DefineType): We can not use the nice
18690 PackingSize with the size set to 1 DefineType method, because it
18691 will not allow us to define the interfaces that the struct
18694 This completes the fixing of bug 27287
18696 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
18697 means also structs. This fixes part of the problem.
18698 (Expresion.ImplicitReferenceConversionExists): ditto.
18700 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
18701 error if there were no errors reported during the type lookup
18702 process, to avoid duplicates or redundant errors. Without this
18703 you would get an ambiguous errors plus a type not found. We have
18704 beaten the user enough with the first error.
18706 (DeclSparce.FindType): Emit a warning if we have an ambiguous
18709 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
18710 during the resolution process, stop the lookup, this avoids
18711 repeated error reports (same error twice).
18713 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
18715 * typemanager.cs (LookupType): Redo the type lookup code to match
18716 the needs of System.Reflection.
18718 The issue is that System.Reflection requires references to nested
18719 types to begin with a "+" sign instead of a dot. So toplevel
18720 types look like: "NameSpace.TopLevelClass", and nested ones look
18721 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
18724 2002-09-19 Martin Baulig <martin@gnome.org>
18726 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
18727 says that a method always returns or always throws an exception,
18728 don't report the CS0161.
18730 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
18731 set `Returns = new_returns'.
18733 2002-09-19 Martin Baulig <martin@gnome.org>
18735 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
18736 to an enum constant, check for a CS0176.
18738 2002-09-18 Miguel de Icaza <miguel@ximian.com>
18740 * class.cs (TypeContainer.CheckPairedOperators): Now we check
18741 for operators that must be in pairs and report errors.
18743 * ecore.cs (SimpleName.DoResolveType): During the initial type
18744 resolution process, when we define types recursively, we must
18745 check first for types in our current scope before we perform
18746 lookups in the enclosing scopes.
18748 * expression.cs (MakeByteBlob): Handle Decimal blobs.
18750 (Invocation.VerifyArgumentsCompat): Call
18751 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
18752 I thought we were supposed to always call this, but there are a
18753 few places in the code where we dont do it.
18755 2002-09-17 Miguel de Icaza <miguel@ximian.com>
18757 * driver.cs: Add support in -linkres and -resource to specify the
18758 name of the identifier.
18760 2002-09-16 Miguel de Icaza <miguel@ximian.com>
18762 * ecore.cs (StandardConversionExists): Sync with the conversion
18763 code: allow anything-* to void* conversions.
18765 (FindMostSpecificSource): Use an Expression argument
18766 instead of a Type, because we might be handed over a Literal which
18767 gets a few more implicit conversions that plain types do not. So
18768 this information was being lost.
18770 Also, we drop the temporary type-holder expression when not
18773 2002-09-17 Martin Baulig <martin@gnome.org>
18775 * class.cs (PropertyBase.CheckBase): Don't check the base class if
18776 this is an explicit interface implementation.
18778 2002-09-17 Martin Baulig <martin@gnome.org>
18780 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
18781 different `IndexerName' attributes.
18783 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
18784 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
18785 virtual CommonResolve().
18787 2002-09-16 Miguel de Icaza <miguel@ximian.com>
18789 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
18790 and convert that to the UnderlyingType.
18792 * statement.cs (Foreach.Resolve): Indexers are just like variables
18793 or PropertyAccesses.
18795 * cs-tokenizer.cs (consume_string): Track line numbers and columns
18796 inside quoted strings, we were not doing this before.
18798 2002-09-16 Martin Baulig <martin@gnome.org>
18800 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
18801 resolve it. This is needed for the definite assignment check of the
18802 instance expression, fixes bug #29846.
18803 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
18805 2002-09-16 Nick Drochak <ndrochak@gol.com>
18807 * parameter.cs: Fix compile error. Cannot reference static member
18808 from an instance object. Is this an mcs bug?
18810 2002-09-14 Martin Baulig <martin@gnome.org>
18812 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
18813 multiple times. Fixes bug #30295, added test-166.cs.
18815 2002-09-14 Martin Baulig <martin@gnome.org>
18817 * statement.cs (Block.Emit): Don't emit unreachable code.
18818 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
18819 `break' statements.
18820 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
18822 2002-09-14 Martin Baulig <martin@gnome.org>
18824 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
18827 2002-09-14 Martin Baulig <martin@gnome.org>
18829 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
18830 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
18831 be false on the ms runtime.
18833 2002-09-13 Martin Baulig <martin@gnome.org>
18835 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
18836 the CS0038 error message.
18838 2002-09-12 Miguel de Icaza <miguel@ximian.com>
18840 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
18841 constant inside, return it.
18843 2002-09-12 Martin Baulig <martin@gnome.org>
18845 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
18846 implicit conversion can be done between enum types.
18848 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
18849 check whether an implicit conversion to the current enum's UnderlyingType
18850 exists and report an error if not.
18852 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
18853 without debugging support.
18855 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
18856 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
18858 2002-09-12 Martin Baulig <martin@gnome.org>
18860 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
18862 * ecore.cs (IMemberExpr.DeclaringType): New property.
18863 (SimpleName.SimpleNameResolve): Check whether we're accessing a
18864 nonstatic member of an outer type (CS0038).
18866 2002-09-11 Miguel de Icaza <miguel@ximian.com>
18868 * driver.cs: Activate the using-error detector at warning level
18869 4 (at least for MS-compatible APIs).
18871 * namespace.cs (VerifyUsing): Small buglett fix.
18873 * pending.cs (PendingImplementation): pass the container pointer.
18875 * interface.cs (GetMethods): Allow for recursive definition. Long
18876 term, I would like to move every type to support recursive
18877 definitions, not the current ordering mechanism that we have right
18880 The situation is this: Attributes are handled before interfaces,
18881 so we can apply attributes to interfaces. But some attributes
18882 implement interfaces, we will now handle the simple cases
18883 (recursive definitions will just get an error).
18885 * parameter.cs: Only invalidate types at the end if we fail to
18888 2002-09-09 Martin Baulig <martin@gnome.org>
18890 * ecore.cs (PropertyExpr.Emit): Also check for
18891 TypeManager.system_int_array_get_length so this'll also work when
18892 compiling corlib. Fixes #30003.
18894 2002-09-09 Martin Baulig <martin@gnome.org>
18896 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
18897 and throw an exception if we can't get the type's size. Fixed #30040,
18900 2002-09-09 Martin Baulig <martin@gnome.org>
18902 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
18904 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
18905 context. Fixes bug #30027.
18907 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
18908 virtual functions. Fixes bug #30043, added test-164.cs.
18910 2002-09-08 Ravi Pratap <ravi@ximian.com>
18912 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
18914 2002-09-08 Nick Drochak <ndrochak@gol.com>
18916 * driver.cs: Use an object to get the windows codepage since it's not a
18919 2002-09-08 Miguel de Icaza <miguel@ximian.com>
18921 * statement.cs (For.Emit): for infinite loops (test == null)
18922 return whether there is a break inside, not always "true".
18924 * namespace.cs (UsingEntry): New struct to hold the name of the
18925 using definition, the location where it is defined, and whether it
18926 has been used in a successful type lookup.
18928 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
18933 2002-09-06 Ravi Pratap <ravi@ximian.com>
18935 * attribute.cs : Fix incorrect code which relied on catching
18936 a NullReferenceException to detect a null being passed in
18937 where an object was expected.
18939 2002-09-06 Miguel de Icaza <miguel@ximian.com>
18941 * statement.cs (Try): flag the catch variable as assigned
18943 * expression.cs (Cast): Simplified by using ResolveType instead of
18944 manually resolving.
18946 * statement.cs (Catch): Fix bug by using ResolveType.
18948 2002-09-06 Ravi Pratap <ravi@ximian.com>
18950 * expression.cs (BetterConversion): Special case for when we have
18951 a NullLiteral as the argument and we have to choose between string
18952 and object types - we choose string the way csc does.
18954 * attribute.cs (Attribute.Resolve): Catch the
18955 NullReferenceException and report error #182 since the Mono
18956 runtime no more has the bug and having this exception raised means
18957 we tried to select a constructor which takes an object and is
18960 2002-09-05 Ravi Pratap <ravi@ximian.com>
18962 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
18963 message (1502, 1503) when we can't locate a method after overload
18964 resolution. This is much more informative and closes the bug
18967 * interface.cs (PopulateMethod): Return if there are no argument
18968 types. Fixes a NullReferenceException bug.
18970 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
18971 expressions too. Previously we were checking only in one place for
18972 positional arguments leaving out named arguments.
18974 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
18975 type to the enum type is not allowed. Remove code corresponding to
18978 (ConvertNumericExplicit): Allow explicit conversions from
18979 the underlying type to enum type. This precisely follows the spec
18980 and closes a bug filed by Gonzalo.
18982 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18985 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
18987 2002-09-03 Miguel de Icaza <miguel@ximian.com>
18989 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
18990 it was important that we stored the right value after the
18991 reduction in `converted'.
18993 2002-09-04 Martin Baulig <martin@gnome.org>
18995 * location.cs (Location.SymbolDocument): Use full pathnames for the
18998 2002-08-30 Miguel de Icaza <miguel@ximian.com>
19000 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
19001 of the expression resolve mechanism, because that will catch the
19002 SimpleName error failures.
19004 (Conditional): If we can not resolve the
19005 expression, return, do not crash.
19007 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19010 (location): display token name instead of its number.
19012 2002-08-28 Martin Baulig <martin@gnome.org>
19014 * expression.cs (Binary.ResolveOperator): Don't silently return
19015 but return an error if an operator cannot be applied between two
19018 2002-08-28 Martin Baulig <martin@gnome.org>
19020 * class.cs (Constructor.Define): Set the permission attributes
19021 correctly instead of making all constructors public.
19023 2002-08-28 Martin Baulig <martin@gnome.org>
19025 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
19026 for private members before reporting a CS0103; if we find anything,
19029 2002-08-28 Martin Baulig <martin@gnome.org>
19031 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
19032 to check whether `closure_start_type == closure_invocation_type',
19033 we also need to check whether `m.DeclaringType == closure_invocation_type'
19034 before bypassing the permission checks. We might be accessing
19035 protected/private members from the base class.
19036 (TypeManager.RealMemberLookup): Only set private_ok if private
19037 members were requested via BindingFlags.NonPublic.
19039 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
19041 * expression.cs (MemberAccess.ResolveMemberAccess): Set
19042 MethodGroupExpr.IsExplicitImpl if appropriate.
19043 (Invocation.DoResolve): Don't report the CS0120 for explicit
19044 interface implementations.
19046 2002-08-27 Martin Baulig <martin@gnome.org>
19048 * expression.cs (Invocation.DoResolve): If this is a static
19049 method and we don't have an InstanceExpression, we must report
19052 2002-08-25 Martin Baulig <martin@gnome.org>
19054 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
19055 `==' between a valuetype and an object.
19057 2002-08-25 Miguel de Icaza <miguel@ximian.com>
19059 * ecore.cs (TypeExpr): Provide a ToString method.
19061 2002-08-24 Martin Baulig <martin@gnome.org>
19063 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
19064 now called proggie.dbg and it's a binary file.
19066 2002-08-23 Martin Baulig <martin@gnome.org>
19068 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
19070 2002-08-23 Martin Baulig <martin@gnome.org>
19072 * struct.cs (MyStructInfo.ctor): Make this work with empty
19073 structs; it's not allowed to use foreach() on null.
19075 2002-08-23 Martin Baulig <martin@gnome.org>
19077 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
19078 writer the full pathname of the generated assembly.
19080 2002-08-23 Martin Baulig <martin@gnome.org>
19082 * statements.cs (FlowBranching.UsageVector.MergeChildren):
19083 A `finally' block never returns or breaks; improved handling of
19086 2002-08-23 Martin Baulig <martin@gnome.org>
19088 * statement.cs (Throw.Resolve): Allow `throw null'.
19090 2002-08-23 Martin Baulig <martin@gnome.org>
19092 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
19093 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
19094 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
19095 MemberLookup would return a wrong event if this is an explicit
19096 interface implementation and the class has an event with the same
19099 2002-08-23 Martin Baulig <martin@gnome.org>
19101 * statement.cs (Block.AddChildVariableNames): New public method.
19102 (Block.AddChildVariableName): Likewise.
19103 (Block.IsVariableNameUsedInChildBlock): Likewise.
19104 (Block.AddVariable): Check whether a variable name has already
19105 been used in a child block.
19107 * cs-parser.jay (declare_local_variables): Mark all variable names
19108 from the current block as being used in a child block in the
19111 2002-08-23 Martin Baulig <martin@gnome.org>
19113 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
19114 find the symbol writer.
19116 * driver.cs: csc also allows the arguments to /define being
19117 separated by commas, not only by semicolons.
19119 2002-08-23 Martin Baulig <martin@gnome.org>
19121 * interface.cs (Interface.GetMembers): Added static check for events.
19123 2002-08-15 Martin Baulig <martin@gnome.org>
19125 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
19126 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
19128 * ecore.cs (Expression.MemberLookup): Added documentation and explained
19129 why the MethodData.EmitDestructor() change was necessary.
19131 2002-08-20 Martin Baulig <martin@gnome.org>
19133 * class.cs (TypeContainer.FindMembers): Added static check for events.
19135 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
19137 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
19138 use Type.GetEvents(), not Type.FindMembers().
19140 2002-08-20 Martin Baulig <martin@gnome.org>
19142 * decl.cs (MemberCache): Added a special method cache which will
19143 be used for method-only searched. This ensures that a method
19144 search will return a MethodInfo with the correct ReflectedType for
19147 2002-08-20 Martin Baulig <martin@gnome.org>
19149 * decl.cs (DeclSpace.FindMembers): Made this public.
19151 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19153 * delegate.cs: fixed build on windows.
19154 [FIXME: Filed as bug #29150: MCS must report these errors.]
19156 2002-08-19 Ravi Pratap <ravi@ximian.com>
19158 * ecore.cs (StandardConversionExists): Return a false
19159 if we are trying to convert the void type to anything else
19160 since that is not allowed.
19162 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
19163 we flag error 70 in the event an event is trying to be accessed
19164 directly from outside the declaring type.
19166 2002-08-20 Martin Baulig <martin@gnome.org>
19168 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
19169 MemberCache from typemanager.cs to decl.cs.
19171 2002-08-19 Martin Baulig <martin@gnome.org>
19173 * class.cs (TypeContainer): Implement IMemberContainer.
19174 (TypeContainer.DefineMembers): Create the MemberCache.
19175 (TypeContainer.FindMembers): Do better BindingFlags checking; only
19176 return public members if BindingFlags.Public was given, check
19177 whether members are static.
19179 2002-08-16 Martin Baulig <martin@gnome.org>
19181 * decl.cs (DeclSpace.Define): Splitted this in Define and
19182 DefineMembers. DefineMembers is called first and initializes the
19185 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
19186 DefineMembers() on all our DeclSpaces.
19188 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
19189 but call DefineMembers() on all nested interfaces. We call their
19190 Define() in our new Define() function.
19192 * interface.cs (Interface): Implement IMemberContainer.
19193 (Interface.Define): Moved all code except the attribute stuf to
19195 (Interface.DefineMembers): Initialize the member cache.
19197 * typemanager.cs (IMemberFinder): Removed this interface, we don't
19198 need this anymore since we can use MemberCache.FindMembers directly.
19200 2002-08-19 Martin Baulig <martin@gnome.org>
19202 * typemanager.cs (MemberCache): When creating the cache for an
19203 interface type, add all inherited members.
19204 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
19205 to `out bool used_cache' and documented it.
19206 (TypeManager.MemberLookup): If we already used the cache in the first
19207 iteration, we don't need to do the interfaces check.
19209 2002-08-19 Martin Baulig <martin@gnome.org>
19211 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
19212 here from IMemberFinder and don't implement this interface anymore.
19213 (DeclSpace.MemberCache): Moved here from IMemberFinder.
19215 * typemanager.cs (IMemberFinder): This interface is now only used by
19216 classes which actually support the member cache.
19217 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
19218 since we only put DeclSpaces into this Hashtable.
19219 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
19220 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
19222 2002-08-16 Martin Baulig <martin@gnome.org>
19224 * typemanager.cs (ICachingMemberFinder): Removed.
19225 (IMemberFinder.MemberCache): New property.
19226 (TypeManager.FindMembers): Merged this with RealFindMembers().
19227 This function will never be called from TypeManager.MemberLookup()
19228 so we can't use the cache here, just the IMemberFinder.
19229 (TypeManager.MemberLookup_FindMembers): Check whether the
19230 IMemberFinder has a MemberCache and call the cache's FindMembers
19232 (MemberCache): Rewrote larger parts of this yet another time and
19233 cleaned it up a bit.
19235 2002-08-15 Miguel de Icaza <miguel@ximian.com>
19237 * driver.cs (LoadArgs): Support quoting.
19239 (Usage): Show the CSC-like command line arguments.
19241 Improved a few error messages.
19243 2002-08-15 Martin Baulig <martin@gnome.org>
19245 * typemanager.cs (IMemberContainer.Type): New property.
19246 (IMemberContainer.IsInterface): New property.
19248 The following changes are conditional to BROKEN_RUNTIME, which is
19249 defined at the top of the file.
19251 * typemanager.cs (MemberCache.MemberCache): Don't add the base
19252 class'es members, but add all members from TypeHandle.ObjectType
19253 if we're an interface.
19254 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
19255 is the current type.
19256 (MemberCache.CacheEntry.Container): Removed this field.
19257 (TypeHandle.GetMembers): Include inherited members.
19259 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19261 * typemanager.cs: fixed compilation and added a comment on a field that
19264 2002-08-15 Martin Baulig <martin@gnome.org>
19266 * class.cs (ConstructorInitializer.Resolve): In the
19267 Expression.MemberLookup call, use the queried_type as
19270 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
19271 declared' attribute, it's always true.
19272 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
19273 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
19274 temporary wrapper for FindMembers which tells MemberLookup whether
19275 members from the base classes are included in the return value.
19276 This will go away soon.
19277 (TypeManager.MemberLookup): Use this temporary hack here; once the
19278 new MemberCache is completed, we don't need to do the DeclaredOnly
19279 looping here anymore since the MemberCache will take care of this.
19280 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
19281 (MemberCache): When creating the MemberCache for a class, get
19282 members from the current class and all its base classes.
19283 (MemberCache.CacheEntry.Container): New field. This is a
19284 temporary hack until the Mono runtime is fixed to distinguish
19285 between ReflectedType and DeclaringType. It allows us to use MCS
19286 with both the MS runtime and the unfixed Mono runtime without
19287 problems and without accecting performance.
19288 (MemberCache.SearchMembers): The DeclaredOnly looping from
19289 TypeManager.MemberLookup is now done here.
19291 2002-08-14 Martin Baulig <martin@gnome.org>
19293 * statement.cs (MyStructInfo.MyStructInfo): Don't call
19294 Type.GetFields on dynamic types but get the fields from the
19295 corresponding TypeContainer.
19296 (MyStructInfo.GetStructInfo): Added check for enum types.
19298 * typemanager.cs (MemberList.IsSynchronized): Implemented.
19299 (MemberList.SyncRoot): Implemented.
19300 (TypeManager.FilterWithClosure): No need to check permissions if
19301 closure_start_type == closure_invocation_type, don't crash if
19302 closure_invocation_type is null.
19304 2002-08-13 Martin Baulig <martin@gnome.org>
19306 Rewrote TypeContainer.FindMembers to use a member cache. This
19307 gives us a speed increase of about 35% for the self-hosting MCS
19308 build and of about 15-20% for the class libs (both on GNU/Linux).
19310 * report.cs (Timer): New class to get enhanced profiling. This
19311 whole class is "TIMER" conditional since it remarkably slows down
19314 * class.cs (MemberList): New class. This is an IList wrapper
19315 which we're now using instead of passing MemberInfo[]'s around to
19316 avoid copying this array unnecessarily.
19317 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
19318 (ICachingMemberFinder, IMemberContainer): New interface.
19319 (TypeManager.FilterWithClosure): If `criteria' is null, the name
19320 has already been checked, otherwise use it for the name comparision.
19321 (TypeManager.FindMembers): Renamed to RealMemberFinder and
19322 provided wrapper which tries to use ICachingMemberFinder.FindMembers
19323 if possible. Returns a MemberList, not a MemberInfo [].
19324 (TypeHandle): New class, implements IMemberContainer. We create
19325 one instance of this class per type, it contains a MemberCache
19326 which is used to do the member lookups.
19327 (MemberCache): New class. Each instance of this class contains
19328 all members of a type and a name-based hash table.
19329 (MemberCache.FindMembers): This is our new member lookup
19330 function. First, it looks up all members of the requested name in
19331 the hash table. Then, it walks this list and sorts out all
19332 applicable members and returns them.
19334 2002-08-13 Martin Baulig <martin@gnome.org>
19336 In addition to a nice code cleanup, this gives us a performance
19337 increase of about 1.4% on GNU/Linux - not much, but it's already
19338 half a second for the self-hosting MCS compilation.
19340 * typemanager.cs (IMemberFinder): New interface. It is used by
19341 TypeManager.FindMembers to call FindMembers on a TypeContainer,
19342 Enum, Delegate or Interface.
19343 (TypeManager.finder_to_member_finder): New PtrHashtable.
19344 (TypeManager.finder_to_container): Removed.
19345 (TypeManager.finder_to_delegate): Removed.
19346 (TypeManager.finder_to_interface): Removed.
19347 (TypeManager.finder_to_enum): Removed.
19349 * interface.cs (Interface): Implement IMemberFinder.
19351 * delegate.cs (Delegate): Implement IMemberFinder.
19353 * enum.cs (Enum): Implement IMemberFinder.
19355 * class.cs (TypeContainer): Implement IMemberFinder.
19357 2002-08-12 Martin Baulig <martin@gnome.org>
19359 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
19361 2002-08-12 Martin Baulig <martin@gnome.org>
19363 * ecore.cs (ITypeExpression): New interface for expressions which
19365 (TypeExpression): Renamed to TypeLookupExpression.
19366 (Expression.DoResolve): If we're doing a types-only lookup, the
19367 expression must implement the ITypeExpression interface and we
19368 call DoResolveType() on it.
19369 (SimpleName): Implement the new ITypeExpression interface.
19370 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
19371 hack, the situation that we're only looking up types can't happen
19372 anymore when this method is called. Moved the type lookup code to
19373 DoResolveType() and call it.
19374 (SimpleName.DoResolveType): This ITypeExpression interface method
19375 is now doing the types-only lookup.
19376 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
19377 (ResolveFlags): Added MaskExprClass.
19379 * expression.cs (MemberAccess): Implement the ITypeExpression
19381 (MemberAccess.DoResolve): Added support for a types-only lookup
19382 when we're called via ITypeExpression.DoResolveType().
19383 (ComposedCast): Implement the ITypeExpression interface.
19385 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
19386 Expression.Resolve() with ResolveFlags.Type instead.
19388 2002-08-12 Martin Baulig <martin@gnome.org>
19390 * interface.cs (Interface.Define): Apply attributes.
19392 * attribute.cs (Attribute.ApplyAttributes): Added support for
19393 interface attributes.
19395 2002-08-11 Martin Baulig <martin@gnome.org>
19397 * statement.cs (Block.Emit): Only check the "this" variable if we
19398 do not always throw an exception.
19400 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
19401 whether the property has a set accessor.
19403 2002-08-11 Martin Baulig <martin@gnome.org>
19405 Added control flow analysis support for structs.
19407 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
19408 with control flow analysis turned off.
19409 (IVariable): New interface.
19410 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
19411 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
19412 (FieldExpr.DoResolve): Resolve the instance expression with flow
19413 analysis turned off and do the definite assignment check after the
19414 resolving when we know what the expression will resolve to.
19416 * expression.cs (LocalVariableReference, ParameterReference):
19417 Implement the new IVariable interface, only call the flow analysis
19418 code if ec.DoFlowAnalysis is true.
19419 (This): Added constructor which takes a Block argument. Implement
19420 the new IVariable interface.
19421 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
19422 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
19423 This does the definite assignment checks for struct members.
19425 * class.cs (Constructor.Emit): If this is a non-static `struct'
19426 constructor which doesn't have any initializer, call
19427 Block.AddThisVariable() to tell the flow analysis code that all
19428 struct elements must be initialized before control returns from
19431 * statement.cs (MyStructInfo): New public class.
19432 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
19433 argument to this indexer. If non-zero, check an individual struct
19434 member, not the whole struct.
19435 (FlowBranching.CheckOutParameters): Check struct members.
19436 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
19437 overloaded versions of these methods which take an additional
19438 `int field_idx' argument to check struct members.
19439 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
19440 overloaded versions of these methods which take an additional
19441 `string field_name' argument to check struct member.s
19442 (VariableInfo): Implement the IVariable interface.
19443 (VariableInfo.StructInfo): New public property. Returns the
19444 MyStructInfo instance of the variable if it's a struct or null.
19445 (Block.AddThisVariable): New public method. This is called from
19446 Constructor.Emit() for non-static `struct' constructor which do
19447 not have any initializer. It creates a special variable for the
19448 "this" instance variable which will be checked by the flow
19449 analysis code to ensure that all of the struct's fields are
19450 initialized before control returns from the constructor.
19451 (UsageVector): Added support for struct members. If a
19452 variable/parameter is a struct with N members, we reserve a slot
19453 in the usage vector for each member. A struct is considered fully
19454 initialized if either the struct itself (slot 0) or all its
19455 members are initialized.
19457 2002-08-08 Martin Baulig <martin@gnome.org>
19459 * driver.cs (Driver.MainDriver): Only report an error CS5001
19460 if there were no compilation errors.
19462 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
19463 `UnsafeContext' property to determine whether the parent is in
19464 unsafe context rather than checking the parent's ModFlags:
19465 classes nested in an unsafe class are unsafe as well.
19467 2002-08-08 Martin Baulig <martin@gnome.org>
19469 * statement.cs (UsageVector.MergeChildren): Distinguish between
19470 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
19471 we return. Added test17() and test18() to test-154.cs.
19473 2002-08-08 Martin Baulig <martin@gnome.org>
19475 * typemanager.cs (TypeManager.FilterWithClosure): If we have
19476 Family access, make sure the invoking type isn't a subclass of the
19477 queried type (that'd be a CS1540).
19479 * ecore.cs (Expression.MemberLookup): Added overloaded version of
19480 this method which takes an additional `Type invocation_type'.
19482 * expression.cs (BaseAccess.DoResolve): Use the base type as
19483 invocation and query type.
19484 (MemberAccess.DoResolve): If the lookup failed and we're about to
19485 report a CS0122, try a lookup with the ec.ContainerType - if this
19486 succeeds, we must report a CS1540.
19488 2002-08-08 Martin Baulig <martin@gnome.org>
19490 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
19491 (MethodGroupExpr): Implement the IMemberExpr interface.
19493 * expression (MemberAccess.ResolveMemberAccess): No need to have
19494 any special code for MethodGroupExprs anymore, they're now
19497 2002-08-08 Martin Baulig <martin@gnome.org>
19499 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
19500 Family, FamANDAssem and FamORAssem permissions.
19501 (TypeManager.IsSubclassOrNestedChildOf): New public method.
19503 2002-08-08 Martin Baulig <martin@gnome.org>
19505 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
19506 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
19509 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
19511 * driver.cs: implemented /resource option to embed managed resources.
19513 2002-08-07 Martin Baulig <martin@gnome.org>
19515 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
19516 (FieldBase.HasFieldInitializer): New public property.
19517 (FieldBase.GetInitializerExpression): New public method. Resolves and
19518 returns the field initializer and makes sure it is only resolved once.
19519 (TypeContainer.EmitFieldInitializers): Call
19520 FieldBase.GetInitializerExpression to get the initializer, this ensures
19521 that it isn't resolved multiple times.
19523 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
19524 the resolving process (SimpleName/MemberLookup) that we're currently
19525 emitting a field initializer (which must not access any instance members,
19526 this is an error CS0236).
19528 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
19529 argument, if the `IsFieldInitializer' flag is set, we must report and
19530 error CS0236 and not an error CS0120.
19532 2002-08-07 Martin Baulig <martin@gnome.org>
19534 * ecore.cs (IMemberExpr): New public interface.
19535 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
19536 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
19537 if the expression is an IMemberExpr.
19539 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
19540 to be null, implicitly default to `this' if we're non-static in
19541 this case. Simplified the code a lot by using the new IMemberExpr
19542 interface. Also fixed bug #28176 here.
19544 2002-08-06 Martin Baulig <martin@gnome.org>
19546 * cs-parser.jay (SimpleLookup): Removed. We need to create
19547 ParameterReferences during semantic analysis so that we can do a
19548 type-only search when resolving Cast, TypeOf and SizeOf.
19549 (block): Pass the `current_local_parameters' to the Block's
19552 * class.cs (ConstructorInitializer): Added `Parameters parameters'
19553 argument to the constructor.
19554 (ConstructorInitializer.Resolve): Create a temporary implicit
19555 block with the parameters.
19557 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
19558 references here if we aren't doing a type-only search.
19560 * statement.cs (Block): Added constructor which takes a
19561 `Parameters parameters' argument.
19562 (Block.Parameters): New public property.
19564 * support.cs (InternalParameters.Parameters): Renamed `parameters'
19565 to `Parameters' and made it public readonly.
19567 2002-08-06 Martin Baulig <martin@gnome.org>
19569 * ecore.cs (Expression.Warning): Made this public as well.
19571 * report.cs (Report.Debug): Print the contents of collections.
19573 2002-08-06 Martin Baulig <martin@gnome.org>
19575 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
19576 used to tell Resolve() which kinds of expressions it may return.
19577 (Expression.Resolve): Added overloaded version of this method which
19578 takes a `ResolveFlags flags' argument. This can be used to tell
19579 Resolve() which kinds of expressions it may return. Reports a
19581 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
19582 ResolveFlags.SimpleName.
19583 (Expression.Error118): Added overloaded version of this method which
19584 takes a `ResolveFlags flags' argument. It uses the flags to determine
19585 which kinds of expressions are allowed.
19587 * expression.cs (Argument.ResolveMethodGroup): New public method.
19588 Resolves an argument, but allows a MethodGroup to be returned.
19589 This is used when invoking a delegate.
19591 * TODO: Updated a bit.
19593 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19595 Fixed compilation with csc.
19597 * ecore.cs: Expression.Error made public. Is this correct? Should
19598 Warning be made public too?
19600 * expression.cs: use ea.Location instead of ea.loc.
19601 [FIXME: Filed as bug #28607: MCS must report these errors.]
19603 2002-08-06 Martin Baulig <martin@gnome.org>
19605 * ecore.cs (Expression.loc): Moved the location here instead of
19606 duplicating it in all derived classes.
19607 (Expression.Location): New public property.
19608 (Expression.Error, Expression.Warning): Made them non-static and
19609 removed the location argument.
19610 (Expression.Warning): Added overloaded version which takes an
19611 `int level' argument.
19612 (Expression.Error118): Make this non-static and removed the
19613 expression and location arguments.
19614 (TypeExpr): Added location argument to the constructor.
19616 * expression.cs (StaticCallExpr): Added location argument to
19618 (Indirection, PointerArithmetic): Likewise.
19619 (CheckedExpr, UnCheckedExpr): Likewise.
19620 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
19621 (StringPtr): Likewise.
19624 2002-08-05 Martin Baulig <martin@gnome.org>
19626 * expression.cs (BaseAccess.DoResolve): Actually report errors.
19628 * assign.cs (Assign.DoResolve): Check whether the source
19629 expression is a value or variable.
19631 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
19632 while resolving the corresponding blocks.
19634 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
19635 an error, don't silently return null.
19637 * statement.cs (Block.AddVariable): Do the error reporting here
19638 and distinguish between CS0128 and CS0136.
19639 (Block.DoResolve): Report all unused labels (warning CS0164).
19640 (LabeledStatement): Pass the location to the constructor.
19641 (LabeledStatement.HasBeenReferenced): New property.
19642 (LabeledStatement.Resolve): Set it to true here.
19644 * statement.cs (Return.Emit): Return success even after reporting
19645 a type mismatch error (CS0126 or CS0127), this is what csc does and
19646 it avoids confusing the users with any consecutive errors.
19648 2002-08-05 Martin Baulig <martin@gnome.org>
19650 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
19652 * const.cs (Const.LookupConstantValue): Catch circular definitions.
19654 * expression.cs (MemberAccess.DoResolve): Silently return if an
19655 error has already been reported.
19657 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
19658 error has already been reported.
19660 2002-08-05 Martin Baulig <martin@gnome.org>
19662 * statement.cs (UsageVector): Only initialize the `parameters'
19663 vector if we actually have any "out" parameters.
19665 2002-08-05 Martin Baulig <martin@gnome.org>
19667 * expression.cs (Binary.ResolveOperator): When combining delegates,
19668 they must have the same type.
19670 2002-08-05 Martin Baulig <martin@gnome.org>
19672 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
19673 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
19674 work with the ms runtime and we also don't need it: if we're a
19675 PropertyBuilder and not in the `indexer_arguments' hash, then we
19676 are a property and not an indexer.
19678 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
19679 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
19680 since the latter one doesn't work with the ms runtime.
19682 2002-08-03 Martin Baulig <martin@gnome.org>
19684 Fixed bugs #27998 and #22735.
19686 * class.cs (Method.IsOperator): New public field.
19687 (Method.CheckBase): Report CS0111 if there's already a method
19688 with the same parameters in the current class. Report CS0508 when
19689 attempting to change the return type of an inherited method.
19690 (MethodData.Emit): Report CS0179 if a method doesn't have a body
19691 and it's not marked abstract or extern.
19692 (PropertyBase): New abstract base class for Property and Indexer.
19693 (PropertyBase.CheckBase): Moved here from Property and made it work
19695 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
19696 the same so we can reuse it there.
19697 (Property, Indexer): Derive from PropertyBase.
19698 (MethodSignature.inheritable_property_signature_filter): New delegate
19699 to find properties and indexers.
19701 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
19702 argument and improved error reporting.
19704 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
19705 EmptyReadOnlyParameters and made it a property.
19707 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
19708 version of this method which takes a `PropertyInfo indexer'.
19709 (TypeManager.RegisterIndexer): New method.
19711 * class.cs: Added myself as author of this file :-)
19713 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19715 * class.cs: fixed compilation on windoze.
19717 2002-08-03 Martin Baulig <martin@gnome.org>
19719 * interface.cs (Interface.GetInterfaceBases): Check whether all
19720 base interfaces are at least as accessible than the current one.
19722 * class.cs (TypeContainer.GetClassBases): Check whether base types
19723 are at least as accessible than the current type.
19724 (TypeContainer.AsAccessible): Implemented and made non-static.
19725 (MemberBase.CheckParameters): Report errors if the accessibility
19728 * delegate.cs (Delegate.Delegate): The default visibility is
19729 internal for top-level types and private for nested types.
19730 (Delegate.Define): Report errors if the accessibility checks fail.
19732 * enum.cs (Enum.Enum): The default visibility is internal for
19733 top-level types and private for nested types.
19734 (Enum.DefineType): Compute the correct visibility.
19736 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
19737 function which takes a `bool is_toplevel' instead of a TypeContainer.
19739 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
19742 2002-08-02 Martin Baulig <martin@gnome.org>
19744 * expression.cs (LocalVariableReferenc): Added constructor which
19745 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
19746 (LocalVariableReference.IsReadOnly): New property.
19747 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
19748 variable is readonly, use our own readonly flag to do this; you can
19749 use the new constructor to get a writable reference to a read-only
19752 * cs-parser.jay (foreach_statement, using_statement): Get a writable
19753 reference to the local variable.
19755 2002-08-01 Miguel de Icaza <miguel@ximian.com>
19757 * rootcontext.cs (ResolveCore): Also include System.Exception
19759 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
19760 we reach an EmptyStatement.
19762 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
19765 * expression.cs (Binary.ResolveOperator): Check error result in
19768 use brtrue/brfalse directly and avoid compares to null.
19770 2002-08-02 Martin Baulig <martin@gnome.org>
19772 * class.cs (TypeContainer.Define): Define all nested interfaces here.
19773 Fixes bug #28407, added test-155.cs.
19775 2002-08-01 Martin Baulig <martin@gnome.org>
19777 * class.cs (Event.EmitDefaultMethod): Make this work with static
19778 events. Fixes #28311, added verify-3.cs.
19780 2002-08-01 Martin Baulig <martin@gnome.org>
19782 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
19783 `is_disposable' fields.
19784 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
19785 `hm.is_disposable' if we're using the collection pattern.
19786 (Foreach.EmitCollectionForeach): Use the correct type for the
19787 enumerator's local variable, only emit the try/finally block if
19788 necessary (fixes #27713).
19790 2002-08-01 Martin Baulig <martin@gnome.org>
19792 * ecore.cs (Expression.report118): Renamed to Error118 and made
19795 * statement.cs (Throw.Resolve): Check whether the expression is of
19796 the correct type (CS0118) and whether the type derives from
19797 System.Exception (CS0155).
19798 (Catch.Resolve): New method. Do the type lookup here and check
19799 whether it derives from System.Exception (CS0155).
19800 (Catch.CatchType, Catch.IsGeneral): New public properties.
19802 * typemanager.cs (TypeManager.exception_type): Added.
19804 2002-07-31 Miguel de Icaza <miguel@ximian.com>
19806 * driver.cs: Updated About function.
19808 2002-07-31 Martin Baulig <martin@gnome.org>
19810 Implemented Control Flow Analysis.
19812 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
19813 (EmitContext.CurrentBranching): Added.
19814 (EmitContext.StartFlowBranching): Added.
19815 (EmitContext.EndFlowBranching): Added.
19816 (EmitContext.KillFlowBranching): Added.
19817 (EmitContext.IsVariableAssigned): Added.
19818 (EmitContext.SetVariableAssigned): Added.
19819 (EmitContext.IsParameterAssigned): Added.
19820 (EmitContext.SetParameterAssigned): Added.
19821 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
19822 Added control flow analysis stuff here.
19824 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
19825 resolve the expression as lvalue.
19826 (LocalVariableReference.DoResolve): Check whether the variable has
19827 already been assigned.
19828 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
19829 the parameter as assigned here.
19830 (ParameterReference.DoResolve): Check whether the parameter has already
19832 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
19833 expression as lvalue.
19835 * statement.cs (FlowBranching): New class for the flow analysis code.
19836 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
19837 (LabeledStatement.IsDefined): New public property.
19838 (LabeledStatement.AddUsageVector): New public method to tell flow
19839 analyis that the label may be reached via a forward jump.
19840 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
19842 (VariableInfo.Number): New public field. This is used by flow analysis
19843 to number all locals of a block.
19844 (Block.CountVariables): New public property. This is the number of
19845 local variables in this block (including the locals from all parent
19847 (Block.EmitMeta): Number all the variables.
19849 * statement.cs: Added flow analysis support to all classes.
19851 2002-07-31 Martin Baulig <martin@gnome.org>
19853 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
19854 To get debugging messages, compile mcs with /define:MCS_DEBUG and
19855 then use this argument.
19857 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
19859 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
19860 use this to specify /define options.
19862 2002-07-29 Martin Baulig <martin@gnome.org>
19864 * statement.cs (Fixed): Moved all code that does variable lookups
19865 and resolvings from Emit to Resolve.
19867 * statement.cs (For): Moved all code that does variable lookups
19868 and resolvings from Emit to Resolve.
19870 * statement.cs (Using): Moved all code that does variable lookups
19871 and resolvings from Emit to Resolve.
19873 2002-07-29 Martin Baulig <martin@gnome.org>
19875 * attribute.cs (Attribute.Resolve): Explicitly catch a
19876 System.NullReferenceException when creating the
19877 CustromAttributeBuilder and report a different warning message.
19879 2002-07-29 Martin Baulig <martin@gnome.org>
19881 * support.cs (ParameterData.ParameterName): Added method to
19882 get the name of a parameter.
19884 * typemanager.cs (TypeManager.IsValueType): New public method.
19886 2002-07-29 Martin Baulig <martin@gnome.org>
19888 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
19889 is a flag which specifies that it's either ref or out.
19890 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
19891 the out parameter to `out Parameter.Modifier mod', also set the
19892 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
19894 * support.cs (InternalParameters.ParameterModifier): Distinguish
19895 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
19896 Parameter.Modifier.ISBYREF flag if it's either ref or out.
19898 * expression.cs (Argument.GetParameterModifier): Distinguish
19899 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
19900 Parameter.Modifier.ISBYREF flag if it's either ref or out.
19902 2002-07-29 Martin Baulig <martin@gnome.org>
19904 * expression.cs (ParameterReference.ParameterReference): Added
19905 `Location loc' argument to the constructor.
19907 * cs-parser.jay: Pass location to ParameterReference.
19909 2002-07-28 Miguel de Icaza <miguel@ximian.com>
19911 * statement.cs (Try): Initialize the location.
19913 * cs-parser.jay: pass location to Try.
19915 * expression.cs (Unary.Reduce): Change the prototype to return
19916 whether a constant fold could be performed or not. The result is
19917 returned in an out parameters. In the case of Indirection and
19918 AddressOf, we want to perform the full tests.
19920 2002-07-26 Miguel de Icaza <miguel@ximian.com>
19922 * statement.cs (Statement.Emit): Flag dead code.
19924 2002-07-27 Andrew Birkett <andy@nobugs.org>
19926 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
19928 2002-07-27 Martin Baulig <martin@gnome.org>
19930 * class.cs (MethodData.Define): Put back call to
19931 TypeManager.AddMethod(), accidentally commented this out.
19933 * report.cs (Debug): New public method to print debugging information,
19934 this is `[Conditional ("DEBUG")]'.
19936 2002-07-26 Martin Baulig <martin@gnome.org>
19938 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
19939 (switch_statement): Push the current_block to the switch_stack and
19940 pop it again when we're done with the switch.
19941 (switch_section): The new block is a child of the current_block.
19942 Fixes bug #24007, added test-152.cs.
19944 2002-07-27 Martin Baulig <martin@gnome.org>
19946 * expression.cs (Invocation.EmitArguments): When calling a varargs
19947 function with only its fixed arguments, we need to pass an empty
19950 2002-07-27 Martin Baulig <martin@gnome.org>
19952 Mono 0.13 has been released.
19954 2002-07-25 Miguel de Icaza <miguel@ximian.com>
19956 * driver.cs: Rename --resource to --linkres, because that is what
19957 we do currently, we dont support --resource yet.
19959 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
19961 2002-07-25 Martin Baulig <martin@gnome.org>
19963 * class.cs (MethodData): New public class. This is a `method builder'
19964 class for a method or one accessor of a Property/Indexer/Event.
19965 (MethodData.GetMethodFlags): Moved here from MemberBase.
19966 (MethodData.ApplyAttributes): Likewise.
19967 (MethodData.ApplyObsoleteAttribute): Likewise.
19968 (MethodData.ApplyConditionalAttribute): Likewise.
19969 (MethodData.ApplyDllImportAttribute): Likewise.
19970 (MethodData.CheckAbstractAndExternal): Likewise.
19971 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
19972 (MethodData.Emit): Formerly known as Method.Emit().
19973 (MemberBase): Moved everything which was specific to a single
19974 accessor/method to MethodData.
19975 (Method): Create a new MethodData and call Define() and Emit() on it.
19976 (Property, Indexer, Event): Create a new MethodData objects for each
19977 accessor and call Define() and Emit() on them.
19979 2002-07-25 Martin Baulig <martin@gnome.org>
19981 Made MethodCore derive from MemberBase to reuse the code from there.
19982 MemberBase now also checks for attributes.
19984 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
19985 (MemberBase.GetMethodFlags): Moved here from class Method and marked
19987 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
19988 `CallingConventions cc' and `Attributes opt_attrs' arguments.
19989 (MemberBase.ApplyAttributes): New virtual method; applies the
19990 attributes to a method or accessor.
19991 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
19992 (MemberBase.ApplyConditionalAttribute): Likewise.
19993 (MemberBase.ApplyDllImportAttribute): Likewise.
19994 (MemberBase.CheckAbstractAndExternal): Likewise.
19995 (MethodCore.ParameterTypes): This is now a property instead of a
19996 method, it's initialized from DoDefineParameters().
19997 (MethodCore.ParameterInfo): Removed the set accessor.
19998 (MethodCore.DoDefineParameters): New protected virtual method to
19999 initialize ParameterTypes and ParameterInfo.
20000 (Method.GetReturnType): We can now simply return the MemberType.
20001 (Method.GetMethodFlags): Override the MemberBase version and add
20002 the conditional flags.
20003 (Method.CheckBase): Moved some code from Define() here, call
20004 DoDefineParameters() here.
20005 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
20006 here to avoid some larger code duplication.
20007 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
20008 ensure that abstract and external accessors don't declare a body.
20010 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
20011 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
20012 lookup in the attribute's parent classes, so we need to abort as soon
20013 as we found the first match.
20014 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
20015 the attribute has no arguments.
20017 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
20020 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20022 * cs-parser.jay: reverted previous patch.
20024 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20026 * cs-parser.jay: fixed bug #22119.
20028 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20030 * attribute.cs: fixed compilation. The error was:
20031 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
20032 be assigned to before control leaves the current method."
20033 [FIXME: Filed as bug #28186: MCS must report this error.]
20035 2002-07-25 Martin Baulig <martin@gnome.org>
20037 * attribute.cs (Attribute.Conditional_GetConditionName): New static
20038 method to pull the condition name ouf of a Conditional attribute.
20039 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
20040 the obsolete message and error flag out of an Obsolete attribute.
20042 * class.cs (Method.GetMethodFlags): New public method to get the
20043 TypeManager.MethodFlags for this method.
20044 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
20046 (Method.Define): Get and apply the Obsolete and Conditional attributes;
20047 if we're overriding a virtual function, set the new private variable
20048 `parent_method'; call the new TypeManager.AddMethod().
20050 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
20051 the MethodBuilder and the Method in a PtrHashtable.
20052 (TypeManager.builder_to_method): Added for this purpose.
20053 (TypeManager.MethodFlags): Added IsObsoleteError.
20054 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
20055 Obsolete and Conditional arguments in MethodBuilders. If we discover
20056 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
20057 the message from the attribute.
20059 2002-07-24 Martin Baulig <martin@gnome.org>
20061 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
20062 preprocessor directives, ensure that the argument to #define/#undef is
20063 exactly one identifier and that it's actually an identifier.
20065 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
20068 2002-07-24 Martin Baulig <martin@gnome.org>
20070 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
20071 initialize it to TypeManager.object_type in the constructor.
20072 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
20073 of the `hm.get_current' method if we're using the collection pattern.
20074 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
20075 for the explicit conversion to make it work when we're using the collection
20076 pattern and the `Current' property has a different return type than `object'.
20079 2002-07-24 Martin Baulig <martin@gnome.org>
20081 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
20082 does not match, but don't report any errors. This method is called in
20083 order for all methods in a MethodGroupExpr until a matching method is
20084 found, so we don't want to bail out if the first method doesn't match.
20085 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
20086 matches, report the 123. Fixes #28070.
20088 2002-07-24 Martin Baulig <martin@gnome.org>
20090 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
20091 TypeManager.TypeToCoreType() to the top of the method so the
20092 following equality checks will work. Fixes #28107.
20094 2002-07-24 Martin Baulig <martin@gnome.org>
20096 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
20097 operand is of type uint, and the other operand is of type sbyte,
20098 short or int, the operands are converted to type long." -
20099 Actually do what this comment already told us. Fixes bug #28106,
20102 2002-07-24 Martin Baulig <martin@gnome.org>
20104 * class.cs (MethodBase): New abstract class. This is now a base
20105 class for Property, Indexer and Event to avoid some code duplication
20106 in their Define() and DefineMethods() methods.
20107 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
20108 generic methods for Define() and DefineMethods().
20109 (FieldBase): Derive from MemberBase, not MemberCore.
20110 (Property): Derive from MemberBase, not MemberCore.
20111 (Property.DefineMethod): Moved all the code from this method to the
20112 new MethodBase.DefineAccessor(), just call it with appropriate
20114 (Property.Define): Call the new Property.DoDefine(), this does some
20115 sanity checks and we don't need to duplicate the code everywhere.
20116 (Event): Derive from MemberBase, not MemberCore.
20117 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
20118 accessors, this will also make them work with interface events.
20119 (Indexer): Derive from MemberBase, not MemberCore.
20120 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
20121 (Indexer.Define): Use the new MethodBase functions.
20123 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
20124 argument to the constructor.
20125 (Interface.FindMembers): Added support for interface events.
20126 (Interface.PopluateEvent): Implemented.
20128 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
20130 2002-07-22 Miguel de Icaza <miguel@ximian.com>
20132 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
20133 but this is required to check for a method name being the same as
20134 the containing class.
20138 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20140 * interface.cs: initialize variable.
20142 2002-07-23 Martin Baulig <martin@gnome.org>
20144 Implemented the IndexerName attribute in interfaces.
20146 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
20147 name if this is an explicit interface implementation.
20148 (Indexer.InterfaceIndexerName): New public variable. If we're
20149 implementing an interface indexer, this is the IndexerName in that
20150 interface. Otherwise, it's the IndexerName.
20151 (Indexer.DefineMethod): If we're implementing interface indexer,
20152 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
20153 and Pending.ImplementIndexer methods.
20154 (Indexer.Define): Also define the PropertyBuilder if we're
20155 implementing an interface indexer and this is neither an explicit
20156 interface implementation nor do the IndexerName match the one in
20159 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
20160 If a method is defined here, then we always need to create a proxy
20161 for it. This is used when implementing interface indexers.
20162 (Pending.IsInterfaceIndexer): New public method.
20163 (Pending.ImplementIndexer): New public method.
20164 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
20165 This is used when implementing interface indexers to define a proxy
20167 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
20168 define a proxy if necessary.
20170 * interface.cs (Interface.IndexerName): New public variable.
20171 (Interface.PopulateIndexer): Set the IndexerName.
20172 (Interface.DefineIndexers): New private method. Populate all the
20173 indexers and make sure their IndexerNames match.
20175 * typemanager.cs (IndexerPropertyName): Added support for interface
20178 2002-07-22 Martin Baulig <martin@gnome.org>
20180 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
20181 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
20182 ret if HasReturnLabel.
20183 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
20186 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
20187 and set the ec.LoopBeginTryCatchLevel.
20188 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
20189 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
20190 the current ec.TryCatchLevel, the branch goes out of an exception
20191 block. In this case, we need to use Leave and not Br.
20193 2002-07-22 Martin Baulig <martin@gnome.org>
20195 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
20196 block unless the block does not always return or it is contained in
20197 another try { ... } catch { ... } block. Fixes bug #26506.
20198 Added verify-1.cs to the test suite.
20200 2002-07-22 Martin Baulig <martin@gnome.org>
20202 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
20203 then we do not always return. Fixes bug #24985.
20205 2002-07-22 Martin Baulig <martin@gnome.org>
20207 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
20208 lookup on a per-class level; ie. walk up the class hierarchy until we
20209 found at least one applicable method, then choose the best among them.
20210 Fixes bug #24463 and test-29.cs.
20212 2002-07-22 Martin Baulig <martin@gnome.org>
20214 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
20215 return types of the methods. The return type is not part of the
20216 signature and we must not check it to make the `new' modifier work.
20217 Fixes bug #27999, also added test-147.cs.
20218 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
20220 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
20221 on the method's return type.
20223 2002-07-21 Martin Baulig <martin@gnome.org>
20225 * assign.cs: Make this work if the rightmost source is a constant and
20226 we need to do an implicit type conversion. Also adding a few more tests
20227 to test-38.cs which should have caught this.
20229 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
20230 target in the makefile for this. The makefile.gnu is primarily intended
20231 for end-users who don't want to debug the compiler.
20233 2002-07-21 Martin Baulig <martin@gnome.org>
20235 * assign.cs: Improved the Assign class so it can now handle embedded
20236 assignments (X = Y = Z = something). As a side-effect this'll now also
20237 consume less local variables. test-38.cs now passes with MCS, added
20238 a few new test cases to that test.
20240 2002-07-20 Martin Baulig <martin@gnome.org>
20242 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
20243 instructions. Fixes bug #27977, also added test-146.cs.
20245 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20247 * cs-tokenizer.cs: fixed getHex ().
20249 2002-07-19 Martin Baulig <martin@gnome.org>
20251 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
20252 not Type.GetType() to lookup the array type. This is needed when
20253 we're constructing an array of a user-defined type.
20254 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
20255 single-dimensional arrays, but also for single-dimensial arrays of
20258 2002-07-19 Martin Baulig <martin@gnome.org>
20260 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
20261 this function is called, it's not allowed to share LocalBuilders
20262 among ILGenerators.
20264 2002-07-19 Martin Baulig <martin@gnome.org>
20266 * expression.cs (Argument.Resolve): Report an error 118 when trying
20267 to pass a type as argument.
20269 2002-07-18 Martin Baulig <martin@gnome.org>
20271 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
20272 Conv_R_Un for the signed `long' type.
20274 2002-07-15 Miguel de Icaza <miguel@ximian.com>
20276 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
20277 `expr' for the temporary result, as that will fail if we do
20278 multiple resolves on the same expression.
20280 2002-07-05 Miguel de Icaza <miguel@ximian.com>
20282 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
20283 ec.TypeContainer for looking up aliases.
20285 * class.cs (TypeContainer): Remove LookupAlias from here.
20287 * decl.cs (DeclSpace); Move here.
20289 2002-07-01 Miguel de Icaza <miguel@ximian.com>
20291 * class.cs (FindMembers): Only call filter if the constructor
20292 bulider is not null.
20294 Also handle delegates in `NestedTypes' now. Now we will perform
20295 type lookups using the standard resolution process. This also
20298 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
20299 This uses Expressions (the limited kind that can be parsed by the
20300 tree) instead of strings.
20302 * expression.cs (ComposedCast.ToString): Implement, used to flag
20303 errors since now we have to render expressions.
20305 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
20308 * ecore.cs (SimpleName.ToString): ditto.
20310 * cs-parser.jay: Instead of using strings to assemble types, use
20311 Expressions to assemble the type (using SimpleName, ComposedCast,
20312 MemberAccess). This should fix the type lookups in declarations,
20313 because we were using a different code path for this.
20315 * statement.cs (Block.Resolve): Continue processing statements
20316 even when there is an error.
20318 2002-07-17 Miguel de Icaza <miguel@ximian.com>
20320 * class.cs (Event.Define): Also remove the `remove' method from
20321 the list of pending items.
20323 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
20324 generate more compact code.
20326 2002-07-17 Martin Baulig <martin@gnome.org>
20328 * const.cs (Const.LookupConstantValue): Add support for constant
20329 `unchecked' and `checked' expressions.
20330 Also adding test case test-140.cs for this.
20332 2002-07-17 Martin Baulig <martin@gnome.org>
20334 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
20335 check whether mi.ReturnType implements the IEnumerator interface; the
20336 `==' and the IsAssignableFrom() will fail in this situation.
20338 2002-07-16 Ravi Pratap <ravi@ximian.com>
20340 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
20343 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20345 * expression.cs: fixed bug #27811.
20347 2002-07-14 Miguel de Icaza <miguel@ximian.com>
20349 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
20350 Molaro: when we are a ref, the value already contains a pointer
20351 value, do not take the address of it.
20353 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
20354 * removed mb-parser.jay and mb-tokenizer.cs
20356 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20358 * expression.cs: check against the building corlib void type.
20360 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
20362 * ecore.cs: fix for valuetype static readonly fields: when
20363 initializing them, we need their address, not the address of a copy.
20365 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
20367 * typemanager.cs: register also enum_type in corlib.
20369 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20371 * class.cs: allow calling this (but not base) initializers in structs.
20373 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
20375 * ecore.cs: make sure we compare against the building base types
20378 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
20380 * typemanager.cs: fix TypeToCoreType() to handle void and object
20381 (corlib gets no more typerefs after this change).
20383 2002-07-12 Miguel de Icaza <miguel@ximian.com>
20385 * expression.cs (ArrayCreation.EmitArrayArguments): use
20386 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
20388 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
20389 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
20390 array indexes, the runtime actually forbids them.
20392 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
20393 for array arguments here.
20395 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
20396 instead of the default for ValueTypes.
20398 (New.DoEmit): Use IsValueType instead of
20399 IsSubclassOf (value_type)
20400 (New.DoResolve): ditto.
20401 (Invocation.EmitCall): ditto.
20403 * assign.cs (Assign): ditto.
20405 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
20406 Statements *are* currently doing part of their resolution during
20409 Expressions do always resolve during resolve, but statements are
20410 only required to propagate resolution to their children.
20412 2002-07-11 Miguel de Icaza <miguel@ximian.com>
20414 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
20416 (LoadAssembly): Do not add the dll if it is already specified
20418 (MainDriver): Add the System directory to the link path at the end,
20419 after all the other -L arguments.
20421 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
20422 wrong opcode for loading bytes and bools (ldelem.i1 instead of
20423 ldelem.u1) and using the opposite for sbytes.
20425 This fixes Digger, and we can finally run it.
20427 * driver.cs (UnixParseOption): Move the option parsing here.
20428 (CSCParseOption): Implement CSC-like parsing of options.
20430 We now support both modes of operation, the old Unix way, and the
20431 new CSC-like way. This should help those who wanted to make cross
20432 platform makefiles.
20434 The only thing broken is that /r:, /reference: and /lib: are not
20435 implemented, because I want to make those have the same semantics
20436 as the CSC compiler has, and kill once and for all the confussion
20437 around this. Will be doing this tomorrow.
20439 * statement.cs (Unsafe.Resolve): The state is checked during
20440 resolve, not emit, so we have to set the flags for IsUnsfe here.
20442 2002-07-10 Miguel de Icaza <miguel@ximian.com>
20444 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
20445 not catch the Error_ObjectRefRequired in SimpleName (as it is
20446 possible to have a class/instance variable name that later gets
20447 deambiguated), we have to check this here.
20449 2002-07-10 Ravi Pratap <ravi@ximian.com>
20451 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
20452 make static and put into Expression.
20454 (Event.Define): Register the private field of the event with the
20455 TypeManager so that GetFieldFromEvent can get at it.
20457 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
20458 keep track of the private field associated with an event which
20461 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
20464 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
20466 2002-07-10 Miguel de Icaza <miguel@ximian.com>
20468 * expression.cs (Binary.EmitBranchable): this routine emits the
20469 Binary expression in a branchable context. This basically means:
20470 we need to branch somewhere, not just get the value on the stack.
20472 This works together with Statement.EmitBoolExpression.
20474 * statement.cs (Statement.EmitBoolExpression): Use
20477 2002-07-09 Miguel de Icaza <miguel@ximian.com>
20479 * statement.cs (For): Reduce the number of jumps in loops.
20481 (For): Implement loop inversion for the For statement.
20483 (Break): We can be breaking out of a Try/Catch controlled section
20484 (foreach might have an implicit try/catch clause), so we need to
20485 use Leave instead of Br.
20487 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
20488 now). If the instace expression supports IMemoryLocation, we use
20489 the AddressOf method from the IMemoryLocation to extract the
20490 address instead of emitting the instance.
20492 This showed up with `This', as we were emitting the instance
20493 always (Emit) instead of the Address of This. Particularly
20494 interesting when This is a value type, as we dont want the Emit
20495 effect (which was to load the object).
20497 2002-07-08 Miguel de Icaza <miguel@ximian.com>
20499 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
20501 * statement.cs (Checked): Set the CheckedState during the resolve
20502 process too, as the ConvCast operations track the checked state on
20503 the resolve process, and not emit.
20505 * cs-parser.jay (namespace_member_declaration): Flag that we have
20506 found a declaration when we do. This is used to flag error 1529
20508 * driver.cs: Report ok when we display the help only.
20510 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
20512 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
20514 2002-07-04 Miguel de Icaza <miguel@ximian.com>
20516 * cs-tokenizer.cs (define): We also have to track locally the
20517 defines. AllDefines is just used for the Conditional Attribute,
20518 but we also need the local defines for the current source code.
20520 2002-07-03 Miguel de Icaza <miguel@ximian.com>
20522 * statement.cs (While, For, Do): These loops can exit through a
20523 Break statement, use this information to tell whether the
20524 statement is the last piece of code.
20526 (Break): Flag that we break.
20528 * codegen.cs (EmitContexts): New `Breaks' state variable.
20530 2002-07-03 Martin Baulig <martin@gnome.org>
20532 * class.cs (TypeContainer.MethodModifiersValid): Allow override
20533 modifiers in method declarations in structs. Otherwise, you won't
20534 be able to override things like Object.Equals().
20536 2002-07-02 Miguel de Icaza <miguel@ximian.com>
20538 * class.cs (Method, Property, Indexer): Do not allow the public
20539 modifier to be used in explicit interface implementations.
20541 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
20542 override modifiers in method declarations in structs
20544 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
20546 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
20547 integer or real overflow, report an error
20549 2002-07-02 Martin Baulig <martin@gnome.org>
20551 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
20552 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
20553 to tell the runtime about our newly created System.Object and
20554 System.ValueType types.
20556 2002-07-02 Miguel de Icaza <miguel@ximian.com>
20558 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
20559 struct instead of Ldarg/Starg.
20561 2002-07-02 Martin Baulig <martin@gnome.org>
20563 * expression.cs (Indirection.Indirection): Call
20564 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
20566 2002-07-02 Martin Baulig <martin@gnome.org>
20568 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
20569 ValueType, call TypeManager.TypeToCoreType() on it.
20570 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
20571 the OpCodes.Newarr argument.
20573 2002-07-02 Martin Baulig <martin@gnome.org>
20575 * expression.cs (Invocation.EmitCall): When compiling corlib,
20576 replace all calls to the system's System.Array type to calls to
20577 the newly created one.
20579 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
20580 System.Array methods.
20581 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
20582 from the system's System.Array type which must be replaced.
20584 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
20586 * typemanager.cs: load unverifiable_code_ctor so we can build
20587 corlib using the correct type. Avoid using GetTypeCode() with
20589 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
20590 TypeManager.object_type to allow building corlib.
20592 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
20594 * ecore.cs: handle System.Enum separately in LoadFromPtr().
20596 2002-07-01 Martin Baulig <martin@gnome.org>
20598 * class.cs: Make the last change actually work, we need to check
20599 whether `ifaces != null' to avoid a crash.
20601 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20603 * class.cs: when we build structs without fields that implement
20604 interfaces, we need to add the interfaces separately, since there is
20605 no API to both set the size and add the interfaces at type creation
20608 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20610 * expression.cs: the dimension arguments to the array constructors
20611 need to be converted if they are a long.
20613 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
20615 * class.cs: don't emit ldarg.0 if there is no parent constructor
20616 (fixes showstopper for corlib).
20618 2002-06-29 Martin Baulig <martin@gnome.org>
20620 MCS now compiles corlib on GNU/Linux :-)
20622 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
20623 ie. check for MethodImplOptions.InternalCall.
20625 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
20626 and TypeManager.attribute_type are null, so we must explicitly check
20627 whether parent is not null to find out whether it's an attribute type.
20628 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
20629 and SetBuilder, not only if the property is neither abstract nor external.
20630 This is necessary to set the MethodImplOptions on the accessor methods.
20631 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
20632 SetBuilder, see Property.Emit().
20634 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
20635 populate "System.Object", "System.ValueType" and "System.Attribute" since
20636 they've already been populated from BootCorlib_PopulateCoreTypes().
20638 2002-06-29 Martin Baulig <martin@gnome.org>
20640 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
20641 is the NullLiteral, we also need to make sure that target_type is not
20644 2002-06-29 Martin Baulig <martin@gnome.org>
20646 * rootcontext.cs (RootContext.ResolveCore): We must initialize
20647 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
20648 before calling BootstrapCorlib_ResolveDelegate ().
20650 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20652 * statement.cs: fixed build-breaker. All tests passed ok.
20654 2002-06-27 Martin Baulig <martin@gnome.org>
20656 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
20657 for System.Decimal when compiling corlib.
20659 2002-06-27 Martin Baulig <martin@gnome.org>
20661 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
20662 switch blocks which contain nothing but a default clause.
20664 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
20666 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
20668 2002-06-27 Martin Baulig <martin@gnome.org>
20670 * ecore.cs (PropertyExpr.PropertyExpr): Call
20671 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
20673 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
20674 is already a TypeBuilder.
20676 2002-06-27 Martin Baulig <martin@gnome.org>
20678 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
20679 `target_type == TypeManager.array_type', not IsAssignableFrom() in
20680 the "from an array-type to System.Array" case. This makes it work
20681 when compiling corlib.
20683 2002-06-27 Martin Baulig <martin@gnome.org>
20685 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
20686 non-static PropertyExpr, set its InstanceExpression. This makes
20687 the `ICollection.Count' property work in System/Array.cs.
20689 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
20691 * driver.cs: Made error handling more consistent. Errors now
20692 tracked by Report class, so many methods which used to return int
20693 now return void. Main() now prints success/failure and
20694 errors/warnings message.
20696 Renamed '--probe' compiler argument to '--expect-error'. Removed
20697 the magic number return values (123 and 124). Now, if the
20698 expected error occurs, the compiler exits with success (exit value
20699 0). If the compilation completes without seeing that particular
20700 error, the compiler exits with failure (exit value 1). The
20701 makefile in mcs/errors has been changed to handle the new behaviour.
20703 * report.cs: Made 'expected error' number a property and renamed
20704 it from 'Probe' to 'ExpectedError'.
20706 * genericparser.cs: Removed error handling support, since it is
20707 now all done by Report class.
20709 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
20710 class, so parse() no longer returns an int.
20712 * namespace.cs: Use Report.Error instead of GenericParser.error
20714 2002-06-22 Miguel de Icaza <miguel@ximian.com>
20716 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
20717 TypeContainer.AddOperator): At the front of the list put the
20718 explicit implementations, so they get resolved/defined first.
20720 2002-06-21 Miguel de Icaza <miguel@ximian.com>
20722 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
20723 interface type is implemented by this TypeContainer. Used during
20724 explicit interface implementation.
20726 (Property.Define, Indexer.Define, Method.Define): Validate that
20727 the given interface in the explicit implementation is one of the
20728 base classes for the containing type.
20730 Also if we are explicitly implementing an interface, but there is
20731 no match in the pending implementation table, report an error.
20733 (Property.Define): Only define the property if we are
20734 not explicitly implementing a property from an interface. Use the
20735 correct name also for those properties (the same CSC uses,
20736 although that is really not needed).
20738 (Property.Emit): Do not emit attributes for explicitly implemented
20739 properties, as there is no TypeBuilder.
20741 (Indexer.Emit): ditto.
20743 Hiding then means that we do not really *implement* a pending
20744 implementation, which makes code fail.
20746 2002-06-22 Martin Baulig <martin@gnome.org>
20748 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
20749 the return value of Object.GetType(). [FIXME: we need to do this whenever
20750 we get a type back from the reflection library].
20752 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
20754 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
20756 2002-06-20 Miguel de Icaza <miguel@ximian.com>
20758 * attribute.cs: Return null if we can not look up the type.
20760 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
20761 the interface types found.
20763 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
20764 interface types found.
20766 * typemanager.cs (GetInterfaces): Make this routine returns alll
20767 the interfaces and work around the lame differences between
20768 System.Type and System.Reflection.Emit.TypeBuilder in the results
20769 result for GetInterfaces.
20771 (ExpandInterfaces): Given an array of interface types, expand and
20772 eliminate repeated ocurrences of an interface. This expands in
20773 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
20776 2002-06-21 Martin Baulig <martin@gnome.org>
20778 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
20781 2002-06-21 Martin Baulig <martin@gnome.org>
20783 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
20784 and called with one of the core types, return the corresponding typebuilder for
20787 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
20790 2002-06-21 Martin Baulig <martin@gnome.org>
20792 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
20793 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
20794 (Expression.ConvertReferenceExplicit): Likewise.
20796 * expression.cs (ElementAccess.DoResolve): Likewise.
20797 (ElementAccess.DoResolveLValue): Likewise.
20799 2002-06-10 Martin Baulig <martin@gnome.org>
20801 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
20802 add the "value" parameter to the parameter list.
20804 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
20807 2002-06-19 Miguel de Icaza <miguel@ximian.com>
20809 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
20810 the argument to an int, uint, long or ulong, per the spec. Also
20811 catch negative constants in array creation.
20813 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
20815 * class.cs: do not allow the same interface to appear twice in
20816 the definition list.
20818 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
20820 * ecore.cs: don't use ldlen with System.Array.
20822 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
20824 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
20826 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
20828 * modifiers.cs: produce correct field attributes for protected
20829 internal. Easy fix so miguel can work on ther harder stuff:-)
20831 2002-06-18 Miguel de Icaza <miguel@ximian.com>
20833 * pending.cs: New file. Move the code from class.cs here.
20834 Support clearning the pending flag for all methods (when not doing
20835 explicit interface implementation).
20837 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
20839 * rootcontext.cs: added a couple more types needed to bootstrap.
20841 2002-06-17 Miguel de Icaza <miguel@ximian.com>
20843 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
20844 constructor in the type, instead of any constructor in the type
20845 hierarchy. Thanks to Paolo for finding this bug (it showed up as
20846 a bug in the Mono runtime when applying the params attribute).
20848 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
20849 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
20851 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
20853 * expression.cs (Unary.ResolveOperator): Use TypeManager
20854 to resolve the type.
20856 2002-06-13 Ravi Pratap <ravi@ximian.com>
20858 * cs-parser.jay (enum_member_declaration): Pass in the attributes
20861 * enum.cs (AddEnumMember): Add support to store the attributes associated
20862 with each member too.
20864 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
20865 field builders too - this takes care of the enum member case.
20867 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
20869 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
20870 address-of operator on both value types and pointers.
20872 2002-06-10 Martin Baulig <martin@gnome.org>
20874 * interface.cs (Interface.PopulateIndexer): Add the indexer's
20875 PropertyBuilder to the `property_builders' list.
20877 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
20878 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
20879 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
20880 find any indexers which are inherited from an interface.
20882 2002-06-09 Martin Baulig <martin@gnome.org>
20884 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
20885 the same type as the constant if necessary. There's also a test-130.cs
20888 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
20890 * typemanager.cs (TypeManager.ChangeType): Previously known as
20891 Enum.ChangeEnumType().
20893 2002-06-09 Martin Baulig <martin@gnome.org>
20895 * expression.cs (Cast.TryReduce): Added support for consts.
20897 2002-06-08 Ravi Pratap <ravi@ximian.com>
20899 * class.cs (Accessor): Hold attributes information so we can pass
20902 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
20903 Modify to pass in attributes attached to the methods.
20905 (add_accessor_declaration, remove_accessor_declaration): Ditto.
20907 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
20908 to handle the Accessor kind :-)
20910 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
20912 2002-06-08 Martin Baulig <martin@gnome.org>
20914 * expression.cs (Unary.TryReduceNegative): Added support for
20917 2002-06-08 Martin Baulig <martin@gnome.org>
20919 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
20920 name can't be found in the `defined_names' - the caller will do a
20921 MemberLookup in this case and thus find methods in System.Enum
20922 such as Enum.IsDefined().
20924 2002-06-08 Martin Baulig <martin@gnome.org>
20926 * enum.cs (Enum.ChangeEnumType): This is a custom version of
20927 Convert.ChangeType() which works with TypeBuilder created types.
20928 (Enum.LookupEnumValue, Enum.Define): Use it here.
20930 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
20931 `TypeBuilder.BaseType != null' check.
20932 (TypeContainer.FindMembers): Only lookup parent members if we
20933 actually have a parent.
20934 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
20935 (ConstructorInitializer.Resolve): Likewise.
20937 * interface.cs (Interface.FindMembers): Added
20938 `TypeBuilder.BaseType != null' check.
20940 * rootcontext.cs (RootContext.ResolveCore): Added
20941 "System.Runtime.CompilerServices.IndexerNameAttribute" to
20942 classes_second_stage.
20944 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
20945 debug_type and trace_type when compiling with --nostdlib.
20947 2002-06-07 Martin Baulig <martin@gnome.org>
20949 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
20950 (AddField): Set it to true when adding a non-static field.
20951 (DefineType): Use `have_nonstatic_fields' to find out whether we
20952 have non-static fields, not `Fields != null'.
20954 2002-06-02 Miguel de Icaza <miguel@ximian.com>
20956 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
20957 dereferencing a null on the static-field code path)
20959 2002-05-30 Martin Baulig <martin@gnome.org>
20961 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
20962 to take command line arguments. Use reflection to call the new
20963 custom `Initialize' function on the symbol writer and pass it the
20964 command line arguments.
20966 * driver.cs (--debug-args): New command line argument to pass command
20967 line arguments to the symbol writer.
20969 2002-05-28 Miguel de Icaza <miguel@ximian.com>
20971 * assign.cs (DoResolve): Forgot to do the implicit conversion to
20972 the target type for indexers and properties. Thanks to Joe for
20975 2002-05-27 Miguel de Icaza <miguel@ximian.com>
20977 * typemanager.cs (MethodFlags): returns the method flags
20978 (Obsolete/ShouldIgnore) that control warning emission and whether
20979 the invocation should be made, or ignored.
20981 * expression.cs (Invocation.Emit): Remove previous hack, we should
20982 not do this on matching a base type, we should do this based on an attribute
20984 Only emit calls to System.Diagnostics.Debug and
20985 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
20986 on the command line.
20988 * rootcontext.cs: Global settings for tracing and debugging.
20990 * cs-tokenizer.cs (define): New utility function to track
20991 defines. Set the global settings for TRACE and DEBUG if found.
20993 2002-05-25 Ravi Pratap <ravi@ximian.com>
20995 * interface.cs (Populate*): Pass in the TypeContainer as well as
20996 the DeclSpace as parameters so that we can create EmitContexts and
20997 then use that to apply attributes etc.
20999 (PopulateMethod, PopulateEvent, PopulateProperty)
21000 (PopulateIndexer): Apply attributes everywhere.
21002 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
21005 (ApplyAttributes): Update accordingly.
21007 We now apply interface attributes for all members too.
21009 2002-05-26 Miguel de Icaza <miguel@ximian.com>
21011 * class.cs (Indexer.Define); Correctly check if we are explicit
21012 implementation (instead of checking the Name for a ".", we
21013 directly look up if the InterfaceType was specified).
21015 Delay the creation of the PropertyBuilder.
21017 Only create the PropertyBuilder if we are not an explicit
21018 interface implementation. This means that explicit interface
21019 implementation members do not participate in regular function
21020 lookups, and hence fixes another major ambiguity problem in
21021 overload resolution (that was the visible effect).
21023 (DefineMethod): Return whether we are doing an interface
21026 * typemanager.cs: Temporary hack until we get attributes in
21027 interfaces (Ravi is working on that) and we get IndexerName
21028 support in interfaces.
21030 * interface.cs: Register the indexers as properties.
21032 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
21033 warning, I have verified that this is a bug in the .NET runtime
21034 (JavaScript suffers of the same problem).
21036 * typemanager.cs (MemberLookup): When looking up members for
21037 interfaces, the parent of an interface is the implicit
21038 System.Object (so we succeed in searches of Object methods in an
21039 interface method invocation. Example: IEnumerable x; x.ToString
21042 2002-05-25 Miguel de Icaza <miguel@ximian.com>
21044 * class.cs (Event): Events should also register if they do
21045 implement the methods that an interface requires.
21047 * typemanager.cs (MemberLookup); use the new GetInterfaces
21050 (GetInterfaces): The code used to lookup interfaces for a type is
21051 used in more than one place, factor it here.
21053 * driver.cs: Track the errors at the bottom of the file, we kept
21056 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
21057 instance if the method we are calling is static!
21059 2002-05-24 Miguel de Icaza <miguel@ximian.com>
21061 * attribute.cs (ApplyAttributes): Make this function filter out
21062 the IndexerName attribute (as that attribute in reality is never
21063 applied) and return the string constant for the IndexerName
21066 * class.cs (TypeContainer.Emit): Validate that all the indexers
21067 have the same IndexerName attribute, and if so, set the
21068 DefaultName attribute on the class.
21070 * typemanager.cs: The return value might contain other stuff (not
21071 only methods). For instance, consider a method with an "Item"
21072 property and an Item method.
21074 * class.cs: If there is a problem with the parameter types,
21077 2002-05-24 Ravi Pratap <ravi@ximian.com>
21079 * ecore.cs (ImplicitConversionExists): Wrapper function which also
21080 looks at user defined conversion after making a call to
21081 StandardConversionExists - we need this for overload resolution.
21083 * expression.cs : Update accordingly the various method calls.
21085 This fixes 2 bugs filed against implicit user defined conversions
21087 2002-05-22 Miguel de Icaza <miguel@ximian.com>
21089 * statement.cs: Track the result of the assignment.
21091 2002-05-21 Miguel de Icaza <miguel@ximian.com>
21093 * expression.cs (MemberAccess): Improved error reporting for
21094 inaccessible members.
21096 2002-05-22 Martin Baulig <martin@gnome.org>
21098 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
21099 itself with debugging support.
21101 2002-05-22 Martin Baulig <martin@gnome.org>
21103 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
21104 Removed, this isn't needed anymore.
21106 2002-05-20 Martin Baulig <martin@gnome.org>
21108 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
21109 be underlying type for an enum.
21111 2002-05-20 Miguel de Icaza <miguel@ximian.com>
21113 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
21114 that splits out the loading of just the core types.
21116 * rootcontext.cs (ResolveCore): Split the struct resolution in
21117 two, so we can load the enumeration underlying types before any
21120 * expression.cs (Is): Bandaid until we fix properly Switch (see
21121 bug #24985 for details).
21123 * typemanager.cs (ImplementsInterface): The hashtable will contain
21124 a null if there are no interfaces implemented.
21126 2002-05-18 Miguel de Icaza <miguel@ximian.com>
21128 * cs-parser.jay (indexer_declarator): It is fine to have array
21131 2002-05-17 Miguel de Icaza <miguel@ximian.com>
21133 * typemanager.cs: (RegisterBuilder): New function used to register
21134 TypeBuilders that implement interfaces. Since
21135 TypeBuilder.GetInterfaces (as usual) does not work with lame
21137 (AddUserType): register interfaces.
21139 (ImplementsInterface): Use the builder_to_ifaces hash if we are
21140 dealing with TypeBuilder. Also, arrays are showing up as
21141 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
21142 methods can not be invoked on them!
21144 * ecore.cs (ExplicitReferenceConversionExists): Made public.
21145 (ImplicitReferenceConversionExists): Split out from
21146 StandardConversionExists.
21148 * expression.cs (As): We were only implementing one of the three
21149 cases for the as operator. We now implement them all.
21150 (Is): Implement the various other cases for Is as well.
21152 * typemanager.cs (CACHE): New define used to control if we want or
21153 not the FindMembers cache. Seems to have a negative impact on
21154 performance currently
21156 (MemberLookup): Nested types have full acess to
21157 enclosing type members
21159 Remove code that coped with instance/static returns for events, we
21160 now catch this in RealFindMembers.
21162 (RealFindMembers): only perform static lookup if the instance
21163 lookup did not return a type or an event.
21165 2002-05-17 Miguel de Icaza <miguel@ximian.com>
21167 * assign.cs (CompoundAssign): We pass more semantic information
21168 now to Compound Assignments than we did before: now we have all
21169 the information at hand, and now we resolve the target *before* we
21170 do the expression expansion, which allows the "CacheValue" method
21171 to have the effect we intended (before, a [x] += 1 would generate
21172 two differen ArrayAccess expressions from the ElementAccess,
21173 during the resolution process).
21175 (CompoundAssign.DoResolve): Resolve target and original_source here.
21177 2002-05-16 Miguel de Icaza <miguel@ximian.com>
21179 * expression.cs (ArrayAccess): dropped debugging information.
21181 * typemanager.cs: Small bug fix: I was always returning i_members,
21182 instead of one of i_members or s_members (depending on which had
21185 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
21186 method is invoked before any code generation takes place, and it
21187 is a mechanism to inform that the expression will be invoked more
21188 than once, and that the method should use temporary values to
21189 avoid having side effects
21191 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
21193 * ecore.cs (Expression.CacheTemporaries): Provide empty default
21196 * expression.cs (Indirection, ArrayAccess): Add support for
21197 CacheTemporaries in these two bad boys.
21199 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
21200 ldobj or ldind_ref.
21201 (StoreFromPtr): Handle stobj as well.
21203 * expression.cs (UnaryMutator): Share more code.
21205 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
21206 down: I was not tracking the Filter function as well, which
21207 was affecting the results of the cache.
21209 2002-05-15 Miguel de Icaza <miguel@ximian.com>
21211 * attribute.cs: Remove the hack to handle the CharSet property on
21214 2002-05-14 Miguel de Icaza <miguel@ximian.com>
21216 * attribute.cs (DoResolve): More uglyness, we now only try to
21217 resolve the attribute partially, to extract the CharSet
21218 information (only if we are a StructLayout attribute). Otherwise
21220 (GetExtraTypeInfo): Add some code to conditionally kill in the
21221 future this. I am more and more convinced that the .NET
21222 framework has special code to handle the attribute setting on
21225 * expression.cs (IsParamsMethodApplicable): Revert my previous
21226 foreach change here, it was wrong.
21228 2002-05-13 Miguel de Icaza <miguel@ximian.com>
21230 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
21231 (pp_expr): do not abort on unknown input, just return.
21232 (eval): abort if there are pending chars.
21234 * attribute.cs (Attribute.Resolve): Positional parameters are
21235 optional. Deal with that case.
21237 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
21238 the Ansi/Unicode/Auto information for the type.
21240 (TypeContainer.DefineType): instantiate the EmitContext here, as
21241 we will be using it during the type definition (to resolve
21242 attributes) and during the emit phase.
21244 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
21245 to pull type information out of the attributes
21247 (Attribute.Resolve): track the constructor builder, and allow for
21248 multiple invocations (structs and classes will use this).
21250 * ecore.cs (MemberLookupFinal): new version with all the
21251 parameters customizable.
21253 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
21254 constructors. Return if the result value is null (as the error
21255 would have been flagged already by MemberLookupFinal)
21257 Do not allow instances of abstract classes or interfaces to be
21260 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
21261 We have to compare the assembly property here when dealing with
21262 FamANDAssem and Assembly access modifiers, because we might be
21263 creating an assembly from *modules* (that means that we are not
21264 getting TypeBuilders for types defined in other modules that are
21265 part of this assembly).
21267 (Method.Emit): If the method is marked abstract and has a body,
21270 (TypeContainer.DefineMembers): If both the defined member and the
21271 parent name match are methods, then do not emit any warnings: let
21272 the Method.Define routine take care of flagging warnings. But if
21273 there is a mismatch (method overrides something else, or method is
21274 overriwritten by something, then emit warning).
21276 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
21277 set to null, this means `do not check for the return type on the
21280 (Method.Define): set the return type for the method signature to
21281 null, so that we get methods with the same name and parameters and
21282 different return types. This is used to flag warning 114 (you are
21283 hiding a method, and you probably want to use the new/override
21286 * typemanager.cs (MemberLookup): Implemented proper access
21287 control, closing a long standing set of bug reports. The problem
21288 was that the Framework only has two bits: Public and NonPublic,
21289 and NonPublic includes private and protected methods, but we need
21290 to enforce the FamANDAssem, FamOrAssem and Family.
21292 2002-05-11 Miguel de Icaza <miguel@ximian.com>
21294 * statement.cs (GotoCase): Return true: Ammounts to giving up
21295 knowledge on whether we return or not, and letting the other case
21296 be responsible for it.
21298 2002-05-10 Miguel de Icaza <miguel@ximian.com>
21300 * driver.cs: Do not load directories for each file processed, only
21301 do it if there is a pattern.
21303 * ecore.cs: Report readonly assigns here as well, as we might have
21304 been resolved only by MemberAccess.
21306 (SimpleName.SimpleNameResolve): Also be useful for LValue
21307 resolution. We need this to propagate assign to local readonly variables
21309 * typemanager.cs: Use a ptrhashtable for the criteria, because we
21310 do not want to reuse potential criteria memory.
21312 * class.cs (MyEventBuilder): Set reflected_type;
21314 * ecore.cs (Constantify): Added support for constifying bools.
21316 (RootContext.LookupType): Added a cache for values looked up in
21317 the declaration space.
21319 * typemanager.cs (FindMembers): Now is a front-end to
21320 RealFindMembers, and provides a two-level hashtable-based cache to
21323 15% performance improvement: from 22.5 to 19.2 seconds.
21325 * expression.cs (IsParamsMethodApplicable): use foreach.
21326 (Invocation.DoResolve): ditto.
21327 (New.DoResolve): ditto.
21328 (ArrayCreation.DoResolve): ditto.
21330 * ecore.cs (FindMostEncompassingType): use foreach.
21332 * delegate.cs (NewDelegate.DoResolve): Use foreach
21334 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
21335 (RemoveMethods): use foreach.
21337 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
21338 nested foreach statements instead of for, and also break out of
21339 the inner loop once a match is found.
21341 (Invocation.OverloadResolve): Use foreach, simplify the code.
21343 2002-05-08 Miguel de Icaza <miguel@ximian.com>
21345 * cfold.cs (BinaryFold): During an enumeration evaluation context,
21346 we actually unwrap the expression to allow for extra information
21349 * expression.cs: Use Shr_Un on unsigned operations.
21351 2002-05-08 Ravi Pratap <ravi@ximian.com>
21353 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
21354 applicable operators was not being considered correctly. This closes
21355 the bug Miguel reported.
21357 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
21359 * attribute.cs: check that the type derives from System.Attribute
21360 and report the correct error in that case (moved the duplicate code to
21361 its own method, too).
21363 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
21365 * attribute.cs: lookup attribute type name as the spec says: first the
21366 bare attribute name and then name + "Attribute" (nant compiles with
21367 mcs after this fix).
21369 2002-05-07 Miguel de Icaza <miguel@ximian.com>
21371 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
21372 Because of the way we parse things, we should try to see if a
21373 UIntConstant can fit in an integer.
21375 2002-05-07 Ravi Pratap <ravi@ximian.com>
21377 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
21378 when we are in an explicit context.
21380 (ConvertReferenceExplicit): When converting from Iface type S to Class
21381 T make sure the rules are implemented as an OR.
21383 * parameter.cs (ParameterType): Make it a property for now although the
21384 purpose really isn't anything immediate.
21386 * expression.cs (Is*Applicable): Do better checking on the parameter type
21387 of a ref/out parameter. The ones from the system assemblies are already
21388 marked with the correct type so we don't need to do any correction.
21390 * ecore.cs (StandardConversionExists): Conversion from Interface types to
21391 the object type is standard too so include that.
21393 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21395 * ecore.cs (StandardConversionExists): Augment with missing code:
21396 deal with IntConstant, LongConstants and Enumerations.
21398 * assign.cs: Report the error, instead of failing silently
21400 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
21401 typecontainer that they are declared, because the
21402 typecontainer/namespace will have the list of using clauses that
21403 need to be applied.
21405 Assembly Attributes were escaping the normal registration
21408 (EmitCode): Apply attributes within an EmitContext that represents
21409 the container they were declared on.
21411 * cs-parser.jay: Track bases for structs. How did I get this wrong?
21413 2002-05-06 Ravi Pratap <ravi@ximian.com>
21415 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
21416 Revamp completely - make much cleaner as we now operate only
21419 (FindMostSpecificSource, FindMostSpecificTarget): New methods
21420 to implement the logic detailed in the spec more correctly.
21422 (UserDefinedConversion): Update accordingly.
21424 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21426 * statement.cs: Return flow analysis information up.
21428 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
21431 (token): Do not consume an extra character before calling
21434 2002-05-06 Piers Haken <piersh@friskit.com>
21436 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
21438 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21440 * class.cs (Constructor.Emit): Set the IsStatic flag in the
21441 EmitContext during the instance constructor initializer
21442 resolution, to stop access to instance variables.
21444 This is mandated by the spec, last paragraph of the `constructor
21445 initializers' section.
21447 2002-05-05 Miguel de Icaza <miguel@ximian.com>
21449 * cs-parser.jay, class.cs (Accessor): new class used to represent
21450 an accessor (get or set). In the past we used `null' to represent
21451 a missing accessor. But this is ambiguous because there was no
21452 way to tell in abstract indexers/properties if one of them was
21455 Now there is a way of addressing that.
21457 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
21458 instead of FindMembers.
21460 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
21461 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
21463 * attribute.cs: Treat indexers and properties as the same in terms
21464 of applying attributes
21466 * ecore.cs (FindMostEncompassedType): Use statically initialized
21467 EmptyExpressions()s like we do elsewhere to avoid creating useless
21468 objects (and we take this out of the tight loop).
21470 (GetConversionOperators): Move the code to extract the actual
21471 operators to a separate routine to clean things up.
21473 2002-05-04 Miguel de Icaza <miguel@ximian.com>
21475 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
21476 events are always registered FieldBuilders.
21478 * class.cs (FieldBase): New class shared by Fields
21480 * delegate.cs: If we are a toplevel delegate, use our full name.
21481 If we are a nested delegate, then only use our tail name.
21483 2002-05-02 Ravi Pratap <ravi@ximian.com>
21485 * expression.cs (IsApplicable): Ensure that we add the "&" to
21486 ref/out types before comparing it with the type of the argument.
21488 (IsParamsMethodApplicable): Ditto.
21490 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
21493 * delegate.cs : Handle the case when we have more than one applicable
21494 method. Flag an error only when we finish checking all.
21496 2002-05-02 Miguel de Icaza <miguel@ximian.com>
21498 * expression.cs: Add support for boolean static initializers.
21500 2002-05-01 Miguel de Icaza <miguel@ximian.com>
21502 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
21504 * parameter.cs (ComputeParameterTypes,
21505 ComputeAndDefineParameterTypes): Better error handling: now we
21506 clear the `types' cache if we fail during any of the type lookups.
21507 We also return the status code correctly to our caller
21509 * delegate.cs: If we fail to define a delegate, abort the extra
21512 * expression.cs (Binary.ResolveOperator): for
21513 operator==(object,object) and operator !=(object, object) we also
21514 have to verify that there is an implicit conversion from one to
21517 (ArrayAccess.DoResolve): Array Access can operate on
21520 2002-04-30 Miguel de Icaza <miguel@ximian.com>
21522 * assign.cs (CompoundAssign): A new class used as a "flag" that
21523 the assignment actually is happening as part of a compound
21524 assignment operator.
21526 During compound assignment, a few new rules exist to enable things
21533 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
21534 to the type of x) if y is implicitly convertible to the type of x,
21535 and the operator is a builtin operator and the return type of the
21536 operator is explicitly convertible to the type of x.
21538 * rootcontext.cs: Reset warning level to 2. 4 catches various
21539 "interesting" features in mcs, we must clean this up at some
21540 point, but currently am trying to kill other bugs ;-)
21542 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
21543 in container classes as well.
21545 * expression.cs (Binary.ResolveOperator): Handle string case
21546 before anything else (as operator overloading does emit an error
21547 before doing anything else).
21549 This code could go away when we move to a table driven model, but
21550 i could not come up with a good plan last night.
21552 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
21554 * typemanager.cs (CSharpName): reimplementation using regex.
21555 * class.cs: added null check for fields in Emit
21556 * rootcontext.cs: set warninglevel to 4
21558 2002-04-29 Miguel de Icaza <miguel@ximian.com>
21560 * typemanager.cs (CSharpName): reimplemented with Lupus
21563 2002-04-28 Miguel de Icaza <miguel@ximian.com>
21565 * statement.cs (If): correclty implement Resolve, because we were
21566 not catching sem errors in there. The same process is needed
21568 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
21571 (Statement.Warning_DeadCodeFound): Factorize code.
21572 (While): Report dead code here too.
21574 (Statement): Added Resolve virtual method to allow
21575 for resolution split from the emit code.
21577 2002-04-26 Miguel de Icaza <miguel@ximian.com>
21579 * statement.cs (EmitBoolExpression): No longer try to resolve the
21581 (MakeBoolean): New utility function that resolve, implicitly
21582 converts to boolean and tags the expression.
21585 (If, Do): Implement dead code elimination.
21586 (While): Implement loop inversion
21588 (Do, While, For, If): Resolve the expression prior to calling our
21591 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
21594 - added method Report28 (warning: program has more than one entry point)
21595 - added method IsEntryPoint, implements paragraph 10.1 of the spec
21596 - modified method Method.Define, the part at the end of the method
21598 * rootcontext.cs: added static public Location EntryPointLocation;
21600 * ../errors/cs0028.cs : Add test case for the above warning.
21603 - modified method CSharpName to allow arrays of primitive type to
21604 be printed nicely (e.g. instead of System.Int32[][] it now prints
21606 - added method CSharpSignature: returns the signature of a method
21607 in string format to be used in reporting errors, warnings, etc.
21609 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
21612 2002-04-26 Ravi Pratap <ravi@ximian.com>
21614 * delegate.cs (Define): Fix extremely silly bug where I was
21615 setting the type of the 'object' parameter of the BeginInvoke
21616 method to System.IAsyncResult instead of System.Object ;-)
21618 2002-04-26 Miguel de Icaza <miguel@ximian.com>
21620 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
21623 (Constructor.Emit): return if we fail to initialize the
21624 constructor. Another door closed!
21626 * expression.cs (New.DoResolve): Improve error message (from -6 to
21627 1501). Use DeclaredOnly lookup to find the exact constructor.
21629 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
21630 loop. This is useful.
21632 * cs-parser.jay: Adjust the default parameters so that destructors
21633 have the proper signature.
21635 2002-04-26 Martin Baulig <martin@gnome.org>
21637 * driver.cs (LoadAssembly): If `assembly' contains any characters
21638 which are only valid in path names and not in assembly names
21639 (currently slash, backslash and point), use Assembly.LoadFrom ()
21640 instead of Assembly.Load () on the `assembly' (before iteration
21641 over the link_paths).
21643 2002-04-26 Martin Baulig <martin@gnome.org>
21645 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
21647 2002-04-25 Miguel de Icaza <miguel@ximian.com>
21649 * class.cs (Property): use the new typemanager.MemberLookup
21651 (TypeContainer.MemberLookup): Implement using the
21652 TypeManager.MemberLookup now.
21654 * typemanager.cs: Make MemberLookup a function of the TypeManager,
21655 and return MemberInfos, so that these can be used without an
21656 EmitContext (what we had before).
21658 2002-04-24 Miguel de Icaza <miguel@ximian.com>
21660 * expression.cs: Fix the case where the argument to params if the
21661 type of the params. I omitted handling this before. Fixed
21663 2002-04-22 Miguel de Icaza <miguel@ximian.com>
21665 * driver.cs: Call BootCorlib_PopulateCoreType
21667 * class.cs (Property.CheckBase): Check for properties only, not
21670 * interface.cs: Temporary hack: try/catch around the
21671 CustomAttributeBuilder, because I am getting an exception that I
21674 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
21675 types whose definitions are required to be there (attributes are
21676 defined before standard types).
21678 Compute definitions as we boot the various types, as they are used
21679 immediately (value_type class will need object_type, but if we do
21680 not initialize object_type, we will pass a null, which will let
21681 the runtime pick the System.Object from the existing corlib, which
21682 is not what we want).
21684 2002-04-22 Patrik Torstensson <totte@labs2.com>
21686 * cs-tokenizer.cs: fixed a number of trim() issues.
21688 2002-04-22 Ravi Pratap <ravi@ximian.com>
21690 * expression.cs (Argument.Type): Ensure that we return the correct
21691 type when we have out or ref parameters [in which case we
21694 2002-04-22 Miguel de Icaza <miguel@ximian.com>
21696 * class.cs (Property, Indexer): Allow extern modifier in there.
21698 * typemanager.cs (InitBaseTypes): Initializes object_type and
21699 value_type, since those will be used early on during the bootstrap
21700 process to compile corlib.
21702 (InitCoreTypes): Move code from here to InitBaseTypes.
21704 2002-04-21 Miguel de Icaza <miguel@ximian.com>
21706 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
21707 single-dimension arrays as using the ldlen opcode.
21709 Daniel Lewis discovered this optimization.
21711 * typemanager.cs: Add signature for System.Array::get_Length
21713 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21715 * statement.cs: report the error when the foreach does not apply to an
21716 array nor a collection.
21718 2002-04-19 Miguel de Icaza <miguel@ximian.com>
21720 * expression.cs: Add implicit conversions to the operator ~.
21722 * constant.cs (DecimalConstant.Emit): Emit decimal value.
21724 * typemanager.cs: Locate the decimal constructor.
21726 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21728 * attribute.cs: use the new property of TypeOf.
21729 * expression.cs: added 'get' property around typearg.
21731 These changes fix a build breaker reported by NickD. Is this the
21732 correct way to fix? If not, please, revert my changes and make it
21735 2002-04-17 Miguel de Icaza <miguel@ximian.com>
21737 * attribute.cs: Add support for typeof in attribute invocations.
21738 I am not sure that this is right though.
21740 2002-04-14 Duncan Mak <duncan@ximian.com>
21742 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
21743 Binary.Operator.Division case.
21745 2002-04-13 Ravi Pratap <ravi@ximian.com>
21747 * class.cs (DefineType): Ensure that we do a proper check on
21748 attribute types and also register it with the TypeManager.
21750 (TypeContainer.Targets): The default for attribute types is
21751 AttributeTargets.All.
21753 * attribute.cs (ApplyAttributes): Registering the attribute type
21754 is done elsewhere, not when we discover we have a Usage attribute.
21756 2002-04-12 Ravi Pratap <ravi@ximian.com>
21758 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
21759 and get rid of is_delegate parameter.
21761 * everywhere : update.
21763 2002-04-12 Ravi Pratap <ravi@ximian.com>
21765 * cs-parser.jay (compilation_unit): Revamp completely to use
21766 some new ideas that I got from Rhys' grammar to solve the problems
21767 with assembly level attributes.
21769 (outer_declaration): New grammar production.
21771 (attribute_sections): Add.
21773 (opt_attributes): Base on attribute_sections
21775 (namespace_declaration): Allow opt_attributes to tackle the case
21776 when we have assembly level attributes - we are clever in this
21779 * attribute.cs (ApplyAttributes): Do not worry about assembly
21780 attributes in the non-global context.
21782 * rootcontext.cs (AddGlobalAttributes): Go back to using this
21783 instead of SetGlobalAttributes.
21785 * class.cs, rootcontext.cs : Ensure we define and generate
21786 attribute types before anything else.
21788 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
21789 and flag the new error -20 for the case when the attribute type
21790 does not have valid targets specified. csc does not catch this.
21792 * ../errors/errors.txt : update for error # -20
21794 2002-04-11 Ravi Pratap <ravi@ximian.com>
21796 * support.cs (InternalParameters.ParameterModifier): Do some null
21797 checking and return sane values.
21799 * class.cs (Method.Define): If we are a PInvoke method, ensure
21800 that we are static and extern. Report error # 601
21802 * ../errors/cs0601.cs : Add test case for the above error.
21804 2002-04-07 Ravi Pratap <ravi@ximian.com>
21806 * rootcontext.cs (attribute_types): We need to keep type of
21807 all attribute types separately and emit code for them first.
21809 (RegisterAttribute) : Implement.
21811 * class.cs (DefineType): Check if the current Type is a custom
21812 attribute type and register it accordingly.
21814 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
21815 adding the first attribute twice and rename to
21817 (SetGlobalAttributes): this.
21819 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
21822 * attribute.cs (ApplyAttributes): Take an additional argument telling us
21823 if we are processing global arguments. Hmm, I am unsure of this.
21825 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21827 * expression.cs: added static array of strings to avoid calling
21828 Enum.ToString () for Operator in Binary. Significant recover of
21831 2002-04-10 Miguel de Icaza <miguel@ximian.com>
21833 * class.cs (FindMembers): Allow the Builders of the various
21834 members to be null. If they are skip them. This only happens
21835 during the PInvoke declaration.
21837 2002-04-09 Miguel de Icaza <miguel@ximian.com>
21839 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
21840 failure, so we do not keep going afterwards.
21842 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
21843 wanted to pass `false' as the `is_delegate' argument. If this is
21844 the case, why not use delegate_type == null to mean `is_delegate =
21845 false' and anything else as is_delegate = true.
21847 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
21849 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
21850 code for the section, not the beginning of the tests.
21852 2002-04-08 Miguel de Icaza <miguel@ximian.com>
21854 * cfold.cs: Handle operator + (Enum x, Underlying x)
21856 * expression.cs (Binary): same. Warn about errors where we have
21857 Enum/Enum in operator + as well.
21859 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
21862 - added support for switch(bool)
21863 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
21864 - add TableSwitchEmit() to handle table-based switch statements
21866 2002-04-05 Ravi Pratap <ravi@ximian.com>
21868 * expression.cs (Invocation.OverloadResolve): Factor out code which
21869 does parameter compatibility checking with arguments so that we can
21870 re-use the code even from Delegate.VerifyApplicability
21872 (VerifyArgumentsCompat): Move above code here.
21874 * delegate.cs (VerifyApplicability): Get rid of duplicate code
21875 and instead make a call to the above method.
21877 2002-03-31 Ravi Pratap <ravi@ximian.com>
21879 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
21880 We use it to keep track of classes which are attribute types.
21882 2002-04-02 Miguel de Icaza <miguel@ximian.com>
21884 * delegate.cs (Delegate.Define): Correctly define the types in the
21885 presence of fixed and array parameters.
21887 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
21890 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
21891 include NonPublic after the first iteration.
21893 * class.cs (Indexer.CheckBase): Only check if both parents are
21896 * cs-parser.jay (accessor_body): If empty, set to null.
21898 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
21899 same code path here to resolve constants names that we did have in
21900 MemberAccess.DoResolve. There is too much code duplicated here.
21902 2002-04-01 Miguel de Icaza <miguel@ximian.com>
21904 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
21906 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
21909 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
21910 tokens, numbers and strings.
21912 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
21915 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
21916 asyncronous parameters and the regular parameters.
21918 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
21919 specify the target directory.
21921 * expression.cs: (This.DoResolve): Simplify
21922 (As.Emit): Optimize, do not generate IsInst if the expression is
21923 always of the given type.
21925 (Is.DoResolve): Bug fix, we were reporting both always/never for
21928 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
21929 creating too many unnecessary arrays.
21931 2002-03-31 Miguel de Icaza <miguel@ximian.com>
21933 * class.cs (EmitFieldInitializer): Use Assign expression to assign
21934 fields instead of rolling our own initializer. Takes care of all
21935 implicit conversions, and drops unnecessary static checks/argument.
21937 2002-03-31 Dick Porter <dick@ximian.com>
21939 * driver.cs: use the GetDirectories() return values properly, and
21940 use "/" as path separator.
21942 2002-03-30 Miguel de Icaza <miguel@ximian.com>
21944 * expression.cs (Unary): Optimize - - expr into expr.
21945 (Binary): Optimize a + (-b) into a -b.
21947 * codegen.cs (CodeGen): Made all methods static.
21949 2002-03-29 Miguel de Icaza <miguel@ximian.com>
21953 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
21954 TypeBuilder property.
21956 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
21959 * tree.cs: Removed the various RecordXXXX, and replaced with a
21960 single RecordDecl. Removed all the accessor methods, and just
21961 left a single access point Type
21963 * enum.cs: Rename DefineEnum to DefineType.
21965 * decl.cs: New abstract method `DefineType' used to unify the
21966 Defines for Enumerations, Interfaces, TypeContainers and
21969 (FindType): Moved LookupInterfaceOrClass here. Moved the
21970 LookupBaseClasses method that used to live in class.cs and
21971 interface.cs here, and renamed to FindType.
21973 * delegate.cs: Implement DefineType. Take advantage of the
21974 refactored pattern for locating the parent builder without taking
21975 the parent_builder argument (which we know does not work if we are
21976 nested, and triggering a toplevel definition).
21978 2002-03-28 Miguel de Icaza <miguel@ximian.com>
21980 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
21981 accessibility of a member has changed during override and report
21984 * class.cs (Method.Define, Property.Define): Only complain on
21985 overrides if the method is private, any other accessibility is
21986 fine (and since we just checked the permission is the same, we are
21989 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
21990 and elif are processed always. The other pre-processing
21991 directives are only processed if we are "taking" the path
21993 2002-03-29 Martin Baulig <martin@gnome.org>
21995 * class.cs (Method.Emit): Only emit symbolic debugging info if the
21996 current location is not Null.
21998 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
21999 a separate method so we can profile it.
22001 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
22002 `span.Seconds' are just seconds, but no minutes or hours.
22003 (MainDriver): Profile the CodeGen.SaveSymbols calls.
22005 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22007 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
22008 Remove the gratuitous set of Final:
22010 // If an interface implementation, then we can set Final.
22011 if (((flags & MethodAttributes.Abstract) == 0) &&
22012 implementing.DeclaringType.IsInterface)
22013 flags |= MethodAttributes.Final;
22015 I do not know what I was smoking when I used that.
22018 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
22019 step into fixing the name resolution issues for delegates and
22020 unifying the toplevel name resolution.
22022 2002-03-28 Martin Baulig <martin@gnome.org>
22024 * class.cs (Method.Emit): If we have a symbol writer, call its
22025 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
22026 tell it about the current method.
22028 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
22029 writer that we're going to emit the first byte of IL code for a new
22030 statement (a new source line).
22031 (EmitContext.EmitTopBlock): If we have a symbol writer, call
22032 EmitContext.Mark() before emitting any code.
22034 * location.cs (SymbolDocument): Return null when we're Null.
22036 * statement.cs (Statement): Moved the `Location loc' variable here.
22037 (Statement.EmitBoolExpression): If we have a symbol writer, call
22038 ec.Mark() before emitting any code to tell it that we're at the
22039 beginning of a new statement.
22040 (StatementExpression): Added `Location' argument to the constructor.
22041 (Block): Added public readonly variable `StartLocation' and public
22042 variable `EndLocation'. The latter is to be set using SetEndLocation().
22043 (Block): Added constructor which takes a start and end location.
22044 (Block.SetEndLocation): New method. This sets the end location.
22045 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
22046 local variables we create.
22047 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
22048 each statement and do also mark the begin and end of the block.
22050 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
22051 tell it the current lexer.Location, use Location.Null for the end of the
22053 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
22054 current block, set its end location using SetEndLocation().
22055 (statement_expression): StatementExpression constructor now takes the
22056 lexer.Location as additional argument.
22057 (for_statement, declare_local_variables): Likewise.
22058 (declare_local_variables): When creating a new implicit block, use the
22059 new Block constructor and pass it the lexer.Location.
22061 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22063 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
22064 members also on the parent interfaces recursively.
22066 2002-03-27 Miguel de Icaza <miguel@ximian.com>
22068 * report.cs: Use new formats, since Gonzalo finished the missing
22071 * expression.cs (Binary.ResolveOperator): added missing operator|
22072 operator& and operator^ for bool/bool.
22074 * cs-parser.jay: CheckDef now takes a Location argument that is
22075 used to report errors more precisly (instead of reporting the end
22076 of a definition, we try to track something which is a lot closer
22077 to the source of the problem).
22079 * cs-tokenizer.cs: Track global token use, so we can properly flag
22080 the use of #define/#undef after the first token has been seen.
22082 Also, rename the reportXXXX to Error_DescriptiveName
22084 * decl.cs (DeclSpace.IsTopLevel): Move property here from
22085 TypeContainer, so that Enum and Interface can use this too.
22087 * class.cs (TypeContainer.LookupInterfaceOrClass,
22088 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
22089 `builder' argument. Typically this was used to pass the parent
22090 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
22093 The problem is that a nested class could trigger the definition of
22094 a toplevel class, and the builder would be obviously wrong in that
22097 So we drop this argument, and we compute dynamically the
22098 TypeBuilder/ModuleBuilder (the correct information was available
22099 to us anyways from DeclSpace.Parent)
22101 * interface.cs (Interface.DefineInterface): Drop builder
22102 parameter cleanup like class.cs
22104 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
22107 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
22110 (Try.Emit): Propagate the returns value from the statement.
22112 (Return.Emit): Even if we are leavning
22114 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
22116 * modifiers.cs: Fix the computation of MethodAttributes flags.
22118 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
22120 * driver.cs: allow compilation of files that start with '/'.
22121 Add a default case when checking the argument of --target.
22123 2002-03-25 Miguel de Icaza <miguel@ximian.com>
22125 * interface.cs: Implement the same search algorithm for types in
22126 the interface code.
22128 * delegate.cs: Do not allow multiple definition.
22130 * Recovered ChangeLog that got accidentally amputated
22132 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
22134 * rootcontext.cs: Load manually enum to allow core classes to
22135 contain enumerations.
22137 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
22138 Update to new static methods in TypeManager.
22140 * typemanager.cs (GetMethod, GetConstructor): Use our
22141 implementation of FindMembers to find the members, since during
22142 corlib compilation, the types are TypeBuilders and GetMethod and
22143 GetConstructor do not work.
22145 Make all methods in TypeManager static.
22147 (InitCodeHelpers): Split the functionality from
22148 the InitCodeTypes function.
22150 * driver.cs: Call InitCodeHelpers after we have populated the
22153 * cs-parser.jay (delegate_declaration): we did not used to compute
22154 the delegate name correctly for void delegates.
22156 2002-03-24 Miguel de Icaza <miguel@ximian.com>
22158 * rootcontext.cs (RootContext): Init the interface_resolve_order
22159 and type_container_resolve_order always.
22161 (ResolveCore, BootstrapCorlib_ResolveClass,
22162 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
22163 compiler when compiling with --nostdlib
22165 * class.cs (TypeContainer.DefineType): Check that our parent is
22166 not null. This test is most important when we are bootstraping
22169 * codegen.cs: Split out the symbol writing code.
22171 2002-03-25 Martin Baulig <martin@gnome.org>
22173 * driver.cs (-g): Made -g an alias for --debug.
22175 2002-03-24 Martin Baulig <martin@gnome.org>
22177 * codegen.cs (SymbolWriter): New public variable. Returns the
22178 current symbol writer.
22179 (CodeGen): Added `bool want_debugging_support' argument to the
22180 constructor. If true, tell the ModuleBuild that we want debugging
22181 support and ask it for the ISymbolWriter.
22182 (Save): If we have a symbol writer, call it's Close() method after
22183 saving the assembly.
22185 * driver.c (--debug): New command line argument to create a
22186 debugger information file.
22188 * location.cs (SymbolDocument): New public property. Returns an
22189 ISymbolDocumentWriter object for the current source file or null
22190 if we don't have a symbol writer.
22192 2002-03-21 Miguel de Icaza <miguel@ximian.com>
22194 * driver.cs (LoadAssembly): Correctly return when all the paths
22195 have been tried and not before.
22197 * statement.cs (Switch.Emit): return the actual coverage for this
22198 statement (returns/not-returns)
22200 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
22201 switch of the statement if we are the last switch section. That
22202 kills two problems: try/catch problems (we used to emit an empty
22203 nop at the end) and switch statements where all branches would
22206 2002-03-19 Miguel de Icaza <miguel@ximian.com>
22208 * driver.cs: Add default assemblies (the equivalent to the
22209 Microsoft CSC.RSP file)
22211 * cs-tokenizer.cs: When updating `cols and setting it to zero,
22212 also update tokens_seen and set it to false.
22214 * driver.cs: Implement --recurse for Mike.
22216 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
22217 correctly splitting out the paths.
22219 2002-03-18 Miguel de Icaza <miguel@ximian.com>
22221 * interface.cs (Interface.PopulateProperty): Instead of using
22222 `parent' as the declaration space for the set parameters, use
22225 * support.cs (InternalParameters): InternalParameters constructor
22226 takes a DeclSpace instead of a TypeContainer.
22228 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
22229 types are being initialized, load the address of it before calling
22232 (New): Provide a mechanism to disable the generation of local
22233 value type temporaries when the caller will be providing us with
22234 an address to store it.
22236 (ArrayCreation.EmitDynamicInitializers): Use it.
22238 2002-03-17 Miguel de Icaza <miguel@ximian.com>
22240 * expression.cs (Invocation.EmitArguments): Only probe for array
22241 property if there is more than one argument. Sorry about that.
22243 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
22244 empty param arrays.
22246 * class.cs (Method.LabelParameters): Fix incorrect code path that
22247 prevented the `ParamArrayAttribute' from being applied to the
22250 2002-03-16 Miguel de Icaza <miguel@ximian.com>
22252 * support.cs (ReflectionParameters): Correctly compute whether the
22253 last argument is a params array. Fixes the problem with
22256 * typemanager.cs: Make the assemblies array always be non-null
22257 (empty, but non-null)
22259 * tree.cs (RecordDecl): New function that abstracts the recording
22260 of names. This reports error 101, and provides a pointer to the
22261 previous declaration. Fixes a crash in the compiler.
22263 * cs-parser.jay (constructor_declaration): Update to new grammar,
22264 and provide a constructor_body that can be empty.
22266 2002-03-15 Miguel de Icaza <miguel@ximian.com>
22268 * driver.cs: Add support for --resources.
22270 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
22271 Make all types for the various array helper methods be integer.
22273 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
22274 CheckState to ConvCast.
22276 (ConvCast): Now it takes a `checked' state argument, to avoid
22277 depending on the emit context for the conversion, and just using
22278 the resolve time setting.
22280 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
22281 instead of Invocation.EmitArguments. We do not emit the original
22282 arguments, instead we emit those which have been converted to
22283 unsigned int expressions.
22285 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
22287 * codegen.cs: ditto.
22289 * expression.cs (LocalVariableReference): Drop the use of the
22290 Store function that depended on the variable index.
22292 * statement.cs (VariableInfo): Drop the `Idx' property from this
22293 class, as this is not taking into account the indexes for
22294 temporaries tat we generate during the execution, getting the
22297 * class.cs: First emit class initializers, then call the parent
22300 * expression.cs (Binary): Fix opcode emision.
22301 (UnaryMutator.EmitCode): Support checked code generation
22303 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
22304 matches for events for both the Static and Instance scans,
22305 pointing to the same element. Fix that.
22307 2002-03-14 Miguel de Icaza <miguel@ximian.com>
22309 * rootcontext.cs (ResolveTree): Always set the
22310 interface_resolve_order, because nested interfaces will be calling
22313 * class.cs (GetInterfaceOrClass): Track the same resolution
22314 process used by TypeManager.LookupType. This fixes the nested
22315 type lookups in class declarations (separate path from
22318 (TypeContainer.DefineType): Also define nested interfaces.
22319 (TypeContainer.RegisterOrder): New public function used to
22320 register the order in which child interfaces need to be closed.
22322 Nested interfaces need to be closed after their parents have been
22325 * interface.cs (InterfaceAttr): Put all the logic for computing
22326 the interface attribute here.
22328 (DefineInterface): Register our interface order with the
22329 RootContext or with the TypeContainer depending on the case.
22331 2002-03-12 Miguel de Icaza <miguel@ximian.com>
22333 * cs-parser.jay: rework foreach statement to work with the new
22334 changes to the policy on SimpleNames.
22336 * report.cs: support Stacktrace on warnings as well.
22338 * makefile: drop --unsafe and /unsafe from the compile.
22340 2002-03-13 Ravi Pratap <ravi@ximian.com>
22342 * ecore.cs (StandardConversionExists): Modify to take an Expression
22343 as the first parameter. Ensure we do null -> reference type conversion
22346 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
22347 temporary Expression objects.
22349 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
22351 * interface.cs: workaround bug in method overloading resolution
22352 (there is already a bugzilla bug for it).
22354 2002-03-12 Miguel de Icaza <miguel@ximian.com>
22356 We could also solve this problem by having a separate path for
22357 performing type lookups, instead of DoResolve, we could have a
22358 ResolveType entry point, and only participating pieces of the
22359 production (simplename, deref, array) would implement this.
22361 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
22362 signal SimpleName to only resolve type names and not attempt to
22363 resolve anything else.
22365 * expression.cs (Cast): Set the flag.
22367 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
22369 * class.cs: Only report 108 if there is no `new' modifier.
22371 * cs-parser.jay: rework foreach statement to work with the new
22372 changes to the policy on SimpleNames.
22374 * report.cs: support Stacktrace on warnings as well.
22376 * makefile: drop --unsafe and /unsafe from the compile.
22378 2002-03-11 Miguel de Icaza <miguel@ximian.com>
22380 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22381 lookups here, instead of doing that at parse time. This means
22382 that our grammar will not introduce `LocalVariableReferences' as
22383 expressions at this point. That solves the problem of code like
22387 static void Main ()
22391 This is only half the fix. The full fix requires parameters to
22392 also be handled in this way.
22394 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
22395 makes the use more obvious of the DeclSpace. The
22396 ec.TypeContainer.TypeBuilder is now only used to pull the
22397 TypeBuilder for it.
22399 My theory is that I can get rid of the TypeBuilder completely from
22400 the EmitContext, and have typecasts where it is used (from
22401 DeclSpace to where it matters).
22403 The only pending problem is that the code that implements Aliases
22404 is on TypeContainer, and probably should go in DeclSpace.
22406 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22407 lookups here, instead of doing that at parse time. This means
22408 that our grammar will not introduce `LocalVariableReferences' as
22409 expressions at this point. That solves the problem of code like
22413 static void Main ()
22417 This is only half the fix. The full fix requires parameters to
22418 also be handled in this way.
22420 * class.cs (Property.DefineMethod): When implementing an interface
22421 method, set newslot, when implementing an abstract method, do not
22422 set the flag (before we tried never setting it, or always setting
22423 it, which is the difference).
22424 (Indexer.DefineMethod): same.
22425 (Method.DefineMethod): same.
22427 * ecore.cs: Only set the status used flag if we get back a Field.
22429 * attribute.cs: Temporary hack, so Paolo can keep working.
22431 2002-03-08 Ravi Pratap <ravi@ximian.com>
22433 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
22434 the unmanaged type in the case we have a MarshalAs attribute.
22436 (Resolve): Handle the case when we are parsing the special MarshalAs
22437 attribute [we need to store the unmanaged type to use later]
22439 * typemanager.cs (marshal_as_attr_type): Built in type for the
22440 MarshalAs Attribute.
22442 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
22443 on parameters and accordingly set the marshalling info.
22445 2002-03-09 Miguel de Icaza <miguel@ximian.com>
22447 * class.cs: Optimizing slightly by removing redundant code after
22448 we switched to the `NoTypes' return value.
22449 (Property.DefineMethod): use NoTypes here too.
22451 This fixes the bug I introduced in my last batch of changes.
22453 2002-03-05 Ravi Pratap <ravi@ximian.com>
22455 * tree.cs (RecordEnum): Add. We now keep track of enums too.
22457 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
22458 Enums since those are types too.
22460 * cs-parser.jay (enum_declaration): Record enums as we parse them.
22462 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
22463 thanks to a call during the lookup process.
22465 2002-03-07 Miguel de Icaza <miguel@ximian.com>
22467 * statement.cs (Foreach): Lots of work to accomodate a particular
22468 kind of foreach statement that I had not kept in mind. It is
22469 possible to have foreachs on classes that provide a GetEnumerator
22470 method that return objects that implement the "pattern" for using
22471 a foreach, there is no need to support GetEnumerator
22474 This is needed to compile nant.
22476 * decl.cs: Only report 114 if the member is not `Finalize' and if
22477 the warning level is at least 2.
22479 * class.cs: Moved the compare function from Method to
22482 (MethodSignature.InheritableMemberSignatureCompare): Add new
22483 filter function that is used to extract inheritable methods from a
22486 (Method.Define): Use the new `inheritable_method_signature_filter'
22489 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
22492 2002-03-06 Miguel de Icaza <miguel@ximian.com>
22494 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
22496 * cs-parser.jay: Add opt_semicolon to the interface declaration.
22498 * expression.cs: Pass location information to
22499 ConvertImplicitStandard.
22501 * class.cs: Added debugging code to track return values from
22504 2002-03-05 Miguel de Icaza <miguel@ximian.com>
22506 * expression.cs (Is.DoResolve): If either side of the `is' is an
22507 interface, do not flag the warning.
22509 * ecore.cs (ImplicitReferenceConversion): We need a separate test
22512 * report.cs: Allow for --fatal to be used with --probe.
22514 * typemanager.cs (NoTypes): Move the definition for the empty Type
22517 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
22519 (TypeContainer.DefineProxy): New function used to proxy to parent
22520 implementations when implementing interfaces.
22521 (TypeContainer.ParentImplements): used to lookup if our parent
22522 implements a public function that is required by an interface.
22523 (TypeContainer.VerifyPendingMethods): Hook this up.
22525 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
22526 `modules' and `assemblies' arraylists into arrays. We only grow
22527 these are the very early start up of the program, so this improves
22528 the speedof LookupType (nicely measured).
22530 * expression.cs (MakeByteBlob): Replaced unsafe code with
22531 BitConverter, as suggested by Paolo.
22533 * cfold.cs (ConstantFold.Binary): Special case: perform constant
22534 folding of string concatenation, but if either side is a string,
22535 and the other is not, then return null, and let the runtime use
22536 the concatenation on the string plus the object (using
22537 `Object.ToString').
22539 2002-03-04 Miguel de Icaza <miguel@ximian.com>
22541 Constant Folding has been implemented now.
22543 * expression.cs (Unary.Reduce): Do not throw an exception, catch
22544 the error instead on types that are not supported in one's
22547 * constant.cs (Constant and all children): New set of functions to
22548 perform implict and explicit conversions.
22550 * ecore.cs (EnumConstant): Implement the new functions to perform
22551 conversion by proxying to the child expression.
22553 * codegen.cs: (ConstantCheckState): Constant evaluation has its
22554 own separate setting that can not be turned off from the command
22555 line using --unchecked or --checked and is only controlled using
22556 the checked/unchecked statements and expressions. This setting is
22557 used by the constant folder to flag errors.
22559 * expression.cs (CheckedExpr, UncheckedExpr): Set the
22560 ConstantCheckState as well.
22562 During Resolve, they also have to flag the state, because the
22563 constant folder runs completely in the Resolve phase.
22565 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
22568 2002-03-01 Miguel de Icaza <miguel@ximian.com>
22570 * cfold.cs: New file, this file contains the constant folder.
22572 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
22573 argument to track whether we are using the resulting address to
22574 load or store a value and provide better error messages.
22576 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
22577 new AddressOf arguments.
22579 * statement.cs (Foreach.EmitCollectionForeach): Update
22581 * expression.cs (Argument.Emit): Call AddressOf with proper
22582 arguments to track usage.
22584 (New.DoEmit): Call AddressOf with new arguments.
22586 (Unary.Emit): Adjust AddressOf call.
22588 2002-03-01 Ravi Pratap <ravi@ximian.com>
22590 * cs-parser.jay (member_access): Change the case for pre-defined types
22591 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
22594 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
22597 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
22598 essentially like methods and apply attributes like MethodImplOptions to them too.
22600 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
22603 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
22604 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
22607 * Update code everywhere accordingly.
22609 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
22611 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
22613 2002-02-28 Ravi Pratap <ravi@ximian.com>
22615 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
22616 try performing lookups against those instead of jumping straight into using
22617 the 'using' clauses.
22619 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
22621 (LookupType): Perform lookups in implicit parents too.
22623 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
22624 sequence as RootContext.LookupType.
22626 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
22627 the various cases of namespace lookups into this method.
22629 2002-03-01 Miguel de Icaza <miguel@ximian.com>
22631 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
22632 in positional arguments)
22634 * class.cs (Operator): Update the AllowedModifiers to contain
22637 * cs-parser.jay: Update operator declaration to allow for the
22638 operator body to be empty.
22640 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
22643 2002-02-27 Miguel de Icaza <miguel@ximian.com>
22645 * class.cs (Method.Emit): Label parameters.
22647 * driver.cs: Return 1 or 0 as the program exit code.
22649 2002-02-26 Miguel de Icaza <miguel@ximian.com>
22651 * expression.cs: Special case the `null' object when trying to
22652 auto-compute the type, as anything can be explicitly converted to
22655 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
22656 spotting this Paolo.
22658 (Expression.ImplicitNumericConversion): Perform comparissions of
22659 the type using the underlying type in the case of an enumeration
22660 rather than using the enumeration type for the compare.
22662 Cope with the underlying == type case, which is not possible to
22665 (Expression.ConvertNumericExplicit): Perform comparissions of
22666 the type using the underlying type in the case of an enumeration
22667 rather than using the enumeration type for the compare.
22669 * driver.cs: If the user does not supply an extension, assume .exe
22671 * cs-parser.jay (if_statement): Rewrote so that we can track the
22672 location for the if statement.
22674 * expression.cs (Binary.ConstantFold): Only concat strings when
22675 the operation is "+", not everything ;-)
22677 * statement.cs (Statement.EmitBoolExpression): Take a location
22679 (If, While, Do): Track location.
22681 * expression.cs (Binary.ResolveOperator): In the object + string
22682 case, I was missing a call to ConvertImplicit
22684 2002-02-25 Ravi Pratap <ravi@ximian.com>
22686 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
22687 Location arguments. Ensure we use RootContext.LookupType to do our work
22688 and not try to do a direct Type.GetType and ModuleBuilder.GetType
22690 * interface.cs (PopulateMethod): Handle the type of the parameter being
22693 * expression.cs (Invocation.BetterFunction): Handle the case when we
22694 have a params method with no fixed arguments and a call is made with no
22697 2002-02-25 Miguel de Icaza <miguel@ximian.com>
22699 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
22700 the verbatim-string-literal
22702 * support.cs (InternalParameters.ParameterModifier): handle null
22704 (InternalParameters.ParameterType): ditto.
22706 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
22707 duplicating the name of the variable parameter.
22708 (GetParameterByName): Fix bug where we were not looking up array
22709 paramters if they were the only present (thanks Paolo!).
22710 (GetParameterInfo): We only have an empty set of types if both
22711 fixed and array are set to null.
22712 (GetParameterInfo-idx): Handle FixedParameter == null
22714 * cs-parser.jay: Handle the case where there is no catch
22715 statements (missing null test).
22717 2002-02-22 Miguel de Icaza <miguel@ximian.com>
22719 * driver.cs (MainDriver): Be conservative on our command line
22722 Catch DirectoryNotFoundException when calling GetFiles.
22724 (SplitPathAndPattern): Used to split the input specification into
22725 a path and a pattern that we can feed to Directory.GetFiles.
22727 2002-02-21 Miguel de Icaza <miguel@ximian.com>
22729 * statement.cs (Fixed): Implement the last case of the Fixed
22730 statement (string handling).
22732 * expression.cs (StringPtr): New class used to return a char * to
22733 a string; Used by the Fixed statement.
22735 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
22737 * expression.cs (Binary.ResolveOperator): Remove redundant
22738 MemberLookup pn parent type.
22739 Optimize union call, we do not need a union if the types are the same.
22740 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
22743 Specialize the use of MemberLookup everywhere, instead of using
22744 the default settings.
22746 (StackAlloc): Implement stackalloc keyword.
22748 * cs-parser.jay: Add rule to parse stackalloc.
22750 * driver.cs: Handle /h, /help, /?
22752 * expression.cs (MakeByteBlob): Removed the hacks we had in place
22753 before we supported unsafe code.
22755 * makefile: add --unsafe to the self compilation of mcs.
22757 2002-02-20 Miguel de Icaza <miguel@ximian.com>
22759 * expression.cs (PointerArithmetic): New class that is used to
22760 perform pointer arithmetic.
22761 (Binary.Resolve): Handle pointer arithmetic
22762 Handle pointer comparission.
22763 (ArrayPtr): Utility expression class that is used to take the
22764 address of an array.
22766 (ElementAccess): Implement array access for pointers
22768 * statement.cs (Fixed): Implement fixed statement for arrays, we
22769 are missing one more case before we are done.
22771 * expression.cs (Indirection): Implement EmitAssign and set the
22772 ExprClass to Variable. This allows pointer dereferences to be
22773 treated as variables, and to have values assigned to them.
22775 * ecore.cs (Expression.StoreFromPtr): New utility function to
22776 store values dereferencing.
22778 2002-02-20 Ravi Pratap <ravi@ximian.com>
22780 * expression.cs (Binary.ResolveOperator): Ensure that we are
22781 not trying to operate on a void type - this fixes the reported
22784 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
22785 the parent implementation is sealed.
22787 * ../errors/cs0239.cs : Add.
22789 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
22791 * typemanager.cs (unverifiable_code_type): Corresponds to
22792 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
22793 which have unsafe code in them.
22795 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
22798 2002-02-19 Miguel de Icaza <miguel@ximian.com>
22800 * cs-tokenizer.cs: Add support for @"litreal strings"
22802 Make tokenizer accept pre-processor directives
22803 on any column (remove the old C-like limitation).
22805 * rootcontext.cs (EmitCode): Emit any global attributes.
22806 (AddGlobalAttributes): Used to keep track of assembly attributes.
22808 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
22810 * cs-parser.jay: Add support for global attributes.
22812 2002-02-17 Miguel de Icaza <miguel@ximian.com>
22814 * expression.cs (Indirection): New helper class. Unary will
22815 create Indirection classes to be able to implement the
22816 IMemoryLocation interface on it.
22818 2002-02-16 Miguel de Icaza <miguel@ximian.com>
22820 * cs-parser.jay (fixed_statement): reference the right statement.
22822 * statement.cs (Fixed.Emit): Finish implementing the fixed
22823 statement for the &x case.
22825 2002-02-14 Miguel de Icaza <miguel@ximian.com>
22827 * class.cs (Property.Define, Method.Define): Remove newslot when
22830 * modifiers.cs: My use of NewSlot when `Abstract' was set was
22831 wrong. NewSlot should only be used if the `new' keyword is present.
22833 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
22834 locating our system dir. Sorry about this.
22836 2002-02-13 Miguel de Icaza <miguel@ximian.com>
22838 * driver.cs (GetSystemDir): Compute correctly the location of our
22839 system assemblies. I was using the compiler directory instead of
22840 the library directory.
22842 2002-02-13 Ravi Pratap <ravi@ximian.com>
22844 * expression.cs (BetterFunction): Put back in what Miguel commented out
22845 since it is the correct fix. The problem is elsewhere ;-)
22847 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
22848 parameters of the parms method are themselves compatible or not !
22850 (StandardConversionExists): Fix very dangerous bug where we were forgetting
22851 to check that a class implements an interface before saying that an implicit
22852 conversion was allowed. Use ImplementsInterface to do the checking.
22854 2002-02-13 Miguel de Icaza <miguel@ximian.com>
22856 * class.cs (Method.Define): Track whether we are an explicit
22857 implementation or not. And only call DefineMethodOverride if we
22858 are an explicit implementation.
22860 (Property.DefineMethod): Ditto.
22862 2002-02-11 Ravi Pratap <ravi@ximian.com>
22864 * expression.cs (BetterFunction): Catch hideous bug which was
22865 preventing us from detecting ambiguous calls due to implicit casts i.e
22868 2002-01-29 Miguel de Icaza <miguel@ximian.com>
22870 * support.cs (Pair): Remove un-needed method. I figured why I was
22871 getting the error in cs-parser.jay, the variable in a foreach loop
22872 is readonly, and the compiler does not really treat this as a variable.
22874 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
22875 instead of EQUALS in grammar.
22877 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
22879 * expression.cs (Unary.DoResolve): Check whether the argument is
22882 2002-01-28 Miguel de Icaza <miguel@ximian.com>
22884 * support.cs: Api for Pair to set a value. Despite the fact that
22885 the variables are public the MS C# compiler refuses to compile
22886 code that accesses the field if the variable is part of a foreach
22889 * statement.cs (Fixed): Begin implementation of the fixed
22892 (Block.AddVariable): Return the VariableInfo on success and null
22893 on failure instead of true/false.
22895 * cs-parser.jay (foreach): Catch errors on variables already
22896 defined (we were ignoring this value before) and properly unwind
22897 the block hierarchy
22899 (fixed_statement): grammar for the fixed statement.
22901 2002-01-25 Miguel de Icaza <miguel@ximian.com>
22903 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
22904 pointer types to be incretemented.
22906 (SizeOf): Implement.
22908 * cs-parser.jay (pointer_member_access): Implement
22909 expr->IDENTIFIER production.
22911 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
22912 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
22915 (Unary): Implement indirection.
22917 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
22918 use in non-unsafe context).
22920 (SimpleName.DoResolve): Check for pointers in field access on safe
22923 (Expression.LoadFromPtr): Factor the load-indirect code in this
22924 function. This was duplicated in UnboxCast and ParameterReference
22926 2002-01-24 Miguel de Icaza <miguel@ximian.com>
22928 * expression.cs (ComposedCast): report an error if a pointer cast
22929 is used in a safe region.
22931 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
22932 pointer type casts in unsafe context.
22934 * codegen.cs (EmitContext): Set up IsUnsafe.
22936 * cs-parser.jay (non_expression_type): Add productions for pointer
22939 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
22940 code. We should not use force into static mode if the method is
22941 not virtual. Fixes bug in MIS
22943 * statement.cs (Do.Emit, While.Emit, For.Emit,
22944 Statement.EmitBoolExpression): Add support to Do and While to
22945 propagate infinite loop as `I do return' semantics.
22947 Improve the For case to also test for boolean constants.
22949 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
22950 to the list of attributes we can add.
22952 Remove `EmitContext' argument.
22954 * class.cs (Method.Define): Apply parameter attributes.
22955 (Constructor.Define): Apply parameter attributes.
22956 (MethodCore.LabelParameters): Move here the core of labeling
22959 * support.cs (ReflectionParameters.ParameterModifier,
22960 InternalParameters.ParameterModifier): Use IsByRef on the type and
22961 only return the OUT bit for these parameters instead of in/out/ref
22964 This is because I miss-understood things. The ParameterInfo.IsIn
22965 and IsOut represent whether the parameter has the [In] and [Out]
22968 2002-01-22 Miguel de Icaza <miguel@ximian.com>
22970 * ecore.cs (FieldExpr.Emit): Release temporaries.
22972 * assign.cs (LocalTemporary.Release): new function.
22974 * codegen.cs (EmitContext.GetTemporaryStorage,
22975 EmitContext.FreeTemporaryStorage): Rework the way we deal with
22976 temporary storage. Now we can "put back" localbuilders when we
22979 2002-01-21 Miguel de Icaza <miguel@ximian.com>
22981 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
22982 need to make a copy of the variable to generate verifiable code.
22984 2002-01-19 Miguel de Icaza <miguel@ximian.com>
22986 * driver.cs: Compute dynamically the system directory.
22988 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
22989 Slower, but more generally useful. Used by the abstract
22990 registering implementation.
22992 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
22993 the rules for the special rule on Type/instances. First check if
22994 we have the same name, and if so, try that special static path
22995 rather than the instance path.
22997 2002-01-18 Miguel de Icaza <miguel@ximian.com>
22999 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
23002 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
23003 Enum, ValueType, Delegate or Array for non-corlib compiles.
23005 * cs-tokenizer.cs: Catch long identifiers (645)
23007 * typemanager.cs (IndexerPropetyName): Ravi never tested this
23010 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
23011 fix, we were returning too early, so we were not registering
23012 pending methods from abstract classes.
23014 Do not register pending methods if the class is abstract.
23016 * expression.cs (Conditional.DoResolve): Report circular implicit
23017 conversions when we neecd to compute it for conditional
23020 (Is.DoResolve): If the expression is always of the provided type,
23021 flag warning 183. If the expression can not ever be of the
23022 provided type flag warning 184.
23024 * class.cs: Catch 169 as well.
23026 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
23029 2002-01-18 Nick Drochak <ndrochak@gol.com>
23031 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
23033 2002-01-17 Miguel de Icaza <miguel@ximian.com>
23035 * interface.cs: (PopulateMethod): Check for pointers being defined
23036 only if the unsafe context is active.
23037 (PopulateProperty): ditto.
23038 (PopulateIndexer): ditto.
23040 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
23041 specified. If pointers are present, make sure that they are
23042 present in an unsafe context.
23043 (Constructor, Constructor.Define): ditto.
23044 (Field, Field.Define): ditto.
23045 (Property, Property.Define): ditto.
23046 (Event, Event.Define): ditto.
23048 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
23049 hashtable if there are classes or structs defined.
23051 * expression.cs (LocalVariableReference.DoResolve): Simplify this
23052 code, as the constant resolution moved.
23054 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
23055 the metadata, so we can flag error 133.
23057 * decl.cs (MemberCore.UnsafeOK): New function to test that a
23058 pointer is being declared in an unsafe context.
23060 2002-01-16 Miguel de Icaza <miguel@ximian.com>
23062 * modifiers.cs (Modifiers.Check): Require a Location argument.
23063 Report error 227 for Unsafe use.
23065 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
23067 * statement.cs (For.Emit): If the test is null, then report that
23068 we do `return', as we wont reach anything afterwards.
23070 (Switch.SwitchGoverningType): Track the expression that matched
23073 * driver.cs: Allow negative numbers as an error code to flag.
23075 * cs-parser.jay: Handle 1551.
23077 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
23079 2002-01-15 Miguel de Icaza <miguel@ximian.com>
23081 * cs-parser.jay: Report 1518 (type declaration can only contain
23082 class, struct, interface, enum or delegate)
23084 (switch_label): Report 1523 (keywords `case' or `default' must
23087 (opt_switch_sections): Report 1522 (empty switch)
23089 * driver.cs: Report 1515 (response file specified multiple times)
23090 Report 1516 (Source file specified multiple times).
23092 * expression.cs (Argument.Resolve): Signal 1510
23094 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
23095 access not allowed in static code)
23097 2002-01-11 Ravi Pratap <ravi@ximian.com>
23099 * typemanager.cs (IsPointerType): Utility method which we are going
23102 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
23103 the object type, so we take care of that.
23105 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
23107 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
23108 added to non-params parameters :-)
23110 * typemanager.cs (CSharpName): Include 'void' type too.
23112 (void_ptr_type): Include in the set of core types.
23114 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
23117 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
23120 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
23121 completely forgotten about it.
23123 2002-01-10 Ravi Pratap <ravi@ximian.com>
23125 * cs-parser.jay (pointer_type): Add. This begins our implementation
23126 of parsing rules for unsafe code.
23128 (unsafe_statement): Implement.
23130 (embedded_statement): Modify to include the above.
23132 * statement.cs (Unsafe): Implement new class for unsafe blocks.
23134 * codegen.cs (EmitContext.InUnsafe): Add. This determines
23135 if the current context is an unsafe one.
23137 * cs-parser.jay (local_variable_pointer_type): Since local variable types
23138 are handled differently, we need separate rules for them.
23140 (local_variable_declaration): Update to use local_variable_pointer_type
23141 to allow variable declarations of unmanaged pointer types.
23143 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
23144 in unsafe contexts.
23146 * ../errors/cs0214.cs : Add.
23148 2002-01-16 Nick Drochak <ndrochak@gol.com>
23150 * makefile: remove 'response' file when cleaning.
23152 2002-01-15 Miguel de Icaza <miguel@ximian.com>
23154 * cs-parser.jay: Report 1524.
23156 2002-01-14 Miguel de Icaza <miguel@ximian.com>
23158 * typemanager.cs (RegisterMethod): drop checking if we have
23159 registered this from here
23161 2002-01-12 Miguel de Icaza <miguel@ximian.com>
23163 * class.cs (Method.EmitDestructor): Implement calling our base
23166 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
23167 value of InFinally.
23169 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
23170 this routine and will wrap the call in a try/catch block. Deal
23173 2002-01-11 Miguel de Icaza <miguel@ximian.com>
23175 * ecore.cs (Expression.MemberLookup): instead of taking a
23176 parameter `same_type' that was used to tell whether we could
23177 access private members we compute our containing type from the
23180 (FieldExpr): Added partial support for volatile fields. This does
23181 not work for volatile fields exposed from assemblies, as I can not
23182 figure out how to extract the modreq from it.
23184 Updated all the source files to use this.
23186 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
23187 because it is referenced by MemberLookup very often.
23189 2002-01-09 Ravi Pratap <ravi@ximian.com>
23191 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
23192 TypeBuilder.GetCustomAttributes to retrieve what we need.
23194 Get rid of redundant default_member_attr_type as this is the same as
23195 default_member_type which already exists.
23197 * interface.cs, attribute.cs : Update accordingly.
23199 2002-01-08 Miguel de Icaza <miguel@ximian.com>
23201 * typemanager.cs: Enable IndexerPropertyName again. It does not
23202 work for TYpeBuilders though. Ravi, can you please fix this?
23204 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
23206 * expression.cs (Argument.Emit): Handle the case of ref objects
23207 being passed to ref functions;
23209 (ParameterReference.EmitLoad): Loads the content of the pointer
23210 without dereferencing.
23212 2002-01-07 Miguel de Icaza <miguel@ximian.com>
23214 * cs-tokenizer.cs: Implemented the pre-processing expressions.
23216 2002-01-08 Ravi Pratap <ravi@ximian.com>
23218 * class.cs (Indexer.DefineMethod): Incorporate the interface
23219 type in the name of the method if we are doing explicit interface
23222 * expression.cs (ConversionExists): Remove as it is completely obsolete.
23224 (BetterConversion): Fix extremely trivial bug where we were referring to
23225 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
23228 * ../errors/bug16.cs : Add although we have fixed it.
23230 2002-01-07 Miguel de Icaza <miguel@ximian.com>
23232 * expression.cs (BaseIndexer): Begin implementation.
23234 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
23236 * cs-parser.jay (indexer_declarator): Use qualified_identifier
23237 production directly to remove a shift/reduce, and implement
23238 explicit interface implementation.
23240 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
23241 after a floating point suffix.
23243 * expression.cs (DoNumericPromotions): Improved the conversion for
23244 uint/uint. If we have a constant, we avoid doing a typecast to a
23247 * class.cs (Indexer): Implement explicit interface implementation
23250 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
23252 * class.cs: make the default instance constructor public and hidebysig.
23254 2001-01-03 Ravi Pratap <ravi@ximian.com>
23256 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
23257 so we can call it from elsewhere.
23259 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
23260 we emit it internally if the class has a defined indexer; otherwise the user
23261 emits it by decorating the class definition with the DefaultMemberAttribute.
23263 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
23264 attribute is not used on a type which defines an indexer.
23266 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
23267 character when we skip whitespace.
23269 * ../errors/cs0646.cs : Add.
23271 2002-01-03 Miguel de Icaza <miguel@ximian.com>
23273 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
23276 * makefile: Add practical target `mcs3.exe' which builds the third
23277 generation compiler.
23279 * expression.cs (New): Fix structures constructor calling.
23281 * class.cs (Property, Method, Indexer): Emit Final flag on the
23282 method if we are an interface implementation and we are not
23285 * ecore.cs (PropertyExpr): New public field `IsBase', tells
23286 whether this property is referencing a `base' method.
23288 * expression.cs (Invocation.EmitCall): take an extra argument:
23289 is_base, this is used to determine whether the `call' or
23290 `callvirt' opcode should be used.
23293 * delegate.cs: update EmitCall.
23295 * class.cs (Method.Define): Set NewSlot for the cases where we are
23296 not implementing an interface method.
23298 (Property.Define): ditto.
23300 2002-01-02 Miguel de Icaza <miguel@ximian.com>
23302 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
23303 'r'. Allows mcs to parse itself fully.
23305 2002-01-02 Ravi Pratap <ravi@ximian.com>
23307 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
23308 of the number of initializers that require the InitializeArray method.
23310 (CheckIndices): Store the Expression in all cases - not the plain value. Also
23311 update the above field where necessary.
23313 (MakeByteBlob): Update accordingly.
23315 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
23318 (EmitDynamicInitializers): Update in accordance with the new optimization.
23320 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
23321 same OpCode applies.
23323 * cs-parser.jay : Fix some glaring errors I introduced.
23325 2002-01-01 Ravi Pratap <ravi@ximian.com>
23327 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
23328 so that we can check for name clashes there too.
23330 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
23331 for interface indexers.
23333 * interfaces.cs (Define): Emit the default member attribute.
23335 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
23336 variable was being referred to while setting the value ;-)
23338 2002-01-01 Miguel de Icaza <miguel@ximian.com>
23340 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
23341 byte-by-byte information when we know the data is zero.
23343 Make the block always a multiple of 4, because
23344 DefineInitializedData has a bug.
23346 * assign.cs: Fix, we should assign from the temporary, not from
23349 * expression.cs (MakeByteBlob): Fix my incorrect code.
23351 2001-12-31 Miguel de Icaza <miguel@ximian.com>
23353 * typemanager.cs (EnumToUnderlying): This function is used to get
23354 the underlying type from an enumeration, because it does not
23357 * constant.cs: Use the I4_S form for values between -128 and 127.
23359 * statement.cs (Block.LookupLabel): Looks up a label.
23360 (Block): Drop support for labeled blocks.
23362 (LabeledStatement): New kind of statement that represents a label
23365 (Goto): Finally implement this bad boy.
23367 * cs-parser.jay: Update to reflect new mechanism to implement
23370 2001-12-30 Miguel de Icaza <miguel@ximian.com>
23372 * codegen.cs (EmitContext.This): a codegen property that keeps the
23373 a single instance of this instead of creating many different this
23376 * delegate.cs (Delegate.DoResolve): Update to use the property;
23378 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
23380 * expression.cs (BaseAccess.DoResolve): Ditto.
23382 2001-12-29 Ravi Pratap <ravi@ximian.com>
23384 * typemanager.cs (methodimpl_attr_type): Add to hold the type
23385 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
23387 (InitCoreTypes): Update accordingly.
23389 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
23390 so we can quickly store the state.
23392 (ApplyAttributes): Set the correct implementation flags
23393 for InternalCall methods.
23395 2001-12-29 Miguel de Icaza <miguel@ximian.com>
23397 * expression.cs (EmitCall): if a method is not virtual, then do
23398 not use callvirt on it.
23400 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
23401 user defined stuff) requires the use of stobj, which takes an
23402 address on the stack instead of an array and an index. So emit
23403 the Ldelema operation for it.
23405 (EmitStoreOpcode): Use stobj for valuetypes.
23407 (UnaryMutator.EmitCode): Use the right 1 value depending on
23408 whether we are dealing with int64/uint64, float or doubles.
23410 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
23411 constructors that I implemented last night.
23413 (Constructor.IsDefault): Fix to work properly for static
23416 * cs-parser.jay (CheckDef): report method signature errors.
23417 Update error number 103 to be 132.
23419 * decl.cs: New AdditionResult enumeration value: MethodExists.
23420 Although we do this check for methods later on in the semantic
23421 analysis, catching repeated default constructors is so easy that
23422 we catch these here.
23424 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
23427 (ParameterReference.EmitAssign, Emit): handle
23430 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
23431 (ArrayAccess.EmitStoreOpcode): ditto.
23433 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
23435 * expression.cs (MakeByteBlob): Complete all the missing types
23436 (uint, short, ushort, byte, sbyte)
23438 * class.cs: Only init instance field initializers on instance
23441 Rename `constructors' to instance_constructors.
23443 (TypeContainer.AddConstructor): Only add constructors to the list
23444 if it is not static.
23446 Make sure that we handle default_static_constructor independently
23447 everywhere where we handle instance_constructors
23449 2001-12-28 Miguel de Icaza <miguel@ximian.com>
23451 * class.cs: Do not lookup or create a base initializer for a
23452 static constructor.
23454 (ConstructorInitializer.Resolve): use the proper type to lookup
23457 * cs-parser.jay: Report error 1585 (modifiers between type and name).
23459 * enum.cs, interface.cs: Remove CloseType, this is taken care by
23462 * decl.cs: CloseType is now an virtual method, the default
23463 implementation just closes this type.
23465 2001-12-28 Ravi Pratap <ravi@ximian.com>
23467 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
23468 to PreserveSig by default. Also emit HideBySig on such methods.
23470 Basically, set the defaults to standard values.
23472 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
23473 argument, if candidate is better, it can't be worse than the best !
23475 (Invocation): Re-write bits to differentiate between methods being
23476 applicable in their expanded form and their normal form - for params
23479 Get rid of use_standard everywhere as only standard conversions are allowed
23480 in overload resolution.
23482 More spec conformance.
23484 2001-12-27 Miguel de Icaza <miguel@ximian.com>
23486 * driver.cs: Add --timestamp, to see where the compiler spends
23489 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
23490 `this' in static code.
23492 (SimpleName.DoResolve): Implement in terms of a helper function
23493 that allows static-references to be passed upstream to
23496 (Expression.ResolveWithSimpleName): Resolve specially simple
23497 names when called by MemberAccess to implement the special
23500 (Expression.ImplicitReferenceConversion): Handle conversions from
23501 Null to reference types before others, as Null's type is
23504 * expression.cs (Invocation.EmitCall): Handle the special case of
23505 calling methods declared on a reference type from a ValueType
23506 (Base classes System.Object and System.Enum)
23508 (MemberAccess.Resolve): Only perform lookups on Enumerations if
23509 the left hand side is a TypeExpr, not on every enumeration.
23511 (Binary.Resolve): If types are reference types, then do a cast to
23512 object on operators != and == of both arguments.
23514 * typemanager.cs (FindMembers): Extract instance and static
23515 members if requested.
23517 * interface.cs (PopulateProperty): Use void_type instead of null
23518 as the return type for the setter method.
23520 (PopulateIndexer): ditto.
23522 2001-12-27 Ravi Pratap <ravi@ximian.com>
23524 * support.cs (ReflectionParameters): Fix minor bug where we
23525 were examining the wrong parameter for the ParamArray attribute.
23527 Cope with requests for the type of the parameter at position
23528 greater than the params parameter's. We now return the element
23529 type of the params array as that makes more sense.
23531 * expression.cs (Invocation.IsParamsMethodApplicable): Update
23532 accordingly as we no longer have to extract the element type
23535 (Invocation.OverloadResolve): Update.
23537 2001-12-27 Miguel de Icaza <miguel@ximian.com>
23539 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
23540 against IEnumerator, test whether the return value is a descendant
23541 of the IEnumerator interface.
23543 * class.cs (Indexer.Define): Use an auxiliary method to implement
23544 the other bits of the method definition. Begin support for
23545 explicit interface implementation.
23547 (Property.DefineMethod): Use TypeManager.void_type instead of null
23548 for an empty return value.
23550 2001-12-26 Miguel de Icaza <miguel@ximian.com>
23552 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
23553 dealing with a FieldExpr which is composed of a FieldBuilder, in
23554 the code path we did extract the constant, but we should have
23555 obtained the underlying value to be able to cast it (otherwise we
23556 end up in an infinite loop, this is what Ravi was running into).
23558 (ArrayCreation.UpdateIndices): Arrays might be empty.
23560 (MemberAccess.ResolveMemberAccess): Add support for section
23561 14.5.4.1 that deals with the special case of E.I when E is a type
23562 and something else, that I can be a reference to a static member.
23564 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
23565 handle a particular array type to create byte blobs, it is just
23566 something we dont generate byteblobs for.
23568 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
23571 * location.cs (Push): remove the key from the hashtable that we
23572 are about to add. This happens for empty files.
23574 * driver.cs: Dispose files after we have parsed them.
23576 (tokenize): new function that only runs the tokenizer on its
23577 input, for speed testing.
23579 2001-12-26 Ravi Pratap <ravi@ximian.com>
23581 * class.cs (Event.Define): Define the private field only if there
23582 are no accessors defined.
23584 * expression.cs (ResolveMemberAccess): If there is no associated
23585 field with the event, that means we have an event defined with its
23586 own accessors and we should flag error cs0070 since transforming
23587 ourselves into a field is not valid in that case.
23589 * ecore.cs (SimpleName.DoResolve): Same as above.
23591 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
23592 and charset to sane values.
23594 2001-12-25 Ravi Pratap <ravi@ximian.com>
23596 * assign.cs (DoResolve): Perform check on events only if they
23597 are being accessed outside the declaring type.
23599 * cs-parser.jay (event_declarations): Update rules to correctly
23600 set the type of the implicit parameter etc.
23602 (add_accessor, remove_accessor): Set current local parameters.
23604 * expression.cs (Binary): For delegate addition and subtraction,
23605 cast the return value from the method into the appropriate delegate
23608 2001-12-24 Ravi Pratap <ravi@ximian.com>
23610 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
23611 of these as the workaround is unnecessary.
23613 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
23614 delegate data - none of that is needed at all.
23616 Re-write bits to extract the instance expression and the delegate method
23619 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
23622 * attribute.cs (ApplyAttributes): New method to take care of common tasks
23623 of attaching attributes instead of duplicating code everywhere.
23625 * everywhere : Update code to do attribute emission using the above method.
23627 2001-12-23 Miguel de Icaza <miguel@ximian.com>
23629 * expression.cs (IsParamsMethodApplicable): if there are not
23630 parameters, return immediately.
23632 * ecore.cs: The 0 literal can be implicity converted to an enum
23635 (SimpleName.DoResolve): First lookup the type, then lookup the
23638 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
23639 want to get its address. If the InstanceExpression is not
23640 addressable, store the result in a temporary variable, then get
23643 * codegen.cs: Only display 219 errors on warning level or above.
23645 * expression.cs (ArrayAccess): Make it implement the
23646 IMemoryLocation interface.
23648 (Binary.DoResolve): handle the operator == (object a, object b)
23649 and operator != (object a, object b) without incurring into a
23650 BoxedCast (because 5 != o should never be performed).
23652 Handle binary enumerator operators.
23654 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
23655 value type, otherwise use Ldelem_ref.
23657 Use precomputed names;
23659 (AddressOf): Implement address of
23661 * cs-parser.jay (labeled_statement): Fix recursive block
23662 addition by reworking the production.
23664 * expression.cs (New.DoEmit): New has a special case:
23666 If we are dealing with a ValueType, we have a few
23667 situations to deal with:
23669 * The target of New is a ValueType variable, that is
23670 easy, we just pass this as the variable reference
23672 * The target of New is being passed as an argument,
23673 to a boxing operation or a function that takes a
23676 In this case, we need to create a temporary variable
23677 that is the argument of New.
23680 2001-12-23 Ravi Pratap <ravi@ximian.com>
23682 * rootcontext.cs (LookupType): Check that current_type is not null before
23683 going about looking at nested types.
23685 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
23686 not implement the IAssignMethod interface any more.
23688 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
23689 where we tranform them into FieldExprs if they are being resolved from within
23690 the declaring type.
23692 * ecore.cs (SimpleName.DoResolve): Do the same here.
23694 * assign.cs (DoResolve, Emit): Clean up code considerably.
23696 * ../errors/bug10.cs : Add.
23698 * ../errors/cs0070.cs : Add.
23700 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
23702 * assign.cs : Get rid of EventIsLocal everywhere.
23704 2001-12-23 Miguel de Icaza <miguel@ximian.com>
23706 * ecore.cs (ConvertIntLiteral): finished the implementation.
23708 * statement.cs (SwitchLabel): Convert the value we are using as a
23709 key before looking up the table.
23711 2001-12-22 Miguel de Icaza <miguel@ximian.com>
23713 * codegen.cs (EmitTopBlock): Require a Location argument now.
23715 * cs-parser.jay (constructor_declarator): We need to setup
23716 current_local_parameters before we parse the
23717 opt_constructor_initializer, to allow the variables to be bound
23718 to the constructor arguments.
23720 * rootcontext.cs (LookupType): First lookup nested classes in our
23721 class and our parents before we go looking outside our class.
23723 * expression.cs (ConstantFold): Extract/debox the values at the
23726 * rootcontext.cs (EmitCode): Resolve the constants first before we
23727 resolve the types. This is not really needed, but it helps debugging.
23729 * statement.cs: report location.
23731 * cs-parser.jay: pass location to throw statement.
23733 * driver.cs: Small bug fix.
23735 * report.cs: Updated format to be 4-zero filled digits.
23737 2001-12-22 Ravi Pratap <ravi@ximian.com>
23739 * expression.cs (CheckIndices): Fix minor bug where the wrong
23740 variable was being referred to ;-)
23742 (DoEmit): Do not call EmitStaticInitializers when the
23743 underlying type is System.Object.
23745 2001-12-21 Ravi Pratap <ravi@ximian.com>
23747 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
23748 and do the usual workaround for SRE.
23750 * class.cs (MyEventBuilder.EventType): New member to get at the type
23751 of the event, quickly.
23753 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
23755 * assign.cs (Assign.DoResolve): Handle the case when the target
23756 is an EventExpr and perform the necessary checks.
23758 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
23761 (SimpleName.MemberStaticCheck): Include check for EventExpr.
23763 (EventExpr): Set the type in the constructor itself since we
23764 are meant to be born fully resolved.
23766 (EventExpr.Define): Revert code I wrote earlier.
23768 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
23769 instance expression is null. The instance expression is a This in that case
23770 or a null, depending on whether it is a static method or not.
23772 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
23773 refers to more than one method.
23775 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
23776 and accordingly flag errors.
23778 2001-12-21 Miguel de Icaza <miguel@ximian.com>
23780 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
23782 2001-12-22 Miguel de Icaza <miguel@ximian.com>
23784 * location.cs (ToString): Provide useful rutine.
23786 2001-12-21 Miguel de Icaza <miguel@ximian.com>
23788 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
23789 objects, return the actual integral boxed.
23791 * statement.cs (SwitchLabel): define an ILLabel for each
23794 (Switch.CheckSwitch): If the value is a Literal, extract
23795 the underlying literal.
23797 Also in the unused hashtable we had, add the SwitchLabel so we can
23798 quickly look this value up.
23800 * constant.cs: Implement a bunch of new constants. Rewrite
23801 Literal based on this. Made changes everywhere to adapt to this.
23803 * expression.cs (Expression.MakeByteBlob): Optimize routine by
23804 dereferencing array only once, and also copes with enumrations.
23806 bytes are two bytes wide, not one.
23808 (Cast): Perform constant conversions.
23810 * ecore.cs (TryImplicitIntConversion): Return literals instead of
23811 wrappers to the literals here.
23813 * expression.cs (DoNumericPromotions): long literals can converted
23814 to ulong implicity (this is taken care of elsewhere, but I was
23815 missing this spot).
23817 * ecore.cs (Expression.Literalize): Make the return type Literal,
23818 to improve type checking.
23820 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
23822 2001-12-20 Miguel de Icaza <miguel@ximian.com>
23824 * literal.cs: Revert code from ravi that checked the bounds. The
23825 bounds are sane by the definition of the type itself.
23827 * typemanager.cs: Fix implementation of ImplementsInterface. We
23828 need to actually look up in our parent hierarchy for interfaces
23831 * const.cs: Use the underlying type for enumerations
23833 * delegate.cs: Compute the basename for the delegate creation,
23834 that should fix the delegate test case, and restore the correct
23835 Type Lookup semantics in rootcontext
23837 * rootcontext.cs: Revert Ravi's last patch. The correct way of
23838 referencing a nested type with the Reflection API is using the "+"
23841 * cs-parser.jay: Do not require EOF token at the end.
23843 2001-12-20 Ravi Pratap <ravi@ximian.com>
23845 * rootcontext.cs (LookupType): Concatenate type names with
23846 a '.' instead of a '+' The test suite passes again.
23848 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
23849 field of the enumeration.
23851 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
23852 the case when the member is an EventExpr.
23854 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
23855 static has an associated instance expression.
23857 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
23859 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
23861 * class.cs (Event.Define): Register event and perform appropriate checks
23864 We define the Add and Remove methods even if the use provides none because
23865 in that case, we provide default implementations ourselves.
23867 Define a private field of the type of the event. This is done by the CSC compiler
23868 and we should be doing it too ;-)
23870 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
23871 More methods we use in code we generate.
23873 (multicast_delegate_type, delegate_type): Two separate types since the distinction
23876 (InitCoreTypes): Update accordingly for the above.
23878 * class.cs (Event.Emit): Generate code for default accessors that we provide
23880 (EmitDefaultMethod): Do the job in the above.
23882 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
23885 2001-12-20 Miguel de Icaza <miguel@ximian.com>
23887 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
23888 builders even if we were missing one.
23890 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
23891 pass the Basename as our class name instead of the Name. The
23892 basename will be correctly composed for us.
23894 * parameter.cs (Paramters): Now takes a Location argument.
23896 * decl.cs (DeclSpace.LookupType): Removed convenience function and
23897 make all the code call directly LookupType in RootContext and take
23898 this chance to pass the Location information everywhere.
23900 * Everywhere: pass Location information.
23902 2001-12-19 Miguel de Icaza <miguel@ximian.com>
23904 * class.cs (Constructor.Define): Updated way of detecting the
23905 length of the parameters.
23907 (TypeContainer.DefineType): Use basename as the type name for
23910 (TypeContainer.Define): Do not recursively define types here, as
23911 definition is taken care in order by the RootContext.
23913 * tree.cs: Keep track of namespaces in a per-file basis.
23915 * parameter.cs (Parameter.ComputeSignature): Update to use
23918 (Parameters.GetSignature): ditto.
23920 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
23921 instead of a TypeContainer.
23923 (Interface.SemanticAnalysis): Use `this' instead of our parent to
23924 resolve names. Because we need to be resolve in our context, not
23927 * driver.cs: Implement response files.
23929 * class.cs (TypeContainer.DefineType): If we are defined, do not
23930 redefine ourselves.
23932 (Event.Emit): Emit the code for add/remove handlers.
23933 (Event.Define): Save the MethodBuilders for add/remove.
23935 * typemanager.cs: Use pair here too.
23937 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
23938 DictionaryEntry requires the first argument to be non-null.
23940 (enum_declaration): Compute full name for registering the
23943 (delegate_declaration): Instead of using
23944 formal_parameter_list, use opt_formal_parameter_list as the list
23947 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
23948 (EventParsing): New property that controls whether `add' and
23949 `remove' are returned as tokens or identifiers (for events);
23951 2001-12-19 Ravi Pratap <ravi@ximian.com>
23953 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
23954 use MyEventBuilder only and let it wrap the real builder for us.
23956 (MyEventBuilder): Revamp constructor etc.
23958 Implement all operations that we perform on EventBuilder in precisely the same
23961 (FindMembers): Update to use the EventBuilder member.
23963 (Event.Emit): Update accordingly.
23965 2001-12-18 Ravi Pratap <ravi@ximian.com>
23967 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
23968 by calling the appropriate methods.
23970 (GetCustomAttributes): Make stubs as they cannot possibly do anything
23973 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
23975 2001-12-17 Ravi Pratap <ravi@ximian.com>
23977 * delegate.cs (Delegate.Populate): Check that the return type
23978 and various parameters types are indeed accessible.
23980 * class.cs (Constructor.Define): Same here.
23982 (Field.Define): Ditto.
23984 (Event.Define): Ditto.
23986 (Operator.Define): Check that the underlying Method defined itself
23987 correctly - so it's MethodBuilder should not be null.
23989 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
23990 expression happens to be null.
23992 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
23993 members but as of now we don't seem to be able to do anything really useful with it.
23995 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
23996 not the EventBuilder.
23998 2001-12-18 Miguel de Icaza <miguel@ximian.com>
24000 * cs-tokenizer.cs: Add support for defines.
24001 Add support for #if, #elif, #else, #endif
24003 (eval_var): evaluates a variable.
24004 (eval): stubbed for evaluating functions.
24006 * cs-parser.jay: Pass the defines information
24008 * driver.cs: Add --define command line option.
24010 * decl.cs: Move MemberCore here.
24012 Make it the base class for DeclSpace. This allows us to catch and
24013 report 108 and 109 for everything now.
24015 * class.cs (TypeContainer.Define): Extract all the members
24016 before populating and emit the warning 108 (new keyword required
24017 to override) instead of having each member implement this.
24019 (MemberCore.Define): New abstract method, we will be using this in
24020 the warning reporting engine in Populate.
24022 (Operator.Define): Adjust to new MemberCore protocol.
24024 * const.cs (Const): This does not derive from Expression, it is a
24025 temporary object we use to create fields, it is a MemberCore.
24027 * class.cs (Method.Define): Allow the entry point to be in a
24030 * driver.cs: Rewrite the argument handler to clean it up a bit.
24032 * rootcontext.cs: Made it just an auxiliary namespace feature by
24033 making everything static.
24035 * driver.cs: Adapt code to use RootContext type name instead of
24038 * delegate.cs: Remove RootContext argument.
24040 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
24043 * class.cs (Event.Define): The lookup can fail.
24045 * cs-tokenizer.cs: Begin implementation of pre-procesor.
24047 * expression.cs: Resolve the this instance before invoking the code.
24049 2001-12-17 Miguel de Icaza <miguel@ximian.com>
24051 * cs-parser.jay: Add a production in element_access that allows
24052 the thing to become a "type" reference. This way we can parse
24053 things like "(string [])" as a type.
24055 Note that this still does not handle the more complex rules of
24059 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
24061 * ecore.cs: (CopyNewMethods): new utility function used to
24062 assemble the list of methods from running FindMembers.
24064 (MemberLookup): Rework FindMembers so that
24066 2001-12-16 Miguel de Icaza <miguel@ximian.com>
24068 * class.cs (TypeContainer): Remove Delegates who fail to be
24071 * delegate.cs (Populate): Verify that we dont get null return
24072 values. TODO: Check for AsAccessible.
24074 * cs-parser.jay: Use basename to emit error 574 (destructor should
24075 have the same name as container class), not the full name.
24077 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
24078 possible representation.
24080 Also implements integer type suffixes U and L.
24082 2001-12-15 Miguel de Icaza <miguel@ximian.com>
24084 * expression.cs (ArrayCreation.DoResolve): We need to do the
24085 argument resolution *always*.
24087 * decl.cs: Make this hold the namespace. Hold the root context as
24089 (LookupType): Move here.
24091 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
24093 * location.cs (Row, Name): Fixed the code, it was always returning
24094 references to the first file.
24096 * interface.cs: Register properties defined through interfaces.
24098 * driver.cs: Add support for globbing on the command line
24100 * class.cs (Field): Make it derive from MemberCore as well.
24103 2001-12-15 Ravi Pratap <ravi@ximian.com>
24105 * class.cs (Event::Define): Check that the type of the event is a delegate
24106 type else flag error #66.
24108 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
24111 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
24112 values of EntryPoint, CharSet etc etc.
24114 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
24116 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
24117 be null and we should ignore this. I am not sure if this is really clean. Apparently,
24118 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
24119 which needs this to do its work.
24121 * ../errors/cs0066.cs : Add.
24123 2001-12-14 Miguel de Icaza <miguel@ximian.com>
24125 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
24128 * class.cs: (MethodSignature.MethodSignature): Removed hack that
24129 clears out the parameters field.
24130 (MemberSignatureCompare): Cleanup
24132 (MemberCore): New base class used to share code between MethodCore
24135 (RegisterRequiredImplementations) BindingFlags.Public requires
24136 either BindingFlags.Instace or Static. Use instance here.
24138 (Property): Refactored code to cope better with the full spec.
24140 * parameter.cs (GetParameterInfo): Return an empty array instead
24143 * class.cs (Property): Abstract or extern properties have no bodies.
24145 * parameter.cs (GetParameterInfo): return a zero-sized array.
24147 * class.cs (TypeContainer.MethodModifiersValid): Move all the
24148 method modifier validation to the typecontainer so we can reuse
24149 this on properties.
24151 (MethodCore.ParameterTypes): return an empty sized array of types.
24153 (Property.Define): Test property modifier validity.
24155 Add tests for sealed/override too.
24157 (Method.Emit): abstract or extern methods have no bodies.
24159 2001-12-14 Ravi Pratap <ravi@ximian.com>
24161 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
24164 (Method::Define, ::Emit): Modify accordingly.
24166 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
24168 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
24170 * makefile: Pass in /unsafe.
24172 2001-12-13 Miguel de Icaza <miguel@ximian.com>
24174 * class.cs (MakeKey): Kill routine.
24176 * class.cs (TypeContainer.Define): Correctly define explicit
24177 method implementations (they require the full interface name plus
24180 * typemanager.cs: Deply the PtrHashtable here and stop using the
24181 lame keys. Things work so much better.
24183 This of course broke everyone who depended on `RegisterMethod' to
24184 do the `test for existance' test. This has to be done elsewhere.
24186 * support.cs (PtrHashtable): A hashtable that avoid comparing with
24187 the object stupid Equals method (because, that like fails all over
24188 the place). We still do not use it.
24190 * class.cs (TypeContainer.SetRequiredInterface,
24191 TypeContainer.RequireMethods): Killed these two routines and moved
24192 all the functionality to RegisterRequiredImplementations.
24194 (TypeContainer.RegisterRequiredImplementations): This routine now
24195 registers all the implementations required in an array for the
24196 interfaces and abstract methods. We use an array of structures
24197 which can be computed ahead of time to reduce memory usage and we
24198 also assume that lookups are cheap as most classes will not
24199 implement too many interfaces.
24201 We also avoid creating too many MethodSignatures.
24203 (TypeContainer.IsInterfaceMethod): Update and optionally does not
24204 clear the "pending" bit if we find that there are problems with
24207 (TypeContainer.VerifyPendingMethods): Update to report errors of
24208 methods that look like implementations but are not.
24210 (TypeContainer.Define): Add support for explicit interface method
24213 2001-12-12 Miguel de Icaza <miguel@ximian.com>
24215 * typemanager.cs: Keep track of the parameters here instead of
24216 being a feature of the TypeContainer.
24218 * class.cs: Drop the registration of parameters here, as
24219 InterfaceMethods are also interface declarations.
24221 * delegate.cs: Register methods with the TypeManager not only with
24222 the TypeContainer. This code was buggy.
24224 * interface.cs: Full registation here.
24226 2001-12-11 Miguel de Icaza <miguel@ximian.com>
24228 * expression.cs: Remove reducer for binary expressions, it can not
24231 * const.cs: Put here the code that used to go into constant.cs
24233 * constant.cs: Put here the code for constants, this is a new base
24234 class for Literals.
24236 * literal.cs: Make Literal derive from Constant.
24238 2001-12-09 Miguel de Icaza <miguel@ximian.com>
24240 * statement.cs (Return.Emit): Report error 157 if the user
24241 attempts to return from a finally block.
24243 (Return.Emit): Instead of emitting a return, jump to the end of
24246 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
24247 LocalBuilder to store the result of the function. ReturnLabel is
24248 the target where we jump.
24251 2001-12-09 Radek Doulik <rodo@ximian.com>
24253 * cs-parser.jay: remember alias in current namespace
24255 * ecore.cs (SimpleName::DoResolve): use aliases for types or
24258 * class.cs (LookupAlias): lookup alias in my_namespace
24260 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
24262 (LookupAlias): lookup alias in this and if needed in parent
24265 2001-12-08 Miguel de Icaza <miguel@ximian.com>
24269 * rootcontext.cs: (ModuleBuilder) Made static, first step into
24270 making things static. I need this to avoid passing the
24271 TypeContainer when calling ParameterType.
24273 * support.cs (InternalParameters.ParameterType): Remove ugly hack
24274 that did string manipulation to compute the type and then call
24275 GetType. Use Parameter.ParameterType instead.
24277 * cs-tokenizer.cs: Consume the suffix for floating values.
24279 * expression.cs (ParameterReference): figure out whether this is a
24280 reference parameter or not. Kill an extra variable by computing
24281 the arg_idx during emission.
24283 * parameter.cs (Parameters.GetParameterInfo): New overloaded
24284 function that returns whether a parameter is an out/ref value or not.
24286 (Parameter.ParameterType): The type of the parameter (base,
24287 without ref/out applied).
24289 (Parameter.Resolve): Perform resolution here.
24290 (Parameter.ExternalType): The full type (with ref/out applied).
24292 * statement.cs (Using.Emit, Using.EmitExpression): Implement
24293 support for expressions on the using statement.
24295 2001-12-07 Miguel de Icaza <miguel@ximian.com>
24297 * statement.cs (Using.EmitLocalVariableDecls): Split the
24298 localvariable handling of the using statement.
24300 (Block.EmitMeta): Keep track of variable count across blocks. We
24301 were reusing slots on separate branches of blocks.
24303 (Try.Emit): Emit the general code block, we were not emitting it.
24305 Check the type of the declaration to be an IDisposable or
24306 something that can be implicity converted to it.
24308 Emit conversions if required.
24310 * ecore.cs (EmptyExpression): New utility class.
24311 (Expression.ImplicitConversionExists): New utility function.
24313 2001-12-06 Miguel de Icaza <miguel@ximian.com>
24315 * statement.cs (Using): Implement.
24317 * expression.cs (LocalVariableReference): Support read only variables.
24319 * statement.cs: Remove the explicit emit for the Leave opcode.
24320 (VariableInfo): Add a readonly field.
24322 2001-12-05 Miguel de Icaza <miguel@ximian.com>
24324 * ecore.cs (ConvCast): new class used to encapsulate the various
24325 explicit integer conversions that works in both checked and
24326 unchecked contexts.
24328 (Expression.ConvertNumericExplicit): Use new ConvCast class to
24329 properly generate the overflow opcodes.
24331 2001-12-04 Miguel de Icaza <miguel@ximian.com>
24333 * statement.cs: The correct type for the EmptyExpression is the
24334 element_type, not the variable type. Ravi pointed this out.
24336 2001-12-04 Ravi Pratap <ravi@ximian.com>
24338 * class.cs (Method::Define): Handle PInvoke methods specially
24339 by using DefinePInvokeMethod instead of the usual one.
24341 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
24342 above to do the task of extracting information and defining the method.
24344 2001-12-04 Ravi Pratap <ravi@ximian.com>
24346 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
24347 of the condition for string type.
24349 (Emit): Move that here.
24351 (ArrayCreation::CheckIndices): Keep string literals in their expression
24354 (EmitDynamicInitializers): Handle strings appropriately.
24356 2001-12-04 Miguel de Icaza <miguel@ximian.com>
24358 * codegen.cs (EmitContext): Replace multiple variables with a
24359 single pointer to the current Switch statement.
24361 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
24364 2001-12-03 Miguel de Icaza <miguel@ximian.com>
24368 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
24371 (Foreach.Emit): Foreach on arrays was not setting
24372 up the loop variables (for break/continue).
24374 (GotoCase): Semi-implented.
24376 2001-12-03 Ravi Pratap <ravi@ximian.com>
24378 * attribute.cs (CheckAttribute): Handle system attributes by using
24379 Attribute.GetAttributes to examine information we need.
24381 (GetValidPlaces): Same here.
24383 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
24385 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
24387 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
24389 (Method::Define): Set appropriate flags if we have a DllImport attribute.
24391 (Method::Emit): Handle the case when we are a PInvoke method.
24393 2001-12-03 Miguel de Icaza <miguel@ximian.com>
24395 * expression.cs: Use ResolveWithSimpleName on compound names.
24397 2001-12-02 Ravi Pratap <ravi@ximian.com>
24399 * constant.cs (EmitConstant): Make sure we resolve the associated expression
24400 before trying to reduce it.
24402 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
24404 * constant.cs (LookupConstantValue): Implement.
24406 (EmitConstant): Use the above in emitting the constant.
24408 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
24409 that are user-defined by doing a LookupConstantValue on them.
24411 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
24414 2001-11-29 Miguel de Icaza <miguel@ximian.com>
24416 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
24418 (BaseAccess.DoResolve): Implement.
24420 (MemberAccess.DoResolve): Split this routine into a
24421 ResolveMemberAccess routine that can be used independently
24423 2001-11-28 Miguel de Icaza <miguel@ximian.com>
24425 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
24426 As that share bits of the implementation. Is returns a boolean,
24427 while As returns the Type that is being probed.
24429 2001-12-01 Ravi Pratap <ravi@ximian.com>
24431 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
24432 instead of a Literal - much easier.
24434 (EnumInTransit): Remove - utterly useless :-)
24436 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
24438 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
24440 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
24441 chain when we have no associated expression.
24443 2001-11-30 Ravi Pratap <ravi@ximian.com>
24445 * constant.cs (Define): Use Location while reporting the errror.
24447 Also emit a warning when 'new' is used and there is no inherited
24450 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
24453 (LookupEnumValue): Implement to lookup an enum member's value and define it
24456 (Populate): Re-write accordingly to use the above routine.
24458 2001-11-27 Miguel de Icaza <miguel@ximian.com>
24460 * expression.cs (This): Fix prototype for DoResolveLValue to
24461 override the base class DoResolveLValue.
24463 * cs-parser.cs: Report errors cs574 and cs575 (destructor
24466 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
24467 (we need to load the address of the field here). This fixes
24470 (FieldExpr.DoResolveLValue): Call the DoResolve
24471 function to initialize the Instance expression.
24473 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
24474 correctly the GetEnumerator operation on a value type.
24476 * cs-parser.jay: Add more simple parsing error catches.
24478 * statement.cs (Switch): Add support for string switches.
24479 Handle null specially.
24481 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
24483 2001-11-28 Ravi Pratap <ravi@ximian.com>
24485 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
24487 (declare_local_constant): New helper function.
24489 * statement.cs (AddConstant): Keep a separate record of constants
24491 (IsConstant): Implement to determine if a variable is a constant.
24493 (GetConstantExpression): Implement.
24495 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
24497 * statement.cs (IsVariableDefined): Re-write.
24499 2001-11-27 Ravi Pratap <ravi@ximian.com>
24501 * class.cs (TypeContainer::FindMembers): Look for constants
24502 in the case when we are looking for MemberTypes.Field
24504 * expression.cs (MemberAccess::DoResolve): Check that in the
24505 case we are a FieldExpr and a Literal, we are not being accessed
24506 by an instance reference.
24508 * cs-parser.jay (local_constant_declaration): Implement.
24510 (declaration_statement): Implement for constant declarations.
24512 2001-11-26 Miguel de Icaza <miguel@ximian.com>
24514 * statement.cs (Switch): Catch double defaults.
24516 (Switch): More work on the switch() statement
24517 implementation. It works for integral values now, need to finish
24521 2001-11-24 Miguel de Icaza <miguel@ximian.com>
24523 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
24524 integer literals into other integer literals. To be used by
24527 2001-11-24 Ravi Pratap <ravi@ximian.com>
24529 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
24532 (EmitDynamicInitializers): Cope with the above since we extract data
24533 directly from ArrayData now.
24535 (ExpectInitializers): Keep track of whether initializers are mandatory
24538 (Bounds): Make it a hashtable to prevent the same dimension being
24539 recorded for every element in that dimension.
24541 (EmitDynamicInitializers): Fix bug which prevented the Set array method
24544 Also fix bug which was causing the indices to be emitted in the reverse
24547 2001-11-24 Miguel de Icaza <miguel@ximian.com>
24549 * expression.cs (ArrayCreation): Implement the bits that Ravi left
24550 unfinished. They do not work, because the underlying code is
24553 2001-11-22 Miguel de Icaza <miguel@ximian.com>
24555 * cs-parser.jay: Remove bogus fixme.
24557 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
24558 on Switch statement.
24560 2001-11-23 Ravi Pratap <ravi@ximian.com>
24562 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
24565 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
24566 parameter. Apparently, any expression is allowed.
24568 (ValidateInitializers): Update accordingly.
24570 (CheckIndices): Fix some tricky bugs thanks to recursion.
24572 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
24573 I was being completely brain-dead.
24575 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
24576 and re-write acordingly.
24578 (DelegateInvocation): Re-write accordingly.
24580 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
24582 (MakeByteBlob): Handle types more correctly.
24584 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
24585 initialization from expressions but it is incomplete because I am a complete
24588 2001-11-22 Miguel de Icaza <miguel@ximian.com>
24590 * statement.cs (If.Emit): Fix a bug that generated incorrect code
24591 on If. Basically, we have to return `true' (ie, we do return to
24592 our caller) only if both branches of the if return.
24594 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
24595 short-circuit operators, handle them as short circuit operators.
24597 (Cast.DoResolve): Resolve type.
24598 (Cast.Cast): Take an expression as the target type.
24600 * cs-parser.jay (cast_expression): Remove old hack that only
24601 allowed a limited set of types to be handled. Now we take a
24602 unary_expression and we resolve to a type during semantic
24605 Use the grammar productions from Rhys to handle casts (this is
24606 not complete like Rhys syntax yet, we fail to handle that corner
24607 case that C# has regarding (-x), but we will get there.
24609 2001-11-22 Ravi Pratap <ravi@ximian.com>
24611 * class.cs (EmitFieldInitializer): Take care of the case when we have a
24612 field which is an array type.
24614 * cs-parser.jay (declare_local_variables): Support array initialization too.
24616 * typemanager.cs (MakeKey): Implement.
24618 (everywhere): Use the above appropriately.
24620 * cs-parser.jay (for_statement): Update for array initialization while
24621 declaring variables.
24623 * ecore.cs : The error message was correct, it's the variable's names that
24624 were misleading ;-) Make the code more readable.
24626 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
24627 the correct type etc.
24629 (ConvertExplicit): Handle Enum types by examining the underlying type.
24631 2001-11-21 Ravi Pratap <ravi@ximian.com>
24633 * parameter.cs (GetCallingConvention): Always return
24634 CallingConventions.Standard for now.
24636 2001-11-22 Miguel de Icaza <miguel@ximian.com>
24638 * expression.cs (Binary.ResolveOperator): Update the values of `l'
24639 and `r' after calling DoNumericPromotions.
24641 * ecore.cs: Fix error message (the types were in the wrong order).
24643 * statement.cs (Foreach.ProbeCollectionType): Need to pass
24644 BindingFlags.Instance as well
24646 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
24647 implicit int literal conversion in an empty cast so that we
24648 propagate the right type upstream.
24650 (UnboxCast): new class used to unbox value types.
24651 (Expression.ConvertExplicit): Add explicit type conversions done
24654 (Expression.ImplicitNumericConversion): Oops, forgot to test for
24655 the target type before applying the implicit LongLiterals to ULong
24658 2001-11-21 Miguel de Icaza <miguel@ximian.com>
24660 * cs-parser.jay (for_statement): Reworked the way For works: now
24661 we declare manually any variables that are introduced in
24662 for_initializer to solve the problem of having out-of-band code
24663 emition (that is what got for broken).
24665 (declaration_statement): Perform the actual variable declaration
24666 that used to be done in local_variable_declaration here.
24668 (local_variable_declaration): Do not declare anything, just pass
24669 the information on a DictionaryEntry
24671 2001-11-20 Ravi Pratap <ravi@ximian.com>
24673 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
24674 re-write of the logic to now make it recursive.
24676 (UpdateIndices): Re-write accordingly.
24678 Store element data in a separate ArrayData list in the above methods.
24680 (MakeByteBlob): Implement to dump the array data into a byte array.
24682 2001-11-19 Ravi Pratap <ravi@ximian.com>
24684 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
24687 * constant.cs (Define): Implement.
24689 (EmitConstant): Re-write fully.
24691 Pass in location info.
24693 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
24696 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
24697 DictionaryEntry since we need location info too.
24699 (constant_declaration): Update accordingly.
24701 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
24702 code into another method : UpdateIndices.
24704 2001-11-18 Ravi Pratap <ravi@ximian.com>
24706 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
24707 some type checking etc.
24709 2001-11-17 Ravi Pratap <ravi@ximian.com>
24711 * expression.cs (ArrayCreation::ValidateInitializers): Implement
24712 bits to provide dimension info if the user skips doing that.
24714 Update second constructor to store the rank correctly.
24716 2001-11-16 Ravi Pratap <ravi@ximian.com>
24718 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
24719 and try to implement.
24721 * ../errors/cs0150.cs : Add.
24723 * ../errors/cs0178.cs : Add.
24725 2001-11-16 Miguel de Icaza <miguel@ximian.com>
24727 * statement.cs: Implement foreach on multi-dimensional arrays.
24729 * parameter.cs (Parameters.GetParameterByName): Also lookup the
24730 name of the params argument.
24732 * expression.cs: Use EmitStoreOpcode to get the right opcode while
24733 initializing the array.
24735 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
24736 we can use this elsewhere.
24738 * statement.cs: Finish implementation of foreach for single
24741 * cs-parser.jay: Use an out-of-band stack to pass information
24742 around, I wonder why I need this.
24744 foreach_block: Make the new foreach_block the current_block.
24746 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
24747 function used to return a static Parameters structure. Used for
24748 empty parameters, as those are created very frequently.
24750 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
24752 2001-11-15 Ravi Pratap <ravi@ximian.com>
24754 * interface.cs : Default modifier is private, not public. The
24755 make verify test passes again.
24757 2001-11-15 Ravi Pratap <ravi@ximian.com>
24759 * support.cs (ReflectionParameters): Fix logic to determine
24760 whether the last parameter is a params one. Test 9 passes again.
24762 * delegate.cs (Populate): Register the builders we define with
24763 RegisterParameterForBuilder. Test 19 passes again.
24765 * cs-parser.jay (property_declaration): Reference $6 instead
24766 of $$ to get at the location.
24768 (indexer_declaration): Similar stuff.
24770 (attribute): Ditto.
24772 * class.cs (Property): Register parameters for the Get and Set methods
24773 if they exist. Test 23 passes again.
24775 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
24776 call to EmitArguments as we are sure there aren't any params arguments.
24777 Test 32 passes again.
24779 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
24780 IndexOutOfRangeException.
24782 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
24783 Test 33 now passes again.
24785 2001-11-15 Miguel de Icaza <miguel@ximian.com>
24787 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
24788 broke a bunch of things. Will have to come up with a better way
24789 of tracking locations.
24791 * statement.cs: Implemented foreach for single dimension arrays.
24793 2001-11-09 Miguel de Icaza <miguel@ximian.com>
24795 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
24796 an error. This removes the lookup from the critical path.
24798 * cs-parser.jay: Removed use of temporary_loc, which is completely
24801 2001-11-14 Miguel de Icaza <miguel@ximian.com>
24803 * support.cs (ReflectionParameters.ParameterModifier): Report
24804 whether the argument is a PARAMS argument or not.
24806 * class.cs: Set the attribute `ParamArrayAttribute' on the
24807 parameter argument.
24809 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
24810 and cons_param_array_attribute (ConstructorInfo for
24811 ParamArrayAttribute).,
24813 * codegen.cs: Emit the return using the `Return' statement, that
24814 way we can report the error correctly for missing return values.
24816 * class.cs (Method.Emit): Clean up.
24818 * expression.cs (Argument.Resolve): Take another argument: the
24819 location where this argument is used. Notice that this is not
24820 part of the "Argument" class as to reduce the size of the
24821 structure (we know the approximate location anyways).
24823 Test if the argument is a variable-reference, if not, then
24824 complain with a 206.
24826 (Argument.Emit): Emit addresses of variables.
24828 (Argument.FullDesc): Simplify.
24830 (Invocation.DoResolve): Update for Argument.Resolve.
24832 (ElementAccess.DoResolve): ditto.
24834 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
24835 method should be virtual, as this method is always virtual.
24837 (NewDelegate.DoResolve): Update for Argument.Resolve.
24839 * class.cs (ConstructorInitializer.DoResolve): ditto.
24841 * attribute.cs (Attribute.Resolve): ditto.
24843 2001-11-13 Miguel de Icaza <miguel@ximian.com>
24845 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
24847 * expression.cs (ParameterReference): Drop IStackStorage and implement
24848 IAssignMethod instead.
24850 (LocalVariableReference): ditto.
24852 * ecore.cs (FieldExpr): Drop IStackStorage and implement
24853 IAssignMethod instead.
24855 2001-11-13 Miguel de Icaza <miguel@ximian.com>
24857 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
24858 enumerations that are used in heavily used structures derive from
24859 byte in a laughable and pathetic attempt to reduce memory usage.
24860 This is the kind of pre-optimzations that you should not do at
24861 home without adult supervision.
24863 * expression.cs (UnaryMutator): New class, used to handle ++ and
24864 -- separatedly from the other unary operators. Cleans up the
24865 code, and kills the ExpressionStatement dependency in Unary.
24867 (Unary): Removed `method' and `Arguments' from this class, making
24868 it smaller, and moving it all to SimpleCall, so I can reuse this
24869 code in other locations and avoid creating a lot of transient data
24870 strucutres when not required.
24872 * cs-parser.jay: Adjust for new changes.
24874 2001-11-11 Miguel de Icaza <miguel@ximian.com>
24876 * enum.cs (Enum.Populate): If there is a failure during
24879 * cs-parser.jay (opt_enum_base): we used to catch type errors
24880 here, but this is really incorrect. The type error should be
24881 catched during semantic analysis.
24883 2001-12-11 Ravi Pratap <ravi@ximian.com>
24885 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
24886 current_local_parameters as expected since I, in my stupidity, had forgotten
24889 * attribute.cs (GetValidPlaces): Fix stupid bug.
24891 * class.cs (Method::Emit): Perform check on applicability of attributes.
24893 (Constructor::Emit): Ditto.
24895 (Field::Emit): Ditto.
24897 (Field.Location): Store location information.
24899 (Property, Event, Indexer, Operator): Ditto.
24901 * cs-parser.jay (field_declaration): Pass in location for each field.
24903 * ../errors/cs0592.cs : Add.
24905 2001-11-12 Ravi Pratap <ravi@ximian.com>
24907 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
24909 (InitCoreTypes): Update accordingly.
24911 (RegisterAttrType, LookupAttr): Implement.
24913 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
24914 info about the same.
24916 (Resolve): Update to populate the above as necessary.
24918 (Error592): Helper.
24920 (GetValidPlaces): Helper to the above.
24922 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
24924 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
24926 2001-11-12 Ravi Pratap <ravi@ximian.com>
24928 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
24930 * ../errors/cs0617.cs : Add.
24932 2001-11-11 Ravi Pratap <ravi@ximian.com>
24934 * enum.cs (Emit): Rename to Populate to be more consistent with what
24935 we expect it to do and when exactly it is called.
24937 * class.cs, rootcontext.cs : Update accordingly.
24939 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
24940 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
24942 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
24944 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
24945 of a fieldinfo using the above, when dealing with a FieldBuilder.
24947 2001-11-10 Ravi Pratap <ravi@ximian.com>
24949 * ../errors/cs0031.cs : Add.
24951 * ../errors/cs1008.cs : Add.
24953 * ../errrors/cs0543.cs : Add.
24955 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
24958 (FindMembers): Implement.
24960 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
24961 enums and delegates too.
24963 (enum_types): Rename to builder_to_enum.
24965 (delegate_types): Rename to builder_to_delegate.
24967 * delegate.cs (FindMembers): Implement.
24969 2001-11-09 Ravi Pratap <ravi@ximian.com>
24971 * typemanager.cs (IsEnumType): Implement.
24973 * enum.cs (Emit): Re-write parts to account for the underlying type
24974 better and perform checking etc.
24976 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
24977 of the underlying type.
24979 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
24982 * enum.cs (error31): Helper to report error #31.
24984 * cs-parser.jay (enum_declaration): Store location of each member too.
24986 * enum.cs (member_to_location): New hashtable.
24988 (AddEnumMember): Update location hashtable.
24990 (Emit): Use the location of each member while reporting errors.
24992 2001-11-09 Miguel de Icaza <miguel@ximian.com>
24994 * cs-parser.jay: A for_initializer if is a
24995 local_variable_declaration really ammount to have an implicit
24996 block with the variable declaration and no initializer for for.
24998 * statement.cs (For.Emit): Cope with null initializers.
25000 This fixes the infinite loop on for initializers.
25002 2001-11-08 Miguel de Icaza <miguel@ximian.com>
25004 * enum.cs: More cleanup.
25006 * ecore.cs: Remove dead code.
25008 * class.cs (Property.Emit): More simplification.
25009 (Event.Emit): ditto.
25011 Reworked to have less levels of indentation.
25013 2001-11-08 Ravi Pratap <ravi@ximian.com>
25015 * class.cs (Property): Emit attributes.
25025 * enum.cs (Emit): Ditto.
25027 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
25030 * class.cs (Field, Event, etc.): Move attribute generation into the
25031 Emit method everywhere.
25033 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
25034 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
25035 as we had no way of defining nested enums !
25037 * rootcontext.cs : Adjust code accordingly.
25039 * typemanager.cs (AddEnumType): To keep track of enum types separately.
25041 2001-11-07 Ravi Pratap <ravi@ximian.com>
25043 * expression.cs (EvalConstantExpression): Move into ecore.cs
25045 * enum.cs (Enum): Rename some members and make them public and readonly
25046 according to our convention.
25048 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
25051 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
25053 (Enum::Emit): Write a simple version for now which doesn't try to compute
25054 expressions. I shall modify this to be more robust in just a while.
25056 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
25058 (TypeContainer::CloseType): Create the Enum types too.
25060 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
25062 * expression.cs (EvalConstantExpression): Get rid of completely.
25064 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
25065 user-defined values and other cases.
25067 (IsValidEnumLiteral): Helper function.
25069 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
25070 out there in the case we had a literal FieldExpr.
25072 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
25074 (Literalize): Revamp a bit to take two arguments.
25076 (EnumLiteral): New class which derives from Literal to wrap enum literals.
25078 2001-11-06 Ravi Pratap <ravi@ximian.com>
25080 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
25082 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
25084 (Resolve): Use the above to ensure we have proper initializers.
25086 2001-11-05 Ravi Pratap <ravi@ximian.com>
25088 * expression.cs (Expression::EvalConstantExpression): New method to
25089 evaluate constant expressions.
25091 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
25093 2001-11-07 Miguel de Icaza <miguel@ximian.com>
25095 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
25098 (Binary.ResolveOperator): Handle operator != (object a, object b)
25099 and operator == (object a, object b);
25101 (Binary.DoNumericPromotions): Indicate whether the numeric
25102 promotion was possible.
25104 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
25107 Made the ArrayAccess implement interface IAssignMethod instead of
25108 IStackStore as the order in which arguments are passed reflects
25111 * assign.cs: Instead of using expr.ExprClass to select the way of
25112 assinging, probe for the IStackStore/IAssignMethod interfaces.
25114 * typemanager.cs: Load InitializeArray definition.
25116 * rootcontext.cs (RootContext.MakeStaticData): Used to define
25117 static data that can be used to initialize arrays.
25119 2001-11-05 Miguel de Icaza <miguel@ximian.com>
25121 * expression.cs: Handle operator== and operator!= for booleans.
25123 (Conditioal.Reduce): Implement reducer for the ?: operator.
25125 (Conditional.Resolve): Implement dead code elimination.
25127 (Binary.Resolve): Catch string literals and return a new
25128 concatenated string.
25130 (Unary.Reduce): Implement reduction of unary expressions.
25132 * ecore.cs: Split out the expression core handling here.
25134 (Expression.Reduce): New method used to perform constant folding
25135 and CSE. This is needed to support constant-expressions.
25137 * statement.cs (Statement.EmitBoolExpression): Pass true and false
25138 targets, and optimize for !x.
25140 2001-11-04 Ravi Pratap <ravi@ximian.com>
25142 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
25143 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
25144 set custom atttributes.
25146 * literal.cs (Literal::GetValue): New abstract method to return the actual
25147 value of the literal, cast as an object.
25149 (*Literal): Implement GetValue method.
25151 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
25152 expressions to the arraylist but objects of type Argument.
25154 * class.cs (TypeContainer::Emit): Emit our attributes too.
25156 (Method::Emit, Constructor::Emit): Ditto.
25158 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
25159 to be ignoring earlier.
25161 2001-11-03 Ravi Pratap <ravi@ximian.com>
25163 * attribute.cs (AttributeSection::Define): Implement to do the business
25164 of constructing a CustomAttributeBuilder.
25166 (Attribute): New trivial class. Increases readability of code.
25168 * cs-parser.jay : Update accordingly.
25170 (positional_argument_list, named_argument_list, named_argument): New rules
25172 (attribute_arguments): Use the above so that we are more correct.
25174 2001-11-02 Ravi Pratap <ravi@ximian.com>
25176 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
25177 to perform all checks for a method with a params parameter.
25179 (Invocation::OverloadResolve): Update to use the above method and therefore
25180 cope correctly with params method invocations.
25182 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
25185 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
25186 constructors in our parent too because we can't afford to miss out on
25189 * attribute.cs (AttributeSection): New name for the class Attribute
25191 Other trivial changes to improve readability.
25193 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
25194 use the new class names.
25196 2001-11-01 Ravi Pratap <ravi@ximian.com>
25198 * class.cs (Method::Define): Complete definition for params types too
25200 (Indexer::Define): Ditto.
25202 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
25203 Cope everywhere with a request for info about the array parameter.
25205 2001-11-01 Ravi Pratap <ravi@ximian.com>
25207 * tree.cs (RecordNamespace): Fix up to check for the correct key.
25209 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
25210 local_variable_type to extract the string corresponding to the type.
25212 (local_variable_type): Fixup the action to use the new helper method.
25214 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
25217 * expression.cs : Clean out code which uses the above.
25219 2001-10-31 Ravi Pratap <ravi@ximian.com>
25221 * typemanager.cs (RegisterMethod): Check if we already have an existing key
25222 and bale out if necessary by returning a false.
25224 (RegisterProperty): Ditto.
25226 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
25227 and print out appropriate error messages.
25229 * interface.cs (everywhere): Ditto.
25231 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
25232 location to constructor.
25234 * class.cs (Property, Event, Indexer): Update accordingly.
25236 * ../errors/cs111.cs : Added.
25238 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
25239 of a method, as laid down by the spec.
25241 (Invocation::OverloadResolve): Use the above method.
25243 2001-10-31 Ravi Pratap <ravi@ximian.com>
25245 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
25246 now take a TypeContainer and a Parameters object.
25248 (ParameterData): Modify return type of ParameterModifier method to be
25249 Parameter.Modifier and not a string.
25251 (ReflectionParameters, InternalParameters): Update accordingly.
25253 * expression.cs (Argument::GetParameterModifier): Same here.
25255 * support.cs (InternalParameters::ParameterType): Find a better way of determining
25256 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
25257 symbol in it at all so maybe this is only for now.
25259 2001-10-30 Ravi Pratap <ravi@ximian.com>
25261 * support.cs (InternalParameters): Constructor now takes an extra argument
25262 which is the actual Parameters class.
25264 (ParameterDesc): Update to provide info on ref/out modifiers.
25266 * class.cs (everywhere): Update call to InternalParameters to pass in
25267 the second argument too.
25269 * support.cs (ParameterData): Add ParameterModifier, which is a method
25270 to return the modifier info [ref/out etc]
25272 (InternalParameters, ReflectionParameters): Implement the above.
25274 * expression.cs (Argument::ParameterModifier): Similar function to return
25275 info about the argument's modifiers.
25277 (Invocation::OverloadResolve): Update to take into account matching modifiers
25280 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
25281 a new SetFormalParameters object which we pass to InternalParameters.
25283 2001-10-30 Ravi Pratap <ravi@ximian.com>
25285 * expression.cs (NewArray): Merge into the ArrayCreation class.
25287 2001-10-29 Ravi Pratap <ravi@ximian.com>
25289 * expression.cs (NewArray): Merge classes NewBuiltinArray and
25290 NewUserdefinedArray into one as there wasn't much of a use in having
25293 * expression.cs (Argument): Change field's name to ArgType from Type.
25295 (Type): New readonly property which returns the proper type, taking into
25296 account ref/out modifiers.
25298 (everywhere): Adjust code accordingly for the above.
25300 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
25301 whether we are emitting for a ref or out parameter.
25303 * expression.cs (Argument::Emit): Use the above field to set the state.
25305 (LocalVariableReference::Emit): Update to honour the flag and emit the
25308 * parameter.cs (Attributes): Set the correct flags for ref parameters.
25310 * expression.cs (Argument::FullDesc): New function to provide a full desc.
25312 * support.cs (ParameterData): Add method ParameterDesc to the interface.
25314 (ReflectionParameters, InternalParameters): Implement the above method.
25316 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
25319 (Invocation::FullMethodDesc): Ditto.
25321 2001-10-29 Miguel de Icaza <miguel@ximian.com>
25323 * cs-parser.jay: Add extra production for the second form of array
25326 * expression.cs (ArrayCreation): Update to reflect the above
25329 * Small changes to prepare for Array initialization.
25331 2001-10-28 Miguel de Icaza <miguel@ximian.com>
25333 * typemanager.cs (ImplementsInterface): interface might be null;
25334 Deal with this problem;
25336 Also, we do store negative hits on the cache (null values), so use
25337 this instead of calling t.GetInterfaces on the type everytime.
25339 2001-10-28 Ravi Pratap <ravi@ximian.com>
25341 * typemanager.cs (IsBuiltinType): New method to help determine the same.
25343 * expression.cs (New::DoResolve): Get rid of array creation code and instead
25344 split functionality out into different classes.
25346 (New::FormArrayType): Move into NewBuiltinArray.
25348 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
25351 (NewBuiltinArray): New class to handle creation of built-in arrays.
25353 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
25354 account creation of one-dimensional arrays.
25356 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
25358 (NewUserdefinedArray::DoResolve): Implement.
25360 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
25362 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
25363 we maintain inside the TypeManager. This is necessary to perform lookups on the
25366 (LookupType): Update to perform GetType on the module builders too.
25368 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
25370 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
25372 2001-10-23 Ravi Pratap <ravi@ximian.com>
25374 * expression.cs (New::DoResolve): Implement guts of array creation.
25376 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
25378 2001-10-27 Miguel de Icaza <miguel@ximian.com>
25380 * expression.cs: Fix bug I introduced lsat night that broke
25383 (Expression.Resolve): Report a 246 error (can not resolve name)
25384 if we find a SimpleName in the stream.
25386 (Expression.ResolveLValue): Ditto.
25388 (Expression.ResolveWithSimpleName): This function is a variant of
25389 ResolveName, this one allows SimpleNames to be returned without a
25390 warning. The only consumer of SimpleNames is MemberAccess
25392 2001-10-26 Miguel de Icaza <miguel@ximian.com>
25394 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
25395 might arrive here. I have my doubts that this is correct.
25397 * statement.cs (Lock): Implement lock statement.
25399 * cs-parser.jay: Small fixes to support `lock' and `using'
25401 * cs-tokenizer.cs: Remove extra space
25403 * driver.cs: New flag --checked, allows to turn on integer math
25406 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
25407 Threading.Monitor.Exit
25409 2001-10-23 Miguel de Icaza <miguel@ximian.com>
25411 * expression.cs (IndexerAccess::DoResolveLValue): Set the
25412 Expression Class to be IndexerAccess.
25414 Notice that Indexer::DoResolve sets the eclass to Value.
25416 2001-10-22 Miguel de Icaza <miguel@ximian.com>
25418 * class.cs (TypeContainer::Emit): Emit code for indexers.
25420 * assign.cs (IAssignMethod): New interface implemented by Indexers
25421 and Properties for handling assignment.
25423 (Assign::Emit): Simplify and reuse code.
25425 * expression.cs (IndexerAccess, PropertyExpr): Implement
25426 IAssignMethod, clean up old code.
25428 2001-10-22 Ravi Pratap <ravi@ximian.com>
25430 * typemanager.cs (ImplementsInterface): New method to determine if a type
25431 implements a given interface. Provides a nice cache too.
25433 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
25436 (ConvertReferenceExplicit): Ditto.
25438 * delegate.cs (Delegate::Populate): Update to define the parameters on the
25439 various methods, with correct names etc.
25441 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
25442 Operator.UnaryNegation.
25444 * cs-parser.jay (operator_declarator): Be a little clever in the case where
25445 we have a unary plus or minus operator.
25447 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
25450 * everywhere : update accordingly.
25452 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
25455 * class.cs (Method::Define): For the case where we are implementing a method
25456 inherited from an interface, we need to set the MethodAttributes.Final flag too.
25457 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
25459 2001-10-21 Ravi Pratap <ravi@ximian.com>
25461 * interface.cs (FindMembers): Implement to work around S.R.E
25464 * typemanager.cs (IsInterfaceType): Implement.
25466 (FindMembers): Update to handle interface types too.
25468 * expression.cs (ImplicitReferenceConversion): Re-write bits which
25469 use IsAssignableFrom as that is not correct - it doesn't work.
25471 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
25472 and accordingly override EmitStatement.
25474 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
25475 using the correct logic :-)
25477 2001-10-19 Ravi Pratap <ravi@ximian.com>
25479 * ../errors/cs-11.cs : Add to demonstrate error -11
25481 2001-10-17 Miguel de Icaza <miguel@ximian.com>
25483 * assign.cs (Assign::Resolve): Resolve right hand side first, and
25484 then pass this as a hint to ResolveLValue.
25486 * expression.cs (FieldExpr): Add Location information
25488 (FieldExpr::LValueResolve): Report assignment to readonly
25491 (Expression::ExprClassFromMemberInfo): Pass location information.
25493 (Expression::ResolveLValue): Add new method that resolves an
25496 (Expression::DoResolveLValue): Default invocation calls
25499 (Indexers): New class used to keep track of indexers in a given
25502 (IStackStore): Renamed from LValue, as it did not really describe
25503 what this did. Also ResolveLValue is gone from this interface and
25504 now is part of Expression.
25506 (ElementAccess): Depending on the element access type
25508 * typemanager.cs: Add `indexer_name_type' as a Core type
25509 (System.Runtime.CompilerServices.IndexerNameAttribute)
25511 * statement.cs (Goto): Take a location.
25513 2001-10-18 Ravi Pratap <ravi@ximian.com>
25515 * delegate.cs (Delegate::VerifyDelegate): New method to verify
25516 if two delegates are compatible.
25518 (NewDelegate::DoResolve): Update to take care of the case when
25519 we instantiate a delegate from another delegate.
25521 * typemanager.cs (FindMembers): Don't even try to look up members
25522 of Delegate types for now.
25524 2001-10-18 Ravi Pratap <ravi@ximian.com>
25526 * delegate.cs (NewDelegate): New class to take care of delegate
25529 * expression.cs (New): Split the delegate related code out into
25530 the NewDelegate class.
25532 * delegate.cs (DelegateInvocation): New class to handle delegate
25535 * expression.cs (Invocation): Split out delegate related code into
25536 the DelegateInvocation class.
25538 2001-10-17 Ravi Pratap <ravi@ximian.com>
25540 * expression.cs (New::DoResolve): Implement delegate creation fully
25541 and according to the spec.
25543 (New::DoEmit): Update to handle delegates differently.
25545 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
25546 because of which we were printing out arguments in reverse order !
25548 * delegate.cs (VerifyMethod): Implement to check if the given method
25549 matches the delegate.
25551 (FullDelegateDesc): Implement.
25553 (VerifyApplicability): Implement.
25555 * expression.cs (Invocation::DoResolve): Update to accordingly handle
25556 delegate invocations too.
25558 (Invocation::Emit): Ditto.
25560 * ../errors/cs1593.cs : Added.
25562 * ../errors/cs1594.cs : Added.
25564 * delegate.cs (InstanceExpression, TargetMethod): New properties.
25566 2001-10-16 Ravi Pratap <ravi@ximian.com>
25568 * typemanager.cs (intptr_type): Core type for System.IntPtr
25570 (InitCoreTypes): Update for the same.
25572 (iasyncresult_type, asynccallback_type): Ditto.
25574 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
25577 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
25580 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
25581 the builders for the 4 members of a delegate type :-)
25583 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
25586 * expression.cs (New::DoResolve): Implement guts for delegate creation.
25588 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
25590 2001-10-15 Miguel de Icaza <miguel@ximian.com>
25592 * statement.cs (Break::Emit): Implement.
25593 (Continue::Emit): Implement.
25595 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
25596 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
25597 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
25598 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
25601 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
25602 properties that track the label for the current loop (begin of the
25603 loop and end of the loop).
25605 2001-10-15 Ravi Pratap <ravi@ximian.com>
25607 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
25608 use of emitting anything at all.
25610 * class.cs, rootcontext.cs : Get rid of calls to the same.
25612 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
25614 (Populate): Define the constructor correctly and set the implementation
25617 * typemanager.cs (delegate_types): New hashtable to hold delegates that
25620 (AddDelegateType): Implement.
25622 (IsDelegateType): Implement helper method.
25624 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
25626 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
25627 and accordingly handle it.
25629 * delegate.cs (Populate): Take TypeContainer argument.
25630 Implement bits to define the Invoke method. However, I still haven't figured out
25631 how to take care of the native int bit :-(
25633 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
25634 Qualify the name of the delegate, not its return type !
25636 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
25639 (StandardConversionExists): Checking for array types turns out to be recursive.
25641 (ConvertReferenceExplicit): Implement array conversion.
25643 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
25645 2001-10-12 Ravi Pratap <ravi@ximian.com>
25647 * cs-parser.jay (delegate_declaration): Store the fully qualified
25648 name as it is a type declaration.
25650 * delegate.cs (ReturnType, Name): Rename members to these. Make them
25653 (DefineDelegate): Renamed from Define. Does the same thing essentially,
25654 as TypeContainer::DefineType.
25656 (Populate): Method in which all the definition of the various methods (Invoke)
25659 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
25662 (CloseDelegate): Finally creates the delegate.
25664 * class.cs (TypeContainer::DefineType): Update to define delegates.
25665 (Populate, Emit and CloseType): Do the same thing here too.
25667 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
25668 delegates in all these operations.
25670 2001-10-14 Miguel de Icaza <miguel@ximian.com>
25672 * expression.cs: LocalTemporary: a new expression used to
25673 reference a temporary that has been created.
25675 * assign.cs: Handle PropertyAccess back here, so that we can
25676 provide the proper semantic access to properties.
25678 * expression.cs (Expression::ConvertReferenceExplicit): Implement
25679 a few more explicit conversions.
25681 * modifiers.cs: `NEW' modifier maps to HideBySig.
25683 * expression.cs (PropertyExpr): Make this into an
25684 ExpressionStatement, and support the EmitStatement code path.
25686 Perform get/set error checking, clean up the interface.
25688 * assign.cs: recognize PropertyExprs as targets, and if so, turn
25689 them into toplevel access objects.
25691 2001-10-12 Miguel de Icaza <miguel@ximian.com>
25693 * expression.cs: PropertyExpr::PropertyExpr: use work around the
25696 * typemanager.cs: Keep track here of our PropertyBuilders again to
25697 work around lameness in SRE.
25699 2001-10-11 Miguel de Icaza <miguel@ximian.com>
25701 * expression.cs (LValue::LValueResolve): New method in the
25702 interface, used to perform a second resolution pass for LValues.
25704 (This::DoResolve): Catch the use of this in static methods.
25706 (This::LValueResolve): Implement.
25708 (This::Store): Remove warning, assigning to `this' in structures
25711 (Invocation::Emit): Deal with invocation of
25712 methods on value types. We need to pass the address to structure
25713 methods rather than the object itself. (The equivalent code to
25714 emit "this" for structures leaves the entire structure on the
25715 stack instead of a pointer to it).
25717 (ParameterReference::DoResolve): Compute the real index for the
25718 argument based on whether the method takes or not a `this' pointer
25719 (ie, the method is static).
25721 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
25722 value types returned from functions when we need to invoke a
25723 method on the sturcture.
25726 2001-10-11 Ravi Pratap <ravi@ximian.com>
25728 * class.cs (TypeContainer::DefineType): Method to actually do the business of
25729 defining the type in the Modulebuilder or Typebuilder. This is to take
25730 care of nested types which need to be defined on the TypeBuilder using
25731 DefineNestedMethod.
25733 (TypeContainer::GetClassBases): Implement. Essentially the code from the
25734 methods in RootContext, only ported to be part of TypeContainer.
25736 (TypeContainer::GetInterfaceOrClass): Ditto.
25738 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
25740 * interface.cs (Interface::DefineInterface): New method. Does exactly
25741 what RootContext.CreateInterface did earlier, only it takes care of nested types
25744 (Interface::GetInterfaces): Move from RootContext here and port.
25746 (Interface::GetInterfaceByName): Same here.
25748 * rootcontext.cs (ResolveTree): Re-write.
25750 (PopulateTypes): Re-write.
25752 * class.cs (TypeContainer::Populate): Populate nested types too.
25753 (TypeContainer::Emit): Emit nested members too.
25755 * typemanager.cs (AddUserType): Do not make use of the FullName property,
25756 instead just use the name argument passed in as it is already fully
25759 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
25760 to TypeContainer mapping to see if a type is user-defined.
25762 * class.cs (TypeContainer::CloseType): Implement.
25764 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
25765 the default constructor.
25767 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
25770 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
25772 * interface.cs (CloseType): Create the type here.
25774 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
25777 Remove all the methods which are now in TypeContainer.
25779 2001-10-10 Ravi Pratap <ravi@ximian.com>
25781 * delegate.cs (Define): Re-write bits to define the delegate
25784 2001-10-10 Miguel de Icaza <miguel@ximian.com>
25786 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
25788 * expression.cs (ImplicitReferenceConversion): handle null as well
25789 as a source to convert to any reference type.
25791 * statement.cs (Return): Perform any implicit conversions to
25792 expected return type.
25794 Validate use of return statement.
25796 * codegen.cs (EmitContext): Pass the expected return type here.
25798 * class.cs (Method, Constructor, Property): Pass expected return
25799 type to EmitContext.
25801 2001-10-09 Miguel de Icaza <miguel@ximian.com>
25803 * expression.cs: Make DoResolve take an EmitContext instead of a
25806 Replaced `l' and `location' for `loc', for consistency.
25808 (Error, Warning): Remove unneeded Tc argument.
25810 * assign.cs, literal.cs, constant.cs: Update to new calling
25813 * codegen.cs: EmitContext now contains a flag indicating whether
25814 code is being generated in a static method or not.
25816 * cs-parser.jay: DecomposeQI, new function that replaces the old
25817 QualifiedIdentifier. Now we always decompose the assembled
25818 strings from qualified_identifier productions into a group of
25821 2001-10-08 Miguel de Icaza <miguel@ximian.com>
25823 * rootcontext.cs: Deal with field-less struct types correctly now
25824 by passing the size option to Define Type.
25826 * class.cs: Removed hack that created one static field.
25828 2001-10-07 Miguel de Icaza <miguel@ximian.com>
25830 * statement.cs: Moved most of the code generation here.
25832 2001-10-09 Ravi Pratap <ravi@ximian.com>
25834 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
25837 (ElementAccess): Remove useless bits for now - keep checks as the spec
25840 2001-10-08 Ravi Pratap <ravi@ximian.com>
25842 * expression.cs (ElementAccess::DoResolve): Remove my crap code
25843 and start performing checks according to the spec.
25845 2001-10-07 Ravi Pratap <ravi@ximian.com>
25847 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
25848 rank_specifiers instead.
25850 (rank_specifiers): Change the order in which the rank specifiers are stored
25852 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
25854 * expression.cs (ElementAccess): Implement the LValue interface too.
25856 2001-10-06 Ravi Pratap <ravi@ximian.com>
25858 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
25859 except that user defined conversions are not included.
25861 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
25862 perform the conversion of the return type, if necessary.
25864 (New::DoResolve): Check whether we are creating an array or an object
25865 and accordingly do the needful.
25867 (New::Emit): Same here.
25869 (New::DoResolve): Implement guts of array creation.
25871 (New::FormLookupType): Helper function.
25873 2001-10-07 Miguel de Icaza <miguel@ximian.com>
25875 * codegen.cs: Removed most of the code generation here, and move the
25876 corresponding code generation bits to the statement classes.
25878 Added support for try/catch/finalize and throw.
25880 * cs-parser.jay: Added support for try/catch/finalize.
25882 * class.cs: Catch static methods having the flags override,
25883 virtual or abstract.
25885 * expression.cs (UserCast): This user cast was not really doing
25886 what it was supposed to do. Which is to be born in fully resolved
25887 state. Parts of the resolution were being performed at Emit time!
25891 2001-10-05 Miguel de Icaza <miguel@ximian.com>
25893 * expression.cs: Implicity convert the result from UserCast.
25895 2001-10-05 Ravi Pratap <ravi@ximian.com>
25897 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
25898 prevented it from working correctly.
25900 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
25901 merely ConvertImplicit.
25903 2001-10-05 Miguel de Icaza <miguel@ximian.com>
25905 * typemanager.cs: Make the LookupTypeContainer function static,
25906 and not per-instance.
25908 * class.cs: Make static FindMembers (the one that takes a Type
25911 * codegen.cs: Add EmitForeach here.
25913 * cs-parser.jay: Make foreach a toplevel object instead of the
25914 inline expansion, as we need to perform semantic analysis on it.
25916 2001-10-05 Ravi Pratap <ravi@ximian.com>
25918 * expression.cs (Expression::ImplicitUserConversion): Rename to
25919 UserDefinedConversion.
25921 (Expression::UserDefinedConversion): Take an extra argument specifying
25922 whether we look for explicit user conversions too.
25924 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
25926 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
25928 (ExplicitUserConversion): Make it a call to UserDefinedConversion
25929 with the appropriate arguments.
25931 * cs-parser.jay (cast_expression): Record location too.
25933 * expression.cs (Cast): Record location info.
25935 (Expression::ConvertExplicit): Take location argument.
25937 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
25938 to determine if we are doing explicit conversions.
25940 (UserCast::Emit): Update accordingly.
25942 (Expression::ConvertExplicit): Report an error if everything fails.
25944 * ../errors/cs0030.cs : Add.
25946 2001-10-04 Miguel de Icaza <miguel@ximian.com>
25948 * modifiers.cs: If the ABSTRACT keyword is present, also set the
25949 virtual and newslot bits.
25951 * class.cs (TypeContainer::RegisterRequiredImplementations):
25952 Record methods we need.
25954 (TypeContainer::MakeKey): Helper function to make keys for
25955 MethodBases, since the Methodbase key is useless.
25957 (TypeContainer::Populate): Call RegisterRequiredImplementations
25958 before defining the methods.
25960 Create a mapping for method_builders_to_methods ahead of time
25961 instead of inside a tight loop.
25963 (::RequireMethods): Accept an object as the data to set into the
25964 hashtable so we can report interface vs abstract method mismatch.
25966 2001-10-03 Miguel de Icaza <miguel@ximian.com>
25968 * report.cs: Make all of it static.
25970 * rootcontext.cs: Drop object_type and value_type computations, as
25971 we have those in the TypeManager anyways.
25973 Drop report instance variable too, now it is a global.
25975 * driver.cs: Use try/catch on command line handling.
25977 Add --probe option to debug the error reporting system with a test
25980 * report.cs: Add support for exiting program when a probe
25981 condition is reached.
25983 2001-10-03 Ravi Pratap <ravi@ximian.com>
25985 * expression.cs (Binary::DoNumericPromotions): Fix the case when
25986 we do a forcible conversion regardless of type, to check if
25987 ForceConversion returns a null.
25989 (Binary::error19): Use location to report error.
25991 (Unary::error23): Use location here too.
25993 * ../errors/cs0019.cs : Check in.
25995 * ../errors/cs0023.cs : Check in.
25997 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
25998 case of a non-null MethodInfo object with a length of 0 !
26000 (Binary::ResolveOperator): Flag error if overload resolution fails to find
26001 an applicable member - according to the spec :-)
26002 Also fix logic to find members in base types.
26004 (Unary::ResolveOperator): Same here.
26006 (Unary::report23): Change name to error23 and make first argument a TypeContainer
26007 as I was getting thoroughly confused between this and error19 :-)
26009 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
26010 (::FindMostEncompassedType): Implement.
26011 (::FindMostEncompassingType): Implement.
26012 (::StandardConversionExists): Implement.
26014 (UserImplicitCast): Re-vamp. We now need info about most specific
26015 source and target types so that we can do the necessary conversions.
26017 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
26018 mathematical union with no duplicates.
26020 2001-10-03 Miguel de Icaza <miguel@ximian.com>
26022 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
26023 in order from base classes to child classes, so that we can in
26024 child classes look up in our parent for method names and
26025 attributes (required for handling abstract, virtual, new, override
26026 constructs: we need to instrospect our base class, and if we dont
26027 populate the classes in order, the introspection might be
26028 incorrect. For example, a method could query its parent before
26029 the parent has any methods and would determine that the parent has
26030 no abstract methods (while it could have had them)).
26032 (RootContext::CreateType): Record the order in which we define the
26035 2001-10-02 Miguel de Icaza <miguel@ximian.com>
26037 * class.cs (TypeContainer::Populate): Also method definitions can
26038 fail now, keep track of this.
26040 (TypeContainer::FindMembers): Implement support for
26041 DeclaredOnly/noDeclaredOnly flag.
26043 (Constructor::Emit) Return the ConstructorBuilder.
26045 (Method::Emit) Return the MethodBuilder.
26046 Check for abstract or virtual methods to be public.
26048 * rootcontext.cs (RootContext::CreateType): Register all the
26049 abstract methods required for the class to be complete and the
26050 interface methods that must be implemented.
26052 * cs-parser.jay: Report error 501 (method requires body if it is
26053 not marked abstract or extern).
26055 * expression.cs (TypeOf::Emit): Implement.
26057 * typemanager.cs: runtime_handle_type, new global type.
26059 * class.cs (Property::Emit): Generate code for properties.
26061 2001-10-02 Ravi Pratap <ravi@ximian.com>
26063 * expression.cs (Unary::ResolveOperator): Find operators on base type
26064 too - we now conform exactly to the spec.
26066 (Binary::ResolveOperator): Same here.
26068 * class.cs (Operator::Define): Fix minor quirk in the tests.
26070 * ../errors/cs0215.cs : Added.
26072 * ../errors/cs0556.cs : Added.
26074 * ../errors/cs0555.cs : Added.
26076 2001-10-01 Miguel de Icaza <miguel@ximian.com>
26078 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
26079 single integer which is really efficient
26081 2001-10-01 Ravi Pratap <ravi@ximian.com>
26083 * expression.cs (Expression::ImplicitUserConversion): Use location
26084 even in the case when we are examining True operators.
26086 * class.cs (Operator::Define): Perform extensive checks to conform
26087 with the rules for operator overloading in the spec.
26089 * expression.cs (Expression::ImplicitReferenceConversion): Implement
26090 some of the other conversions mentioned in the spec.
26092 * typemanager.cs (array_type): New static member for the System.Array built-in
26095 (cloneable_interface): For System.ICloneable interface.
26097 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
26098 we start resolving the tree and populating types.
26100 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
26102 2001-10-01 Miguel de Icaza <miguel@ximian.com>
26104 * expression.cs (Expression::ExprClassFromMemberInfo,
26105 Expression::Literalize): Create literal expressions from
26106 FieldInfos which are literals.
26108 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
26109 type casts, because they were wrong. The test suite in tests
26112 (ImplicitNumericConversion): ushort to ulong requires a widening
26115 Int32 constant to long requires widening cast as well.
26117 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
26118 for integers because the type on the stack is not i4.
26120 2001-09-30 Miguel de Icaza <miguel@ximian.com>
26122 * expression.cs (report118): require location argument.
26124 * parameter.cs: Do not dereference potential null value.
26126 * class.cs: Catch methods that lack the `new' keyword when
26127 overriding a name. Report warnings when `new' is used without
26128 anything being there to override.
26130 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
26132 * class.cs: Only add constructor to hashtable if it is non-null
26133 (as now constructors can fail on define).
26135 (TypeManager, Class, Struct): Take location arguments.
26137 Catch field instance initialization in structs as errors.
26139 accepting_filter: a new filter for FindMembers that is static so
26140 that we dont create an instance per invocation.
26142 (Constructor::Define): Catch errors where a struct constructor is
26145 * cs-parser.jay: Pass location information for various new
26148 * delegate.cs (Delegate): take a location argument.
26150 * driver.cs: Do not call EmitCode if there were problesm in the
26151 Definition of the types, as many Builders wont be there.
26153 * decl.cs (Decl::Decl): Require a location argument.
26155 * cs-tokenizer.cs: Handle properly hex constants that can not fit
26156 into integers, and find the most appropiate integer for it.
26158 * literal.cs: Implement ULongLiteral.
26160 * rootcontext.cs: Provide better information about the location of
26161 failure when CreateType fails.
26163 2001-09-29 Miguel de Icaza <miguel@ximian.com>
26165 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
26168 * expression.cs (Binary::CheckShiftArguments): Add missing type
26170 (Binary::ResolveOperator): Add type to the logical and and logical
26171 or, Bitwise And/Or and Exclusive Or code paths, it was missing
26174 (Binary::DoNumericPromotions): In the case where either argument
26175 is ulong (and most signed types combined with ulong cause an
26176 error) perform implicit integer constant conversions as well.
26178 2001-09-28 Miguel de Icaza <miguel@ximian.com>
26180 * expression.cs (UserImplicitCast): Method should always be
26182 (Invocation::BetterConversion): Simplified test for IntLiteral.
26184 (Expression::ImplicitNumericConversion): Split this routine out.
26185 Put the code that performs implicit constant integer conversions
26188 (Expression::Resolve): Become a wrapper around DoResolve so we can
26189 check eclass and type being set after resolve.
26191 (Invocation::Badness): Remove this dead function
26193 (Binary::ResolveOperator): Do not compute the expensive argumnets
26194 unless we have a union for it.
26196 (Probe::Emit): Is needs to do an isinst and then
26197 compare against null.
26199 (::CanConvert): Added Location argument. If the Location argument
26200 is null (Location.Null), then we do not report errors. This is
26201 used by the `probe' mechanism of the Explicit conversion. We do
26202 not want to generate an error for something that the user
26203 explicitly requested to be casted. But the pipeline for an
26204 explicit cast first tests for potential implicit casts.
26206 So for now, if the Location is null, it means `Probe only' to
26207 avoid adding another argument. Might have to revise this
26210 (ClassCast): New class used to type cast objects into arbitrary
26211 classes (used in Explicit Reference Conversions).
26213 Implement `as' as well.
26215 Reverted all the patches from Ravi below: they were broken:
26217 * The use of `level' as a mechanism to stop recursive
26218 invocations is wrong. That was there just to catch the
26219 bug with a strack trace but not as a way of addressing
26222 To fix the problem we have to *understand* what is going
26223 on and the interactions and come up with a plan, not
26224 just get things going.
26226 * The use of the type conversion cache that I proposed
26227 last night had an open topic: How does this work across
26228 protection domains. A user defined conversion might not
26229 be public in the location where we are applying the
26230 conversion, a different conversion might be selected
26231 (ie, private A->B (better) but public B->A (worse),
26232 inside A, A->B applies, but outside it, B->A will
26235 * On top of that (ie, even if the above is solved),
26236 conversions in a cache need to be abstract. Ie, `To
26237 convert from an Int to a Short use an OpcodeCast', not
26238 `To convert from an Int to a Short use the OpcodeCast on
26239 the variable 5' (which is what this patch was doing).
26241 2001-09-28 Ravi Pratap <ravi@ximian.com>
26243 * expression.cs (Invocation::ConversionExists): Re-write to use
26244 the conversion cache
26246 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
26247 cache all conversions done, not just user-defined ones.
26249 (Invocation::BetterConversion): The real culprit. Use ConversionExists
26250 to determine if a conversion exists instead of acutually trying to
26251 perform the conversion. It's faster too.
26253 (Expression::ConvertExplicit): Modify to use ConversionExists to check
26254 and only then attempt the implicit conversion.
26256 2001-09-28 Ravi Pratap <ravi@ximian.com>
26258 * expression.cs (ConvertImplicit): Use a cache for conversions
26259 already found. Check level of recursion and bail out if necessary.
26261 2001-09-28 Miguel de Icaza <miguel@ximian.com>
26263 * typemanager.cs (string_concat_string_string, string_concat_object_object):
26264 Export standard methods that we expect for string operations.
26266 * statement.cs (Block::UsageWarning): Track usage of variables and
26267 report the errors for not used variables.
26269 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
26272 2001-09-27 Miguel de Icaza <miguel@ximian.com>
26274 * codegen.cs: remove unnneded code
26276 * expression.cs: Removed BuiltinTypeAccess class
26278 Fix the order in which implicit conversions are
26281 The previous fixed dropped support for boxed conversions (adding a
26282 test to the test suite now)
26284 (UserImplicitCast::CanConvert): Remove test for source being null,
26285 that code is broken. We should not feed a null to begin with, if
26286 we do, then we should track the bug where the problem originates
26287 and not try to cover it up here.
26289 Return a resolved expression of type UserImplicitCast on success
26290 rather than true/false. Ravi: this is what I was talking about,
26291 the pattern is to use a static method as a "constructor" for
26294 Also, do not create arguments until the very last minute,
26295 otherwise we always create the arguments even for lookups that
26296 will never be performed.
26298 (UserImplicitCast::Resolve): Eliminate, objects of type
26299 UserImplicitCast are born in a fully resolved state.
26301 * typemanager.cs (InitCoreTypes): Init also value_type
26302 (System.ValueType).
26304 * expression.cs (Cast::Resolve): First resolve the child expression.
26306 (LValue): Add new method AddressOf to be used by
26309 Change the argument of Store to take an EmitContext instead of an
26310 ILGenerator, because things like FieldExpr need to be able to call
26311 their children expression to generate the instance code.
26313 (Expression::Error, Expression::Warning): Sugar functions for
26316 (Expression::MemberLookup): Accept a TypeContainer instead of a
26317 Report as the first argument.
26319 (Expression::ResolvePrimary): Killed. I still want to improve
26320 this as currently the code is just not right.
26322 (Expression::ResolveMemberAccess): Simplify, but it is still
26325 (Unary::Resolve): Catch errors in AddressOf operators.
26327 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
26328 index to a byte for the short-version, or the compiler will choose
26329 the wrong Emit call, which generates the wrong data.
26331 (ParameterReference::Emit, ::Store): same.
26333 (FieldExpr::AddressOf): Implement.
26335 * typemanager.cs: TypeManager: made public variable instead of
26338 * driver.cs: document --fatal.
26340 * report.cs (ErrorMessage, WarningMessage): new names for the old
26341 Error and Warning classes.
26343 * cs-parser.jay (member_access): Turn built-in access to types
26344 into a normal simplename
26346 2001-09-27 Ravi Pratap <ravi@ximian.com>
26348 * expression.cs (Invocation::BetterConversion): Fix to cope
26349 with q being null, since this was introducing a bug.
26351 * expression.cs (ConvertImplicit): Do built-in conversions first.
26353 2001-09-27 Ravi Pratap <ravi@ximian.com>
26355 * expression.cs (UserImplicitCast::Resolve): Fix bug.
26357 2001-09-27 Ravi Pratap <ravi@ximian.com>
26359 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
26360 I had introduced long ago (what's new ?).
26362 * expression.cs (UserImplicitCast::CanConvert): Static method to do
26363 the work of all the checking.
26364 (ConvertImplicit): Call CanConvert and only then create object if necessary.
26365 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
26367 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
26368 that is the right way.
26370 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
26371 overloading resolution. Use everywhere instead of cutting and pasting code.
26373 (Binary::ResolveOperator): Use MakeUnionSet.
26375 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
26376 we have to convert to bool types. Not complete yet.
26378 2001-09-27 Miguel de Icaza <miguel@ximian.com>
26380 * typemanager.cs (TypeManager::CSharpName): support ushort.
26382 * expression.cs (Expression::TryImplicitIntConversion): Attempts
26383 to provide an expression that performsn an implicit constant int
26384 conversion (section 6.1.6).
26385 (Expression::ConvertImplicitRequired): Reworked to include
26386 implicit constant expression conversions.
26388 (Expression::ConvertNumericExplicit): Finished.
26390 (Invocation::Emit): If InstanceExpression is null, then it means
26391 that we perform a call on this.
26393 2001-09-26 Miguel de Icaza <miguel@ximian.com>
26395 * expression.cs (Unary::Emit): Remove some dead code.
26396 (Probe): Implement Resolve and Emit for `is'.
26397 (Expression::ConvertImplicitRequired): Attempt to do constant
26398 expression conversions here. Maybe should be moved to
26399 ConvertImplicit, but I am not sure.
26400 (Expression::ImplicitLongConstantConversionPossible,
26401 Expression::ImplicitIntConstantConversionPossible): New functions
26402 that tell whether is it possible to apply an implicit constant
26403 expression conversion.
26405 (ConvertNumericExplicit): Started work on explicit numeric
26408 * cs-parser.jay: Update operator constants.
26410 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
26411 (Parameters::GetSignature): Hook up VerifyArgs here.
26412 (Parameters::VerifyArgs): Verifies that no two arguments have the
26415 * class.cs (Operator): Update the operator names to reflect the
26416 ones that the spec expects (as we are just stringizing the
26419 * expression.cs (Unary::ResolveOperator): Fix bug: Use
26420 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
26421 previous usage did only work for our methods.
26422 (Expression::ConvertImplicit): Handle decimal implicit numeric
26423 conversions as well.
26424 (Expression::InternalTypeConstructor): Used to invoke constructors
26425 on internal types for default promotions.
26427 (Unary::Emit): Implement special handling for the pre/post
26428 increment/decrement for overloaded operators, as they need to have
26429 the same semantics as the other operators.
26431 (Binary::ResolveOperator): ditto.
26432 (Invocation::ConversionExists): ditto.
26433 (UserImplicitCast::Resolve): ditto.
26435 2001-09-26 Ravi Pratap <ravi@ximian.com>
26437 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
26438 operator, return after emitting body. Regression tests pass again !
26440 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
26441 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
26442 (Invocation::OverloadResolve): Ditto.
26443 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
26445 * everywhere : update calls to the above methods accordingly.
26447 2001-09-26 Miguel de Icaza <miguel@ximian.com>
26449 * assign.cs (Assign): Make it inherit from ExpressionStatement.
26451 * expression.cs (ExpressionStatement): New base class used for
26452 expressions that can appear in statements, so that we can provide
26453 an alternate path to generate expression that do not leave a value
26456 (Expression::Emit, and all the derivatives): We no longer return
26457 whether a value is left on the stack or not. Every expression
26458 after being emitted leaves a single value on the stack.
26460 * codegen.cs (EmitContext::EmitStatementExpression): Use the
26461 facilties of ExpressionStatement if possible.
26463 * cs-parser.jay: Update statement_expression.
26465 2001-09-25 Miguel de Icaza <miguel@ximian.com>
26467 * driver.cs: Change the wording of message
26469 2001-09-25 Ravi Pratap <ravi@ximian.com>
26471 * expression.cs (Binary::ResolveOperator): Had forgottten to set
26472 the type of the expression to the return type of the method if
26473 we have an overloaded operator match ! The regression tests pass again !
26474 (Unary::ResolveOperator): Ditto.
26476 * expression.cs (Invocation::ConversionExists): Correct the member lookup
26477 to find "op_Implicit", not "implicit" ;-)
26478 (UserImplicitCast): New class to take care of user-defined implicit conversions.
26479 (ConvertImplicit, ForceConversion): Take TypeContainer argument
26481 * everywhere : Correct calls to the above accordingly.
26483 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
26484 (ConvertImplicit): Do user-defined conversion if it exists.
26486 2001-09-24 Miguel de Icaza <miguel@ximian.com>
26488 * assign.cs: track location.
26489 (Resolve): Use implicit conversions on assignment.
26491 * literal.cs: Oops. Not good, Emit of short access values should
26492 pass (Bytes) or the wrong argument will be selected.
26494 * expression.cs (Unary::Emit): Emit code for -expr.
26496 (Unary::ResolveOperator): Handle `Substract' for non-constants
26497 (substract from zero from the non-constants).
26498 Deal with Doubles as well.
26500 (Expression::ConvertImplicitRequired): New routine that reports an
26501 error if no implicit conversion exists.
26503 (Invocation::OverloadResolve): Store the converted implicit
26504 expressions if we make them
26506 2001-09-24 Ravi Pratap <ravi@ximian.com>
26508 * class.cs (ConstructorInitializer): Take a Location argument.
26509 (ConstructorBaseInitializer): Same here.
26510 (ConstructorThisInitializer): Same here.
26512 * cs-parser.jay : Update all calls accordingly.
26514 * expression.cs (Unary, Binary, New): Take location argument.
26515 Update accordingly everywhere.
26517 * cs-parser.jay : Update all calls to the above to take a location
26520 * class.cs : Ditto.
26522 2001-09-24 Ravi Pratap <ravi@ximian.com>
26524 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
26525 (Invocation::BetterConversion): Same here
26526 (Invocation::ConversionExists): Ditto.
26528 (Invocation::ConversionExists): Implement.
26530 2001-09-22 Ravi Pratap <ravi@ximian.com>
26532 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
26533 Also take an additional TypeContainer argument.
26535 * All over : Pass in TypeContainer as argument to OverloadResolve.
26537 * typemanager.cs (CSharpName): Update to check for the string type and return
26540 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
26543 2001-09-21 Ravi Pratap <ravi@ximian.com>
26545 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
26546 (Invocation::BetterFunction): Implement.
26547 (Invocation::BetterConversion): Implement.
26548 (Invocation::ConversionExists): Skeleton, no implementation yet.
26550 Okay, things work fine !
26552 2001-09-21 Miguel de Icaza <miguel@ximian.com>
26554 * typemanager.cs: declare and load enum_type, delegate_type and
26557 * expression.cs (Expression::Emit): Now emit returns a value that
26558 tells whether a value is left on the stack or not. This strategy
26559 might be reveted tomorrow with a mechanism that would address
26560 multiple assignments.
26561 (Expression::report118): Utility routine to report mismatches on
26564 (Unary::Report23): Report impossible type/operator combination
26567 (Unary::IsIncrementableNumber): Whether the type can be
26568 incremented or decremented with add.
26569 (Unary::ResolveOperator): Also allow enumerations to be bitwise
26571 (Unary::ResolveOperator): Implement ++, !, ~,
26573 (Invocation::Emit): Deal with new Emit convetion.
26575 * All Expression derivatives: Updated their Emit method to return
26576 whether they leave values on the stack or not.
26578 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
26579 stack for expressions that are statements.
26581 2001-09-20 Miguel de Icaza <miguel@ximian.com>
26583 * expression.cs (LValue): New interface. Must be implemented by
26585 (LocalVariableReference, ParameterReference, FieldExpr): Implement
26588 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
26589 interface for generating code, simplifies the code.
26591 2001-09-20 Ravi Pratap <ravi@ximian.com>
26593 * expression.cs (everywhere): Comment out return statements in ::Resolve
26594 methods to avoid the warnings.
26596 2001-09-20 Miguel de Icaza <miguel@ximian.com>
26598 * driver.cs (parse): Report error 2001 if we can not open the
26601 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
26604 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
26607 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
26608 otherwise nested blocks end up with the same index.
26610 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
26612 * expression.cs: Instead of having FIXMEs in the Resolve
26613 functions, throw exceptions so it is obvious that we are facing a
26616 * cs-parser.jay (invocation_expression): Pass Location information.
26618 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
26619 Use a basename for those routines because .NET does not like paths
26622 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
26625 2001-09-19 Miguel de Icaza <miguel@ximian.com>
26627 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
26628 are loading the correct data types (throws an exception if not).
26629 (TypeManager::InitCoreTypes): Use CoreLookupType
26631 * expression.cs (Unary::ResolveOperator): return the child
26632 expression for expressions which are just +expr.
26633 (Unary::ResolveOperator): Return negative literals for -LITERAL
26634 expressions (otherwise they are Unary {Literal}).
26635 (Invocation::Badness): Take into account `Implicit constant
26636 expression conversions'.
26638 * literal.cs (LongLiteral): Implement long literal class.
26639 (IntLiteral): export the `Value' of the intliteral.
26641 2001-09-19 Ravi Pratap <ravi@ximian.com>
26643 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
26645 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
26646 instead of 'Operator'
26648 * expression.cs (Binary::ResolveOperator): Update accordingly.
26649 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
26652 * cs-parser.jay (unary_expression): Update to use the new names.
26654 * gen-treedump.cs (GetUnary): Same here.
26656 * expression.cs (Unary::Resolve): Implement.
26657 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
26658 operators are found instead of making noise ;-)
26659 (Unary::ResolveOperator): New method to do precisely the same thing which
26660 Binary::ResolveOperator does for Binary expressions.
26661 (Unary.method, .Arguments): Add.
26662 (Unary::OperName): Implement.
26663 (Unary::ForceConversion): Copy and Paste !
26665 * class.cs (Operator::Define): Fix a small bug for the case when we have
26668 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
26669 for the inbuilt operators. Only overloading works for now ;-)
26671 2001-09-18 Miguel de Icaza <miguel@ximian.com>
26673 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
26674 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
26676 * expression.cs (This::Emit): Implement.
26677 (This::Resolve): Implement.
26678 (TypeOf:Resolve): Implement.
26679 (Expression::ResolveSimpleName): Add an implicit this to instance
26681 (MemberAccess::Resolve): Deal with Parameters and Fields.
26682 Bind instance variable to Field expressions.
26683 (FieldExpr::Instance): New field used to track the expression that
26684 represents the object instance.
26685 (FieldExpr::Resolve): Track potential errors from MemberLookup not
26687 (FieldExpr::Emit): Implement.
26689 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
26690 the last instruction contains a return opcode to avoid generating
26691 the last `ret' instruction (this generates correct code, and it is
26692 nice to pass the peverify output).
26694 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
26695 initializer for static and instance variables.
26696 (Constructor::Emit): Allow initializer to be null in the case of
26697 static constructors. Only emit initializer for instance
26700 (TypeContainer::FindMembers): Return a null array if there are no
26703 Also fix the code for the MemberTypes.Method branch, as it was not
26704 scanning that for operators (or tried to access null variables before).
26706 * assign.cs (Assign::Emit): Handle instance and static fields.
26710 * driver.cs: Stop compilation if there are parse errors.
26712 * cs-parser.jay (constructor_declaration): Provide default base
26713 initializer for non-static constructors.
26714 (constructor_declarator): Do not provide a default base
26715 initializers if none was specified.
26716 Catch the fact that constructors should not have parameters.
26718 * class.cs: Do not emit parent class initializers for static
26719 constructors, that should be flagged as an error.
26721 2001-09-18 Ravi Pratap <ravi@ximian.com>
26723 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
26724 Move back code into TypeContainer::Populate.
26726 2001-09-18 Ravi Pratap <ravi@ximian.com>
26728 * class.cs (TypeContainer::AddConstructor): Fix the check to
26729 compare against Name, not Basename.
26730 (Operator::OpType): Change Plus and Minus to Add and Subtract.
26732 * cs-parser.jay : Update accordingly.
26734 * class.cs (TypeContainer::FindMembers): For the case where we are searching
26735 for methods, don't forget to look into the operators too.
26736 (RegisterMethodBuilder): Helper method to take care of this for
26737 methods, constructors and operators.
26738 (Operator::Define): Completely revamp.
26739 (Operator.OperatorMethod, MethodName): New fields.
26740 (TypeContainer::Populate): Move the registering of builders into
26741 RegisterMethodBuilder.
26742 (Operator::Emit): Re-write.
26744 * expression.cs (Binary::Emit): Comment out code path to emit method
26745 invocation stuff for the case when we have a user defined operator. I am
26746 just not able to get it right !
26748 2001-09-17 Miguel de Icaza <miguel@ximian.com>
26750 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
26753 (Expression::MemberLookup): Provide a version that allows to
26754 specify the MemberTypes and BindingFlags.
26756 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
26757 so it was not fetching variable information from outer blocks.
26759 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
26760 Beforefieldinit as it was buggy.
26762 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
26763 that Ravi put here.
26765 * class.cs (Constructor::Emit): Only emit if block is not null.
26766 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
26767 deal with this by semantically definining it as if the user had
26770 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
26771 constructors as we now "emit" them at a higher level.
26773 (TypeContainer::DefineDefaultConstructor): Used to define the
26774 default constructors if none was provided.
26776 (ConstructorInitializer): Add methods Resolve and Emit.
26778 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
26780 2001-09-17 Ravi Pratap <ravi@ximian.com>
26782 * class.cs (TypeContainer::EmitDefaultConstructor): Register
26783 the default constructor builder with our hashtable for methodbuilders
26786 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
26787 and argument_count is 0 in which case we have a match.
26788 (Binary::ResolveOperator): More null checking and miscellaneous coding
26791 2001-09-17 Ravi Pratap <ravi@ximian.com>
26793 * rootcontext.cs (IsNameSpace): Compare against null.
26795 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
26797 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
26798 and Unary::Operator.
26800 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
26803 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
26804 we have overloaded operators.
26805 (Binary::ResolveOperator): Implement the part which does the operator overload
26808 * class.cs (Operator::Emit): Implement.
26809 (TypeContainer::Emit): Emit the operators we have too.
26811 * expression.cs (Binary::Emit): Update to emit the appropriate code for
26812 the case when we have a user-defined operator.
26814 2001-09-17 Miguel de Icaza <miguel@ximian.com>
26816 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
26818 2001-09-16 Ravi Pratap <ravi@ximian.com>
26820 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
26821 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
26822 (Constructor::Emit): Implement.
26823 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
26824 if we have no work to do.
26825 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
26828 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
26829 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
26831 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
26834 2001-09-15 Ravi Pratap <ravi@ximian.com>
26836 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
26838 (Tree::RecordNamespace): Method to do what the name says ;-)
26839 (Tree::Namespaces): Property to get at the namespaces hashtable.
26841 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
26844 * rootcontext.cs (IsNamespace): Fixed it :-)
26846 2001-09-14 Miguel de Icaza <miguel@ximian.com>
26848 * class.cs (TypeContainer::FindMembers): Add support for
26850 (MethodCore): New class that encapsulates both the shared aspects
26851 of a Constructor and a Method.
26852 (Method, Constructor): Factored pieces into MethodCore.
26854 * driver.cs: Added --fatal which makes errors throw exceptions.
26855 Load System assembly as well as part of the standard library.
26857 * report.cs: Allow throwing exceptions on errors for debugging.
26859 * modifiers.cs: Do not use `parent', instead use the real type
26860 container to evaluate permission settings.
26862 * class.cs: Put Ravi's patch back in. He is right, and we will
26863 have to cope with the
26865 2001-09-14 Ravi Pratap <ravi@ximian.com>
26867 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
26868 FamORAssem, not FamANDAssem.
26870 2001-09-14 Miguel de Icaza <miguel@ximian.com>
26872 * driver.cs: Added --parse option that only parses its input files
26875 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
26876 incorrect. IsTopLevel is not used to tell whether an object is
26877 root_types or not (that can be achieved by testing this ==
26878 root_types). But to see if this is a top-level *class* (not
26879 necessarly our "toplevel" container).
26881 2001-09-14 Ravi Pratap <ravi@ximian.com>
26883 * enum.cs (Enum::Define): Modify to call the Lookup method on the
26884 parent instead of a direct call to GetType.
26886 2001-09-14 Ravi Pratap <ravi@ximian.com>
26888 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
26889 Modifiers.TypeAttr. This should just be a call to that method.
26891 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
26892 object so that we can determine if we are top-level or not.
26894 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
26897 * enum.cs (Enum::Define): Ditto.
26899 * modifiers.cs (FieldAttr): Re-write.
26901 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
26902 (TypeContainer::HaveStaticConstructor): New property to provide access
26903 to precisely that info.
26905 * modifiers.cs (MethodAttr): Re-write.
26906 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
26908 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
26909 of top-level types as claimed.
26911 2001-09-13 Miguel de Icaza <miguel@ximian.com>
26913 * expression.cs (MemberLookup): Fruitless attempt to lookup
26914 constructors. Maybe I need to emit default constructors? That
26915 might be it (currently .NET emits this for me automatically).
26916 (Invocation::OverloadResolve): Cope with Arguments == null.
26917 (Invocation::EmitArguments): new function, shared by the new
26918 constructor and us.
26919 (Invocation::Emit): Handle static and instance methods. Emit
26920 proper call instruction for virtual or non-virtual invocations.
26921 (New::Emit): Implement.
26922 (New::Resolve): Implement.
26923 (MemberAccess:Resolve): Implement.
26924 (MethodGroupExpr::InstanceExpression): used conforming to the spec
26925 to track instances.
26926 (FieldExpr::Resolve): Set type.
26928 * support.cs: Handle empty arguments.
26930 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
26931 SimpleLookup): Auxiliary routines to help parse a qualifier
26934 Update qualifier_identifier rule.
26936 * codegen.cs: Removed debugging messages.
26938 * class.cs: Make this a global thing, this acts just as a "key" to
26939 objects that we might have around.
26941 (Populate): Only initialize method_builders_to_methods once.
26943 * expression.cs (PropertyExpr): Initialize type from the
26946 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
26947 Resolve pattern. Attempt to implicitly convert value to boolean.
26950 * expression.cs: Set the type for the int32/int32 argument case.
26951 (Binary::ResolveOperator): Set the return type to boolean for
26952 comparission operators
26954 * typemanager.cs: Remove debugging print code.
26956 (Invocation::Resolve): resolve type.
26958 * class.cs: Allocate a MemberInfo of the correct size, as the code
26959 elsewhere depends on the test to reflect the correct contents.
26961 (Method::) Keep track of parameters, due to System.Reflection holes
26963 (TypeContainer::Populate): Keep track of MethodBuilders to Method
26966 (TypeContainer::FindMembers): Use ArrayList and then copy an array
26967 of the exact size and return that.
26969 (Class::LookupMethodByBuilder): New function that maps
26970 MethodBuilders to its methods. Required to locate the information
26971 on methods because System.Reflection bit us again.
26973 * support.cs: New file, contains an interface ParameterData and
26974 two implementations: ReflectionParameters and InternalParameters
26975 used to access Parameter information. We will need to grow this
26978 * expression.cs (Invocation::GetParameterData): implement a cache
26979 and a wrapper around the ParameterData creation for methods.
26980 (Invocation::OverloadResolve): Use new code.
26982 2001-09-13 Ravi Pratap <ravi@ximian.com>
26984 * class.cs (TypeContainer::EmitField): Remove and move into
26985 (Field::Define): here and modify accordingly.
26986 (Field.FieldBuilder): New member.
26987 (TypeContainer::Populate): Update accordingly.
26988 (TypeContainer::FindMembers): Implement.
26990 2001-09-13 Miguel de Icaza <miguel@ximian.com>
26992 * statement.cs: (VariableInfo::VariableType): New field to be
26993 initialized with the full type once it is resolved.
26995 2001-09-12 Miguel de Icaza <miguel@ximian.com>
26997 * parameter.cs (GetParameterInfo): Use a type cache to compute
26998 things only once, and to reuse this information
27000 * expression.cs (LocalVariableReference::Emit): Implement.
27001 (OpcodeCast::Emit): fix.
27003 (ParameterReference::Resolve): Implement.
27004 (ParameterReference::Emit): Implement.
27006 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
27007 that are expressions need to stay as Expressions.
27009 * typemanager.cs (CSharpName): Returns the C# name of a type if
27012 * expression.cs (Expression::ConvertImplicit): New function that
27013 implements implicit type conversions.
27015 (Expression::ImplicitReferenceConversion): Implements implicit
27016 reference conversions.
27018 (EmptyCast): New type for transparent casts.
27020 (OpcodeCast): New type for casts of types that are performed with
27021 a sequence of bytecodes.
27023 (BoxedCast): New type used for casting value types into reference
27024 types. Emits a box opcode.
27026 (Binary::DoNumericPromotions): Implements numeric promotions of
27027 and computation of the Binary::Type.
27029 (Binary::EmitBranchable): Optimization.
27031 (Binary::Emit): Implement code emission for expressions.
27033 * typemanager.cs (TypeManager): Added two new core types: sbyte
27036 2001-09-12 Ravi Pratap <ravi@ximian.com>
27038 * class.cs (TypeContainer::FindMembers): Method which does exactly
27039 what Type.FindMembers does, only we don't have to use reflection. No
27040 implementation yet.
27042 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
27043 typecontainer objects as we need to get at them.
27044 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
27046 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
27047 typecontainer object.
27049 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
27050 of just a Report object.
27052 2001-09-11 Ravi Pratap <ravi@ximian.com>
27054 * class.cs (Event::Define): Go back to using the prefixes "add_" and
27056 (TypeContainer::Populate): Now define the delegates of the type too.
27057 (TypeContainer.Delegates): Property to access the list of delegates defined
27060 * delegates.cs (Delegate::Define): Implement partially.
27062 * modifiers.cs (TypeAttr): Handle more flags.
27064 2001-09-11 Ravi Pratap <ravi@ximian.com>
27066 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
27068 (Operator::Define): Re-write logic to get types by using the LookupType method
27069 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
27070 (Indexer::Define): Ditto.
27071 (Event::Define): Ditto.
27072 (Property::Define): Ditto.
27074 2001-09-10 Ravi Pratap <ravi@ximian.com>
27076 * class.cs (TypeContainer::Populate): Now define operators too.
27077 (TypeContainer.Operators): New property to access the list of operators
27079 (Operator.OperatorMethodBuilder): New member to hold the method builder
27080 for the operator we are defining.
27081 (Operator::Define): Implement.
27083 2001-09-10 Ravi Pratap <ravi@ximian.com>
27085 * class.cs (Event::Define): Make the prefixes of the accessor methods
27086 addOn_ and removeOn_
27088 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
27089 of the location being passed in too. Ideally, this should go later since all
27090 error reporting should be done through the Report object.
27092 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
27093 (Populate): Iterate thru the indexers we have and define them too.
27094 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
27095 for the get and set accessors.
27096 (Indexer::Define): Implement.
27098 2001-09-09 Miguel de Icaza <miguel@ximian.com>
27100 * expression.cs (Binary::Resolve): Beginning of it. I scratched
27101 my previous implementation, did not work.
27103 * typemanager.cs: Add a couple of missing types (the longs).
27105 * literal.cs: Use TypeManager.bool_type instead of getting it.
27107 * expression.cs (EventExpr): New kind of expressions.
27108 (Expressio::ExprClassFromMemberInfo): finish
27110 2001-09-08 Miguel de Icaza <miguel@ximian.com>
27112 * assign.cs: Emit stores to static fields differently.
27114 2001-09-08 Ravi Pratap <ravi@ximian.com>
27116 * Merge in changes and adjust code to tackle conflicts. Backed out my
27117 code in Assign::Resolve ;-)
27119 2001-09-08 Ravi Pratap <ravi@ximian.com>
27121 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
27122 instead Report.Error and also pass in the location.
27123 (CSharpParser::Lexer): New readonly property to return the reference
27124 to the Tokenizer object.
27125 (declare_local_variables): Use Report.Error with location instead of plain
27129 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
27130 (Operator.CheckBinaryOperator): Ditto.
27132 * cs-parser.jay (operator_declarator): Update accordingly.
27134 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
27135 (CheckBinaryOperator): Same here.
27137 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
27138 on the name without any prefixes of namespace names etc. This is because we
27139 already might have something already fully qualified like
27140 'System.Console.WriteLine'
27142 * assign.cs (Resolve): Begin implementation. Stuck ;-)
27144 2001-09-07 Ravi Pratap <ravi@ximian.com>
27146 * cs-tokenizer.cs (location): Return a string which also contains
27149 * expression.cs (ElementAccess): New class for expressions of the
27150 type 'element access.'
27151 (BaseAccess): New class for expressions of the type 'base access.'
27152 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
27155 * cs-parser.jay (element_access): Implement action.
27156 (base_access): Implement actions.
27157 (checked_expression, unchecked_expression): Implement.
27159 * cs-parser.jay (local_variable_type): Correct and implement.
27160 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
27162 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
27164 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
27165 name and the specifiers.
27167 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
27169 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
27170 making them all public ;-)
27172 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
27175 2001-09-07 Miguel de Icaza <miguel@ximian.com>
27177 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
27179 (FieldExpr, PropertyExprs): New resolved expressions.
27180 (SimpleName::MemberStaticCheck): Perform static checks for access
27181 to non-static fields on static methods. Maybe this should be
27182 generalized for MemberAccesses.
27183 (SimpleName::ResolveSimpleName): More work on simple name
27186 * cs-parser.jay (primary_expression/qualified_identifier): track
27187 the parameter index.
27189 * codegen.cs (CodeGen::Save): Catch save exception, report error.
27190 (EmitContext::EmitBoolExpression): Chain to expression generation
27191 instead of temporary hack.
27192 (::EmitStatementExpression): Put generic expression code generation.
27194 * assign.cs (Assign::Emit): Implement variable assignments to
27195 local variables, parameters and fields.
27197 2001-09-06 Miguel de Icaza <miguel@ximian.com>
27199 * statement.cs (Block::GetVariableInfo): New method, returns the
27200 VariableInfo for a variable name in a block.
27201 (Block::GetVariableType): Implement in terms of GetVariableInfo
27203 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
27204 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
27206 2001-09-06 Ravi Pratap <ravi@ximian.com>
27208 * cs-parser.jay (operator_declaration): Continue on my quest : update
27209 to take attributes argument.
27210 (event_declaration): Ditto.
27211 (enum_declaration): Ditto.
27212 (indexer_declaration): Ditto.
27214 * class.cs (Operator::Operator): Update constructor accordingly.
27215 (Event::Event): Ditto.
27217 * delegate.cs (Delegate::Delegate): Same here.
27219 * enum.cs (Enum::Enum): Same here.
27221 2001-09-05 Ravi Pratap <ravi@ximian.com>
27223 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
27225 * ../tests/cs0658.cs : New file to demonstrate error 0658.
27227 * attribute.cs (Attributes): New class to encapsulate all attributes which were
27228 being passed around as an arraylist.
27229 (Attributes::AddAttribute): Method to add attribute sections.
27231 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
27232 (struct_declaration): Update accordingly.
27233 (constant_declaration): Update.
27234 (field_declaration): Update.
27235 (method_header): Update.
27236 (fixed_parameter): Update.
27237 (parameter_array): Ditto.
27238 (property_declaration): Ditto.
27239 (destructor_declaration): Ditto.
27241 * class.cs (Struct::Struct): Update constructors accordingly.
27242 (Class::Class): Ditto.
27243 (Field::Field): Ditto.
27244 (Method::Method): Ditto.
27245 (Property::Property): Ditto.
27246 (TypeContainer::OptAttribute): update property's return type.
27248 * interface.cs (Interface.opt_attributes): New member.
27249 (Interface::Interface): Update to take the extra Attributes argument.
27251 * parameter.cs (Parameter::Parameter): Ditto.
27253 * constant.cs (Constant::Constant): Ditto.
27255 * interface.cs (InterfaceMemberBase): New OptAttributes field.
27256 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
27257 the attributes as a parameter.
27258 (InterfaceProperty): Update constructor call.
27259 (InterfaceEvent): Ditto.
27260 (InterfaceMethod): Ditto.
27261 (InterfaceIndexer): Ditto.
27263 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
27264 pass the attributes too.
27265 (interface_event_declaration): Ditto.
27266 (interface_property_declaration): Ditto.
27267 (interface_method_declaration): Ditto.
27268 (interface_declaration): Ditto.
27270 2001-09-05 Miguel de Icaza <miguel@ximian.com>
27272 * class.cs (Method::Define): Track the "static Main" definition to
27273 create an entry point.
27275 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
27276 EntryPoint if we find it.
27278 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
27279 (EmitContext::ig): Make this variable public.
27281 * driver.cs: Make the default output file be the first file name
27282 with the .exe extension.
27284 Detect empty compilations
27286 Handle various kinds of output targets. Handle --target and
27287 rename -t to --dumper.
27289 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
27290 methods inherited from Expression return now an Expression. This
27291 will is used during the tree rewriting as we resolve them during
27294 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
27295 the spec. Missing entirely is the information about
27296 accessability of elements of it.
27298 (Expression::ExprClassFromMemberInfo): New constructor for
27299 Expressions that creates a fully initialized Expression based on
27300 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
27303 (Invocation::Resolve): Begin implementing resolution of invocations.
27305 * literal.cs (StringLiteral): Implement Emit.
27307 2001-09-05 Ravi Pratap <ravi@ximian.com>
27309 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
27312 2001-09-04 Ravi Pratap <ravi@ximian.com>
27314 * cs-parser.jay (attribute_arguments): Implement actions.
27315 (attribute): Fix bug in production. Implement action.
27316 (attribute_list): Implement.
27317 (attribute_target): Implement.
27318 (attribute_target_specifier, opt_target_specifier): Implement
27319 (CheckAttributeTarget): New method to check if the attribute target
27321 (attribute_section): Implement.
27322 (opt_attributes): Implement.
27324 * attribute.cs : New file to handle attributes.
27325 (Attribute): Class to hold attribute info.
27327 * cs-parser.jay (opt_attribute_target_specifier): Remove production
27328 (attribute_section): Modify production to use 2 different rules to
27329 achieve the same thing. 1 s/r conflict down !
27330 Clean out commented, useless, non-reducing dimension_separator rules.
27332 * class.cs (TypeContainer.attributes): New member to hold list
27333 of attributes for a type.
27334 (Struct::Struct): Modify to take one more argument, the attribute list.
27335 (Class::Class): Ditto.
27336 (Field::Field): Ditto.
27337 (Method::Method): Ditto.
27338 (Property::Property): Ditto.
27340 * cs-parser.jay (struct_declaration): Update constructor call to
27341 pass in the attributes too.
27342 (class_declaration): Ditto.
27343 (constant_declaration): Ditto.
27344 (field_declaration): Ditto.
27345 (method_header): Ditto.
27346 (fixed_parameter): Ditto.
27347 (parameter_array): Ditto.
27348 (property_declaration): Ditto.
27350 * constant.cs (Constant::Constant): Update constructor similarly.
27351 Use System.Collections.
27353 * parameter.cs (Parameter::Parameter): Update as above.
27355 2001-09-02 Ravi Pratap <ravi@ximian.com>
27357 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
27358 (TypeContainer.delegates): New member to hold list of delegates.
27360 * cs-parser.jay (delegate_declaration): Implement the action correctly
27361 this time as I seem to be on crack ;-)
27363 2001-09-02 Miguel de Icaza <miguel@ximian.com>
27365 * rootcontext.cs (RootContext::IsNamespace): new function, used to
27366 tell whether an identifier represents a namespace.
27368 * expression.cs (NamespaceExpr): A namespace expression, used only
27369 temporarly during expression resolution.
27370 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
27371 utility functions to resolve names on expressions.
27373 2001-09-01 Miguel de Icaza <miguel@ximian.com>
27375 * codegen.cs: Add hook for StatementExpressions.
27377 * class.cs: Fix inverted test for static flag in methods.
27379 2001-09-02 Ravi Pratap <ravi@ximian.com>
27381 * class.cs (Operator::CheckUnaryOperator): Correct error number used
27382 to make it coincide with MS' number.
27383 (Operator::CheckBinaryOperator): Ditto.
27385 * ../errors/errors.txt : Remove error numbers added earlier.
27387 * ../errors/cs1019.cs : Test case for error # 1019
27389 * ../errros/cs1020.cs : Test case for error # 1020
27391 * cs-parser.jay : Clean out commented cruft.
27392 (dimension_separators, dimension_separator): Comment out. Ostensibly not
27393 used anywhere - non-reducing rule.
27394 (namespace_declarations): Non-reducing rule - comment out.
27396 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
27397 with TypeContainer::AddEnum.
27399 * delegate.cs : New file for delegate handling classes.
27400 (Delegate): Class for declaring delegates.
27402 * makefile : Update.
27404 * cs-parser.jay (delegate_declaration): Implement.
27406 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
27408 * class.cs (Event::Define): Implement.
27409 (Event.EventBuilder): New member.
27411 * class.cs (TypeContainer::Populate): Update to define all enums and events
27413 (Events): New property for the events arraylist we hold. Shouldn't we move to using
27414 readonly fields for all these cases ?
27416 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
27418 * class.cs (Property): Revamp to use the convention of making fields readonly.
27419 Accordingly modify code elsewhere.
27421 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
27422 the Define method of the Property class.
27424 * class.cs : Clean up applied patch and update references to variables etc. Fix
27426 (TypeContainer::Populate): Update to define all the properties we have. Also
27427 define all enumerations.
27429 * enum.cs (Define): Implement.
27431 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
27433 * cs-parser.jay (overloadable_operator): The semantic value is an
27434 enum of the Operator class.
27435 (operator_declarator): Implement actions.
27436 (operator_declaration): Implement.
27438 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
27439 validity of definitions.
27440 (Operator::CheckBinaryOperator): Static method to check for binary operators
27441 (TypeContainer::AddOperator): New method to add an operator to a type.
27443 * cs-parser.jay (indexer_declaration): Added line to actually call the
27444 AddIndexer method so it gets added ;-)
27446 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
27447 already taken care of by the MS compiler ?
27449 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
27451 * class.cs (Operator): New class for operator declarations.
27452 (Operator::OpType): Enum for the various operators.
27454 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
27456 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
27457 ostensibly handle this in semantic analysis.
27459 * cs-parser.jay (general_catch_clause): Comment out
27460 (specific_catch_clauses, specific_catch_clause): Ditto.
27461 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
27462 (catch_args, opt_catch_args): New productions.
27463 (catch_clause): Rewrite to use the new productions above
27464 (catch_clauses): Modify accordingly.
27465 (opt_catch_clauses): New production to use in try_statement
27466 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
27467 and re-write the code in the actions to extract the specific and
27468 general catch clauses by being a little smart ;-)
27470 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
27471 Hooray, try and catch statements parse fine !
27473 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27475 * statement.cs (Block::GetVariableType): Fix logic to extract the type
27476 string from the hashtable of variables.
27478 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
27479 I end up making that mistake ;-)
27480 (catch_clauses): Fixed gross error which made Key and Value of the
27481 DictionaryEntry the same : $1 !!
27483 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27485 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
27487 * cs-parser.jay (event_declaration): Correct to remove the semicolon
27488 when the add and remove accessors are specified.
27490 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27492 * cs-parser.jay (IndexerDeclaration): New helper class to hold
27493 information about indexer_declarator.
27494 (indexer_declarator): Implement actions.
27495 (parsing_indexer): New local boolean used to keep track of whether
27496 we are parsing indexers or properties. This is necessary because
27497 implicit_parameters come into picture even for the get accessor in the
27498 case of an indexer.
27499 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
27501 * class.cs (Indexer): New class for indexer declarations.
27502 (TypeContainer::AddIndexer): New method to add an indexer to a type.
27503 (TypeContainer::indexers): New member to hold list of indexers for the
27506 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
27508 * cs-parser.jay (add_accessor_declaration): Implement action.
27509 (remove_accessor_declaration): Implement action.
27510 (event_accessors_declaration): Implement
27511 (variable_declarators): swap statements for first rule - trivial.
27513 * class.cs (Event): New class to hold information about event
27515 (TypeContainer::AddEvent): New method to add an event to a type
27516 (TypeContainer::events): New member to hold list of events.
27518 * cs-parser.jay (event_declaration): Implement actions.
27520 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
27522 * cs-parser.jay (dim_separators): Implement. Make it a string
27523 concatenating all the commas together, just as they appear.
27524 (opt_dim_separators): Modify accordingly
27525 (rank_specifiers): Update accordingly. Basically do the same
27526 thing - instead, collect the brackets here.
27527 (opt_rank_sepcifiers): Modify accordingly.
27528 (array_type): Modify to actually return the complete type string
27529 instead of ignoring the rank_specifiers.
27530 (expression_list): Implement to collect the expressions
27531 (variable_initializer): Implement. We make it a list of expressions
27532 essentially so that we can handle the array_initializer case neatly too.
27533 (variable_initializer_list): Implement.
27534 (array_initializer): Make it a list of variable_initializers
27535 (opt_array_initializer): Modify accordingly.
27537 * expression.cs (New::NType): Add enumeration to help us
27538 keep track of whether we have an object/delegate creation
27539 or an array creation.
27540 (New:NewType, New::Rank, New::Indices, New::Initializers): New
27541 members to hold data about array creation.
27542 (New:New): Modify to update NewType
27543 (New:New): New Overloaded contructor for the array creation
27546 * cs-parser.jay (array_creation_expression): Implement to call
27547 the overloaded New constructor.
27549 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
27551 * class.cs (TypeContainer::Constructors): Return member
27552 constructors instead of returning null.
27554 2001-08-26 Miguel de Icaza <miguel@ximian.com>
27556 * typemanager.cs (InitCoreTypes): Initialize the various core
27557 types after we have populated the type manager with the user
27558 defined types (this distinction will be important later while
27559 compiling corlib.dll)
27561 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
27562 on Expression Classification. Now all expressions have a method
27563 `Resolve' and a method `Emit'.
27565 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
27566 generation from working. Also add some temporary debugging
27569 2001-08-24 Miguel de Icaza <miguel@ximian.com>
27571 * codegen.cs: Lots of code generation pieces. This is only the
27572 beginning, will continue tomorrow with more touches of polish. We
27573 handle the fundamentals of if, while, do, for, return. Others are
27574 trickier and I need to start working on invocations soon.
27576 * gen-treedump.cs: Bug fix, use s.Increment here instead of
27579 * codegen.cs (EmitContext): New struct, used during code
27580 emission to keep a context. Most of the code generation will be
27583 * cs-parser.jay: Add embedded blocks to the list of statements of
27584 this block. So code generation proceeds in a top down fashion.
27586 2001-08-23 Miguel de Icaza <miguel@ximian.com>
27588 * statement.cs: Add support for multiple child blocks.
27590 2001-08-22 Miguel de Icaza <miguel@ximian.com>
27592 * codegen.cs (EmitCode): New function, will emit the code for a
27593 Block of code given a TypeContainer and its ILGenerator.
27595 * statement.cs (Block): Standard public readonly optimization.
27596 (Block::Block constructors): Link children.
27597 (Block::Child): Child Linker.
27598 (Block::EmitVariables): Emits IL variable declarations.
27600 * class.cs: Drop support for MethodGroups here, delay until
27602 (Method::): Applied the same simplification that I did before, and
27603 move from Properties to public readonly fields.
27604 (Method::ParameterTypes): Returns the parameter types for the
27605 function, and implements a cache that will be useful later when I
27606 do error checking and the semantic analysis on the methods is
27608 (Constructor::GetCallingConvention): Renamed from CallingConvetion
27609 and made a method, optional argument tells whether this is a class
27610 or a structure to apply the `has-this' bit.
27611 (Method::GetCallingConvention): Implement, returns the calling
27613 (Method::Define): Defines the type, a second pass is performed
27614 later to populate the methods.
27616 (Constructor::ParameterTypes): implement a cache similar to the
27617 one on Method::ParameterTypes, useful later when we do semantic
27620 (TypeContainer::EmitMethod): New method. Emits methods.
27622 * expression.cs: Removed MethodGroup class from here.
27624 * parameter.cs (Parameters::GetCallingConvention): new method.
27626 2001-08-21 Miguel de Icaza <miguel@ximian.com>
27628 * class.cs (TypeContainer::Populate): Drop RootContext from the
27631 (Constructor::CallingConvention): Returns the calling convention.
27632 (Constructor::ParameterTypes): Returns the constructor parameter
27635 (TypeContainer::AddConstructor): Keep track of default constructor
27636 and the default static constructor.
27638 (Constructor::) Another class that starts using `public readonly'
27639 instead of properties.
27641 (Constructor::IsDefault): Whether this is a default constructor.
27643 (Field::) use readonly public fields instead of properties also.
27645 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
27646 track of static constructors; If none is used, turn on
27647 BeforeFieldInit in the TypeAttributes.
27649 * cs-parser.jay (opt_argument_list): now the return can be null
27650 for the cases where there are no arguments.
27652 (constructor_declarator): If there is no implicit `base' or
27653 `this', then invoke the default parent constructor.
27655 * modifiers.cs (MethodAttr): New static function maps a set of
27656 modifiers flags into a MethodAttributes enum
27657 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
27658 MethodAttr, TypeAttr to represent the various mappings where the
27659 modifiers are used.
27660 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
27662 2001-08-19 Miguel de Icaza <miguel@ximian.com>
27664 * parameter.cs (GetParameterInfo): Fix bug where there would be no
27667 * interface.cs (PopulateIndexer): Implemented the code generator
27668 for interface indexers.
27670 2001-08-17 Miguel de Icaza <miguel@ximian.com>
27672 * interface.cs (InterfaceMemberBase): Now we track the new status
27675 (PopulateProperty): Implement property population. Woohoo! Got
27676 Methods and Properties going today.
27678 Removed all the properties for interfaces, and replaced them with
27679 `public readonly' fields.
27681 2001-08-16 Miguel de Icaza <miguel@ximian.com>
27683 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
27684 initialize their hashtables/arraylists only when they are needed
27685 instead of doing this always.
27687 * parameter.cs: Handle refs and out parameters.
27689 * cs-parser.jay: Use an ArrayList to construct the arguments
27690 instead of the ParameterCollection, and then cast that to a
27693 * parameter.cs: Drop the use of ParameterCollection and use
27694 instead arrays of Parameters.
27696 (GetParameterInfo): Use the Type, not the Name when resolving
27699 2001-08-13 Miguel de Icaza <miguel@ximian.com>
27701 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
27702 and instead use public readonly fields.
27704 * class.cs: Put back walking code for type containers.
27706 2001-08-11 Miguel de Icaza <miguel@ximian.com>
27708 * class.cs (MakeConstant): Code to define constants.
27710 * rootcontext.cs (LookupType): New function. Used to locate types
27713 2001-08-08 Miguel de Icaza <miguel@ximian.com>
27715 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
27716 this System.Reflection code is. Kudos to Microsoft
27718 * typemanager.cs: Implement a type cache and avoid loading all
27719 types at boot time. Wrap in LookupType the internals. This made
27720 the compiler so much faster. Wow. I rule!
27722 * driver.cs: Make sure we always load mscorlib first (for
27723 debugging purposes, nothing really important).
27725 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
27726 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
27728 * rootcontext.cs: Lookup types on their namespace; Lookup types
27729 on namespaces that have been imported using the `using' keyword.
27731 * class.cs (TypeContainer::TypeAttr): Virtualize.
27732 (Class::TypeAttr): Return attributes suitable for this bad boy.
27733 (Struct::TypeAttr): ditto.
27734 Handle nested classes.
27735 (TypeContainer::) Remove all the type visiting code, it is now
27736 replaced with the rootcontext.cs code
27738 * rootcontext.cs (GetClassBases): Added support for structs.
27740 2001-08-06 Miguel de Icaza <miguel@ximian.com>
27742 * interface.cs, statement.cs, class.cs, parameter.cs,
27743 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
27744 Drop use of TypeRefs, and use strings instead.
27746 2001-08-04 Miguel de Icaza <miguel@ximian.com>
27750 * class.cs (Struct::Struct): set the SEALED flags after
27751 checking the modifiers.
27752 (TypeContainer::TypeAttr): new property, returns the
27753 TypeAttributes for a class.
27755 * cs-parser.jay (type_list): Oops, list production was creating a
27756 new list of base types.
27758 * rootcontext.cs (StdLib): New property.
27759 (GetInterfaceTypeByName): returns an interface by type name, and
27760 encapsulates error handling here.
27761 (GetInterfaces): simplified.
27762 (ResolveTree): Encapsulated all the tree resolution here.
27763 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
27766 * driver.cs: Add support for --nostdlib, to avoid loading the
27767 default assemblies.
27768 (Main): Do not put tree resolution here.
27770 * rootcontext.cs: Beginning of the class resolution.
27772 2001-08-03 Miguel de Icaza <miguel@ximian.com>
27774 * rootcontext.cs: Provide better error reporting.
27776 * cs-parser.jay (interface_base): set our $$ to be interfaces.
27778 * rootcontext.cs (CreateInterface): Handle the case where there
27779 are no parent interfaces.
27781 (CloseTypes): Routine to flush types at the end.
27782 (CreateInterface): Track types.
27783 (GetInterfaces): Returns an array of Types from the list of
27784 defined interfaces.
27786 * typemanager.c (AddUserType): Mechanism to track user types (puts
27787 the type on the global type hash, and allows us to close it at the
27790 2001-08-02 Miguel de Icaza <miguel@ximian.com>
27792 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
27793 RecordInterface instead.
27795 * cs-parser.jay: Updated to reflect changes above.
27797 * decl.cs (Definition): Keep track of the TypeBuilder type that
27798 represents this type here. Not sure we will use it in the long
27799 run, but wont hurt for now.
27801 * driver.cs: Smaller changes to accomodate the new code.
27803 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
27806 * rootcontext.cs (CreateInterface): New method, used to create
27807 the System.TypeBuilder type for interfaces.
27808 (ResolveInterfaces): new entry point to resolve the interface
27810 (CodeGen): Property, used to keep track of the code generator.
27812 2001-07-26 Miguel de Icaza <miguel@ximian.com>
27814 * cs-parser.jay: Add a second production for delegate_declaration
27817 (enum_body): Put an opt_comma here instead of putting it on
27818 enum_body or enum_member_declarations so we can handle trailing
27819 commas on enumeration members. Gets rid of a shift/reduce.
27821 (type_list): Need a COMMA in the middle.
27823 (indexer_declaration): Tell tokenizer to recognize get/set
27825 * Remove old targets.
27827 * Re-add the parser target.
27829 2001-07-13 Simon Cozens <simon@simon-cozens.org>
27831 * cs-parser.jay: Add precendence rules for a number of operators
27832 ot reduce the number of shift/reduce conflicts in the grammar.
27834 2001-07-17 Miguel de Icaza <miguel@ximian.com>
27836 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
27839 Get rid of old crufty code.
27841 * rootcontext.cs: Use this to keep track of the parsed
27842 representation and the defined types available to the program.
27844 * gen-treedump.cs: adjust for new convention.
27846 * type.cs: Split out the type manager, and the assembly builder
27849 * typemanager.cs: the type manager will live here now.
27851 * cil-codegen.cs: And the code generator here.
27853 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
27855 * makefile: Fixed up for easy making.
27857 2001-07-13 Simon Cozens <simon@simon-cozens.org>
27859 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
27862 (unary_expression): Expand pre_increment_expression and
27863 post_decrement_expression to reduce a shift/reduce.
27865 2001-07-11 Simon Cozens
27867 * cs-tokenizer.cs: Hex numbers should begin with a 0.
27869 Improve allow_keyword_as_indent name.
27871 2001-06-19 Miguel de Icaza <miguel@ximian.com>
27873 * Adjustments for Beta2.
27875 2001-06-13 Miguel de Icaza <miguel@ximian.com>
27877 * decl.cs: Added `Define' abstract method.
27878 (InTransit): new property, used to catch recursive definitions.
27880 * interface.cs: Implement `Define'.
27882 * modifiers.cs: Map Modifiers.constants to
27883 System.Reflection.TypeAttribute flags.
27885 * class.cs: Keep track of types and user-defined types.
27886 (BuilderInit): New method for creating an assembly
27887 (ResolveType): New function to launch the resolution process, only
27888 used by interfaces for now.
27890 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
27891 that are inserted into the name space.
27893 2001-06-08 Miguel de Icaza <miguel@ximian.com>
27895 * ARGH. I have screwed up my tree so many times due to the use of
27896 rsync rather than using CVS. Going to fix this at once.
27898 * driver.cs: Objetify driver. Load assemblies, use assemblies to
27901 2001-06-07 Miguel de Icaza <miguel@ximian.com>
27903 * Experiment successful: Use System.Type rather that our own
27906 2001-05-25 Miguel de Icaza <miguel@ximian.com>
27908 * cs-parser.jay: Removed nsAliases from here.
27910 Use new namespaces, handle `using XXX;'
27912 * namespace.cs: Reimplemented namespace handling, use a recursive
27913 definition of the class. Now we can keep track of using clauses
27914 and catch invalid using clauses.
27916 2001-05-24 Miguel de Icaza <miguel@ximian.com>
27918 * gen-treedump.cs: Adapted for all the renaming.
27920 * expression.cs (Expression): this class now has a Type property
27921 which returns an expression Type.
27923 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
27924 `Type', as this has a different meaning now in the base
27926 2001-05-22 Miguel de Icaza <miguel@ximian.com>
27928 * interface.cs, class.cs: Removed from all the sources the
27929 references to signature computation, as we can not do method
27930 signature computation during the parsing time, as we are not
27931 trying to solve at that point distinguishing:
27935 void a (NS.Blah x) {}
27938 Which depending on the context might be valid or not, as we do not
27939 know if Blah is the same thing as NS.Blah at that point.
27941 * Redid everything so the code uses TypeRefs now instead of
27942 Types. TypeRefs are just temporary type placeholders, that need
27943 to be resolved. They initially have a pointer to a string and the
27944 current scope in which they are used. This is used later by the
27945 compiler to resolve the reference to an actual Type.
27947 * DeclSpace is no longer a CIR.Type, and neither are
27948 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
27949 are all DeclSpaces, but no Types.
27951 * type.cs (TypeRefManager): This implements the TypeRef manager,
27952 which keeps track of all the types that need to be resolved after
27953 the parsing has finished.
27955 2001-05-13 Miguel de Icaza <miguel@ximian.com>
27957 * ARGH. We are going to have to store `foreach' as a class rather
27958 than resolving it, as we need to verify error 1579 after name
27959 resolution. *OR* we could keep a flag that says `This request to
27960 IEnumerator comes from a foreach statement' which we can then use
27961 to generate the error.
27963 2001-05-10 Miguel de Icaza <miguel@ximian.com>
27965 * class.cs (TypeContainer.AddMethod): we now add methods to the
27966 MethodGroup instead of the method hashtable.
27968 * expression.cs: Add MethodGroup abstraction, which gets us one
27969 step closer to the specification in the way we handle method
27972 * cs-parser.jay (primary_expression): qualified_identifier now
27973 tried to match up an identifier to a local variable reference or
27974 to a parameter reference.
27976 current_local_parameters is now a parser global variable that
27977 points to the current parameters for the block, used during name
27980 (property_declaration): Now creates an implicit `value' argument to
27983 2001-05-09 Miguel de Icaza <miguel@ximian.com>
27985 * parameter.cs: Do not use `param' arguments as part of the
27986 signature, per the spec.
27988 2001-05-08 Miguel de Icaza <miguel@ximian.com>
27990 * decl.cs: Base class for classes, structs and interfaces. This
27991 is the "Declaration Space"
27993 * cs-parser.jay: Use CheckDef for checking declaration errors
27994 instead of having one on each function.
27996 * class.cs: Factor out some code for handling error handling in
27997 accordance to the "Declarations" section in the "Basic Concepts"
27998 chapter in the ECMA C# spec.
28000 * interface.cs: Make all interface member classes derive from
28001 InterfaceMemberBase.
28003 2001-05-07 Miguel de Icaza <miguel@ximian.com>
28005 * Many things: all interfaces are parsed and generated in
28006 gen-treedump. Support for member variables, constructors,
28007 destructors, properties, constants is there.
28009 Beginning of the IL backend, but very little done, just there for
28012 2001-04-29 Miguel de Icaza <miguel@ximian.com>
28014 * cs-parser.jay: Fix labeled statement.
28016 * cs-tokenizer.cs (escape): Escape " and ' always.
28017 ref_line, ref_name: keep track of the line/filename as instructed
28018 by #line by the compiler.
28021 2001-04-27 Miguel de Icaza <miguel@ximian.com>
28023 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
28024 to match the values in System.CodeDOM.
28026 Divid renamed to Divide.
28028 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
28030 (Statements.set): remove.
28032 * System.CodeDOM/CodeCatchClause.cs: always have a valid
28035 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
28036 falseStatements always have valid values.
28038 * cs-parser.jay: Use System.CodeDOM now.