1 2008-01-22 Marek Safar <marek.safar@gmail.com>
3 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
6 * generic.cs: Implemented coalesce expression.
8 2008-01-22 Marek Safar <marek.safar@gmail.com>
11 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
12 expression tree type inference.
14 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
17 * expression.cs (Binary.IsUnsignedType): Fix typo.
19 2008-01-22 Marek Safar <marek.safar@gmail.com>
21 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
23 2008-01-22 Marek Safar <marek.safar@gmail.com>
26 * ecore.cs, expression.cs: Wider range of extension method supported
29 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
31 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
32 AssemblyBuilder to operate in compiler context. Fixes mcs part of
35 2008-01-22 Marek Safar <marek.safar@gmail.com>
38 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
40 2008-01-22 Miguel de Icaza <miguel@novell.com>
42 * expression.cs (CreateExpressionTree): Add support for or and
43 logical or, and indent following the coding conventions.
45 * typemanager.cs (LinqExpression): renamed from
46 ExpressionTreeManager, for a shorter name.
48 Use TypeManager.CoreLookupType to lookup types from our core
49 assemblies and turn those into "Type" variables.
51 Consumers that previously used "Namespace" and "Type" from this
52 class should instead use the TypeExpression which is a type that
53 is fully resolved (without involving the regular C# resolution
56 This typically looks like this:
58 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
59 new MemberAccess (texpr, name, type_arguments, loc)
61 This avoids the problem in: #355178
63 2008-01-21 Marek Safar <marek.safar@gmail.com>
65 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
66 feature in parser only as we do in other cases.
68 2008-01-21 Marek Safar <marek.safar@gmail.com>
70 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
71 typemanager.cs: A refactoring of params arguments to reuse existing
72 expressions (params -> array initializer) to emit params argument instead
73 of specialized handling.
74 It was required by expression tree implementation and it has other benefits
75 as well, we now apply same optimization for params arguments as we do for
78 2008-01-18 Marek Safar <marek.safar@gmail.com>
81 * generic.cs: A type inference of params arguments may not required any
82 temporary array creation.
84 2008-01-18 Marek Safar <marek.safar@gmail.com>
87 * generic.cs, ecore.cs, expression.cs: A method group type inference is
88 supported for delegates only.
90 2008-01-18 Marek Safar <marek.safar@gmail.com>
92 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
93 type for more than 1 candidates.
95 2008-01-18 Marek Safar <marek.safar@gmail.com>
97 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
100 2008-01-16 Marek Safar <marek.safar@gmail.com>
102 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
103 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
104 operator) expressions.
106 2008-01-16 Zoltan Varga <vargaz@gmail.com>
108 * statement.cs: Avoid declaring an IL variable for this_variable since it is
109 not accessed from the generated IL.
111 2008-01-14 Marek Safar <marek.safar@gmail.com>
113 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
114 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
115 statement.cs: The first expression tree implementation drop, mostly
118 2008-01-14 Marek Safar <marek.safar@gmail.com>
120 * ecore.cs (IsNestedChild): Refactored.
122 2008-01-11 Marek Safar <marek.safar@gmail.com>
124 * lambda.cs: Don't use a cast on unknown expression statement.
126 2008-01-10 Geoff Norton <gnorton@novell.com>
128 * cs-tokenizer.cs: One more token to distinguish between method and lambda
131 2008-01-09 Marek Safar <marek.safar@gmail.com>
133 * doc.cs: Report better /doc crash details.
135 2008-01-09 Marek Safar <marek.safar@gmail.com>
137 A fix for bug #352536
138 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
140 2008-01-08 Marek Safar <marek.safar@gmail.com>
142 A fix for bug #352287
143 * ecore.cs, expression.cs: Do `this' access checking in all member access
146 2008-01-08 Marek Safar <marek.safar@gmail.com>
148 * rootcontext.cs, driver.cs: Switch to linq mode by default.
150 * report.cs: Reset message stacks.
152 2008-01-08 Marek Safar <marek.safar@gmail.com>
154 * generic.cs (InferInPhases): Correctly calculate params position.
156 2008-01-08 Marek Safar <marek.safar@gmail.com>
158 * cs-tokenizer.cs: No need to parse full string when parsing lambda
161 2008-01-07 Marek Safar <marek.safar@gmail.com>
163 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
165 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
167 * driver.cs: Updated --help option.
169 2008-01-07 Marek Safar <marek.safar@gmail.com>
171 * generic.cs (InferParamsTypeArguments): Removed.
172 (InferInPhases): Add params type inference.
173 (LowerBoundInference): Fixed scoring mechanism.
175 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
177 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
179 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
180 byte array for unsigned "baked" assemblies.
182 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
184 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
185 array for assemblies that are not strongnamed.
187 2008-01-04 Marek Safar <marek.safar@gmail.com>
189 A fix for bug #351481
190 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
191 declaring type for nested generic types.
193 2008-01-04 Marek Safar <marek.safar@gmail.com>
195 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
198 2008-01-03 Marek Safar <marek.safar@gmail.com>
200 A fix for bug #351047
201 * expression.cs (Binary.ResolveOperator): Allow equality operators between
202 null and structs only when equality and inequality operators are defined
203 either as an user-operators or predefined operators.
205 2008-01-03 Marek Safar <marek.safar@gmail.com>
207 A fix for bug #351047
208 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
210 2008-01-03 Marek Safar <marek.safar@gmail.com>
212 A fix for bug #351257
213 * cs-tokenizer.cs: Advance line number for '\r' correctly.
215 2008-01-03 Marek Safar <marek.safar@gmail.com>
217 A fix for bug #351157
218 * class.cs (Using): Fixed yet another broken cloning.
220 (Block): Put back more sensible default value for statements.
222 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
224 * codegen.cs: Allow AssemblyVersion with only major version component.
227 2007-12-29 Marek Safar <marek.safar@gmail.com>
229 A fix for bug #324654
230 * class.cs: Use FullName property as member name.
232 2007-12-28 Marek Safar <marek.safar@gmail.com>
234 A fix for bug #342117
235 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
236 constructor constraint.
238 2007-12-28 Marek Safar <marek.safar@gmail.com>
240 A fix for bug #338273
241 * class.cs (ProbertyBase): Access modifier checks are required for overrides
244 2007-12-28 Marek Safar <marek.safar@gmail.com>
246 A fix for bug #350839
247 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
249 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
251 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
254 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
256 * statement.cs: Changed some Hashtables to use HybridDictionaries
257 instead. It was observed that some HashTables only contained a few
258 items in the vast majority of cases. Since HybridDictionary is
259 more efficient on small sets (<10 elements), "known_variables"
260 from class ExplicitBlock as well as "labels" and "constants " from
261 class Block were changed to HybridDictionaries.
263 Atsai results: (56216kb->54987kb)
265 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
268 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
270 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
273 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
275 * expression.cs: foreach loop to for loop, saved on allocation of
276 enumerator (59333kb->59141kb)
278 * statement.cs. Changed foreach loops to for loops, saved on
279 allocation of enumerator (59141kb->59006kb)
281 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
282 when constructed with no specified capacity. This was causing a
283 few ArrayLists to allocate more memory than they would potentially
284 need in the Block class and MemberCache class. Setting the
285 ArrayLists to construct with a capacity of 1 saves some
286 memory. (56216kb->55585kb)
288 2007-12-27 Marek Safar <marek.safar@gmail.com>
290 A fix for bug #347189 (2nd issue)
291 * expression.cs (MemberAccess): Nested type can be found in base non-generic
294 2007-12-27 Miguel de Icaza <miguel@novell.com>
296 * report.cs: Do not use colors if stdout and stderr are not a
299 2007-12-27 Marek Safar <marek.safar@gmail.com>
301 A fix for bug #346998
302 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
305 2007-12-27 Marek Safar <marek.safar@gmail.com>
307 A fix for bug #343465
308 * class.cs: Explicit method name for nested types uses dots only.
310 2007-12-27 Marek Safar <marek.safar@gmail.com>
312 A fix for bug #343707
313 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
315 2007-12-27 Marek Safar <marek.safar@gmail.com>
317 * ecore.cs: Report type inference errors only when arguments count matches
320 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
322 * expression.cs, report.cs: New warning.
324 * typemanager.cs: Catch anonymous method type too.
326 2007-12-23 Marek Safar <marek.safar@gmail.com>
328 A fix for bug #346379
329 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
331 2007-12-23 Marek Safar <marek.safar@gmail.com>
333 A fix for bug #347359
334 * expression.cs (Invocation): Don't resolve already resolved expression.
336 2007-12-23 Marek Safar <marek.safar@gmail.com>
338 A fix for bug #347189
339 * class.cs (FixedField): Use non-dependent code only in the define phase.
341 2007-12-23 Marek Safar <marek.safar@gmail.com>
343 A fix for bug #348076
344 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
346 2007-12-22 Marek Safar <marek.safar@gmail.com>
348 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
349 discovered extension methods.
351 2007-12-22 Marek Safar <marek.safar@gmail.com>
353 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
356 2007-12-21 Miguel de Icaza <miguel@novell.com>
358 * report.cs (ErrorMessage): Add support for using colors on
359 terminals that support it.
361 2007-12-21 Marek Safar <marek.safar@gmail.com>
363 * ecore.cs: Use information about expanded params for error reporting.
365 2007-12-21 Marek Safar <marek.safar@gmail.com>
367 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
368 and logic for params overloads.
370 2007-12-15 Miguel de Icaza <miguel@novell.com>
372 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
373 as this is also created from the parser. Fixes #349034
375 2007-12-12 Miguel de Icaza <miguel@novell.com>
377 * statement.cs (Throw.CloneTo): it is valid to have empty
378 expressions for throw.
380 2007-12-03 Marek Safar <marek.safar@gmail.com>
382 * cs-parser.jay: Set delegate constraint parsing region correctly.
384 2007-12-03 Marek Safar <marek.safar@gmail.com>
386 A fix for bug #345467
387 * typemanager.cs (IsEqual): Compare generic parameters position only.
389 2007-11-28 Marek Safar <marek.safar@gmail.com>
391 * expression.cs (BaseAccess): Type arguments can be null.
393 2007-11-27 Raja R Harinath <harinath@gmail.com>
395 * statement.cs (Block.Resolve): Ensure flow-branching tree is
396 consistent even when an error has occured.
397 (Switch.Resolve): Likewise.
399 2007-11-22 Marek Safar <marek.safar@gmail.com>
401 A fix for bug #334505
402 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
405 2007-11-22 Marek Safar <marek.safar@gmail.com>
407 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
408 refactorings required to resolve extension methods correctly when mixing
409 generics and non-generics members.
411 2007-11-20 Marek Safar <marek.safar@gmail.com>
413 A fix for bug #342584
414 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
417 2007-11-19 Marek Safar <marek.safar@gmail.com>
419 A fix for bug #342512
420 * delegate.cs: Use delegate argument expression when is available. Don't
421 emit virtual call when class is sealed.
423 2007-11-16 Marek Safar <marek.safar@gmail.com>
425 A fix for bug #325423
426 * assign.cs (FieldInitializer): Use resolved expression for emit.
428 * class.cs: Print less confusing error message.
430 2007-11-16 Marek Safar <marek.safar@gmail.com>
432 * cs-tokenizer.cs: Removed GMCS ifdefs.
434 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
437 * cs-parser.jay: Disabled nullable check.
439 * generic-mcs: Copied more generic stuff.
441 2007-11-16 Marek Safar <marek.safar@gmail.com>
443 * gcs-parser.jay: Merged to cs-parser.jay.
445 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
446 * *.csproj, *.sources: Updated to use only jay parser file.
448 2007-11-16 Marek Safar <marek.safar@gmail.com>
450 * gcs-parser.jay: Added nullable and default expression feature checks.
452 2007-11-16 Marek Safar <marek.safar@gmail.com>
454 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
455 it fixes many TODOs and hidden bugs.
457 * expression: Removed duplicate error check.
459 2007-11-15 Marek Safar <marek.safar@gmail.com>
461 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
462 implicitly type local variable only when it is used in a declaration.
464 2007-11-15 Marek Safar <marek.safar@gmail.com>
466 * attribute.cs: Use CS0612 for empty strings.
468 2007-11-14 Marek Safar <marek.safar@gmail.com>
470 * lambda.cs, statement.cs: Contextual return may act as a statement.
472 2007-11-14 Marek Safar <marek.safar@gmail.com>
474 A fix for a regression cause by #324222
475 * class.cs: Don't report unused even when it implements an interface.
477 2007-11-13 Marek Safar <marek.safar@gmail.com>
479 A fix for bug #341205
480 * ecore.cs, expression.cs: Method group expression cannot do static
481 method access with an instance reference check before overloading takes
484 2007-11-13 Marek Safar <marek.safar@gmail.com>
486 A fix for bug #325359
487 * class.cs: Use predictable name for automatically generated property.
489 2007-11-12 Marek Safar <marek.safar@gmail.com>
491 A fix for bug #324996
492 * expression.cs (Is): Handle case where D is nullable and T is not
495 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
497 2007-11-12 Marek Safar <marek.safar@gmail.com>
499 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
500 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
501 Flush small error reporting changes.
503 2007-11-09 Marek Safar <marek.safar@gmail.com>
505 A fix for bug #324996
506 * expression.cs: Rewrote Is expression implementation to work with
507 generics, nullable types, anonymous method. A const result expression
508 uses existing infrastructure instead of custom not fully-featured one.
510 2007-11-08 Marek Safar <marek.safar@gmail.com>
512 A fix for bug #340202
513 * class.cs: Consider generics for volatile field.
515 2007-11-08 Marek Safar <marek.safar@gmail.com>
517 A fix for bug #335594
518 * expression.cs: Use conversion rules when handling string addition.
520 2007-11-07 Marek Safar <marek.safar@gmail.com>
522 A fix for bug #336651
523 * expression.cs: Fixed a crash when probing is on.
525 2007-11-07 Marek Safar <marek.safar@gmail.com>
527 A fix for bug #324242
528 * covert.cs: Added a conversion from any nullable-type with an
529 underlying enum-type to the type System.Enum.
531 2007-11-07 Marek Safar <marek.safar@gmail.com>
533 A fix for bug #324222
534 * class.cs: Report all non-used event fields.
536 2007-11-07 Marek Safar <marek.safar@gmail.com>
538 A fix for bug #325161
539 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
540 qualifier for generic types.
542 2007-11-07 Marek Safar <marek.safar@gmail.com>
544 A fix for bug #322971
545 * expression.cs, ecore.cs: Added intermediate result value check for
548 2007-11-07 Marek Safar <marek.safar@gmail.com>
550 A fix for bug #324754
551 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
552 when it was requested.
554 2007-11-07 Marek Safar <marek.safar@gmail.com>
556 A fix for bug #325101
557 * expression.cs: Do type not value comparison for `is' expression.
559 2007-11-07 Marek Safar <marek.safar@gmail.com>
561 A fix for bug #320236
562 * convert.cs: Don't apply user conversion on underlying target type.
564 2007-11-06 Marek Safar <marek.safar@gmail.com>
566 * expression.cs: Don't use unresolved expression for error reporting.
568 2007-11-06 Marek Safar <marek.safar@gmail.com>
570 A fix for bugs #337712, #324490
571 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
572 overloading resolution too.
574 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
575 the process consistent and more robust.
577 * expression.cs, linq.cs, report.cs: Update.
579 2007-11-02 Marek Safar <marek.safar@gmail.com>
581 A fix for bug #332909
582 * attribute.cs: Resolve attributes in correct context using error
585 * rootcontext.cs: Define Obsolete attribute members as core members.
587 2007-11-02 Marek Safar <marek.safar@gmail.com>
589 * statement.cs: Removed unused methods.
591 2007-10-31 Wade Berrier <wberrier@novell.com>
593 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
594 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
597 2007-10-31 Marek Safar <marek.safar@gmail.com>
599 A fix for bug #338102
600 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
601 methods registered as non-generics.
603 2007-10-31 Marek Safar <marek.safar@gmail.com>
605 A fix for bugs #337712, #324490
606 * delegate.cs: Delegate covariance and contravariance is not allowed for
609 2007-10-31 Marek Safar <marek.safar@gmail.com>
611 A fix for bug #337719
612 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
615 2007-10-30 Marek Safar <marek.safar@gmail.com>
617 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
619 2007-10-29 Marek Safar <marek.safar@gmail.com>
621 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
624 2007-10-29 Raja R Harinath <rharinath@novell.com>
626 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
628 2007-10-29 Marek Safar <marek.safar@gmail.com>
630 A fix for bug #334652
631 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
632 extension methods when we have not found the best candidate in normal
635 2007-10-27 Marek Safar <marek.safar@gmail.com>
637 * AssemblyInfo.cs: Keep up-to-date.
639 2007-10-27 Marek Safar <marek.safar@gmail.com>
641 * Makefile: Fixed generics compiler name.
643 2007-10-27 Marek Safar <marek.safar@gmail.com>
645 * lambda.test: removed, lambda parsing is done differently.
647 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
649 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
651 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
653 2007-10-27 Marek Safar <marek.safar@gmail.com>
655 * Makefile, *.sources : All C# compilers are in mcs folder.
657 * *.cs: Use existing 2_1 define for smcs.
659 2007-10-26 Marek Safar <marek.safar@gmail.com>
661 A fix for bug #335847
662 * assign.cs, expression.cs: Couple of changes to avoid creating a
663 temporary variable for each object initializer assignment statement. It
664 simplifies struct initialization too, otherwise two temporary variables
666 Implemented optimization of redundant default element initializers.
668 2007-10-25 Marek Safar <marek.safar@gmail.com>
670 A fix for bug #336766
671 * expression.cs (Class.CheckBase): Use generic name when method is
674 2007-10-25 Marek Safar <marek.safar@gmail.com>
676 A fix for bug #334737
677 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
678 variable and not variable argument for prepared copies.
680 2007-10-24 Marek Safar <marek.safar@gmail.com>
682 A fix for bug #325110
683 * class.cs, expression.cs, attribute.cs: Use open generic method when
684 checking conditional attribute.
686 2007-10-24 Marek Safar <marek.safar@gmail.com>
688 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
689 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
690 FeatureIsNotAvailable.
692 2007-10-24 Marek Safar <marek.safar@gmail.com>
694 ** C# 3.0 Partial methods
696 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
697 methods support. Because of member cache issue with generics only
698 non-generics partial methods are fully supported.
700 2007-10-23 Marek Safar <marek.safar@gmail.com>
702 * class.cs, decl.cs: Rewrote member overloads check to cope with
703 generics and to use member cache for member checking. It also improves
704 performance and fixes remaining overloads issues.
706 2007-10-20 Marek Safar <marek.safar@gmail.com>
708 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
709 roottypes.cs, typemanager.cs:
711 A member cache creation logic changed to add members immediately and
712 not rely on fallback. The member cache is now only prefered way
713 how to access and find type declaration members. It saves 5 MB of memory
714 during MWF compilation and makes code ready for more optimizations and
715 clean-ups, it's also a pre-requirement for partial methods.
717 2007-10-18 Raja R Harinath <harinath@gmail.com>
719 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
720 handling for generic parameters.
722 2007-10-15 Marek Safar <marek.safar@gmail.com>
724 * class.cs (FixedField): Removed redundant volatile check.
726 2007-10-15 Marek Safar <marek.safar@gmail.com>
728 * class.cs, decl.cs: Fixed overload members verification to do only one
729 check per possible collision.
731 2007-10-13 Marek Safar <marek.safar@gmail.com>
733 A fix for bug #325478
734 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
735 and create only one disposable flags container.
737 2007-10-12 Marek Safar <marek.safar@gmail.com>
739 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
740 * statement.cs (Fixed): Fixed variables cloning.
742 2007-10-12 Marek Safar <marek.safar@gmail.com>
744 A fix for bug #333342
745 * class.cs (EventField): Don't mark value type event as synchronized.
747 2007-10-12 Marek Safar <marek.safar@gmail.com>
749 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
750 inference to identify best candidate method correctly.
751 (ProperyExpr): A range variable is read only and cannot be modified.
753 2007-10-11 Marek Safar <marek.safar@gmail.com>
755 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
756 logic to identify best candidate method correctly.
758 2007-10-11 Marek Safar <marek.safar@gmail.com>
760 * location.cs (Equals, GetHashCode): Removed.
762 2007-10-11 Marek Safar <marek.safar@gmail.com>
764 * report.cs: Implemented message recorder. It is used mainly for lambda
765 expressions to capture otherwise swallowed error messages.
767 * anonymous.cs, lambda.cs.cs: Do full parameters check.
769 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
771 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
773 * expression.cs (MemberAccess): Always report lookup failure.
775 * location.cs: Implemented Equals, GetHashCode.
777 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
779 2007-10-10 Jb Evain <jbevain@novell.com>
781 * codegen.cs: re-enable assembly version check.
783 2007-10-09 Marek Safar <marek.safar@gmail.com>
785 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
788 * namespace.cs (UsingAlias): Do correct version check.
790 2007-10-08 Marek Safar <marek.safar@gmail.com>
792 * expresison.cs, ecore.cs: Issue extension method error message when
795 * rootcontext.cs: Added ISO_2 compiler mode option.
797 2007-10-08 Marek Safar <marek.safar@gmail.com>
799 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
802 2007-10-08 Marek Safar <marek.safar@gmail.com>
804 * attribute.cs (GetString, GetBoolean): Work with both literal and
807 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
808 Moved method overload specific methods to MethodGroupExpr.
810 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
811 it should be less memory consuming.
813 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
815 * codegen.cs: remove the assembly version check until the buildbot is
818 2007-10-07 Jb Evain <jbevain@novell.com>
820 * attribute.cs (Attribute.GetString): if the value
821 expression is a StringConstant, return its string value.
823 2007-10-07 Jb Evain <jbevain@novell.com>
825 * typemanager.cs: add `assembly_version_attribute_type`.
826 * codegen.cs: on attribute emission, check that the
827 AssemblyVersionAttribute doesn't overflow.
829 2007-10-05 Marek Safar <marek.safar@gmail.com>
831 A fix for bug #324677
832 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
833 parent container of a scope container with currently resolved one.
835 2007-10-05 Marek Safar <marek.safar@gmail.com>
837 A fix for bug #325534
838 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
841 2007-10-05 Marek Safar <marek.safar@gmail.com>
843 A fix for bug #327504
844 * class.cs (Operator.Define): Refactored implicit and explicit user
845 operator conversion rules.
847 2007-10-05 Marek Safar <marek.safar@gmail.com>
849 A fix for bug #327520
850 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
852 2007-10-04 Marek Safar <marek.safar@gmail.com>
854 A fix for bug #328022
855 * class.cs (MethodData.Define): Use correct method to check whether
856 a method implementents an accessor.
858 2007-10-04 Marek Safar <marek.safar@gmail.com>
860 A fix for bug #330069
861 * statement.cs (Fixed.Resolve): Read the first array element only when
862 an array is instantiated.
864 2007-10-04 Marek Safar <marek.safar@gmail.com>
866 * expression.cs, assign.cs, generics.cs: Print correct operator when
867 compound assignment is used.
869 2007-10-04 Marek Safar <marek.safar@gmail.com>
871 A fix for bug #325841
872 * expression.cs (ArrayAccess): Use full argument cloning only for
873 string compound concatenation.
875 2007-10-03 Marek Safar <marek.safar@gmail.com>
877 A fix for bug #328774
878 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
880 (PropertyExpr.EmitAssign): Fixed string concatenation compound
883 2007-10-03 Raja R Harinath <rharinath@novell.com>
886 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
887 Event accessibility checks here. Remove some bogus code that
888 accidently made GenericMethods work.
889 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
891 2007-09-25 Marek Safar <marek.safar@gmail.com>
893 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
895 * statement.cs (Block): Refactored AddVariable to allow error handling
898 * generic.cs: New stub.
900 2007-09-23 Marek Safar <marek.safar@gmail.com>
902 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
905 2007-09-17 Marek Safar <marek.safar@gmail.com>
907 * class.cs: Use partial container to record whether any partial part
908 contains static field initializer and therefore default contructor has
911 2007-09-14 Marek Safar <marek.safar@gmail.com>
913 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
914 mono-list when only one of two partial parts has defined accessibility
917 2007-09-14 Marek Safar <marek.safar@gmail.com>
921 * class.cs (TypeContainer): Set correct resolve context for all field
924 2007-09-13 Marek Safar <marek.safar@gmail.com>
926 * assign.cs: Fixed a crash when field is resolved twice with an error.
928 * codegen.cs: Changed InFieldInitializer to be flag.
930 * anonymous.cs, ecore.cs, expression.cs: Update after
931 IsInFieldInitializer rename.
933 * const.cs: Removed unused parameter.
935 * class.cs: Changed the way how we resolve and emit field initializers.
936 The field initilizers have to have access to contructor block to emit
937 compiler generated code.
939 2007-09-13 Marek Safar <marek.safar@gmail.com>
941 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
942 generics use TypeContainer instead.
944 2007-09-12 Marek Safar <marek.safar@gmail.com>
946 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
948 * lambda.cs (ResolveParameters): Use more powerful
949 InflateGenericArgument.
951 * parameters.cs: Better exception message.
953 2007-09-10 Marek Safar <marek.safar@gmail.com>
955 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
956 correct expression block type.
958 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
960 * expression.cs (Invocation): Extracted method group resolve to
963 2007-09-07 Marek Safar <marek.safar@gmail.com>
965 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
966 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
968 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
969 generic extension methods.
971 2007-09-06 Marek Safar <marek.safar@gmail.com>
973 A fix for bug #82676 (Do I get it right now?)
974 * convert.cs (Binary.ResolveOperator): An interface is converted to the
975 object before a standard conversion is applied.
977 2007-09-06 Marek Safar <marek.safar@gmail.com>
979 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
982 2007-09-05 Marek Safar <marek.safar@gmail.com>
985 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
986 non-generic interface types.
988 2007-09-05 Marek Safar <marek.safar@gmail.com>
991 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
993 2007-09-05 Marek Safar <marek.safar@gmail.com>
996 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
997 modifier for container based methods.
999 2007-09-05 Marek Safar <marek.safar@gmail.com>
1001 A fix for bug #82676
1002 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
1003 any interface-type T means to any of interface type T.
1005 2007-09-04 Marek Safar <marek.safar@gmail.com>
1007 * namespace.cs: We have 2 versions of System.Core assembly.
1009 2007-09-04 Marek Safar <marek.safar@gmail.com>
1011 A fix for bug #82652
1012 * class.cs (Class.GetClassBases): Compare types and not expressions.
1014 2007-09-04 Marek Safar <marek.safar@gmail.com>
1016 A fix for bug #82620
1017 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
1018 actually never worked before.
1019 (IndexerAccess): Emit prepared arguments before they are modified.
1021 2007-09-04 Marek Safar <marek.safar@gmail.com>
1023 A fix for bug #82563
1024 * assign.cs: Revert wrong fix.
1026 * expression.cs (VariableReference.EmitAssign): Handle ref reference
1028 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
1029 Instead of ldelema/stdind we have to use temporary variables to handle
1030 cases like String.Concat (params string[]).
1032 2007-08-31 Marek Safar <marek.safar@gmail.com>
1034 * class.cs: EmitAttributes to Emit rename.
1036 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
1038 (MemberCore.HasClsCompliantAttribute): Don't depend on
1039 GetClsCompliantAttributeValue execution.
1041 2007-08-31 Marek Safar <marek.safar@gmail.com>
1043 * anonymous.cs: Use shorter type prefix.
1045 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
1048 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
1049 variables when probing is on.
1051 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
1052 unresolved variables.
1053 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
1054 handle transparent identifiers.
1056 2007-08-26 Marek Safar <marek.safar@gmail.com>
1058 * attribute.cs (IsClsCompliant): Add nullable types test.
1060 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
1062 * doc.cs : catch other types of exception than XmlException to
1063 report CS1570. Fixed bug #82565.
1065 2007-08-23 Marek Safar <marek.safar@gmail.com>
1067 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
1068 The number of delegate parameters has to match.
1069 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
1072 2007-08-21 Marek Safar <marek.safar@gmail.com>
1074 * anonymous.cs (AnonymousMethod): Generate private anonymous method
1075 to fix problem with private arguments.
1077 2007-08-20 Marek Safar <marek.safar@gmail.com>
1079 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
1081 * decl.cs (MemberName): Ignore generic type with no generic arguments.
1083 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
1084 empty. Add cloning suport.
1086 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
1088 2007-08-20 Marek Safar <marek.safar@gmail.com>
1090 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
1091 to create EmptyCast. It handles EmptyConstantCast specialization for
1094 2007-08-18 Marek Safar <marek.safar@gmail.com>
1096 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
1097 (EmitArrayArgument): One routine for array arguments.
1098 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
1100 2007-08-17 Marek Safar <marek.safar@gmail.com>
1102 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
1104 2007-08-17 Marek Safar <marek.safar@gmail.com>
1106 * anonymous.cs: MemberLookupFinal update.
1108 * class.cs (ConstructorInitializer): Is expression based.
1110 * delegate.cs: MethodGroupExpr update.
1112 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
1114 (Error_MemberLookupFailed): Customizable error override.
1115 (MethodGroupExpr): Keep queried type for later usage.
1116 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
1119 * expression.cs: Error_MemberLookupFailed refactoring.
1120 (New.DoResolve): Resolve as much as possible.
1121 (ElementInitializer.Error_MemberLookupFailed): Object initializer
1122 customization for invalid member types.
1124 * statement.cs: MethodGroupExpr update.
1126 2007-08-16 Marek Safar <marek.safar@gmail.com>
1128 * modifier.cs (Check): Check all modifiers and not only accessibility
1131 2007-08-16 Marek Safar <marek.safar@gmail.com>
1133 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
1134 type and not an expression.
1136 2007-08-16 Marek Safar <marek.safar@gmail.com>
1138 * statement.cs (Catch.Clone): Type and variable can be null.
1140 2007-08-16 Marek Safar <marek.safar@gmail.com>
1142 A fix for bug #81979
1143 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
1144 I am really not sure whether this is the best fix.
1146 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
1149 2007-08-14 Marek Safar <marek.safar@gmail.com>
1151 ** C# 3.0 Object and collection initializers (major re-write)
1153 * assign.cs (DoResolve): Initializers are not assign related.
1155 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
1156 used during collection or object initialization.
1158 * expression.cs (Error_InvalidArguments): Add initializers specific
1159 messages. More will come later because it requires some general
1161 (New.DoResolve): Better error handling for unsafe types.
1162 (EmptyExpressionStatement): New class.
1163 (ElementInitializer): An object initializer expression.
1164 (CollectionElementInitializer): A collection initializer expression.
1165 (CollectionOrObjectInitializers): A block of object or collection
1167 (NewInitialize): New expression with element/object initializers.
1169 * statement.cs: Reverted object/collection initializer hacks.
1171 * typemanager.cs (CSharpName): Filter __arglist type.
1173 2007-08-09 Marek Safar <marek.safar@gmail.com>
1175 ** C# 3.0 Anonymous Types (update to the latest standard)
1177 * expression.cs (Binary.ResolveOperator): Threat all null based types
1179 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
1180 (AnonymousTypeParameter): Updated.
1182 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
1183 (AnonymousTypeClass): New anonymous type container.
1185 * class.cs (AddField): Return operation result.
1187 * generic.cs: Another empty TypeArguments overload.
1189 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
1190 are stored at top of normal hierarchy.
1192 * typemanager.cs (CSharpName): Filter anonymous types.
1194 2007-08-09 Marek Safar <marek.safar@gmail.com>
1196 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
1197 as single Concat call. How could we miss that :-(
1199 2007-08-08 Marek Safar <marek.safar@gmail.com>
1201 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
1203 2007-08-07 Miguel de Icaza <miguel@novell.com>
1205 * expression.cs: Fix the previous commit, the creation of the
1206 arguments array list needs also to be conditional on the arguments
1209 * class.cs: Add a little bit of help to help narrow down problems.
1211 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
1212 not try to copy in that case.
1214 * driver.cs: When building SMCS, include a new different set of
1215 default assemblies here. Do this here so we can control whether
1216 to include the default assemblies with /noconfig.
1218 2007-08-03 Marek Safar <marek.safar@gmail.com>
1220 A fix for bug #81979
1221 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
1224 2007-08-03 Marek Safar <marek.safar@gmail.com>
1226 A fix for bug #82300
1228 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
1229 we are in probing scope.
1231 2007-08-03 Marek Safar <marek.safar@gmail.com>
1233 A fix for bug #82301
1235 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
1236 (Statement.CloneTo): Clone and not map children blocks.
1238 2007-08-03 Marek Safar <marek.safar@gmail.com>
1240 A fix for bug #82299
1242 * expression.cs (LocalVariableReference.CloneTo): Remap local info
1245 * statement.cs (Statement.CloneTo): Clone variables before statements
1246 to allow remaping of local variables.
1248 2007-08-03 Marek Safar <marek.safar@gmail.com>
1250 A fix for bug #82296
1253 * report.cs: Log crash details for future clone problems.
1255 * statement.cs (Return.Clone): Don't clone non-existent expression.
1257 2007-08-03 Raja R Harinath <harinath@gmail.com>
1259 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
1260 (Class.AddBasesForPart): Move CS0537 check here from ...
1261 * cs-parser.jay (class_declaration): ... here. Move calling of
1262 'AddBasesForPart' to ...
1263 (class_bases): ... here.
1264 (struct_declaration, interface_declaration): Update to changes.
1266 2007-08-02 Marek Safar <marek.safar@gmail.com>
1268 A fix for bug #81923
1270 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
1271 conversion is allowed.
1273 2007-08-02 Marek Safar <marek.safar@gmail.com>
1275 A fix for bug #81564
1277 * ecore.cs (EventExpr): Add IsBase handling.
1279 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
1282 2007-08-02 Raja R Harinath <harinath@gmail.com>
1284 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
1285 * cs-parser.jay: Some whitespace cleanups.
1286 (current_delegate): New.
1288 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
1289 a dummy code block, and use 'type_name' instead of 'member_name'.
1290 (interface_declaration, class_declaration): Likewise.
1291 (delegate_declaration): Likewise. Rearrange slightly and use
1293 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
1294 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
1296 2007-08-02 Marek Safar <marek.safar@gmail.com>
1298 A fix for bug #82039
1300 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
1303 * typemanager.cs (CSharpName): Split to string overload.
1305 2007-08-02 Marek Safar <marek.safar@gmail.com>
1308 * report.cs: Updated warning CS0472.
1310 2007-08-01 Marek Safar <marek.safar@gmail.com>
1312 A fix for bug #82181
1314 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
1316 2007-08-01 Marek Safar <marek.safar@gmail.com>
1318 A fix for bug #82277
1319 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
1321 2007-08-01 Marek Safar <marek.safar@gmail.com>
1323 ** C# 3.0 Type Inference (major bits are working)
1325 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
1326 (.ImplicitStandardConversionExists): Uses compatible.
1327 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
1328 (.InferReturnType): New method.
1329 (.Compatible): Refactored.
1330 (.ResolveParameters): Uses factory to create resolved parameters.
1331 (.CompatibleMethod): Add probing mode support.
1332 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
1333 clearly distinguish between 2 different operations.
1334 (LambdaMethod): Moved to lambda.cs.
1335 (AnonymousMethod): Removed unused fields and methods.
1336 (AnonymousDelegate): Simplified.
1338 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
1340 * convert. cs (ImplicitConversionStandard): Compatible works differently.
1342 * delegate.cs (Delegate): New mehods to reduce code duplication.
1343 (.GetConstructor): New method.
1344 (.GetInvokeMethod): New method.
1345 (DelegateCreation): Updated.
1347 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
1349 (OverloadResolve): Made probing little bit faster.
1351 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
1354 * generic.cs (TypeInferenceContext): Dummy implementation.
1356 * iterators.cs: Updated after Resolve/Define rename.
1358 * lambda.cs (LambdaExpression)
1359 (.ResolveParameters): Handles both type of arguments and type inference too.
1361 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
1362 (InflateTypes): Updated.
1364 * support.cs (InflateTypes): Changed signature and updated.
1366 * typemanager.cs (LookupMemberCache): Better dynamic type check.
1367 (MemberLookup_FindMembers): More MS tricks.
1368 (GetParameterData): Ditto.
1369 (GetDelegateParameters): Uses quick path for dynamic types.
1371 2007-08-01 Marek Safar <marek.safar@gmail.com>
1373 * class.cs (MethodData.Define): EmitContext is required for generic stuff
1376 2007-07-31 Marek Safar <marek.safar@gmail.com>
1378 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
1381 2007-07-26 Jb Evain <jbevain@novell.com>
1383 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
1384 which takes a boolean 'report_errors', similar to the GetMethod.
1385 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
1386 in .net 2.1, do not report errors here.
1388 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
1389 System.Runtime.CompilerServices.RequiredAttributeAttribute and
1390 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
1393 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
1394 of the type InternalsVisibleToAttribute before the first call
1395 to CoreLookupType which is allowed to fail (third boolean parameter
1396 to true). Because, during the resolution for a type that is not
1397 immediately found, we try to check if the type is not defined in
1398 a friend assembly, and to do so, we need the
1399 InternalVisibleToAttribute.
1401 2007-07-23 Miguel de Icaza <miguel@novell.com>
1403 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
1404 feature that allows structs to be compared against null and inline
1405 the result as true or false.
1407 Notice that the same code is not permitted inside a generic block
1408 of code that would do:
1410 class Foo<T> where T : struct {
1417 It is only allowed if the type of T is not bound (no where
1418 clause). In my opinion, this CSC 2 behavior is broken but people
1419 seem to be using it (IronRuby does, a few bug reports on bugzilla
1420 have it and some people have complained about it).
1422 All of the users that depend on this behavior have code that is
1425 * report.cs (Warning, Error): make these take object arguments,
1426 not strings, as that allows us to take advantage of Format.
1428 2007-07-20 William Holmes <billholmes54@gmail.com>
1430 * decl.cs: Changed MemberName.CountTypeArguments to also check the
1431 Left member variable for the Count.
1432 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
1433 MemberName.CountTypeArguments to avoid a NRE.
1435 This code is contributed under the MIT X11 license
1437 2007-07-18 Marek Safar <marek.safar@gmail.com>
1439 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
1441 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
1443 * doc.cs : generic method arguments are written as ``x while generic
1444 type arguments are `x. Combined with the previous change, fixed bug
1447 2007-07-18 Raja R Harinath <rharinath@novell.com>
1450 * expression.cs (Binary.ResolveOperator): When converting
1451 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
1453 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
1455 * doc.cs : when T: or whatever x: is specified, it does not really
1456 check the doc comment's syntax correctness. Fixed bug #82006.
1458 2007-07-18 Marek Safar <marek.safar@gmail.com>
1460 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
1461 LambdaExpression better.
1463 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
1465 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
1467 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
1468 as it can be generated.
1470 * expression.cs (Invocation.Error_InvalidArguments): Show correct
1473 * lambda.cs (LambdaExpression): Refactored to share same code with
1474 AnonymousMethodExpression.
1476 2007-07-17 Marek Safar <marek.safar@gmail.com>
1478 * anonymous.cs (MakeName): Include host name for easier debugging.
1479 (LambdaMethod): New class for lambda spcecific stuff.
1481 * attribute.cs: Set EmitContext return type.
1483 * class.cs: Set EmitContext return type.
1485 * codegen.cs (EmitContext): Return type cannot be null to stop messing
1486 with null/void meaning.
1488 * iterators.cs (ContainerType): Implemented.
1490 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
1492 * statement.cs (Return): Updated to lambda expressions.
1493 (Block.CloneTo): Parent can be null.
1495 2007-07-13 Marek Safar <marek.safar@gmail.com>
1497 A fix for bug #81917
1498 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
1500 * class.cs (FixedField): Check whether field is in unsafe scope.
1502 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
1503 (FieldExpr.Emit): Fixed buffers cannot be volatile.
1505 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
1508 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
1510 2007-07-13 Marek Safar <marek.safar@gmail.com>
1512 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
1513 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
1516 2007-07-13 Marek Safar <marek.safar@gmail.com>
1518 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
1520 2007-07-13 Marek Safar <marek.safar@gmail.com>
1522 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
1523 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
1525 * codegen.cs(EmitContext): Add ProbingMode flag.
1527 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
1529 * driver.cs: For now set both warning values.
1531 * ecore.cs (SimpleName): Name is readonly.
1532 (MethodGroup.OverloadResolve): One quick path for probing.
1534 * expression.cs (Unary): Set Oper r/o.
1535 (Binary): Set Oper r/o.
1536 (ParameterReference): Set few instance variables as r/o.
1537 (ParameterReference.DoResolveBase): Don't capture aruments when
1539 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
1540 (Arglist): arguments are private.
1541 (SizeOf): type is private and r/o.
1542 (MemberAccess): arguments are private.
1544 * report.cs: Enhanced reporting on/off capabilities.
1546 * lambda.cs: Uses ec.IsInProbingMode.
1547 (ContextualReturn): Derives from return.
1549 * rootcontext.cs: For now set both warning values.
1551 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
1553 (Return.Resolve): Don't die immediately.
1554 (Block.Resolve): Speed-up probing.
1555 (Block.CloneTo): Clone only child blocks.
1557 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
1559 * iterators.cs: reverted Miguel's latest change (r81925) as it
1560 breaks the build in System.
1562 2007-07-13 Miguel de Icaza <miguel@novell.com>
1564 * iterators.cs (Yield.CheckContext): Check for the iterator type
1565 also here as we can call into Yield even in codepaths that are not
1567 (MethodOrOperator is the only path that was checked).
1569 In addition to the standard check, use a more specific check for
1570 constructors to report a more verbose error.
1572 2007-07-12 Miguel de Icaza <miguel@novell.com>
1574 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
1575 report the warning and continue
1577 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
1578 values on the stack on the call to Emit. Use EmitStatement if
1579 possible, or using Emit + Pop if not possible. Fixes #82064
1581 2007-07-12 Raja R Harinath <rharinath@novell.com>
1583 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
1584 avoid try...finally in some cases.
1586 2007-07-10 Marek Safar <marek.safar@gmail.com>
1588 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
1590 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
1591 instead of method. Re-use standard error handling.
1592 (ConstructorInitializer.Emit): Simplified.
1594 * delegate.cs: Updated after Invocation.EmitCall change.
1596 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
1597 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
1598 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
1599 method and don't permanently changing input arguments.
1600 (MethodGroupExpr): Introduced resolved best_candidate, when method group
1601 is resolved it has one of the candidates is the best one which is later
1602 used to emit. Removed a few unused method.
1603 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
1605 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
1606 (Binary.ResolveOperator): Ditto.
1607 (ConditionalLogicalOperator.DoResolve): Ditto.
1608 (Invocation): Uses method group.
1609 (Invocation.DoResolve): Simplified.
1610 (Invocation.EmitCall): Removed useless is_static.
1611 (Invocation.Emit): Delegate to method group.
1612 (Invocation.EmitStatement): Simplified.
1613 (New): Uses method group.
1614 (MemberAccess.DoResolve): Don't destroy original expression.
1616 * statement.cs (ForEach.Resolve): Use null for no method arguments.
1618 2007-07-04 Marek Safar <marek.safar@gmail.com>
1620 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
1623 * lambda.cs: Add custom error message type.
1625 2007-07-03 Marek Safar <marek.safar@gmail.com>
1627 * lambda.cs: Simplified little bit.
1629 * parameter.cs: Introduced ImplicitLambdaParameter.
1630 (Parameters.CreateFullyResolved): New factory instead of ctor.
1634 * delegate.cs: Updated parameter creation.
1636 2007-07-03 Marek Safar <marek.safar@gmail.com>
1638 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
1641 * generic.cs: Synchronized with gmcs.
1643 2007-07-03 Marek Safar <marek.safar@gmail.com>
1645 * class.cs (Indexer): Check return type as soon as possible.
1647 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
1650 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
1652 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
1654 * parameter.cs (Parameter): Use expression type when it is available.
1656 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
1657 method modifier for the first parameter only.
1659 2007-06-24 Marek Safar <marek.safar@gmail.com>
1661 A fix for bug #81938
1662 * typemanager.cs (ChangeType): Fixed couple of char conversions.
1664 * constant.cs: Tide up an exception message.
1666 2007-06-22 Marek Safar <marek.safar@gmail.com>
1668 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
1669 an uninitialized variable is used.
1671 * expression.cs (LocalVariableReference.DoResolve): Ditto.
1673 2007-06-22 Marek Safar <marek.safar@gmail.com>
1675 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
1676 not found error handling.
1678 * expression.cs (ArrayCreation): Removed redundant fields and little bit
1680 (ArrayCreation.ResolveArrayElement): To be ready to customization.
1681 (ArrayCreation.DoResolve): Simplified.
1682 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
1683 its own resolve process.
1684 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
1686 2007-06-20 Marek Safar <marek.safar@gmail.com>
1688 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
1691 2007-06-20 Marek Safar <marek.safar@gmail.com>
1693 * cs-tokenizer.cs: Removed var related stuff.
1695 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
1696 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
1697 a type and a keyword at same time.
1699 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
1702 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
1703 implicitly typed arrays, more changes will follow.
1705 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
1707 2007-06-19 Marek Safar <marek.safar@gmail.com>
1709 * ecore.cs (VarExpr): Removed Handled field.
1711 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
1712 build-in assign functionality.
1713 (ForEach.Resolve): Removed all implicitly typed local variable code and
1715 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
1716 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
1718 2007-06-18 Marek Safar <marek.safar@gmail.com>
1720 * assign.cs: Removed implicitly typed local variable check.
1722 * expression.cs (LocalVariableReference.DoResolve): Add check for self
1723 referencing implicitly typed local variable.
1724 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
1727 * statement.cs (Fixed): Removed unsupported implicitly typed local
1730 2007-06-15 Marek Safar <marek.safar@gmail.com>
1732 * decl.cs (MemberName): Moved all Unbound stuff to parser.
1734 2007-06-14 Marek Safar <marek.safar@gmail.com>
1736 A fix for bugs #81855 and #76274
1737 * attribute.cs (AttachTo): Always set owner for global attributes to
1740 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
1743 * cs-parser.jay: Assembly and module attributes must precede all other
1744 elements except using clauses and extern alias declarations.
1746 2007-06-13 Marek Safar <marek.safar@gmail.com>
1748 A fix for bug #81748
1750 * expression.cs: More checks for non ISO-1 features.
1752 2007-06-12 Marek Safar <marek.safar@gmail.com>
1754 A fix for bug #81807
1755 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
1756 present inside switch statement and it is required by nullable check.
1758 2007-06-12 Marek Safar <marek.safar@gmail.com>
1760 A fix for bug #81840
1761 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
1762 when type matching fails.
1764 * namespace.cs: Tiny error message change.
1766 2007-06-12 Marek Safar <marek.safar@gmail.com>
1768 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
1769 reporting. Added automatic property check.
1771 * class.cs: Updated after CheckAbstractAndExtern relocation.
1772 (AEventPropertyAccessor.GetSignatureForError): Customized.
1774 2007-06-11 Marek Safar <marek.safar@gmail.com>
1776 * class.cs (DefineBaseTypes): Base type can be undefined.
1778 * ecore.cs (TypeLookup): Minor refactoring.
1779 (DoResolveAsTypeStep): Removed redundant check.
1781 * namespace.cs (Lookup): Removed redundant check.
1783 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
1784 ResolveAsTypeTerminal step.
1785 (BootstrapCorlib_*): Simplified.
1786 (PopulateCoreType): Core types can be now external.
1788 2007-06-07 Marek Safar <marek.safar@gmail.com>
1790 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
1792 (InferTypeArguments): Infers anonymous expression type arguments.
1793 (Compatible): Split to Compatible and InferTypeArguments.
1795 * lambda.cs: Updated.
1797 2007-06-08 Marek Safar <marek.safar@gmail.com>
1799 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
1801 2007-06-07 Raja R Harinath <harinath@gmail.com>
1803 Fix #80477, cs0135-2.cs, cs0135-3.cs
1804 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
1805 names to the "known" variables list.
1806 (Block.CheckInvariantMeaningInBlock): Handle the fact the
1807 parameter names are also "known".
1808 (Block.CheckError136): Remove.
1809 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
1812 2007-06-07 Marek Safar <marek.safar@gmail.com>
1814 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
1816 2007-06-06 Marek Safar <marek.safar@gmail.com>
1818 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
1819 internal error not an user error.
1821 * expression.cs (IsApplicable): Refactored to make debugging easier.
1823 * support.cs: More tricks for non-mono runtimes.
1825 * typemanager.cs (CoreLookupType): Made public.
1826 (InitSystemCore): All linq specific stuff moved to linq.cs
1828 2007-06-05 Marek Safar <marek.safar@gmail.com>
1830 * typemanager.cs (CSharpSignature): One more missing build-in types
1832 More tricks for non-mono runtime.
1834 2007-06-05 Raja R Harinath <harinath@gmail.com>
1836 * statement.cs (Block.CheckError136_InParents): Remove.
1837 (Block.AddVariable): Use GetParameterInfo instead.
1838 (ToplevelBlock.ProcessArguments): Likewise.
1840 2007-06-04 Raja R Harinath <rharinath@novell.com>
1842 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
1844 (ToplevelBlock.GetParameterInfo): Split out of ...
1845 (ToplevelBlock.GetParameterRefernce): ... this.
1846 (ToplevelBlock.ParameterMap): Remove.
1847 * expression.cs (ParameterReference): Update to use
1848 ToplevelParameterInfo.
1850 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
1853 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
1854 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
1856 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
1857 (ToplevelBlock.ProcessParameters) ... here.
1858 (ToplevelBlock..ctor): Invoke it.
1860 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
1863 * statement.cs (IKnownVariable): New interface.
1864 (LocalInfo): Implement it.
1865 (ToplevelParameterInfo): New class.
1866 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
1867 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
1868 GetKnownVariableInfo.
1870 2007-06-03 Raja R Harinath <harinath@gmail.com>
1872 Partly speed up CS0136 error checks.
1873 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
1874 'recurse' parameter.
1875 (Block.DoCheckError136): Only check errors in parameters. Move
1876 local variable checks ...
1877 (Block.AddVariable): ... here, and ...
1878 (ToplevelBlock.ResolveMeta): ... here.
1880 2007-06-02 Raja R Harinath <harinath@gmail.com>
1882 * statement.cs (Block.IsChildOf): Remove.
1884 * statement.cs (Statement.Clone): Move special case code ...
1885 (Block.CloneTo): ... here.
1887 2007-05-29 Raja R Harinath <rharinath@novell.com>
1889 * statement.cs (ToplevelBlock.container): Remove field. It's
1890 redundant with 'Parent'.
1891 (ToplevelBlock.ContainerBlock): Remove accessor.
1892 (ToplevelBlock..ctor): Update to changes. Register anonymous
1893 child with parent here, ...
1894 * cs-parser.jay (end_anonymous): ... not here. Don't modify
1896 (start_anonymous): Don't save current_block.
1897 (top_current_block): Remove.
1899 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
1900 (Block.Resolve): Update to changes.
1901 (Block..ctor): Move setting of "correct" 'Toplevel'
1902 and 'Explicit' fields to ...
1903 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
1905 2007-05-27 Raja R Harinath <harinath@gmail.com>
1908 * statement.cs (Block.Implicit): Remove.
1909 (Block): Update to changes.
1910 * flowanalysis.cs: Likewise.
1912 Mildly speed up CheckInvariantMeaningInBlock
1913 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
1914 Recursively call AddKnownVariable to all enclosing blocks.
1915 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
1916 Remove recursive calls.
1917 (Block): Update to changes.
1919 New ExplicitBlock invariants
1920 * statement.cs (Block.Explicit): New field. It points to the
1921 immediately enclosing non-implicit block.
1922 (Block..ctor): Maintain the invariant.
1923 * cs-parser.jay: Take advantage of invariant.
1925 Introduce ExplicitBlock
1926 * statement.cs (ExplicitBlock): New.
1927 (ToplevelBlock): Derive from it.
1928 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
1930 (Block.Implicit): Update to changes.
1931 * cs-parser.jay: Update to changes.
1934 * codegen.cs (EmitContext.IsLastStatement): Remove.
1935 * statement.cs (Block.DoEmit): Update to changes.
1937 2007-05-25 Raja R Harinath <rharinath@novell.com>
1939 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
1940 modifying current_block directly.
1942 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
1944 * class.cs: Implemented automatic properties (C# 3.0)
1945 Thanks to Marek for the help.
1947 2007-05-23 Raja R Harinath <rharinath@novell.com>
1949 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
1950 variable as assigned, note also that all its components are
1952 (MyBitVector.SetRange): New. Function to set multiple bits to true.
1954 2007-05-19 Marek Safar <marek.safar@gmail.com>
1956 * anonymous.cs, class.cs: Emit Compiler generated attribute when
1957 member is marked as compiler generated.
1959 * decl.cs (MemberCore): Refactored ModFlags into property.
1961 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
1962 (Check): Check only accessibility modifiers.
1964 2007-05-18 Raja R Harinath <rharinath@novell.com>
1966 Track all assignable slots in one bit array
1967 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
1968 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
1969 logic from VariableMap constructor here. Use the same 'offset'
1970 variable that's later used for computing offsets of local
1972 * flowanalysis.cs (UsageVector.parameters): Remove.
1973 (UsageVector): Update to changes.
1974 (VariableMap): Remove.
1976 Avoid creating ParameterMap in every block
1977 * statement.cs (Block.ParameterMap): Move ...
1978 (ToplevelBlock.ParameterMap): ... here.
1979 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
1981 * flowanalysis.cs (FlowBranching.param_map): Remove.
1982 (FlowBranching.UsageVector): Update to changes.
1983 (FlowBranchingToplevel.CheckOutParameters): Likewise.
1985 * statement.cs (Block.CloneTo): Clone Toplevel field too.
1987 * expression.cs (ParameterReference): Distinguish between block
1988 where parameter was referenced and declared.
1990 2007-05-18 Marek Safar <marek.safar@gmail.com>
1992 * flowanalysis.cs, statement.cs: Put back improved error handling.
1994 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
1998 Imporved object and collection initialization (C# 3.0).
2000 2007-05-15 Marek Safar <marek.safar@gmail.com>
2002 A fix for bug #81380
2003 * expression.cs (Is.DoResolve): Only value types have constant `is'
2006 2007-05-15 Raja R Harinath <rharinath@novell.com>
2008 * statement.cs (ToplevelBlock.child): Remove.
2010 2007-05-15 Raja R Harinath <harinath@gmail.com>
2012 Rationalize ResolveMeta: refactoring
2013 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
2014 out constant handling code into ...
2015 (Block.DoResolveConstants): ... this.
2017 Rationalize ResolveMeta: kill local_map
2018 * statement.cs (Block.local_map, Block.LocalMap): Remove.
2019 (Block.AssignableSlots): New.
2020 (Block.ResolveMeta): Make protected. Don't create a VariableMap
2021 for locals -- move code from VariableMap here. Avoid unnecessary
2023 * flowanalysis.cs (FlowBranching.local_map): Remove.
2024 (FlowBranching..ctor): Use Block.AssignableSlots.
2025 (VariableMap): Remove unused constructors.
2027 2007-05-11 Raja R Harinath <rharinath@novell.com>
2029 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
2031 2007-05-11 Marek Safar <marek.safar@gmail.com>
2033 * typemanager.cs (IsFriendAssembly): Should not be called for building
2036 2007-05-09 Marek Safar <marek.safar@gmail.com>
2038 * literal.cs (NullConstant): Print null in all cases.
2040 * expression.cs (Binary.ResolveOperator): Implemented delegate
2041 comparison based on C# 2.0 changes.
2043 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
2045 This code is contributed under the MIT X11 license
2047 The following enables support for several C# 3.0 language features:
2049 * cs-tokenizer.cs: Added support for the "var" keyword.
2051 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
2052 Added VarExpr class to facilitate type inferencing.
2054 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
2055 to support anonymous types.
2057 * assign.cs: Added support for type inferencing and initialization.
2059 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
2061 * expression.cs: Added implicit array support to ArrayCreation.
2062 Added 5 types and 1 interface:
2064 IInitializable Implementing classes can inject initializing
2065 statements after object instantiation.
2067 Initializer Stores data for object initialization.
2069 AnonymousType An expression for anonymous types.
2071 AnonymousTypeParameter Stores data about an anonymous type's field.
2073 NewInitialize An expression for object initialization.
2075 CollectionInitialize An expression for collection initialization.
2077 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
2080 2007-05-06 Marek Safar <marek.safar@gmail.com>
2082 A fix for bug #81500
2083 * cs-tokenizer.cs: Add special handling for coalescing operator.
2085 2007-05-06 Marek Safar <marek.safar@gmail.com>
2087 A fix for bug #81529
2088 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
2089 its value from base class until it is redefined.
2091 2007-05-02 Raja R Harinath <rharinath@novell.com>
2093 Fix regression in cs0631-3.cs
2094 * cs-parser.jay (operator_declarator): Add opt_attributes to error
2095 fallback. Make error fallback catch more cases.
2097 2007-05-01 Miguel de Icaza <miguel@novell.com>
2099 * cs-parser.jay: Allow parameters in operator declarations to have
2102 2007-04-27 Miguel de Icaza <miguel@novell.com>
2104 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
2107 * lambda.cs (ContextualReturn.Resolve): An expression is valid
2108 inside the ContextualReturn, it does not have to be an
2109 ExpressionStatement.
2111 2007-04-24 Miguel de Icaza <miguel@novell.com>
2113 * lambda.cs (ContextualReturn.Resolve): if the return type is not
2116 2007-04-23 Miguel de Icaza <miguel@novell.com>
2118 * anonymous.cs (AnonymousContainer): split the virtual Resolve
2119 method in two methods: ResolveNoDefine and Resolve.
2121 ResolveNoDefine will stop just after ResolveTopBlock has been
2124 Resolve will then continue by creating a method and issuing the
2125 call to method.Define ().
2127 (AnonymousMethod): Split and implement the new Resolve and
2128 ResolveNoDefine as well.
2130 * lambda.cs (LambdaExpression): Split the anonymous method
2131 resolution code into a separate routine (CoreCompatibilityTest)
2132 from DoCompatibleTest.
2134 (LambdaExpression.TryBuild): New method, this method tries to
2135 build the LambdaExpression with the given set of types to be used
2136 as the types for the various parameters of the lambda expression.
2138 If the compilation succeed with the given types, the infered type
2139 of the Anonymous method is returned, otherwise null is returned.
2141 2007-04-23 Marek Safar <marek.safar@gmail.com>
2143 A fix for bug #81414
2144 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
2146 2007-04-22 Miguel de Icaza <miguel@novell.com>
2148 * cs-tokenizer.cs: Change various identifiers here from the
2149 camelCasing to the recommended Linux-like style for instance
2150 variables from the Coding Guidelines.
2152 2007-04-19 Martin Baulig <martin@ximian.com>
2155 (Convert.ImplicitReferenceConversionCore): Allow conversions from
2156 System.Enum to System.ValueType.
2158 2007-04-13 Martin Baulig <martin@ximian.com>
2160 Rewrote implicit reference conversions. We need to distinguish
2161 between implicit reference conversions (13.1.4) and implicit
2162 boxing conversions (13.1.5).
2164 According to the spec, there's an an implicit conversion
2165 "From a one-dimensional array-type S[] to IList<T> and base
2166 interfaces of this interface, provided there is an implicit
2167 reference conversion from S to T." Note that this does not
2168 include boxing conversions.
2171 (Convert.ImplicitTypeParameterBoxingConversion): New method.
2172 (Convert.ImplicitReferenceConversion): Split into
2173 ImplicitReferenceConversionCore() and
2174 ImplicitBoxingConversionExist().
2175 (Convert.ImplicitReferenceConversionExists): Use the new
2176 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
2178 2007-04-12 Martin Baulig <martin@ximian.com>
2180 * convert.cs (Convert.ImplicitReferenceConversion): Move the
2181 `TypeManager.null_type' checks up to the top of the method.
2183 2007-04-11 Marek Safar <marek.safar@gmail.com>
2185 A fix for bug #81350
2186 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
2189 2007-04-11 Martin Baulig <martin@ximian.com>
2191 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
2192 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
2193 to make this work for generic classes; fixes #79561.
2195 2007-04-11 Martin Baulig <martin@ximian.com>
2197 * expression.cs (As): Add support for nullable types; fixes #79371.
2199 2007-04-11 Martin Baulig <martin@ximian.com>
2201 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
2202 `type.FullName' is null; fixes #80243.
2204 2007-04-11 Martin Baulig <martin@ximian.com>
2206 * expression.cs (Invocation.IsApplicable): Don't modify the method
2207 if type inference succeeded, but the method was not applicable.
2210 2007-04-10 Marek Safar <marek.safar@gmail.com>
2212 A fix for bug #81324
2213 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
2214 internal and external namespaces containers.
2216 2007-04-10 Martin Baulig <martin@ximian.com>
2218 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
2219 TypeManager.DropGenericMethodArguments() so we also call
2220 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
2222 2007-04-10 Martin Baulig <martin@ximian.com>
2224 * iterators.cs (Iterator.CreateIterator): Don't crash if
2225 `method.ReturnType' is null. This happens if something went wrong
2226 while resolving that typ (we already reported an error in this case).
2228 2007-04-10 Martin Baulig <martin@ximian.com>
2230 * expression.cs (New.DoResolve): Don't call CheckComImport() on
2231 generic interfaces; report the CS0144 directly.
2233 2007-04-10 Martin Baulig <martin@ximian.com>
2235 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
2236 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
2238 2007-04-10 Martin Baulig <martin@ximian.com>
2240 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
2242 2007-04-09 Raja R Harinath <rharinath@novell.com>
2245 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
2246 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
2249 * statement.cs (For.Resolve): If resolution fails, use
2252 2007-04-08 Marek Safar <marek.safar@gmail.com>
2254 * anonymous.cs (MakeName): Make faster and zero-based.
2255 (VerifyExplicitParameterCompatibility): Back to mode where generic
2256 parameter is ignored.
2257 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
2259 * class.cs (EmitType): Method can emit another new method.
2261 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
2263 * driver.cs: Updated.
2265 * lambda.cs: Reuse predefined empty parameters.
2267 * parameter.cs: Updated
2269 * support.cs: Implemented InflateTypes.
2271 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
2272 (InitSystemCore): Introduced to isolate 3.0 dependencies.
2274 2007-04-03 Martin Baulig <martin@ximian.com>
2278 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
2279 version of TypeManager.IsOverride() which also works with generic
2282 2007-04-03 Martin Baulig <martin@ximian.com>
2287 (Convert.ExplicitReferenceConversion): We need to cast when
2288 converting from IList<T> to S[].
2290 2007-04-01 Marek Safar <marek.safar@gmail.com>
2292 * decl.cs (FindExtensionMethods): Consider all candidates with same name
2295 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
2297 2007-03-31 Marek Safar <marek.safar@gmail.com>
2299 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
2300 argument and return type inferring.
2302 * codegen.cs (InferReturnType): Flag whether return can be inferred.
2303 (ReturnType): Turned to property.
2305 * statement.cs (Return): Implemented return type inferring.
2307 * support.cs (ReflectionParameters): Use local types if possible.
2309 2007-03-30 Raja R Harinath <rharinath@novell.com>
2311 * flowanalysis.cs (FlowBranching.Reachability): Remove.
2312 (FlowBranching.UsageVector): Update to changes.
2314 Prepare to kill 'Reachability'
2315 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
2316 argument of constructor.
2318 2007-03-29 Raja R Harinath <rharinath@novell.com>
2320 Prepare to kill 'Reachability'
2321 * flowanalysis.cs (UsageVector.is_unreachable): New.
2322 (UsageVector): Update to maintain 'is_unreachable' in parallel to
2323 'reachability', and verify they're consistent.
2326 * expression.cs (New.EmitStatement): Handle type parameters here too.
2328 2007-03-29 Martin Baulig <martin@ximian.com>
2333 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
2334 CompilerGeneratedClass.
2335 (ScopeInfo.EmitScopeInstance): Make this protected.
2336 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
2337 `ec.CurrentAnonymousMethod.Scope == Scope'.
2339 * statement.cs (Block.ScopeInfo): Make this a property.
2341 2007-03-27 Raja R Harinath <harinath@gmail.com>
2343 Prepare to kill 'Reachability'
2344 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
2345 (FlowBranching.UsageVector.Reachability): Remove property.
2346 (FlowBranching.UsageVector.IsUnreachable): New property.
2347 (FlowBranching.UsageVector.ResetBarrier): New.
2348 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
2349 * codegen.cs, statement.cs: Update to changes.
2351 2007-03-27 Martin Baulig <martin@ximian.com>
2356 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
2359 2007-03-26 Raja R Harinath <rharinath@novell.com>
2361 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
2362 instead of TriState. Remove all mention of TriState.
2364 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
2365 replaced by a boolean. Add boolean 'is_unreachable' field, check
2366 and maintain invariants.
2368 2007-03-25 Marek Safar <marek.safar@gmail.com>
2370 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
2372 2007-03-25 Marek Safar <marek.safar@gmail.com>
2374 * expression.cs: Stop using obsolete 2.0 opcodes.
2376 2007-03-25 Marek Safar <marek.safar@gmail.com>
2378 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
2379 one of the latests Martin's fixes.
2381 2007-03-23 Miguel de Icaza <miguel@novell.com>
2383 * expression.cs: On BigEndian systems, swap the bytes, temporary
2384 solution until we get a new bitconverter class.
2386 2007-03-23 Martin Baulig <martin@ximian.com>
2390 * decl.cs (MemberCache.AddMembers): Add generic methods both as
2391 "Method" and "Method`1". Normally, a cache lookup is done on the
2392 "Method" form (ie. without the generic arity), but this one makes
2393 lookups on the full form work as well.
2395 2007-03-22 Raja R Harinath <rharinath@novell.com>
2397 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
2400 2007-03-20 Bill Holmes <billholmes54@gmail.com>
2402 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
2403 ordered_member_list, to TypeBuilder to store members to be defined
2404 in the order they were parsed in.
2405 - ordered_explicit_member_list contains all properties indexers
2406 and methods that are defined as explicit implementation of an
2407 interface or base class.
2408 - ordered_member_list contains all properties indexers and methods
2409 that are not defined as explicit implementation of an interface
2412 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
2413 functionality in these removed classes has been replaced with
2414 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
2415 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
2417 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
2418 to CheckForDuplications inside GetMethod and SetMethod Define Method
2419 to handle method property and indexer name conflicts.
2423 All code is contributed under the MIT/X11 license.
2425 2007-03-20 Martin Baulig <martin@ximian.com>
2427 * class.cs (TypeContainer.Interfaces): Removed; they're now
2428 included in `TypeContainer.Types'.
2430 2007-03-20 Martin Baulig <martin@ximian.com>
2432 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
2434 * class.cs (TypeContainer.CreateType): New public method. This is
2435 now called before DefineType() to create the TypeBuilders.
2436 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
2437 has already been created by CreateType().
2438 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
2439 don't resolve our base classes here; this has been moved into
2440 DefineBaseTypes(). We're now called from CreateType().
2441 (TypeContainer.DefineBaseTypes): New private method; resolve our
2442 base classes here. We're now called from DefineType().
2445 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
2446 our types first to create all the TypeBuilders. After that, call
2447 TypeContainer.DefineType() on all the types which'll resolve their
2448 base classes and setup the resolve order.
2450 2007-03-20 Martin Baulig <martin@ximian.com>
2452 * class.cs (TypeContainer.Enums): Removed; they're now included in
2453 `TypeContainer.Types'.
2455 2007-03-20 Martin Baulig <martin@ximian.com>
2458 (TypeContainer.DefineType): Don't call ResolveMembers() here.
2459 (TypeContainer.DoResolveMembers): Call DefineType() on our
2460 `compiler_generated' classes; moved here from DefineNestedTypes().
2463 (RootContext.ResolveTree): Call ResolveMembers() on all
2464 TypeContainer's in the `type_container_resolve_order'.
2466 2007-03-19 Marek Safar <marek.safar@gmail.com>
2468 * class.cs: Use corlib to handle InternalMethodImplAttribute.
2470 2007-03-17 Marek Safar <marek.safar@gmail.com>
2472 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
2473 implementation flags.
2475 2007-03-17 Marek Safar <marek.safar@gmail.com>
2477 * class.cs: More optimizations for type parameters.
2479 2007-03-15 Marek Safar <marek.safar@gmail.com>
2481 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
2483 * ecore.cs, parameter.cs: More common code for both corlibs.
2485 * typemanager.cs (IsGenericMethod): Simplified.
2487 2007-03-15 Raja R Harinath <rharinath@novell.com>
2489 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2491 * statement.cs, iterators.cs, lambda.cs: Update to changes.
2493 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
2494 unconditionally. Simplify explanation.
2495 (Try.Resolve, Using.Resolve): Likewise.
2497 2007-03-15 Martin Baulig <martin@ximian.com>
2501 * decl.cs (DeclSpace): If we're a partial class, use our
2502 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
2504 2007-03-15 Raja R Harinath <rharinath@novell.com>
2506 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2508 (FlowBranching.UsageVector): Update to changes.
2509 (FlowBranching.MergeSiblings): Likewise.
2510 * statement.cs: Likewise.
2512 2007-03-15 Martin Baulig <martin@ximian.com>
2517 (MemberCache): Added a special .ctor for type parameters.
2520 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
2523 2007-03-09 Martin Baulig <martin@ximian.com>
2525 * enum.cs (Enum): Make this a TypeContainer.
2526 (EnumMember): Derive from `Const'.
2529 (Const.DoResolveValue): New protected virtual method; move most of
2530 the functionality of ResolveValue() here so we can override it in
2532 (Const.CreateConstantReference): Make this virtual.
2534 * class.cs (Kind): Add `Kind.Enum'.
2535 (TypeContainer.Emit): Don't emit the enums here; they're already
2536 in the `RootContext.typecontainer_resolve_order'.
2538 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
2539 here; they're already in the `typecontainer_resolve_order'.
2541 * ecore.cs (EnumConstant.ConvertImplicitly): Add
2542 TypeManager.DropGenericTypeArguments().
2545 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
2546 (TypeManager.IsEnumType): Likewise.
2547 (TypeManager.EnumToUnderlying): Likewise.
2548 (TypeManager.IsEqual): Add support for enums.
2550 2007-03-12 Raja R Harinath <rharinath@novell.com>
2552 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
2553 DefaultParameterValueAttribute to be undefined, say if System.dll
2556 2007-03-11 Marek Safar <marek.safar@gmail.com>
2558 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
2561 2007-03-10 Marek Safar <marek.safar@gmail.com>
2563 * class.cs, parameter.cs: Unified parameters verification.
2565 2007-03-08 Martin Baulig <martin@ximian.com>
2567 * cs-parser.jay (constructor_header): Pass the location to the
2568 newly created TopLevelBlock.
2570 2007-03-07 Martin Baulig <martin@ximian.com>
2572 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
2574 2007-03-06 Miguel de Icaza <miguel@novell.com>
2576 * convert.cs (ExplicitReferenceConversionExists): Sync this method
2577 with the changes from David, fixes the build.
2579 2007-03-05 David Mitchell <dmitchell@logos.com>
2581 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
2582 and its base interfaces to a one-dimensional array type S[],
2583 provided there is an implicit or explicit reference conversion
2586 2007-03-03 Marek Safar <marek.safar@gmail.com>
2588 * cs-tokenizer.cs: Implemented basic linq grammar.
2590 * driver.cs: Set linq lang version on demand.
2592 2007-02-26 Marek Safar <marek.safar@gmail.com>
2594 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
2596 2007-02-25 Marek Safar <marek.safar@gmail.com>
2598 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
2601 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
2603 Check property and event extern attributes.
2605 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
2608 2007-02-24 Marek Safar <marek.safar@gmail.com>
2610 A fix for bug #80407
2611 * ecore.cs: Don't report ambiguity error when methods have same parent.
2613 2007-02-23 Marek Safar <marek.safar@gmail.com>
2615 A fix for bug #80878
2616 * class.cs, cs-parser.jay: Event property can host anonymous methods.
2618 2007-02-22 Marek Safar <marek.safar@gmail.com>
2620 * attribute.cs: Enable ExtensionAttribute presence test.
2622 2007-02-22 Marek Safar <marek.safar@gmail.com>
2624 * class.cs: Warn about missing GetHashCode only when Equals is override.
2626 * decl.cs: Check accessibility of type arguments.
2628 * typemanager.cs: Correctly report nullable array.
2630 2007-02-20 Marek Safar <marek.safar@gmail.com>
2632 * class.cs, report.cs: Capture more details when things go wrong.
2634 2007-02-20 Marek Safar <marek.safar@gmail.com>
2636 A fix for bug #80650
2637 * cs-parser.jay: Anonymous container starts at constructor declaration
2638 and not at block beginning because it has to be usable in constructor
2641 * statement.cs: Use context location and not block one for error reporting.
2643 2007-02-18 Marek Safar <marek.safar@gmail.com>
2645 A fix for bug #78712
2646 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
2649 2007-02-18 Marek Safar <marek.safar@gmail.com>
2651 A fix for bug #80493 by Atsushi Enomoto
2652 * cs-parser.jay: Ignore invalid attribute target.
2654 2007-02-18 Marek Safar <marek.safar@gmail.com>
2656 * cs-tokenizer.cs: Ignore '\0' as white space character.
2658 2007-02-17 Miguel de Icaza <miguel@novell.com>
2660 * cs-parser.jay: Add support for lambda expressions to the mcs
2663 * lambda.cs: Only clone when we are probing, not on the final call
2664 (Compatible is the final call).
2666 * statement.cs (CloneContext): Introduce class to provide block
2667 remapping during clone.
2669 All statements Clone themselves now.
2671 (Clone): special handling for blocks, when we clone a block, we
2672 register the block inside this routine, as children of the block
2673 might trigger a lookup.
2675 * expression.cs: Add support for CloneContext in all expressions.
2677 2007-02-17 Marek Safar <marek.safar@gmail.com>
2679 A fix for bug #80493
2680 * statement.cs: Report ambiguous warning when interfaces are not related.
2682 2007-02-15 Marek Safar <marek.safar@gmail.com>
2684 C# 3.0 extension methods.
2686 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
2687 cannot be used directly.
2689 * class.cs (Class.Emit): Emit extension attribute if any class method
2690 is extension method.
2691 (Method.Define): Add basic extension method validation conditions.
2692 (Method.Emit): Emit extension attribute for method.
2694 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
2695 extension method exists. Currently we follow same approach as Microsoft
2696 does, emit even if a method or a class are private but this can change
2699 * cs-parser.jay: Add handling of `this' keyword in method parameters
2702 * decl.cs (DeclSpace.IsStaticClass): New property.
2703 (MemberCache.FindExtensionMethods): Looks for extension methods with
2704 defined name and extension type.
2706 * doc.cs: Updated after OverloadResolve changes.
2708 * driver.cs: Add new soft reference to System.Core.dll.
2710 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
2711 (ExtensionMethodGroupExpr): Represents group of extension methods.
2713 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
2714 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
2715 to MethodGroupExpr and made non-static for easier customization.
2716 (Invocation.DoResolve): Add extension method lookup when no standard
2718 (MemberAccess.DoResolve): Try extension methods if no member exists.
2720 * modifiers.cs: Add METHOD_EXTENSION modifier.
2722 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
2723 as well as candidate extension type.
2724 (ComputeNamespaces): When assembly constains extension methods registers
2726 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
2727 extension method lookup.
2728 (Namespace.LookupExtensionMethod): Looks for extension method in this
2730 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
2731 find a method which matches name and extensionType.
2733 * parameter.cs (Parameter): Add This modifer.
2734 (HasExtensionMethodModifier): New property.
2735 (Resolve): Add extension parameter check.
2736 (ModFlags): turned to property to exclude this modifier as it is not real
2738 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
2740 * support.cs (ParameterData): Add ExtensionMethodType.
2741 (ReflectionParameters): Implemented ExtensionMethodType interface property.
2743 * typemanager.cs: Add type and ctor extension attribute type.
2745 2007-02-15 Miguel de Icaza <miguel@novell.com>
2747 * report.cs (DisableErrors, EnableErrors): used to prevent error
2748 output when we are "trying" to compile various methods with
2751 * ecore.cs (Expression): Add Clone method that calls the virtual
2752 CloneTo method. The current CloneTo method in Expression throws
2753 an exception so we can track down all the places where this must
2754 be implemented (not using abstract, because that would be a lot of
2755 up-front-work before we can start testing the implementation
2758 Important: we only need Clone capabilities for expressions created
2759 by the parser, as the expressions we will be cloning are
2760 expressions in the pre-resolved state. This vastly simplifies
2763 (SimpleName): Add CloneTo that does nothing.
2764 (EmptyCast): Add CloneTo.
2766 * expression.cs (Binary): Implement CloneTo.
2767 (Invocation.IsApplicable): Store the current ec in
2768 EmitContext.TempEc and restore it on return. This is used so we
2769 do not have to sprinkle hundres of methods with an extra
2770 EmitContext, we know that the only user is the lambda expression
2771 ImplicitConversionExists code.
2773 (Argument): Add Cloning capabilities.
2774 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
2775 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
2776 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
2777 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
2778 IndexerAccess): Add Clone capability.
2780 (LocalVariableReference, This): TODO: needs cloned Block mapping.
2782 (Argument): Add cloning capability.
2784 * assign.cs (Assign): Implement CloneTo.
2786 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
2788 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
2789 version by calling Convert with the EmitContext (that we are
2790 currently storing in ec, this is not great, but will do for now,
2791 to avoid passing EmitContext parameters to hundreds of functions
2792 that do not need them now).
2794 (SetExpression): Remove, it is not needed.
2796 (ContextualReturn): Implement CloneTo.
2798 * statement.cs (Statement): Implement cloning infrastructure,
2799 similar to expressions.
2801 (Block): Partial implementation of Clone for statements.
2803 (Return): Implement clone.
2805 * constant.cs (Constant.CloneTo): New method, does nothing.
2807 * codegen.cs (TempEc): Add a static EmitContext as a temporary
2808 solution, until we decide how to exactly do this.
2810 2007-02-14 Marek Safar <marek.safar@gmail.com>
2812 A fix for bug #80493
2813 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
2814 a property is override we need to use second accessor.
2816 2007-02-13 Marek Safar <marek.safar@gmail.com>
2818 A fix for bug #80418
2819 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
2822 2007-02-13 Marek Safar <marek.safar@gmail.com>
2824 Another fix for bug #80749
2825 * pending.cs: Abstract class has priority over interfaces.
2827 2007-02-13 Marek Safar <marek.safar@gmail.com>
2829 Another fix for bug #80749
2830 * pending.cs: Abstract class has priority over interfaces.
2832 2007-02-13 Marek Safar <marek.safar@gmail.com>
2834 Another fix for bug #80749
2835 * pending.cs: Abstract class has priority over interfaces.
2837 2007-02-13 Marek Safar <marek.safar@gmail.com>
2839 Another fix for bug #80749
2840 * pending.cs: Abstract class has priority over interfaces.
2842 2007-02-13 Marek Safar <marek.safar@gmail.com>
2844 * class.cs Better error message.
2846 * driver.cs: Add shorter versions of -optimize option.
2848 2007-02-13 Martin Baulig <martin@ximian.com>
2850 * class.cs (Constructor.Emit): Check the return value of
2851 ec.ResolveTopBlock() and return on error.
2853 2007-02-13 Raja R Harinath <rharinath@novell.com>
2855 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
2856 message to fix error message regression.
2858 2007-02-12 Marek Safar <marek.safar@gmail.com>
2860 * delegate.cs: Delegate creation expression cannot be of Nullable type.
2862 2007-02-12 Marek Safar <marek.safar@gmail.com>
2864 A fix for bug #80749
2865 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
2866 its parent container.
2868 * class.cs (DefineFieldInitializers): Each initializer can has different
2871 * const.cs: Updated.
2873 2007-02-11 Miguel de Icaza <miguel@novell.com>
2875 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
2876 now all the heavy lifting to check that embedded statements or
2877 expressions have the right form is done in the ContextualReturn.
2879 (ContextualReturn): New class.
2881 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
2882 method that can be invoked to report 201, so we do not replicate
2885 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
2887 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
2888 treating tabs as spaces.
2890 2007-02-09 Marek Safar <marek.safar@gmail.com>
2892 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
2893 * assign.cs: Use full implicit conversion for right side check.
2895 2007-02-09 Marek Safar <marek.safar@gmail.com>
2897 * statement.cs (Switch): Switch over boolean type is not standardized.
2899 2007-02-08 Marek Safar <marek.safar@gmail.com>
2901 A fix for bug #80755
2902 * decl.cs (FindBaseEvent): Don't use method cache for events.
2904 2007-02-07 Marek Safar <marek.safar@gmail.com>
2906 * cs-parser.jay: Better syntax error handling.
2908 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
2909 instead of underlying type value.
2911 2007-02-06 Marek Safar <marek.safar@gmail.com>
2913 * driver.cs: Check define identifier before is registered.
2915 * namespace.cs: Use existing error message.
2917 * report.cs: New warning.
2919 2007-02-06 Marek Safar <marek.safar@gmail.com>
2921 A fix for bug #80742
2922 * expression.cs: Delegate Invoke method can be called directly.
2924 2007-02-06 Marek Safar <marek.safar@gmail.com>
2926 A fix for bug #80676
2927 * class.cs (IsEntryPoint): The Main method can have params modifier.
2929 2007-02-04 Miguel de Icaza <miguel@novell.com>
2931 * parameter.cs (Parameter, Parameters): Add Clone method.
2933 * anonymous.cs (Compatible): Turn method into virtual method, so
2934 LambdaExpression can implement a different behavior.
2936 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
2937 out the basic checking here, so it can be used by
2940 * lambda.cs: Introduce "Compatible" function that will do the
2943 2007-02-02 Marek Safar <marek.safar@gmail.com>
2945 * attribute.cs: Unified one error message.
2947 * class.cs (Class): Use type attributes and not properties to test static
2949 (IsEntryPoint): Don's pass local variable.
2951 * convert.cs: Removed duplicate check.
2953 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
2955 * driver.cs: Don't crash when soft reference does not exist.
2957 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
2958 (UsingEntry): Removed redundant allocation.
2960 * parameter.cs: Add fast path for type parameters.
2962 * support.cs: Don't allocate attribute when it's not used.
2964 2007-01-30 Miguel de Icaza <miguel@novell.com>
2967 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
2968 this into a virtual method, so we can override it in LambdaExpression.
2970 * driver.cs: Improve diagnostics in case of failure.
2972 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
2973 write a function that is slightly more complex and that parses:
2975 type identifier [, type identifier]* )
2977 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
2980 (canEmpty ? i >= 0 : i > 0)
2982 2007-01-30 Raja R Harinath <rharinath@novell.com>
2984 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
2985 exception on possibly valid code.
2987 2007-01-29 Raja R Harinath <rharinath@novell.com>
2989 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
2991 (parse_opt_type_arguments): Remove. It's almost the same as
2993 (parse_namespace_or_typename): Use parse_less_than.
2995 2007-01-28 Miguel de Icaza <miguel@novell.com>
2997 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
2998 this bug took a few hours to find, because the state saved and
2999 restored by PushPosition and PopPosition was ignoring the state of
3000 parse_generic_less_than.
3002 I can also now remove the handling of OP_LT and OP_GT, this solves
3005 * cs-tokenizer.cs: store the location for the ARROW token, we use
3008 (PushPosition, PopPosition): save/restore also `current_token',
3009 restore `parse_generic_less_than' (was missing).
3011 (parse_opt_type_arguments): use parse_type, not
3012 parse_namespace_or_typename to parse types.
3014 * lambda.cs: Empty new file, will eventually have the lambda
3015 expression implementation.
3017 * lambda.test: used to test the internal tokenizer.
3019 * report.cs (FeatureIsNotISO1): Rename from
3020 FeatureIsNotStandardized, because it was about the language level
3021 (1 vs 2) it was not about standarization.
3023 (FeatureRequiresLINQ): New.
3025 * support.cs (SeekableStreamReader): Only require that the reader
3026 is a TextReader, not a StreamReader, so we can plug StringReader.
3028 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
3029 given position in the input stream the following tokens can be
3030 parsed as a type followed by an identifier.
3032 (is_punct): after a '(' if parse_type_and_parameter returns true,
3033 then return a special token OPEN_PARENS_LAMBDA which is used to
3034 avoid reduce/reduce errors in the grammar for the
3035 lambda_expression rules.
3037 (parse_type): implement a type parser inside the
3038 tokenizer, the parser only returns true or false depending on
3039 whether the input at a given position can be parsed as a type.
3041 (peek_token): new method used during type parsing.
3043 2007-01-28 Raja R Harinath <rharinath@novell.com>
3046 * anonymous.cs (ScopeInfo.InflateParameters): New.
3047 (AnonymousContainer.Resolve): Use it to redirect types of
3048 delegate parameters.
3050 2007-01-27 Raja R Harinath <rharinath@novell.com>
3053 * expression.cs (Error_InvalidArguments): Don't use two different
3054 messages for CS1503. Use ExtraInformation and
3055 SymbolRelatedToPreviousError instead.
3058 * decl.cs (DeclSpace.initialize_type_params): Don't access
3059 'type_params' of a partial class directly.
3061 2007-01-26 Miguel de Icaza <miguel@novell.com>
3063 * constant.cs: Removed a handful of out-of-range checks that were
3066 2007-01-25 Marek Safar <marek.safar@gmail.com>
3068 * expression.cs (CheckUselessComparison): Add additional check for char
3071 * namespace.cs: Fixed typo.
3073 2007-01-23 Miguel de Icaza <miguel@novell.com>
3075 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
3076 gone, instead we inline the test, preventing the needless casts to
3077 longs, ulongs and doubles for the parameters, avoiding calls to
3078 methods that overchecked stuff, and instead inlined things
3081 2007-01-20 Marek Safar <marek.safar@gmail.com>
3083 * cs-parser.jay: Better parameter error handling.
3085 2007-01-17 Marek Safar <marek.safar@gmail.com>
3087 A fix for bug #80368, #80522
3088 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
3089 whether array initializer contains constants only.
3090 (ArrayCreation.Emit): Use better formula to decide when
3091 are array initializers for static initialization.
3092 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
3093 have to emit even constants otherwise they are pre-initialized.
3095 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
3096 Raja R Harinath <rharinath@novell.com>
3098 Fix emit order of 'get' vs. 'set'.
3099 * support.cs (Accessors): New.
3100 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
3101 Note the order in which accessors are declared in the source.
3102 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
3103 Refactored from Property.Define and Indexer.Define.
3104 (PropertyBase.DefineAccessors): New helper that calls the above in
3105 appropriate order as noted by the parser.
3106 (Property.Define, Indexer.Define): Update to changes.
3107 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
3109 2007-01-17 Raja R Harinath <rharinath@novell.com>
3111 Fix cs0029-6.cs and gcs0029-2.cs (regression)
3112 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
3113 there's an implicit conversion from the current type to the target
3114 type before converting the underlying constant.
3116 2007-01-16 Marek Safar <marek.safar@gmail.com>
3118 * const.cs (ResolveValue): Updated after constant conversion was made more
3121 * constant.cs (GetAttributableValue): constant to object conversion is
3122 used for attributes only.
3123 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
3124 constant conversions.
3125 (LongConstant.ConvertImplicitly): Ditto.
3127 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
3128 (ImplicitConversionStandard): Handle constant conversion as extra step.
3129 It solves the issue when constant conversion was called indirectly like
3130 inside array initializer and constant folding was skipped.
3132 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
3135 * statement.cs(ImplicitConversionStandard): Updated after constant
3136 conversion was made more generic.
3138 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
3140 * expression.cs (As.DoResolve): Use GenericConstraints instead of
3141 Constraints, solves the problem where the compiler incorrectly
3142 reported that a type parameter was not constrained to a class (Bug
3145 2007-01-14 Marek Habersack <grendello@gmail.com>
3147 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
3149 2007-01-14 Marek Safar <marek.safar@gmail.com>
3151 A fix for bug #80368
3152 * assign.cs (FieldInitializer): New class implements field
3153 initializer statement.
3155 * attribute.cs: Update after FieldMember rename.
3157 * class.cs (PropertyBasedMember): New common class for property based
3159 (InterfaceMemberBase): New base class for all members which can be used as
3160 an interface members.
3161 (MethodCore): Moved really common code to InterfaceMemberBase.
3162 (Method.Define): Equal and GetHasCode detection is relevant for methods
3164 (MethodData.Define): Don't assume that public event implements an
3165 interface automatically.
3166 (MethodData.DefineMethodBuilder): Issue an error even if only extern
3168 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
3169 (FieldMember): Merged with FieldBase.
3170 (EventProperty.AEventPropertyAccessor): New specialization to check whether
3171 event extern modifier can be used.
3172 (EventField.EventFieldAccessor): Moved event field specific code here.
3173 (Event.AllowedModifiers): Even event can be extern.
3174 (Event.FindOutBaseMethod): New override specific to events.
3175 (Indexer.parameters): Reintroduce parameters because base class holds
3176 only properties common data.
3177 (Indexer.CheckForDuplications): Indexers are threated as methods so we
3178 need do extra parameters check.
3180 * const.cs: Update after FieldMember rename.
3182 * decl.cs (MemberCache.FindBaseEvent): New method.
3184 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
3185 to reflect that indexer is now derived from PropertyBased.
3187 * ecore.cs (GetMemberType): Made public.
3188 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
3191 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
3193 * typemanager.cs (CSharpSignature): Correctly print event accessors.
3194 (RegisterEvent): Removed.
3195 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
3196 (GetPrivateFieldOfEvent): Renamed to GetEventField.
3198 2007-01-11 Raja R Harinath <rharinath@novell.com>
3201 * statement.cs (CollectionForeach.TryType): Prefer generic
3202 GetEnumerator over non-generic variant. Fix code to follow comments.
3204 2007-01-09 Raja R Harinath <rharinath@novell.com>
3207 * support.cs (ReflectionParameter): Don't use an invalid index on
3208 the generic parameter data.
3210 2007-01-08 Miguel de Icaza <miguel@novell.com>
3212 * driver.cs: Just add a tiny bit of infrastructure.
3214 2007-01-02 Marek Safar <marek.safar@gmail.com>
3216 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
3217 where field type is struct from current assembly.
3219 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
3222 2007-01-02 Marek Safar <marek.safar@gmail.com>
3224 A fix for bug #80381
3225 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
3228 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
3230 (Namespace.LookupType): Always use core types from corlib when speficied.
3232 * report.cs: A new warning.
3234 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
3235 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
3236 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
3238 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
3239 (InitCoreTypes): Set expression type of object_type and value_type
3240 immediately after lookup.
3242 2007-01-01 Miguel de Icaza <miguel@novell.com>
3244 * cs-tokenizer.cs: Accept Pc class characters (Connector
3245 Punctuation) as valid identifiers. Fixes #78259
3247 * expression.cs (Invocation.DoResolve): Moved the check for the
3248 use of `this' for doing method calls to the Invocation resolution
3249 step, after overload resolution has taken place instead of doing
3250 the check at the low-level `This.DoResolve' level.
3252 The `This.DoResolve'(appens before overload resolution, so it has
3253 no way of knowing if the method that will be called will be
3254 instace or static, triggering an erroneous report for cs0188 (Bug
3257 We now do the check for instance method invocations after we know
3258 what method will be called.
3260 (This.CheckThisUsage): Move the actual use of this structure
3261 checking into its own method and expose it.
3263 * Everywhere that called Error_ValueCannotBeConverted: pass a new
3266 Exceptions: Null.ConvertImplicitly,
3267 Constant.ImplicitConversionRequired as there are too many call
3268 sites for passing the ec.
3270 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
3271 EmitContext, if the value is null, then we do not try to provide
3272 the extra information from the error (If a userdefined conversion
3273 exists, as UserDefinedConversion requires a non null-EmitContext).
3277 2006-12-30 Raja R Harinath <rharinath@novell.com>
3279 * flowanalysis.cs (MyBitVector): Document some invariants.
3280 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
3281 introduced below, and add a couple of others,
3283 2006-12-30 Marek Safar <marek.safar@gmail.com>
3285 * attribute.cs (GetMethodObsoleteAttribute): Uses new
3286 GetPropertyFromAccessor and GetEventFromAccessor.
3288 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
3289 overrides non-obsolete one.
3290 (Indexer.Define): Error message has been moved to the parser.
3292 * cs-parser.jay: Better syntax errors handling.
3294 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
3295 when an invocation has no arguments.
3297 * ecore.cs: Removed not used caching.
3299 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
3302 * report.cs: Add a new warning.
3304 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
3306 * typemanager.cs (enumeration_type): Removed.
3307 (CSharpSignature): Reuses IsSpecialMethod.
3308 (IsEqual): Hack for MS BCL.
3309 (GetPropertyFromAccessor): New method.
3310 (GetEventFromAccessor): New method.
3311 (IsSpecialMethod): Fixed to handle more cases.
3313 2006-12-30 Marek Safar <marek.safar@gmail.com>
3315 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
3316 Made white spaces array static.
3318 * ecore.cs (RemoveGenericArity): Optimized.
3320 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
3322 (MyBitVector.initialize_vector): Simplified.
3324 2006-12-22 Miguel de Icaza <miguel@novell.com>
3326 * ecore.cs: Am not entirely happy with this hack, but it seems to
3327 address the issue in 80257 (a small test case for
3330 I set the MethodGroupExpr.Type to an internal compiler type
3331 (itself in this case) to force the resolution to take place. Why
3332 it does not take place with a null is beyond me.
3334 2006-12-20 Marek Safar <marek.safar@gmail.com>
3336 A fix for bug #80288
3337 * expression.cs (ResolveOperator): Consider user defined conversion for
3338 logical and operator too.
3339 (EmitBranchable): Optimization for logical and when full constant folding
3340 could not be applied but one operand is constant.
3342 2006-12-19 Marek Safar <marek.safar@gmail.com>
3344 * class.cs (GetClassBases): Write 5 times every day, will never use
3345 FullName for error reporting.
3347 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
3349 2006-12-19 Martin Baulig <martin@ximian.com>
3351 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
3352 the symbol file info here.
3354 2006-12-18 Marek Safar <marek.safar@gmail.com>
3356 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
3357 of `elseif' is taking then following sections are not taking.
3358 Fixes an issue reported on mono mailing list.
3360 2006-12-18 Marek Safar <marek.safar@gmail.com>
3362 A fix for bug #80300
3363 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
3364 a caller is not taking.
3366 2006-12-18 Raja R Harinath <rharinath@novell.com>
3368 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
3369 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
3370 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
3371 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
3372 * class.cs: Update to changes.
3374 2006-12-17 Marek Safar <marek.safar@gmail.com>
3376 A fix for bug #79934
3377 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
3380 * class.cs (ResolveMembers): Register an iterator in current container and
3383 2006-12-16 Raja R Harinath <rharinath@novell.com>
3386 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
3387 satisfy a params annotated parameter.
3389 2006-12-16 Marek Safar <marek.safar@gmail.com>
3391 A fix for bug #77014
3392 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
3393 paramters correctly and not rely on hacks in Parameters class.
3394 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
3396 (Invocation.VerifyArgumentsCompat): Ditto.
3397 (Invocation.EmitArguments): Changed to correctly emit params arguments at
3400 * parameter.cs (HasParams): Don't assume that params is the last one.
3402 * support.cs (ReflectionParameters.ctor): Look for params attribute
3404 (ReflectionParameters.ParameterType): Removed hack when we returned last
3405 parameter for out of range parameters.
3406 (ParameterName, ParameterModifier): Ditto.
3408 2006-12-14 Marek Safar <marek.safar@gmail.com>
3410 A fix for bug #79987
3411 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
3412 when assembly is not CLS compliant but type is. I have no idea why is this
3415 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
3417 2006-12-13 Miguel de Icaza <miguel@novell.com>
3419 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
3420 in struct constructors, they are basically no-ops.
3422 2006-12-12 Marek Safar <marek.safar@gmail.com>
3424 * cs-tokenizer.cs (Position): Save preprocessor status too.
3426 2006-12-12 Marek Safar <marek.safar@gmail.com>
3428 A fix for bug #77794
3429 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
3431 2006-12-12 Marek Safar <marek.safar@gmail.com>
3433 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
3435 (pp_expr): Report error for an invalid expression.
3436 (handle_preprocessing_directive): Simplified; add more error checking.
3438 2006-12-11 Marek Safar <marek.safar@gmail.com>
3440 A fix for bug #74939
3441 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
3442 directives handling.
3444 2006-12-10 Marek Safar <marek.safar@gmail.com>
3446 A fix for bugs #80093, and #75984
3447 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
3448 logic, it seems to me as it worked before "by coincidence".
3449 (xtoken): Simplified to use reworked handle_preprocessing_directive.
3450 (cleanup): Enabled endif check.
3452 2006-12-09 Marek Safar <marek.safar@gmail.com>
3454 A fix for bug #80162
3455 * statement.cs (CollectionForeach.TryType): Generics and non-generics
3456 enumerators are never ambiguous.
3458 2006-12-08 Raja R Harinath <rharinath@novell.com>
3461 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
3463 2006-12-06 Marek Safar <marek.safar@gmail.com>
3465 A fix for bug #80144
3466 * class.cs (EventProperty.Define): Explicit implementation means
3467 that an even is used.
3469 2006-12-06 Marek Safar <marek.safar@gmail.com>
3471 Fixes the operators implementation (part II)
3473 * cfold.cs (DoConstantNumericPromotions): Renamed to
3474 DoBinaryNumericPromotions and simplified.
3475 (BinaryFold): Couple of conversion fixes; simplified.
3477 * constant.cs, ecore.cs, literal.cs
3478 (ToType): Renamed to ConvertImplicitly.
3479 (Reduce): Renamed to ConvertExplicitly.
3481 * class.cs, convert.cs: Updated.
3483 * expression.cs: TryReduce doesn't throw an exception.
3485 2006-12-01 Marek Safar <marek.safar@gmail.com>
3487 A fix for bug #80108
3488 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
3491 2006-11-30 Marek Safar <marek.safar@gmail.com>
3493 Fixes unary operators implementation (part I)
3496 * cfold.cs (Error_CompileTimeOverflow): Made internal
3498 * const.cs (IConstant): Changed to use reference to constant and
3499 not constant itself.
3500 Updated IConstant implementations.
3502 * constant.cs (CreateConstant): New factory method.
3503 Updated IConstant implementation.
3505 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
3507 * ecore.cs: Updated to use CreateConstantReference.
3509 * enum.cs: Reflects IConstant changes.
3511 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
3513 * literal.cs (NullConstant): Change to be independently usable.
3515 2006-11-29 Martin Baulig <martin@ximian.com>
3517 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
3518 we need to emit the scope initializer before calling the base .ctor.
3520 * anonymous.cs: Merged back from the new anonymous methods branch.
3521 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
3523 * expression.cs (ParameterReference.DoResolveBase): Create a
3524 "normal" ScopeInfo when capturing parameters rather than using the
3525 root scope; this makes things work with anonymous methods having
3529 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
3531 2006-11-22 Marek Safar <marek.safar@gmail.com>
3533 A fix for bug #79987
3534 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
3535 check to a base class.
3536 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
3537 only when assembly has missing attribute.
3538 * report.cs: Update.
3540 2006-11-21 Marek Safar <marek.safar@gmail.com>
3542 * cs-tokenizer.cs: Merged with gmcs version.
3544 2006-11-20 Marek Safar <marek.safar@gmail.com>
3547 * cs-parser.jay: Better error message when partial keyword is misplaced.
3549 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
3551 A fix for bug #79810
3552 report.cs: CS1058 only applies to 2.0 profile (gmcs).
3553 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
3554 a RuntimeWrappedException by default.
3556 2006-11-18 Marek Safar <marek.safar@gmail.com>
3558 A fix for bug #79843
3559 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
3561 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
3563 2006-11-18 Marek Safar <marek.safar@gmail.com>
3565 * driver.cs, namespace.cs: Uses faster IndexOf version.
3567 2006-11-17 Marek Safar <marek.safar@gmail.com>
3569 A fix for bug #79941
3570 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
3572 (Operator.Define): Implicit/Explicit operator of same type is duplicate
3573 even if internal name is different.
3574 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
3575 (UserDefinedConversion): Simplified as the operators cannot be internal.
3576 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
3578 (MethodLookup): Replaced EmitContext with parentType.
3579 * expression.cs: Updated.
3581 2006-11-09 Raja R Harinath <rharinath@novell.com>
3583 * driver.cs (BadAssembly): Handle all the ugliness of
3584 DefineDynamicAssembly.
3586 2006-11-08 Raja R Harinath <rharinath@novell.com>
3588 Address parts of #58244 -- most of what's left is in the runtime
3589 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
3590 CS1509 error checks, and handle them for all assembly loads, not
3591 just the first invocation.
3592 (LoadModule): Likewise. Move handling of 'adder_method' ...
3593 * codegen.cs (AssemblyClass.AddModule): ... here.
3595 2006-11-02 Marek Safar <marek.safar@gmail.com>
3597 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
3598 IEnumerable<T> is ambiguous.
3600 2006-10-31 Marek Safar <marek.safar@gmail.com>
3602 A fix for bug #67689
3603 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
3604 GetEnumerator is ambiguous.
3606 * report.cs: Add new warning.
3608 2006-10-29 Marek Safar <marek.safar@gmail.com>
3610 A fix for bug #78602
3611 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3612 to protected member can be nested type.
3614 2006-10-28 Marek Safar <marek.safar@gmail.com>
3616 A fix for bug #78965
3617 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3618 to protected member must derive from current type.
3620 2006-10-27 Marek Safar <marek.safar@gmail.com>
3622 assign.cs: Reuses error method.
3624 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
3625 instead of type for constants.
3626 (Expression.Error_ValueAssignment): Common error method.
3628 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
3631 2006-10-27 Marek Safar <marek.safar@gmail.com>
3633 A fix for bug #79081
3634 * expression.cs (MemberAccess.DoResolve): Check nested type
3637 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
3639 * doc.cs : nested delegates were not handled. Fixed bug #79754.
3641 2006-10-26 Marek Safar <marek.safar@gmail.com>
3643 A fix for bug #76591
3644 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
3646 2006-10-26 Marek Safar <marek.safar@gmail.com>
3648 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
3649 type forwarder of the same type multiple times.
3651 2006-10-26 Raja R Harinath <rharinath@novell.com>
3654 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
3655 instance as an rvalue, even when we later resolve as an lvalue.
3657 2006-10-25 Martin Baulig <martin@ximian.com>
3659 * anonymous.cs: Fix #79673.
3661 2006-10-24 Marek Safar <marek.safar@seznam.cz>
3663 A fix for bug #79666
3664 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
3665 ignored when is optimized (= default value) as its value is already set.
3667 2006-10-23 Marek Safar <marek.safar@seznam.cz>
3669 A fix for bug #79724
3670 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
3671 TypeContainer for type lookup.
3673 2006-10-23 Marek Safar <marek.safar@seznam.cz>
3675 A fix for bug #79231
3676 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
3677 * expression.cs (OverloadResolve): Always convert type name for
3679 (ResolveNamespaceOrType): Don't confuse a nested type with any
3682 2006-10-18 Martin Baulig <martin@ximian.com>
3684 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
3686 2006-10-17 Miguel de Icaza <miguel@novell.com>
3688 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
3689 an int32, but requesting an int64 from the conversion
3691 2006-10-12 Martin Baulig <martin@ximian.com>
3694 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
3696 2006-10-12 Martin Baulig <martin@ximian.com>
3699 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
3701 2006-10-11 Miguel de Icaza <miguel@novell.com>
3703 * convert.cs: Remove broken code: I was doing the "Existance"
3704 tests for Implicit conversions.
3706 2006-10-10 Miguel de Icaza <miguel@novell.com>
3708 * convert.cs: Added one missing case in
3709 ImplicitStandardConversionExists uint64 to intptr.
3713 * typemanager.cs (uintptr_type): another core known type.
3715 * ecore.cs (OperatorCast): routine used to do cast operations that
3716 depend on op_Explicit. We could change some of the Decimal
3717 conversions to use this.
3719 This one has a probe mechanism that checks both types for an op_
3720 which it coudl be used to eliminate two classes: CastToDecimal
3721 and CastFromDecimal.
3723 * convert.cs: Implement the conversions documented in #59800
3725 2006-10-10 Martin Baulig <martin@ximian.com>
3727 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
3728 before RootScope.ResolveMembers().
3730 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
3731 `CurrentType' if appropriate.
3733 2006-10-09 Marek Safar <marek.safar@seznam.cz>
3735 A fix for bug #78568
3736 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
3737 when contains binary operators.
3738 * cs-parser.jay: Updated.
3740 2006-10-09 Martin Baulig <martin@ximian.com>
3743 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
3744 moved that into Define() and also do the other type parameter
3745 checks there. Fixes #79094. Added gtest-292.cs.
3748 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
3749 since that doesn't include type parameters; don't use `Ldelema'
3750 for type parameters. Fixes #78980. Added gtest-293.cs.
3752 2006-10-08 Marek Safar <marek.safar@seznam.cz>
3755 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
3756 conversion is allowed.
3758 2006-10-06 Marek Safar <marek.safar@seznam.cz>
3760 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
3761 error reporting when no error occurs.
3763 2006-10-06 Marek Safar <marek.safar@seznam.cz>
3765 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
3768 2006-10-06 Raja R Harinath <rharinath@novell.com>
3771 * class.cs (DefineTypeBuilder): Check circular dependencies before
3772 setting the parent of the TypeBuilder.
3773 (CheckRecursiveDefinition): Don't use 'BaseType', since
3774 it may not be valid until after DefineTypeBuilder. Use
3775 'base_type' instead.
3777 2006-10-04 Martin Baulig <martin@ximian.com>
3779 Merged the Anonymous Methods patch.
3781 * anonymous.cs, iterators.cs: The new anonymous methods code.
3783 * statement.cs (Variable): New public abstract class.
3784 (LocalInfo.Variable): New public property.
3785 (LocalInfo.ResolveVariable): New public method.
3786 (Block.Flags): Add `IsIterator'.
3787 (Block.AddVariable): Improved the CS0136 check.
3788 (Block.AnonymousChildren): New public property.
3789 (Block.AddAnonymousChild): New public method.
3790 (ToplevelBlock): Update to use the new anonymous method framework.
3791 (ToplevelBlock.ctor): `container' is now a `Block' and not a
3792 `ToplevelBlock'; this is required to correctly implement the
3794 (Fixed, Using): Use `TemporaryVariable' instead of directly
3795 creating the `LocalBuilder'.
3797 * parameter.cs (Parameter.ResolveVariable): New public method.
3798 (Parameters.ResolveVariable): Likewise.
3800 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
3802 * class.cs (TypeContainer): Replaced the `iterators' list and
3803 corresponding methods with a list of `CompilerGeneratedClass'es.
3804 (TypeContainer.ResolveMembers): New public method.
3805 (Method): `IIteratorContainer' has been replaced by
3808 * expression.cs (VariableReference): New public abstract base
3809 class for `LocalVariableReference', `ParameterReference' and
3812 * codegen.cs (EmitContext): Removed `capture_context',
3813 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
3814 (EmitContext.EmitThis): Removed.
3816 * cs-parser.jay: Replace `iterator_container' with
3819 2006-10-04 Martin Baulig <martin@ximian.com>
3821 * generic.cs (GenericMethod): Don't make this abstract.
3822 (Constraints.Clone): Added dummy implementation.
3824 2006-10-04 Raja R Harinath <harinath@gmail.com>
3827 * namespace.cs (LookForAnyGenericType): Avoid nullref on
3828 'declspaces'. Avoid allocating arrays willy-nilly.
3831 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
3832 cases out of the switch.
3834 2006-09-28 Marek Safar <marek.safar@seznam.cz>
3836 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
3837 message when non-generic type is used with the type arguments.
3838 * expression.cs: Updated.
3840 2006-09-28 Raja R Harinath <rharinath@novell.com>
3843 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
3844 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3845 Change semantics slightly. Don't insist on having only one
3846 temporary EmptyExpression -- just throttle the creation of new ones.
3849 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
3850 non-interfaces too. If no methods are found, don't try to create
3853 2006-09-28 Marek Safar <marek.safar@seznam.cz>
3855 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
3858 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
3859 us produce better error message.
3861 2006-09-27 Marek Safar <marek.safar@seznam.cz>
3863 * expression.cs (Binary.ResolveOperator): Warn about a side effect
3864 of the `|' operator.
3866 * report.cs: A new warning added.
3868 2006-09-27 Martin Baulig <martin@ximian.com>
3870 * generic.cs (GenericMethod): Don't make this abstract.
3872 2006-09-27 Martin Baulig <martin@ximian.com>
3875 (InternalErrorException): Added overloaded ctor taking a params array.
3877 2006-09-26 Marek Safar <marek.safar@seznam.cz>
3879 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
3880 Fixed the cases when same error was reported twice.
3882 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
3883 now report symbol information.
3885 2006-09-25 Martin Baulig <martin@ximian.com>
3887 * class.cs: Completely unified with the gmcs version.
3889 2006-09-25 Martin Baulig <martin@ximian.com>
3891 * typemanager.cs (TypeManager.IsNullableType): New public function.
3892 (TypeManager.IsNullableTypeOf): Likewise.
3893 (TypeManager.IsNullableValueType): Likewise.
3895 * class.cs (MethodCore): Added the `GenericMethod' argument from
3896 gmcs and also unified all classes derived from `MethodCore' with gmcs.
3898 2006-09-24 Raja R Harinath <harinath@gmail.com>
3900 * convert.cs: Unify with gmcs version.
3902 2006-09-24 Marek Safar <marek.safar@seznam.cz>
3904 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
3905 verify them as well.
3907 * report.cs: New warning.
3909 2006-09-24 Marek Safar <marek.safar@seznam.cz>
3911 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
3912 for anonymous block with out argument.
3914 2006-09-24 Marek Safar <marek.safar@seznam.cz>
3916 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
3917 not used private events only.
3919 2006-09-23 Marek Safar <marek.safar@seznam.cz>
3921 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
3923 * const.cs (Const.Define): Check for constant type.
3924 (Const.IsConstantTypeValid): Looks for valid constant types.
3926 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
3928 * ecore.cs (EmptyConstantCast): New common class for all constant based
3931 * expression.cs (Is.DoResolve): Handle null constant especially.
3932 (New.DoResolve): Check for new void().
3933 (MemberAccess.DoResolve): Cope with all kind of nulls.
3935 * literal.cs (NullConstant): Uses EmptyConstantCast.
3936 (NullDefault): Based on EmptyConstantCast.
3937 (NullLiteral): Uses EmptyConstantCast.
3939 * statement.cs (Block.ResolveMeta): Check for constant type.
3941 2006-09-22 Martin Baulig <martin@ximian.com>
3943 * delegate.cs, attribute.cs: Merged with the gmcs versions.
3945 2006-09-22 Raja R Harinath <rharinath@novell.com>
3947 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
3951 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
3952 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
3955 2006-09-22 Martin Baulig <martin@ximian.com>
3957 * ecore.cs: Merged with the gmcs version.
3959 * generic.cs (ConstructedType): New dummy class.
3960 (TypeArguments): Don't make this abstract.
3963 (TypeManager.IsGenericTypeDefinition): New method.
3964 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
3966 2006-09-22 Raja R Harinath <rharinath@novell.com>
3968 * expression.cs (ComposedCast): Check for arrays of TypedReference
3969 before creating the type, not after.
3971 2006-09-21 Marek Safar <marek.safar@seznam.cz>
3973 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
3974 after ToType change.
3976 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
3977 when constant must be implicitly convertible.
3979 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
3981 * ecore.cs (NullCast): Derives from NullConstant.
3983 * expression.cs (Is.DoResolve): Removed useless variables.
3984 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
3985 (New.Constantify): Add enum support.
3986 (MemberAccess.DoResolve): Add warning when accessing null constant or
3989 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
3992 * literal.cs (NullConstant): New abstract class with common
3993 functionality for all null specializations.
3994 (NullDefault): Represents default(X) when result can be
3996 (NullLiteral): Updated.
3998 * report.cs: Add new warning.
4000 2006-09-21 Martin Baulig <martin@ximian.com>
4002 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
4004 2006-09-21 Martin Baulig <martin@ximian.com>
4006 * generic.cs (GenericConstraints): New dummy class.
4007 (Constraints): Likewise.
4008 (TypeParameter): Likewise.
4009 (TypeParameterName): Likewise.
4010 (GenericMethod): Likewise.
4012 * typemanager.cs (TypeManager.GetGenericArguments): New method.
4014 * decl.cs: Merged with the gmcs version.
4016 2006-09-21 Raja R Harinath <rharinath@novell.com>
4018 * generic.cs (TypeParameter): Implement IMemberContainer.
4019 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
4021 * rootcontext.cs: Unify with gmcs version.
4023 * report.cs: Unify with gmcs version.
4024 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
4025 from gmcs/generics.cs.
4026 * generics.cs (TypeParameter): New dummy class.
4028 * support.cs: Unify with gmcs version.
4030 2006-09-20 Raja R Harinath <rharinath@novell.com>
4032 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
4033 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
4035 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
4036 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
4037 * mcs.exe.sources: Add generic.cs.
4039 * codegen.cs: Unify with gmcs version.
4041 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
4042 (EmitContext): Add GenericDeclContainer implementation.
4043 * decl.cs (MemberCore, DeclSpace): Likewise.
4044 * namespace.cs: Remove #ifdef GMCS_SOURCE.
4046 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
4047 MCS TypeManager has a corresponding dummy method.
4049 2006-09-19 Martin Baulig <martin@ximian.com>
4051 * expression.cs: Completely merged with the gmcs version.
4053 2006-09-19 Martin Baulig <martin@ximian.com>
4055 * expression.cs (Invocation): Merged with the gmcs version.
4056 (ArrayAccess.GetStoreOpcode): Likewise.
4058 2006-09-19 Martin Baulig <martin@ximian.com>
4061 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
4062 (TypeManager.IsGenericMethodDefinition): Likewise.
4064 2006-09-19 Martin Baulig <martin@ximian.com>
4067 (TypeManager.IsEqual): Moved the gmcs implementation here.
4068 (TypeManager.DropGenericTypeArguments): Likewise.
4069 (TypeManager.DropGenericMethodArguments): Likewise.
4070 (TypeManager.GetTypeArguments): Moved here from gmcs.
4071 (TypeManager.HasGenericArguments): Likewise.
4073 2006-09-19 Martin Baulig <martin@ximian.com>
4075 * expression.cs (Binary): Merged with the gmcs version.
4077 2006-09-19 Martin Baulig <martin@ximian.com>
4079 * expression.cs (Probe, As, Is): Merged with the gmcs version.
4081 2006-09-19 Martin Baulig <martin@ximian.com>
4083 * typemanager.cs: Merged with the gmcs version.
4085 2006-09-16 Raja R Harinath <rharinath@novell.com>
4087 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
4088 * driver.cs: Likewise.
4090 2006-09-16 Marek Safar <marek.safar@seznam.cz>
4093 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
4094 only if parent type is class.
4095 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
4098 2006-09-15 Marek Safar <marek.safar@seznam.cz>
4101 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
4103 * typemanager.cs(CSharpName): Converts NullType to null.
4105 2006-09-15 Martin Baulig <martin@ximian.com>
4108 (TypeManager.GetMethodName): Added mcs implementation.
4109 (TypeManager.IsEqual): Likewise.
4112 (SimpleName.RemoveGenericArity): Added dummy implementation.
4114 * pending.cs: Merged with the gmcs version.
4116 2006-09-15 Martin Baulig <martin@ximian.com>
4118 * statement.cs: Merge with the gmcs version.
4120 2006-09-15 Martin Baulig <martin@ximian.com>
4122 * statement.cs (Switch): Merge with the gmcs implementation
4123 (without nullables), which is newer.
4125 2006-09-15 Martin Baulig <martin@ximian.com>
4127 * statement.cs (Block.Variables): Make this public.
4128 (ToplevelBlock.Parameters): Make this a property.
4129 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
4131 2006-09-15 Martin Baulig <martin@ximian.com>
4133 * namespace.cs: Merge with the gmcs version.
4135 2006-09-15 Martin Baulig <martin@ximian.com>
4137 * decl.cs (MemberName): Minor code cleanups.
4139 2006-09-15 Martin Baulig <martin@ximian.com>
4141 * parameter.cs: Merge with the gmcs version.
4143 2006-09-15 Martin Baulig <martin@ximian.com>
4145 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
4146 and an error in mcs.
4148 2006-09-15 Martin Baulig <martin@ximian.com>
4150 * flowanalysis.cs: Merged from GMCS; added the generics code into
4151 a `GMCS_SOURCE' conditional so we can share this file.
4153 2006-09-08 Martin Baulig <martin@ximian.com>
4155 * typemanager.cs (TypeManager.interlocked_type): New public field.
4156 (TypeManager.int_interlocked_compare-exchange): New public field.
4157 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
4158 enumerator types here and call InitGenericCoreTypes().
4159 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
4160 after calling InitEnumUnderlyingTypes().
4163 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
4164 `classes_second_stage'.
4166 2006-09-14 Marek Safar <marek.safar@seznam.cz>
4168 * assign.cs, ecore.cs, expression.cs: Share error message text.
4169 * class.cs (FieldMember.Define): Check for varible of static type.
4170 * driver.cs (LoadAssembly): Uses error output for errors.
4171 * statement.cs: Updated.
4173 2006-09-08 Marek Safar <marek.safar@seznam.cz>
4175 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
4178 2006-09-07 Martin Baulig <martin@ximian.com>
4181 (MainDriver): Revert r62663 from Marek; see #70506 for details.
4183 2006-08-29 Miguel de Icaza <miguel@novell.com>
4185 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
4187 2006-08-17 Miguel de Icaza <miguel@novell.com>
4189 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
4190 #52019 and #79064, the use of the \uXXXX sequence in source code
4191 to represent unicode characters.
4193 2006-08-15 Marek Safar <marek.safar@seznam.cz>
4195 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
4197 * class.cs, ecore.cs, statement.cs: Merged to one error message.
4199 2006-08-13 Miguel de Icaza <miguel@novell.com>
4201 * assign.cs: Catch attempts to assign to a method groups in += and
4204 2006-08-13 Marek Safar <marek.safar@seznam.cz>
4207 * cs-parser.jay: Don't destroy current array type by typeof of array's.
4209 2006-08-12 Marek Safar <marek.safar@seznam.cz>
4211 * class.cs (Method.Define): Issue a warning when generic method looks like
4213 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
4216 2006-08-09 Marek Safar <marek.safar@seznam.cz>
4218 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
4220 * decl.cs (MemberCache.FindMembers): When container is interface we need to
4221 search all base interfaces as a member can be ambiguous.
4222 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
4223 Constructor member type filter.
4224 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
4225 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
4226 reporting for returned memberinfos.
4227 * report.cs: Updated.
4228 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
4229 version to work on all runtimes.
4230 (TypeManager.RealMemberLookup): Removed members filtering.
4232 2006-08-08 Raja R Harinath <rharinath@novell.com>
4234 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
4235 (PropertyExpr.EmitAssign): Likewise.
4236 * expression.cs (Indirection.EmitAssign): Likewise.
4237 (LocalVariableReference.EmitAssign): Likewise.
4238 (ParameterReference.EmitAssign): Likewise.
4239 (Invocation.EmitArguments): Likewise.
4240 (ArrayAccess.EmitAssign): Likewise.
4241 (IndexerAccess.EmitAssign): Likewise.
4242 (This.EmitAssign): Likewise.
4243 (ConditionalLogicalOperator.Emit): Likewise.
4246 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
4247 instead of ArrayList. If the hashtable has a LocalBuilder, don't
4248 leave it in after returning it.
4249 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
4251 2006-08-06 Marek Safar <marek.safar@seznam.cz>
4253 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
4256 2006-08-03 Raja R Harinath <rharinath@novell.com>
4258 Fix cs0146-3.cs and cs0146-4.cs.
4259 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
4260 enclosing types don't depend on the current type.
4262 2006-08-02 Raja R Harinath <rharinath@novell.com>
4265 * class.cs (TypeContainer.DoDefineMembers): Use
4266 FindBaseMemberWithSameName on Parent, since we're interested in
4267 whether we hide inherited members or not.
4268 (FindBaseMemberWithSameName): Make slightly more robust.
4270 Fix the non-generic testcase from #77396
4271 * decl.cs (DeclSpace.DeclContainer): Remove override.
4273 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
4274 declspaces for doppelgangers too.
4275 (UsingEntry): Implement IResolveContext.
4276 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
4277 'this' as the resolve context.
4278 (LocalAliasEntry): Likewise.
4280 Implement parts of #77403
4281 * roottypes.cs (RootDeclSpace): New. Used to represent the
4282 toplevel declaration space. Each namespace declaration introduces
4283 a "partial" root declaretion space.
4284 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
4285 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
4286 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
4287 from 'current_namespace.SlaveDeclSpace'.
4288 (namespace_declaration): Likewise.
4289 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
4290 check. It can't happen now.
4291 * decl.cs (DeclSpace.LookupType): Likewise.
4292 * driver.cs (MainDriver): Sanity check.
4294 2006-08-01 Raja R Harinath <rharinath@novell.com>
4296 * decl.cs (DeclSpace.FindNestedType): Remove.
4297 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
4298 LookupTypeContainer to get the container of the nested type.
4299 * class.cs (TypeContainer.FindNestedType): Make non-override.
4301 2006-07-31 Raja R Harinath <rharinath@novell.com>
4303 * decl.cs (DeclSpace.PartialContainer): Move field from ...
4304 * class.cs (TypeContainer.PartialContainer): ... here.
4305 (TypeContainer.AddBasesForPart): New helper.
4306 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
4308 * cs-parser.jay (current_class): Convert to DeclSpace.
4309 (struct_declaration, interface_declaration, class_declaration):
4310 Use AddBasesForPart instead of .Bases directly.
4311 * const.cs, iterators.cs: Update to changes.
4313 2006-07-28 Raja R Harinath <rharinath@novell.com>
4315 * class.cs (TypeContainer.AddMemberType): Rename from
4317 (TypeContainer.AddMember): Rename from AddToMemberContainer.
4318 (AddTypeContainer): New. Combine AddClassOrStruct and
4320 (AddPartial): Update. Add 'is_partial' argument.
4321 * roottypes.cs: Update to changes.
4322 * cs-parser.jay (push_current_class): New helper for handling
4323 current_container and current_class.
4324 (struct_declaration, interface_declaration, class_declaration):
4327 2006-07-26 Raja R Harinath <rharinath@novell.com>
4329 * roottypes.cs: Rename from tree.cs.
4331 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
4332 * tree.cs (Tree, ITreeDump): Remove types.
4333 * rootcontext.cs (tree, Tree): Remove fields.
4334 (root, ToplevelTypes): New.
4335 * *.cs: Update to rename.
4337 * tree.cs (Tree.RecordDecl): Remove.
4338 (RootTypes.AddToTypeContainer): Record the toplevel type in its
4340 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
4342 2006-07-23 Raja R Harinath <harinath@gmail.com>
4344 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
4345 DoFlowAnalysis and OmitStructFlowAnalysis here.
4346 (ec.With): Rename from WithUnsafe and generalize.
4347 (ec.WithCheckState): Remove. All users can be handled by 'With'.
4348 (ec.WithFlowAnalyis): New.
4349 * ecore.cs, expression.cs, statement.cs: Update.
4351 2006-07-22 Raja R Harinath <harinath@gmail.com>
4353 * statement.cs (Block.ResolveMeta): Simplify slightly.
4355 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
4356 multiple boolean fields. Convert InUnsafe, constant_check_state,
4357 check_state to flags.
4358 (CheckState, ConstantCheckState): Update.
4359 (InUnsafe): New read-only property.
4360 (FlagsHandle): Rename from CheckStateHandle and convert to handle
4362 (WithUnsafe): New helper similar to WithCheckState.
4363 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
4364 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
4366 2006-07-21 Raja R Harinath <rharinath@novell.com>
4368 Make comparisons use the same IL irrespective of whether they're
4369 in a 'checked' or 'unchecked' context: one of the issues in #78899
4370 * codegen.cs (EmitContext.CheckState): Make read-only property.
4371 (EmitContext.ConstantCheckState): Likewise.
4372 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
4373 helper that implement a save/restore stack for CheckState
4374 values. This is the only way to change check-state.
4375 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
4376 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
4377 (CheckedExpr.EmitBranchable): New forwarding method.
4378 (UnCheckedExpr): Likewise.
4379 * statement.cs (Block.ResolveMeta): Use WithCheckState.
4380 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
4381 (Checked.Resolve, checked.DoEmit): Likewise.
4383 2006-07-20 Miguel de Icaza <miguel@novell.com>
4385 * anonymous.cs: Cache the resolved anonymous delegate, and return
4386 this so that the ResolveTopBlock is only triggered once, not
4389 Currently we trigger ResolvetopBlock twice due to a first pass of
4390 argument check compatibility, and a second pass that does the
4393 2006-07-15 Marek Safar <marek.safar@seznam.cz>
4395 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
4397 * rootcontext.cs (Reset): Add helper_classes.
4399 2006-07-15 Marek Safar <marek.safar@seznam.cz>
4402 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
4405 2006-07-13 Miguel de Icaza <miguel@novell.com>
4407 * statement.cs (Lock): Handle expressions of type
4408 TypeManager.null_type specially. Fixes #78770
4410 2006-07-08 Marek Safar <marek.safar@seznam.cz>
4412 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
4415 2006-07-08 Marek Safar <marek.safar@seznam.cz>
4417 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
4418 for accessors as well.
4419 * ecore.cs (EventExpr): Add AccessorTable.
4421 2006-07-01 Marek Safar <marek.safar@seznam.cz>
4424 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
4425 for CS0122 where appropriate.
4426 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
4428 (Filter): Assembly can be null in the case of top level attributes.
4430 2006-06-25 Marek Safar <marek.safar@seznam.cz>
4434 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
4435 is done at global level.
4437 2006-06-24 Marek Safar <marek.safar@seznam.cz>
4439 A fix for #77002, Implemented TypeForwarder support.
4441 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
4442 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
4443 * typemanager.cs (): Add type_forwarder_attr_type.
4445 2006-06-24 Marek Safar <marek.safar@seznam.cz>
4447 * report.cs: Add CS0469 warning.
4449 2006-06-21 Martin Baulig <martin@ximian.com>
4451 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
4452 the `try'-block, so we also report CS0016 etc. there.
4454 2006-06-21 Martin Baulig <martin@ximian.com>
4457 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
4459 2006-06-21 Martin Baulig <martin@ximian.com>
4461 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
4462 also report CS1686 for parameters.
4464 2006-06-21 Martin Baulig <martin@ximian.com>
4466 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
4467 instead of an error if the value is not implicitly convertible to
4468 the switch types; fixes #77964.
4470 2006-06-21 Raja R Harinath <rharinath@novell.com>
4473 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
4474 FieldBuilder is null.
4477 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
4478 'left' and 'right' before error-checking.
4480 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
4482 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
4484 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
4485 (FieldExpr.DoResolve): likewise.
4486 (PropertyExpr.InstanceResolve): likewise.
4487 (EventExpr.InstanceResolve): likewise.
4489 2006-06-04 Marek Safar <marek.safar@seznam.cz>
4491 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
4492 attribute applicable tests for attribute argument.
4494 2006-06-02 Raja R Harinath <rharinath@novell.com>
4497 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
4498 (Binary.OverloadResolve_PredefinedIntegral): New.
4499 (Binary.OverloadResolve_PredefinedFloating): New.
4500 (Binary.OverloadResolve_PredefinedString): New.
4501 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
4502 Follow the standard more closely, and treat numeric promotions in
4503 terms of overload resolution.
4504 (Binary.CheckShiftArguments): Simplify.
4506 2006-06-01 Raja R Harinath <rharinath@novell.com>
4508 * flowanalysis.cs (MyBitVector): Simplify representation.
4509 (MyBitVector.Clone): Avoid allocating BitArray.
4510 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
4511 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
4512 (*): Update. Change all references to MyBitVector.And and
4513 MyBitVector.Or to &= and |=.
4515 2006-05-29 Raja R Harinath <rharinath@novell.com>
4518 * cs-parser.jay (formal_parameter_list): Extend the pattern below
4519 to param arguments too.
4521 2006-05-26 Miguel de Icaza <miguel@novell.com>
4523 * cs-parser.jay: Catch another parsing form for arglist being
4524 followed by other arguments. Fixes #78313.
4526 2006-05-24 Raja R Harinath <rharinath@novell.com>
4528 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
4529 checking of out parameters to ...
4530 (FlowBranchingToplevel.Merge): ... here.
4531 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
4532 set, propagate the origin upward, and only complain if there was
4534 (FlowBranchingException.AddContinueOrigin): Likewise.
4535 (FlowBranchingException.AddReturnOrigin): Likewise.
4536 (FlowBranchingException.AddGotoOrigin): Likewise.
4538 2006-05-23 Raja R Harinath <rharinath@novell.com>
4540 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
4541 unreachable, skip it.
4542 (FlowBranchingException.Merge): Always propagate jumps, even if
4543 the finally block renders subsequent code unreachable.
4545 2006-05-18 Raja R Harinath <rharinath@novell.com>
4548 * statement.cs (Goto.Resolve): Move responsibility for resolving
4549 'goto' to FlowBranching.AddGotoOrigin.
4550 (Goto.SetResolvedTarget): New. Callback to set the
4551 LabeledStatement that's the target of the goto.
4552 (Goto.DoEmit): Use Leave instead of Br when crossing an
4553 unwind-protect boundary.
4554 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
4555 LookupLabel and adjust to new semantics.
4556 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
4557 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
4558 Goto.SetResolvedTarget to update target.
4559 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
4560 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
4561 AddBreakOrigin & co. Delay propagation until ...
4562 (FlowBranchingException.Merge): ... this.
4564 * statement.cs (Block.Resolve): Always depend on flow-branching to
4565 determine unreachability. Kill workaround that originally emitted
4566 only one statement after an "unreachable" label (see infloop in
4569 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
4570 This is still "wrong", but anything better would probably need a
4571 multi-pass algorithm.
4572 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
4573 usage vector. Force current usage vector to be reachable, to
4574 optimistically signify backward jumps.
4575 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
4577 (FlowBranchingLabeled.Merge): New. If no backward jump was
4578 detected, return the original salted-away usage vector instead,
4579 updated with appropriate changes. Print unreachable warning if
4581 * statement.cs (Block.Resolve): Don't print unreachable warning on
4582 a labeled statement.
4584 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
4586 * driver.cs: Pass filename without path to AssemblyBuilder's
4587 AddResourceFile. Fixes bug #78407.
4589 2006-05-17 Raja R Harinath <rharinath@novell.com>
4591 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
4592 * flowanalysis.cs (FlowBranchingLabeled): ... here.
4593 (FlowBranching.MergeChild): Overwrite
4594 reachability information from Labeled branchings too.
4596 2006-05-16 Raja R Harinath <rharinath@novell.com>
4598 * statement.cs (Goto.Resolve): Merge jump origins here ...
4599 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
4601 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
4602 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
4603 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
4604 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
4606 * statement.cs (Goto.Resolve): ... not here.
4607 (Goto.Emit): Remove CS1632 check.
4609 2006-05-14 Marek Safar <marek.safar@seznam.cz>
4611 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
4614 2006-05-11 Raja R Harinath <rharinath@novell.com>
4616 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
4617 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
4618 (FlowBranchingException.Label): Likewise.
4620 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
4622 (MyBitVector.Or): Use it to avoid losing information (Count).
4623 (FlowBranching.MergeOrigins): Likewise.
4625 * flowanalysis.cs (UsageVector.IsDirty): Remove.
4626 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
4627 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
4628 (UsageVector.ToString): Simplify.
4629 (UsageVector.MergeSiblings): Move here from ...
4630 (FlowBranching.Merge): ... here.
4631 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
4634 2006-05-10 Raja R Harinath <rharinath@novell.com>
4636 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
4637 null bitvector is treated as all-true.
4639 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
4640 (MyBitVector): Rationalize invariants. 'vector != null' implies
4641 that we have our own copy of the bitvector. Otherwise,
4642 'InheritsFrom == null' implies all inherited bits are true.
4644 2006-05-09 Marek Safar <marek.safar@seznam.cz>
4646 * statement.cs (LocalInfo): Add IsConstant.
4647 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
4648 local variable for constants.
4650 2006-05-09 Raja R Harinath <rharinath@novell.com>
4652 * flowanalysis.cs (MyBitVector.Empty): New.
4653 (MyBitVector): Don't allow InheritedFrom to be null.
4654 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
4655 (UsageVector, FlowBranching): Update to changes.
4657 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
4658 recursion. The 'Parent == null' condition isn't sufficient for
4660 (FlowBranching.AddBreakOrigin): Likewise.
4661 (FlowBranching.AddContinueOrigin): Likewise.
4662 (FlowBranching.AddReturnOrigin): Likewise.
4663 (FlowBranching.StealFinallyClauses): Likewise.
4664 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
4665 (FlowBranching.CheckOutParameters): Likewise.
4666 (FlowBranchingToplevel): Terminate all the above recursions here.
4667 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
4668 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
4670 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
4672 (FlowBranchingToplevel): New. Empty for now.
4673 (FlowBranching.MergeTopBlock): Update.
4674 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
4675 branching for the anonymous delegate.
4676 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
4678 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
4679 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
4680 information at the start of the merge. Reorganize.
4682 2006-05-07 Marek Safar <marek.safar@seznam.cz>
4684 * class.cs (MethodData.Define): Method cannot implement interface accessor.
4686 2006-05-07 Marek Safar <marek.safar@seznam.cz>
4688 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
4689 to newly introduced ctor.
4691 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
4692 message to one place.
4693 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
4696 2006-05-07 Marek Safar <marek.safar@seznam.cz>
4698 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
4700 * ecore.cs (Expression.ResolveAsConstant): Updated.
4702 * statement.cs (ResolveMeta): Updated.
4704 2006-05-06 Marek Safar <marek.safar@seznam.cz>
4706 * cs-parser.jay: __arglist cannot be used in initializer.
4708 2006-05-06 Marek Safar <marek.safar@seznam.cz>
4711 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
4714 2006-05-05 Raja R Harinath <rharinath@novell.com>
4716 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
4717 (LabeledStatement): Add 'name' parameter.
4718 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
4719 (Block.AddLabel): Update to changes.
4720 * cs-parser.jay (labeled_statement): Likewise.
4722 * flowanalysis.cs (BranchingType.Labeled): New.
4723 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
4724 (FlowBranchingLabeled): New. Does nothing for now, but will
4725 eventually handle 'goto' flows.
4726 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
4727 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
4728 that's terminated ...
4729 (Block.Resolve): ... here.
4731 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
4732 (UsageVector.MergeFinallyOrigins): Likewise.
4733 (FlowBranching.InTryOrCatch): Likewise.
4734 (FlowBranching.AddFinallyVector): Likewise.
4735 (FlowBranchingException): Update to changes.
4738 * statement.cs (Return.Resolve): Move error checking to ...
4739 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
4740 (FlowBranchingException): Handle return origins like break and
4742 (FlowBranching.UsageVector.CheckOutParameters): Remove.
4744 2006-05-04 Marek Safar <marek.safar@seznam.cz>
4747 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
4750 2006-05-04 Marek Safar <marek.safar@seznam.cz>
4753 * class.cs (MethodData.Define): Do public accessor check only when method
4754 implements an interface.
4756 2006-05-04 Raja R Harinath <rharinath@novell.com>
4758 Remove special handling of 'break'
4759 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
4760 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
4761 (UsageVector.Break): Remove.
4762 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
4764 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
4766 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
4767 UsageVector.Breaks (). Don't set NeedsReturnLabel.
4769 2006-05-03 Marek Safar <marek.safar@seznam.cz>
4772 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
4773 be the interface member.
4775 2006-05-03 Marek Safar <marek.safar@seznam.cz>
4778 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
4779 for emitting small (int) values.
4781 2006-05-03 Raja R Harinath <rharinath@novell.com>
4784 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
4785 control-flow passes through the 'finally' after merging-in all the
4786 control-flows from 'try' and the 'catch' clauses.
4788 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
4789 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
4790 always true at the only non-recursive entry point.
4791 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
4792 FlowBranchingBreakable.
4793 (FlowBranchingLoop): Remove.
4794 * statement.cs (Return.DoResolve): Update to changes.
4797 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
4798 (FlowBranching.CreateBranching): Handle it: create a
4799 FlowBranchingContinuable.
4800 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
4801 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
4802 except that it handles the 'continue' command.
4803 (FlowBranching.UsageVector.MergeOrigins): Rename from
4805 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
4806 except that it overrides AddContinueOrigin.
4807 (FlowBranchingException): Override AddContinueOrigin, similar to
4809 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
4810 Create a new branching around the embedded statement.
4811 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
4812 control flow after the embedded statement.
4813 (Continue.Resolve): Move all error checking to AddContinueOrigin.
4815 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
4816 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
4817 FlowBranchingBreakable.
4818 (FlowBranchingSwitch): Remove.
4821 * statement.cs (Break.Resolve): Simplify. Move responsibility for
4822 error reporting to ...
4823 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
4824 Rename from 'AddBreakVector'. Add new location argument. Return
4825 a bool indicating whether the 'break' crosses an unwind-protect.
4826 (FlowBranchingException.AddBreakOrigin): Add.
4827 (FlowBranchingException.Merge): Propagate 'break's to surrounding
4828 flowbranching after updating with the effects of the 'finally'
4830 (FlowBranchingBreakable): New common base class for
4831 FlowBranchingLoop and FlowBranchingSwitch.
4833 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
4835 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
4837 2006-05-02 Raja R Harinath <rharinath@novell.com>
4839 * statement.cs (Do.Resolve): If the loop is infinite, set the
4841 (While.Resolve, For.Resolve): Set a barrier after the embedded
4842 statement. There's no direct control flow that goes from the end
4843 of the embedded statement to the end of the loop.
4844 * flowanalysis.cs (FlowBranching.Infinite): Remove.
4845 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
4846 above ensure that the reachability is correctly computed.
4848 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
4849 (UsageVector.MergeBreakOrigins): If the current path is
4850 unreachable, treat it as if all parameters/locals are initialized.
4851 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
4852 infinite loops before merging-in break origins.
4854 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
4855 (Reachability.Reachable): Split part into ...
4856 (Reachability.Unreachable): ... this. Simplify.
4857 (Reachability.IsUnreachable): Use 'Unreachable' instead.
4859 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
4860 (Reachability.SetThrowsSometimes): Likewise.
4861 (FlowBranchingBlock.MergeTopBlock): Don't compare against
4862 TriState.Always, use corresponding property.
4863 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
4864 (Block.Resolve): Likewise. Remove some redundant checks.
4866 2006-05-02 Raja R Harinath <harinath@gmail.com>
4868 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
4869 (Reachability.Meet): Don't bother checking AlwaysThrows --
4870 barrier is always set.
4871 (FlowBranchingBlock.Merge): Likewise.
4873 2006-05-01 Raja R Harinath <harinath@gmail.com>
4875 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
4876 checks for unreachable.
4878 2006-05-01 Marek Safar <marek.safar@seznam.cz>
4881 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
4883 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
4884 whether field is really assigned.
4886 2006-04-30 Raja R Harinath <harinath@gmail.com>
4888 * flowanalysis.cs (Reachability): Make 4-argument constructor
4890 (Reachability.Meet): Rename from 'And'. Remove static variant.
4891 (Reachability.Always): Rename from the highly misleading
4892 'Reachability.Never'.
4893 (FlowBranching.Merge): Update to changes. Mark an impossible
4894 situation with a 'throw'.
4895 (*): Update to changes.
4897 2006-04-29 Raja R Harinath <harinath@gmail.com>
4899 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
4901 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
4902 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
4903 (*): Update to changes.
4904 * statement.cs: Update to changes.
4906 2006-04-28 Marek Safar <marek.safar@seznam.cz>
4909 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
4911 2006-04-28 Raja R Harinath <harinath@gmail.com>
4913 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
4916 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
4917 argument to two arguments: an usage-vector and a bool. Move call
4918 to FlowBranching.Merge () ...
4919 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
4921 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
4922 handling of loop and switch reachability to ...
4923 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
4925 2006-04-27 Raja R Harinath <harinath@gmail.com>
4927 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
4928 handling to FlowBranchingLoop.InLoop.
4929 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
4931 2006-04-26 Marek Safar <marek.safar@seznam.cz>
4934 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
4935 anonymous method is allowed from AnonymousContainer here.
4937 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
4939 2006-04-24 Raja R Harinath <rharinath@novell.com>
4942 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
4944 2006-04-23 Marek Safar <marek.safar@seznam.cz>
4947 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
4948 (DoubleConstant.Reduce): Ditto.
4950 2006-04-23 Raja R Harinath <rharinath@novell.com>
4952 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
4953 Remove 'lvalue_right_side' argument. Move parts to ...
4954 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
4955 (LocalVariable.DoResolveLValue): ... these.
4957 2006-04-21 Raja R Harinath <rharinath@novell.com>
4960 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
4961 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
4962 (LocalVariableReference.DoResolveBase): Use it to implement new
4964 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
4965 (Argument.Resolve): Simplify. Move CS1510 check ...
4966 * ecore.cs (Expression.ResolveLValue): ... here.
4967 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
4968 (PropertyExpr.DoResolveLValue): Likewise.
4969 (FieldExpr.Report_AssignToReadonly): Likewise.
4970 (FieldExpr.DoResolve): Add 'out_access' argument. Use
4971 LValueMemberAccess or LValueMemberOutAccess on instance depending
4973 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
4974 DoResolve as appropriate.
4976 2006-04-20 Raja R Harinath <rharinath@novell.com>
4979 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
4980 implicit conversions on 'out' and 'ref' arguments.
4982 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
4983 improve clarity. Remove dead code.
4986 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
4987 (Catch.Resolve): Resolve VarBlock if it exists.
4989 2006-04-19 Miguel de Icaza <miguel@novell.com>
4991 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
4992 twice, this was some residual code, the enumerator was emitted
4993 properly in the two branche of if later.
4995 2006-04-19 Raja R Harinath <rharinath@novell.com>
4997 * expression.cs (Cast.ResolveLValue): Remove. The result of a
4998 cast is never an lvalue.
4999 (Cast.DoResolve, Cast.ResolveRest): Combine.
5000 (Argument.Emit): Simplify slightly. Move 'Expr is
5001 IMemoryLocation' check ...
5002 (Argument.Resolve): ... here.
5003 (Argument.Error_LValueRequired): Remove. Inline into only user.
5005 Simplifications. Fix cs0191-2.cs
5006 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
5007 CS1649 and CS1651 to ...
5008 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
5009 the actual selection of the error code and message to a lookup
5010 table. Add a dummy return value to simplify callsites.
5011 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
5012 readonly fields of other instances of the same type. Move CS0197
5014 * expression.cs (Argument.Resolve): ... here. Simplify code.
5015 Ensure that ec.InRefOutArgumentResolving is only set during LValue
5016 resolution of an out or ref argument. The code simplification
5017 above uses this invariant.
5019 2006-04-18 Raja R Harinath <rharinath@novell.com>
5021 Possibly fix #77752. Fix cs1690-[4-7].cs.
5022 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
5023 CheckMarshallByRefAccess. Drop parameter.
5024 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
5026 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
5028 * report.cs (AllWarnings): Add CS1690.
5029 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
5031 (LocalVariableReference.DoResolveBase): Update.
5033 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5035 * class.cs (MethodOrOperator): Moved common parts from method class.
5036 detect obsolete attributes.
5037 (Method.Define): Simplified as it reuses code from base.
5038 (Constructor.ValidAttributeTargets): Fixed issue found during
5040 (Destructor.ValidAttributeTargets): Fixed issue found during
5042 (Operator): Finished refactoring set off by #78020. Operator class is now
5043 ordinary method class.
5045 * anonymous.cs: Updated.
5047 * decl.cs (DeclSpace): Add IsGeneric
5049 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5051 * class.cs (Constructor.Emit): Don't emit the attributes twice.
5053 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5055 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
5056 detect obsolete attributes.
5057 (Method.CreateEmitContext): Moved to MethodOrOperator.
5059 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5062 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
5063 customized exception to make crash detection easier.
5064 (MethodOrOperator): Started to work on new base class for methods and
5066 (Method): Derives from MethodOrOperator.
5067 (Constructor.Emit): Emits its own attributes.
5068 (AbstractPropertyEventMethod.Emit): Ditto.
5069 (Operator): Derives from MethodOrOperator, will refactor fully in extra
5071 (Operator.Emit): It's temporary more tricky than should be.
5073 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
5075 * report.cs (InternalErrorException): Add ctor with inner exception.
5077 2006-04-08 Marek Safar <marek.safar@seznam.cz>
5080 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
5083 2006-04-07 Marek Safar <marek.safar@seznam.cz>
5086 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
5089 2006-04-06 Marek Safar <marek.safar@seznam.cz>
5091 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
5092 attribute is present and Guid not.
5093 (Interface.ApplyAttributeBuilder): Ditto.
5095 * attribute.cs: Add error message.
5097 2006-04-06 Marek Safar <marek.safar@seznam.cz>
5101 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
5102 sources (it's composite) so hold them in extra array as they are used in
5103 Emit phase only. It worked in the previous versions by mistake.
5104 (Attribute.Emit): Emit attribute for more owners when exist.
5106 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
5107 it has now different behaviour.
5109 2006-04-04 Marek Safar <marek.safar@seznam.cz>
5111 * constant.cs (Constant.IsDefaultInitializer): New method.
5113 * class.cs: Updated.
5115 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
5116 re-initialize default values. It saves KBs almost for every assembly.
5117 Thanks Zoltan for the idea.
5118 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
5119 (ArrayCreation.DoResolve): Resolve only once.
5120 (ArrayCreation.Emit): Emit static initializer only when it is faster.
5121 (ArrayCreation.GetAttributableValue): Cope with optimized values.
5123 2006-04-03 Zoltan Varga <vargaz@gmail.com>
5125 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
5128 2006-04-01 Marek Safar <marek.safar@seznam.cz>
5130 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
5131 in an embedded statement too.
5133 2006-04-01 Raja R Harinath <rharinath@novell.com>
5136 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
5138 2006-04-01 Marek Safar <marek.safar@seznam.cz>
5142 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
5145 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
5147 2006-03-31 Marek Safar <marek.safar@seznam.cz>
5149 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
5152 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
5153 LocalTemporary change.
5155 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
5157 (ClassOrStruct.DefineFieldInitializers): Implemented static field
5158 initializers optimization.
5159 (ClassOrStruct.TypeAttr): Moved from modifiers.
5160 (Constructor.CheckBase): Don't crash when static ctor has parameters.
5161 (FieldBase.ResolveInitializer): Resolves initializer.
5162 (FieldBase.HasDefaultInitializer): New property.
5164 * cs-parser.jay: Removed message.
5166 * expression.cs (CompilerGeneratedThis): New specialization.
5168 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
5170 2006-03-28 Marek Safar <marek.safar@seznam.cz>
5172 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
5174 2006-03-27 Marek Safar <marek.safar@seznam.cz>
5176 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
5177 be now EnumConstants only.
5179 2006-03-27 Marek Safar <marek.safar@seznam.cz>
5181 * attribute.cs, driver.cs: Reset more caches.
5183 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5185 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
5187 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5189 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
5190 for easier reuse. Updated all overrides.
5191 (IntegralConstant): New base class for all integral constants.
5192 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
5193 of the constant range, report custom error.
5194 (UIntConstant.Reduce): Fixed uint conversion.
5196 * ecore.cs, literal.cs: Reduce updates.
5198 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5202 * class.cs (Constructor.Define): Removed extra if for default ctors.
5203 A patch from Atsushi Enomoto.
5205 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5207 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
5208 GetAttributableValue.
5210 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
5213 * convert.cs (ImplicitConversionRequired): Error message moved to
5216 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
5217 automatic implicit conversion of an output value.
5218 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
5220 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
5222 (TypeOf.GetAttributableValue): Add extra handling for object type.
5224 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
5225 special error message.
5227 2006-03-25 Marek Safar <marek.safar@seznam.cz>
5229 * class.cs (Constructor.Emit): Don't crash when struct ctor is
5231 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
5232 compatible with MS runtime.
5234 2006-03-23 Marek Safar <marek.safar@seznam.cz>
5236 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
5237 attribute arguments here.
5239 * class.cs (Indexer.Define): The check was moved to attribute class.
5241 2006-03-22 Marek Safar <marek.safar@seznam.cz>
5243 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
5244 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
5247 2006-03-22 Raja R Harinath <rharinath@novell.com>
5249 Support ParameterDefaultValueAttribute in gmcs. Also applied to
5250 mcs to keep code differences small.
5251 * attribute.cs (Attribute.GetParameterDefaultValue): New.
5252 * typemanager.cs (parameter_default_value_attribute_type): New.
5253 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
5256 2006-03-21 Marek Safar <marek.safar@seznam.cz>
5258 * expression.cs (StringConcat.Append): Reverted back to no warning state.
5260 2006-03-21 Marek Safar <marek.safar@seznam.cz>
5262 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
5264 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
5267 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
5269 * doc-bootstrap.cs : fix build.
5271 2006-03-20 Marek Safar <marek.safar@seznam.cz>
5273 * expression.cs (StringConcat.Append): Issue a warning when empty string
5276 2006-03-20 Marek Safar <marek.safar@seznam.cz>
5278 * assign.cs (CompoundAssign.ResolveSource): Removed.
5280 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
5283 * class.cs (TypeContainer.FindMethods): Removed.
5284 (TypeContainer.CheckMemberUsage): Made static.
5286 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
5288 * constant.cs (CheckRange): Removed unused type argument.
5289 (CheckUnsigned): Removed unused type argument.
5291 * cs-parser.jay: Updated after MemberAccess clean up.
5292 Uses Length for empty string test.
5294 * cs-tokenizer.cs: Uses Length for empty string test.
5295 (IsCastToken): Made static.
5296 (is_hex): Made static.
5297 (real_type_suffix): Made static.
5299 * decl.cs (SetupCache): Made static.
5300 (OnGenerateDocComment): Removed unused ds argument.
5302 * delegate.cs (VerifyDelegate): Removed unused argument.
5304 * doc.cs: Uses Length for empty string test.
5306 * driver.cs: Uses Length for empty string test.
5308 * enum.cs (IsValidEnumType): Made static
5310 * expression.cs (EnumLiftUp): Removed unused argument.
5311 (ResolveMethodGroup): Ditto.
5312 (BetterConversion): Ditto.
5313 (GetVarargsTypes): Ditto.
5314 (UpdateIndices): Ditto.
5315 (ValidateInitializers): Ditto.
5316 (MemberAccess.ctor): Ditto.
5317 (GetIndexersForType): Ditto.
5319 * flowanalysis.cs: (MergeFinally): Removed unused argument.
5321 * iterators.cs: Updated after MemberAccess clean up.
5323 * location.cs: Uses Length for empty string test.
5325 * namespace.cs: Uses Length for empty string test.
5327 * report.cs (CheckWarningCode): Made static.
5329 * statement.cs (LabeledStatement): Removed unused argument.
5331 * typemanager.cs (FilterNone): Removed.
5333 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5335 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
5338 * class.cs: Updated.
5340 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5342 * cs-parser.jay.cs: __arglist is not allowed for delegates.
5344 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5348 * expression.cs (VerifyArgumentsCompat): Reverted to double error
5349 reporting, it's more tricky than I thought.
5351 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5355 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
5357 (AnonymousMethod.ImplicitStandardConversionExists): New method.
5358 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
5359 Add more error reporting; Fixed issue with params.
5361 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
5363 * cs-parser.jay: AnonymousMethod requires host container.
5365 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
5367 2006-03-18 Raja R Harinath <harinath@gmail.com>
5369 * class.cs: Change 'TypeContainer ds' constructor argument to
5370 'DeclSpace parent'. Some classes were missed below due to
5371 different naming convention.
5373 * class.cs (MemberCore.Parent): Delete. This makes the
5374 ParentContainer changes below enforceable by the compiler.
5376 Treat pointers to enclosing declaration space as 'DeclSpace', not
5378 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
5379 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
5381 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
5383 (Block.AddThisVariable): Likewise.
5384 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
5385 (AbstractPropertyEventMethod.Emit): Likewise.
5386 (AbstractPropertyEventMethod.EmitMethod): Likewise.
5387 (GetMethod.Define, SetMethod.Define): Likewise.
5388 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
5389 (DelegateMethod.EmitMethod): Likewise.
5391 Fix regression test-partial-13.cs.
5392 Rationalize use of PartialContainer. Ensure that the partial
5393 class semantics can be tied to type-correctness, i.e., any
5394 violation will cause a compile error.
5395 * class.cs, const.cs: Access all fields that belong to class
5396 TypeContainer via ParentContainer. Arguments of EmitContexts and
5397 Resolve()-like functions still use 'Parent'.
5399 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
5400 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
5401 (PropertyMethod.CheckModifiers): Remove unused argument.
5402 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
5405 2006-03-17 Raja R Harinath <harinath@gmail.com>
5407 Make semantics of PartialContainer simpler.
5408 * decl.cs (DeclSpace.IsPartial): Remove.
5409 * class.cs (TypeContainer.IsPartial): Likewise.
5410 (TypeContainer..ctor): Set PartialContainer to point to self.
5411 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
5412 (TypeContainer.FindNestedType): Likewise.
5413 (MemberCore.ParentContainer): Simplify. Remove deprecation.
5415 2006-03-17 Marek Safar <marek.safar@seznam.cz>
5417 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
5419 2006-03-15 Marek Safar <marek.safar@seznam.cz>
5421 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
5424 2006-03-15 Marek Safar <marek.safar@seznam.cz>
5426 * class.cs (Operator.Define): An error for base conversion was not
5429 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
5431 * iterator.cs : yield break is allowed in try statement which has
5432 catch clauses. Fixed bug #77767.
5434 2006-03-13 Marek Safar <marek.safar@seznam.cz>
5436 A fix for #77593, #77574.
5438 * class.cs (MethodCore.CheckBase): Another if for operator.
5440 2006-03-09 Marek Safar <marek.safar@seznam.cz>
5442 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
5445 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
5446 (DelegateCreation.ImplicitStandardConversionExists): New method for just
5449 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
5452 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
5453 Updated after another emitcontext usage was clean up. It should help us to
5454 synchronize with gmcs easier.
5456 2006-03-04 Marek Safar <marek.safar@seznam.cz>
5460 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
5461 (Event.Define): ditto
5462 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
5464 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
5465 Removed redundant code and set NewSlot for Invoke method too.
5467 * parameter.cs (Parameters.ctor): Add custom, type ctor.
5468 (Parameters.MergeGenerated): New method. Use this method when you merge
5469 compiler generated argument with user arguments.
5471 2006-03-03 Marek Safar <marek.safar@seznam.cz>
5473 * attribute.cs (ResolveAsTypeTerminal): Removed.
5475 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
5476 specialization for predefined types; 30% speed up.
5477 Finally placed obsolete check to right place.
5478 (Expression.ResolveType): Removed.
5480 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
5481 Updated after ResolveType was removed.
5483 * expression.cs (Cast.ctor): Check void cast.
5484 (Binary.ResolveAsTypeTerminal): Is never type.
5485 (Conditional.ResolveAsTypeTerminal): Is never type.
5487 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
5489 2006-03-01 Raja R Harinath <rharinath@novell.com>
5492 * expression.cs (ParameterReference.DoResolveBase): Change return
5494 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
5498 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
5501 * typemanager.cs (GetFullNameSignature): Don't nullref on
5502 protected accessors.
5504 2006-02-27 Marek Safar <marek.safar@seznam.cz>
5506 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
5507 these two separated members to simplify the code.
5508 (Attribute.Resolve): Refactored to use new fields and methods.
5509 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
5510 implemented obsolete attribute checking.
5511 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
5512 implemented obsolete checking again. It look line never ending quest ;-)
5513 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
5515 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
5517 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
5519 *class.cs (Property.Define): Add RegisterProperty call.
5521 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
5522 argument groups (only 2).
5524 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
5525 encoding expression to arguments.
5526 (Expression.ExprClassToResolveFlags): Just turned to property.
5528 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
5529 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
5530 optimized as well as implemented support for zero-length attributes.
5532 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
5533 Add caching of PropertyInfo's.
5535 2006-02-25 Marek Safar <marek.safar@seznam.cz>
5537 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
5538 error multiple times.
5540 2006-02-25 Marek Safar <marek.safar@seznam.cz>
5542 New partial class implementation.
5543 A fix for #77027, #77029, #77403
5545 * attribute.cs (Attributable): Made attributes protected.
5547 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
5548 the replacements of ClassPart and PartialContainer.
5549 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
5550 (TypeContainer.AddInterface): Ditto.
5551 (TypeContainer.AddPartial): The main method for partial classes. It checks
5552 for errors and merges ModFlags and attributes. At the end class is added to
5554 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
5556 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
5557 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
5558 from the rest of partial classes.
5559 (TypeContainer.GetClassBases): Simplified.
5560 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
5562 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
5563 (TypeContainer.HasExplicitLayout): Uses Flags now.
5564 (PartialContainer): Removed.
5565 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
5566 (StaticClass): Was merged with Class.
5567 (Class.GetClassBases): class and static class bases are verified here.
5568 (Class.TypeAttr): Added static attributes when class is static.
5569 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
5570 (MemberBase): In some cases we need to call parent container for partial
5571 class. It should be eliminated but it's not easy now.
5573 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
5575 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
5576 partial classed to accumulate class comments.
5577 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
5579 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
5581 * driver.cs (MainDriver): Tree.GetDecl was removed.
5583 * modifiers.cs (Modifiers): Add partial modifier.
5585 * tree.cs (Tree.decl): Removed.
5586 (RootTypes): Started to use this class more often for root types
5589 2006-02-22 Marek Safar <marek.safar@seznam.cz>
5593 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
5594 external interface does not have an attribute.
5596 2006-02-22 Marek Safar <marek.safar@seznam.cz>
5598 Another prerequisites for new partial classs implementation.
5600 * attribute.cs (Attribute.Equal): Implemented.
5601 (Attribute.Emit): Changed as attributes can be applied more than twice.
5602 (Attributes.Emit): Check for duplicate attributes here.
5604 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
5605 as a parameter, clean-up.
5607 2006-02-11 Marek Safar <marek.safar@seznam.cz>
5611 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
5612 contains obsolete attribute check which can in some cases look for base
5613 type of current class which is not initialized yet.
5614 (TypeContainer.BaseType): Replacement of ptype.
5616 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
5618 2006-02-11 Marek Safar <marek.safar@seznam.cz>
5620 First of prerequisites for new partial classs implemention.
5622 * attribute.cs (Attributable): Extended by ResolveContext;
5623 Attributes finally have correct context for resolving in all cases.
5624 (AttachTo): Attribute owner is assigned here.
5626 * codegen.cs (IResolveContext): Introduce new interface to hold
5627 all information needed in resolving phase.
5628 (EmitContext): Implements IResolveContext; more clean-up needed here.
5630 * decl.cs (MemberCore): Implemented IResolveContext.
5632 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
5633 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
5634 parameter.cs, statement.cs, tree.cs, typemanager.cs:
5635 Refactored to use new IResolveContext instead of EmitContext; cleanup
5637 2006-02-06 Miguel de Icaza <miguel@novell.com>
5639 * codegen.cs (EmitScopeInitFromBlock): check here the
5640 capture_context, there is no need to make two calls to the
5643 * anonymous.cs: Add some debugging messages that might help me
5644 track other instances of this problem in the future (the
5645 regression of test 467).
5647 * cs-parser.jay: track the variable block, as we need to initalize
5648 any captured variables declared in this block for the "catch"
5649 portion of the "Try" statement.
5651 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
5652 scope initialization for captured variables.
5654 Also, move the emit for the variables after the block location has
5657 2006-02-06 Marek Safar <marek.safar@seznam.cz>
5659 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
5661 2006-02-02 Miguel de Icaza <miguel@novell.com>
5663 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
5664 commit yesterday, the initialization for the roots is necessary.
5665 What is not necessary is the scope activation.
5667 2006-02-02 Raja R Harinath <rharinath@novell.com>
5669 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
5670 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
5672 (Argument.Resolve): Remove CS0206 checks.
5674 2006-02-01 Miguel de Icaza <miguel@novell.com>
5676 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
5677 scopes for all the roots, the scopes will now be emitted when the
5678 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
5680 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
5681 code. This reduces a lot of existing cruft.
5683 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
5684 that the ScopeInfo is generated as we enter the scope, not at the
5685 time of use, which is what we used to do before.
5687 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
5688 every time a Block is about to be emitted if we have a
5691 2006-02-01 Raja R Harinath <rharinath@novell.com>
5693 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
5695 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
5697 * typemanager.cs (cons_param_array_attribute): Make private.
5698 (Reset): Set it to null.
5699 (InitCoreHelpers): Don't initialize it.
5700 (ConsParamArrayAttribute): New. Initialize it as needed.
5701 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
5703 2006-01-31 Miguel de Icaza <miguel@novell.com>
5705 * expression.cs: There might be errors reported during the
5706 selection of applicable methods. If there are errors, do not
5707 continue execution as it will lead the compiler to crash.
5709 2006-01-30 Miguel de Icaza <miguel@novell.com>
5711 * expression.cs: Member access is not allowed on anonymous
5712 methods. Fixes #77402.
5714 2006-01-30 Raja R Harinath <rharinath@novell.com>
5717 * cs-parser.jay (VariableDeclaration): Don't set
5718 current_array_type to null.
5719 (field_declaration, event_declaration, declaration_statement):
5720 Set it to null here.
5722 2006-01-28 Raja R Harinath <harinath@gmail.com>
5724 * typemanager.cs (GenericParameterPosition): New.
5727 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
5729 * doc.cs : To process "include" elements, first we should create
5730 another list than XmlNodeList, because it could result in node
5731 removal, which could result in that the XmlNodeList gives up
5734 (Also made code identical to gmcs again.)
5736 2006-01-25 Miguel de Icaza <miguel@novell.com>
5738 * ecore.cs: Introduce an error report that we were not catching
5739 before, if not silent, we must report the error. Gonzalo ran into
5742 2006-01-23 Miguel de Icaza <miguel@novell.com>
5744 A fix for bug: #76957
5746 * iterators.cs (MoveNextMethod.CreateMethodHost): call
5747 ComputeMethodHost before creating the method, this is a new
5750 * anonymous.cs (AnonymousContainer): Now we track all the scopes
5751 that this method references (RegisterScope). The actual scope
5752 where the method is hosted is computed with the ComputeMethodHost
5753 before we create the method.
5755 Moved the Deepest routine here.
5757 (AnonymousContainer.ComputeMethodHost): New routine used to
5758 compute the proper ScopeInfo that will host the anonymous method.
5760 (ScopeInfo): Deal with multiple roots. The problem was that we
5761 did not have a unique root where all ScopeInfos could be hanged
5762 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
5765 Remove AdjustMethodScope which is now computed at the end. Remove
5766 LinkScope which did a partial link, instead link all ScopeInfos
5767 before code generation from the new "LinkScopes" routine.
5769 Simplify all the Add* routines as they no longer need to maintain
5770 the tree, they just need to record that they are using variables
5773 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
5774 routines to produce the forest of ScopeInfo trees.
5776 * class.cs (TypeContainer.AppendMethod): This is just like
5777 AddMethod, but ensures that an interface implementation method
5778 (IEnumerable.XXX) is not inserted at the beginning of the queue of
5779 methods, but at the end.
5781 We use this functionality to ensure that the generated MoveNext
5782 method in the iterator class is resolved/emitted before the
5783 enumerator methods created.
5785 This is required because the MoveNext method computes the right
5786 ScopeInfo for the method. And the other methods will eventually
5787 need to resolve and fetch information computed from the anonymous
5790 2006-01-21 Raja R Harinath <harinath@gmail.com>
5791 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5794 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
5796 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
5797 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
5799 2006-01-18 Raja R Harinath <rharinath@novell.com>
5801 Fix #76656, cs0231-2.cs.
5802 * cs-parser.jay (formal_parameter_list): Make error case catch
5804 (parenthesized_expression_0): Add CS1026 check.
5805 (invocation_expression): Remove unused { $$ = lexer.Location }.
5807 2006-01-17 Raja R Harinath <rharinath@novell.com>
5810 * cs-parser.jay (statement_expression): Don't list out the
5811 individual statement-expressions. Convert syntax error into
5814 2006-01-16 Raja R Harinath <rharinath@novell.com>
5817 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
5818 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
5819 CheckIntermediateModification.
5820 (FieldExpr.DoResolve): Add new two-argument version that
5821 allows us to resolve the InstanceExpression as an lvalue.
5822 The one-argument variant is now just a wrapper.
5823 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
5824 Resolve the lhs as an lvalue if the it has a value type.
5825 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
5826 from Assign.DoResolve.
5827 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
5828 resolved as an lvalue.
5829 (PropertyExpr.DoResolve): Update.
5830 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
5831 has a value type. Move CS1612 check here from
5832 CheckIntermediateModification.
5833 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
5834 * expression.cs (EmptyExpression.OutAccess): New. Used as the
5835 'right_side' of a ResolveLValue on an 'out' argument.
5836 (EmptyExpression.LValueMemberAccess): New. Used as the
5837 'right_side' of a propagated ResolveLValue on a value type.
5838 (LocalVariableReference.DoResolveBase): Recognize
5839 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
5841 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
5842 EmptyExpression.Null.
5844 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
5846 * typemanager.cs : added IsGenericParameter(). In mcs it always
5848 * doc.cs : for generic parameters, use GenericParameterPosition,
5851 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
5853 * expression.cs: Fix Console.WriteLine ((this = x).foo);
5855 2006-01-12 Miguel de Icaza <miguel@novell.com>
5857 This fixes the problem where we used ldfld instead of ldflda to
5858 load the "THIS" pointer on captured parameters, when THIS is a
5859 value type. See bug #77205.
5861 * iterators.cs (CapturedThisReference.Emit): Pass false to
5862 EmitThis (we do not need the address).
5864 * codegen.cs (EmitThis): it needs to know whether we need the
5865 address of `this' or not. This is used by value types.
5867 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
5868 every other call passes false.
5870 2006-01-12 Raja R Harinath <rharinath@novell.com>
5873 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
5875 * expression.cs (Invocation.OverloadResolve): Update.
5876 (Invocation.DoResolve): Avoid double resolution of invocation.
5878 2006-01-11 Raja R Harinath <rharinath@novell.com>
5881 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
5882 unary negation of floating point types as 0-expr; negation cannot
5883 overflow in floating point types.
5886 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
5887 on operands of 'void' type.
5890 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
5891 and ExclusiveOr for boolean constants too.
5893 2006-01-09 Raja R Harinath <rharinath@novell.com>
5896 * expression.cs (Invocation.OverloadResolve): Replace reflected
5897 override methods with their base virtual methods, rather than
5899 * typemanager.cs (TypeManager.GetOverride): New.
5901 2006-01-05 Jb Evain <jbevain@gmail.com>
5903 * class.cs (Property.Define, Indexer.Define): do not tag the
5904 properties as SpecialName | RTSpecialName.
5906 2006-01-04 Miguel de Icaza <miguel@novell.com>
5908 * class.cs (MethodCore.IsDuplicateImplementation): This method was
5909 doing a low-level comparission of parameter types. It was lacking
5910 a check for __argslist.
5912 2005-12-30 Miguel de Icaza <miguel@novell.com>
5914 * expression.cs (ParameterReference.DoResolveBase): Allow
5915 reference parameters if they are local to this block.
5917 This allows the ref and out parameters of a delegate to be used in
5918 an anonymous method, for example:
5920 delegate void set (out int x);
5922 set s = delegate (out int x){
5926 This is used by functionality introduced late in the C# language.
5928 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
5929 method that take ref and out parameters.
5931 Fixes #77119 which was a late change in the spec.
5933 2005-12-23 Miguel de Icaza <miguel@novell.com>
5935 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
5936 parent if its the same scope. Fixes #77060.
5938 2005-12-21 Miguel de Icaza <miguel@novell.com>
5940 * driver.cs: Report the case of no source files and no -out:
5943 2005-12-20 Raja R Harinath <rharinath@novell.com>
5946 * expression.cs (ComposedCast.GetSignatureForError): Define.
5948 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5952 * namespace.cs (NamespaceEntry): Add extern_aliases as a
5953 ListDictionary, to contain the ExternAliasEntry entries (in
5954 addition to the NamespaceEntry.aliases hashtable). This field is
5955 shared between the original entry and its doppelganger (bodyless
5957 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
5958 extern_aliases field.
5959 (NamespaceEntry.Lookup): Move the IsImplicit check after the
5960 lookup in extern_aliases.
5962 2005-12-16 Raja R Harinath <rharinath@novell.com>
5965 * class.cs (TypeContainer.Mark_HasEquals): New.
5966 (TypeContainer.Mark_HasGetHashCode): New.
5967 (ClassPart): Override them.
5968 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
5971 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
5972 'parent' argument to the base constructor.
5974 Remove all mention of TypeContainer from decl.cs.
5975 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
5976 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
5977 (DeclSpace.DeclSpace): Likewise.
5978 (DeclSpace.DefineMembers): Remove unused argument.
5979 * cs-parser.jay (pop_current_class): Update to changes. Simplify
5980 debugging check -- we don't care if the debug code throws an
5981 InvalidCastException instead of an InternalErrorException.
5982 * class.cs (TypeContainer.DefineMembers): Update to changes.
5983 (TypeContainer.DoDefineMembers): Likewise.
5984 (TypeContainer.GetMethods): Likewise.
5985 (PropertyMember.Define): Likewise.
5986 (MemberBase.Parent): New property that forwards to
5987 MemberCore.Parent, but ensures that we get a TypeContainer.
5988 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
5989 (RootContext.PopulateTypes): Likewise. Remove special case code
5990 for !RootContext.StdLib: DefineMembers is idempotent.
5992 2005-12-14 Miguel de Icaza <miguel@novell.com>
5994 * convert.cs (ExplicitConversionCore): Check the return value from
5995 ExplicitConversionCore which can return null on failure. Fixes #76914
5997 2005-12-13 Marek Safar <marek.safar@seznam.cz>
5999 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
6001 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
6003 * doc.cs : The search for referenced namespace was insufficient to
6004 get global one as it used to do. Fixed bug #76965.
6006 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
6008 * doc.cs : check name in cref in the last phase that whether it is
6011 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6013 * cs-tokenizer.cs : reverted the latest change: it somehow broke
6016 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6018 * doc.cs : so it turned out that we cannot skip override check for
6019 interface members. Fixed bug #76954.
6021 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6023 * cs-tokenizer.cs : fixed bug #75984:
6024 - #warning and #error should not be handled when the source line
6026 - #line is not checked strictly when the source line is disabled.
6027 - #define and #undef is on the other hand checked strictly at any
6030 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
6032 * cs-tokenizer.cs : missing Location (actually, filename) in one of
6035 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6037 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
6039 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
6041 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
6042 (FieldBase.Initializer): Initializer is now optional.
6043 (EventField.Define): Only event field can have initializer.
6045 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
6047 * const.cs (Const): Reuse initializer.
6049 * cs-parser.jay: Updated after FieldBase changes.
6050 Added current_array_type to simplify array initializers.
6052 * ecore.cs (NullCast.IsDefaultValue): Implemented.
6054 * expression.cs, iterators.cs: Updated.
6056 * namespace.cs (NamespaceEntry): Made UsingFound private.
6058 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6060 * parameterCollection.cs: Obsolete, removed.
6061 * parser.cs: Obsolete, removed.
6063 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6066 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
6068 * enum.cs (Enum.Define): Set obsolete context here.
6070 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
6073 - FindDocumentedMember() now expects 1) paramList as null
6074 when "we don't have to check the number of parameters" and
6075 2) Type.EmptyTypes when "there is no arguments".
6076 - Introduced FoundMember struct to hold the exact type which was
6077 used to find the documented member (the above change broke
6078 test-xml-044; it might be better just to use DeclaringType than
6079 what MS does, like this change does, but it depends on usage.)
6081 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
6083 * doc.cs : documented member might be from DeclaringType for nested
6084 types. Fixed bug #76782.
6086 2005-12-03 Ben Maurer <bmaurer@ximian.com>
6088 * anonymous.cs: Have the param code handle leaving copies on the
6089 stack etc. Allows anonymous params to take part in the assignment
6090 code (++, +=, etc). Fixes bug #76550
6092 * expression.cs: Handle the prepare_for_load/leave_copy by passing
6093 it down to the anon code.
6095 * iterators.cs: Use dummy var here
6097 * codegen.cs: Handle new vars
6099 2005-12-01 Marek Safar <marek.safar@seznam.cz>
6102 * class.cs (MethodData.Define): Set proper Obsolete context.
6104 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
6106 (FieldExpr.DoResolve): Ditto.
6108 2005-12-01 Marek Safar <marek.safar@seznam.cz>
6111 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
6112 parent is not obsolete.
6114 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
6116 * doc.cs : (FindDocumentedMember) find parameterless members first
6117 and get CS0419 in the early stage. Fixed first case of bug #76727.
6119 2005-11-30 Marek Safar <marek.safar@seznam.cz>
6122 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
6123 no error was reported.
6125 *expression.cs (Binary.DoResolve): left can be null.
6127 2005-11-22 Marek Safar <marek.safar@seznam.cz>
6130 * class.cs (MethodData.Emit): Parameters should be labeled first.
6132 2005-11-21 Marek Safar <marek.safar@seznam.cz>
6135 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
6137 2005-11-18 Marek Safar <marek.safar@seznam.cz>
6139 * attribute.cs (AreParametersCompliant): Moved to Parameter.
6141 * class.cs (MethodCore): Parameter clean up.
6142 (IMethodData): Added ParameterInfo.
6143 (MethodData): Parameter clean up.
6144 (Indexer.Define): Parameter clean up.
6156 * typemanager.cs: Parameter clean up.
6158 * delegate.cs (Define): Get rid of duplicated code.
6160 * expression.cs (ParameterReference): Removed useless parameters
6162 (Invocation): Ditto.
6164 * parameter.cs (ParamsParameter): New class, params specialization.
6165 (ArglistParameter): Attemp to separate arglist.
6166 (Parameter): Refactored to be reusable and faster.
6167 (Parameter.Modifier): Made understandable.
6168 (Parameters): Changed to be used as a class for `this' assembly
6169 parameters. Refactored to use new specialized classes.
6171 * support.cs (ParameterData): Added Types property.
6172 (InternalParameters): Deleted.
6174 2005-08-20 Martin Baulig <martin@ximian.com>
6176 Merging this patch from GMCS to fix #75867.
6178 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
6179 scope if we don't already have it.
6181 2005-11-17 Martin Baulig <martin@ximian.com>
6184 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
6185 inherit the scope from our parent. Fixes #76653.
6187 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6189 * doc.cs : the previous patch does not actually fix the bug.
6190 PropertyInfo override check is now implemented and really fixed it.
6191 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
6193 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6195 * doc.cs : apply "override filter" also to properties.
6198 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6200 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
6201 no need to check overrides. For classes, omit those results from
6202 interfaces since they must exist in the class. Fixed bug #76726.
6204 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6206 * typemanager.cs : (GetFullNameSignature) differentiate indexers
6207 with different parameters. Fixed the second problem in #76685.
6209 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6211 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
6212 get expected 'protected' access in CheckValidFamilyAccess()).
6215 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6217 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
6218 Fixed bug #76705. CS1569 was incorrectly commented out.
6220 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
6222 * doc.cs : use Invocation.IsOverride() to do real override check.
6223 * expression.cs : made Invocation.IsOverride() internal.
6225 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
6227 * doc.cs : use TypeManager.FindMembers() instead of (possible)
6228 TypeBuilder.FindMembers() and filter overriden base members out.
6231 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6233 * doc.cs : ref/out parameters are represented as '@' (instead of
6234 '&' in type FullName). Fixed bug #76630 (additionally crefs).
6236 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6238 * doc.cs : when there was no '.' in cref to methods in doc comment,
6239 then parameters were missing in the output. Fixed bug #76691.
6241 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6243 * driver.cs : don't output docs when there is an error.
6246 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6249 Now it should detect indexers. Fixed primary concern in bug #76685.
6250 Fixed CS0419 message to not show the identical member signature in
6253 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6255 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
6256 instead of Type.FindMembers() since it does not handle events.
6259 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
6261 * codegen.cs: Fixed typo (speficied -> specified).
6263 2005-11-11 Marek Safar <marek.safar@seznam.cz>
6266 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
6268 2005-11-11 Marek Safar <marek.safar@seznam.cz>
6270 * attribute.cs: Changed error message.
6272 * cs-tokenizer.cs: One more check.
6274 2005-11-10 Marek Safar <marek.safar@seznam.cz>
6276 * statement.cs (Block.Resolve): Ignore empty statement.
6278 2005-11-10 Marek Safar <marek.safar@seznam.cz>
6280 * report.cs: Made error/warning methods more strict to avoid
6283 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
6284 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
6285 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
6286 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
6288 2005-11-08 Marek Safar <marek.safar@seznam.cz>
6290 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
6291 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
6293 * class.cs (TypeContainer.IsComImport): New property.
6294 (Constructor.Define): Create proper ctor for ComImport types.
6296 * expression.cs (New.CheckComImport): Fixed.
6298 2005-11-07 Miguel de Icaza <miguel@novell.com>
6300 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
6301 that a parameter has been captured does not mean that we do not
6302 have to do the rest of the processing. This fixes the second part
6303 of #76592. If there was another anonymous method capturing
6304 values in the past, the Scope would never be set for the second
6305 method that captured the same parameter.
6307 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
6308 properly manipulate the stack. Second part of fix for #76592.
6310 * expression.cs (New): Add support for invoking "new" on
6311 interfaces that have been flagged with the ComImport attribute and
6312 the CoClass. Fixes #76637
6314 * statement.cs (Try.DoEmit): When a variable is captured, do not
6315 try to emit the vi.LocalBuilder variable as it has been captured.
6316 Create a temporary variable and store the results on the
6317 FieldBuilder. Fixes #76642
6319 2005-11-07 Marek Safar <marek.safar@seznam.cz>
6321 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
6323 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
6325 * expression.cs (Binary.DoResolve): Added && optimalization.
6327 * typemanager.cs (AddUserType): Removed useless argument.
6329 2005-11-04 Marek Safar <marek.safar@seznam.cz>
6331 * statement.cs (Block.variables): Uses ListDictionary.
6333 2005-11-03 Marek Safar <marek.safar@seznam.cz>
6336 * class.cs (PartialContainer.EmitType): Customized to emit
6337 security attributes.
6338 (ClassPart.ApplyAttributeBuilder): Transform security attribute
6339 for partial classes.
6341 2005-11-03 Marek Safar <marek.safar@seznam.cz>
6344 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
6345 access has to be fixed.
6347 * typemanager.cs (IsUnmanagedType): Wrong common field type.
6349 2005-11-01 Marek Safar <marek.safar@seznam.cz>
6352 * ecore.cs (NullCast.Reduce): Implemented.
6354 * expression.cs (ArrayCreation.CheckIndices): Correcly check
6357 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
6359 (Foreach.Resolve): Catch null properly.
6361 2005-10-29 Marek Safar <marek.safar@seznam.cz>
6363 * cs-tokenizer.cs: Warning text fix.
6365 * driver.cs: AllWarningNumbers exposed on public interface.
6367 * report.cs (): Reviewed warning numbers.
6368 (IsValidWarning): Use binary search.
6370 2005-10-29 Marek Safar <marek.safar@seznam.cz>
6372 * driver.cs: Implemeted resource visibility.
6373 (Resources): New class for code sharing between /res: and
6376 2005-10-28 Marek Safar <marek.safar@seznam.cz>
6379 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
6382 * convert (Convert.ImplicitReferenceConversion): NullCast holds
6385 * ecore.cs (NullCast): Child is contant only.
6387 * literal.cs (NullLiteral.Reduce): null can be converted to any
6390 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
6392 * driver.cs: Use Encoding.Default as default code page instead
6395 2005-10-27 Raja R Harinath <rharinath@novell.com>
6398 * expression.cs (Invocation.Error_InvalidArguments): Handle
6399 __arglist parameters.
6400 (Invocation.VerifyArgumentsCompat): Likewise.
6401 * support.cs (ReflectionParameters.GetSignatureForError): Print
6402 __arglist parameters.
6403 (InternalParamters.GetSignatureForError): Likewise.
6404 * parameter.cs (Parameters.GetSignatureForError): Likewise.
6406 2005-10-26 Marek Safar <marek.safar@seznam.cz>
6408 * attribute.cs (GetPropertyValue): Made public.
6410 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
6412 Add new property WrapNonExceptionThrows to handle 2.0 assembly
6414 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
6417 * driver.cs: Reflect method name change.
6419 * statement.cs (Try.Resolve): Warn when try has both general
6422 * typemanager.cs: runtime_compatibility_attr_type new predefined
6425 2005-10-26 Raja R Harinath <harinath@gmail.com>
6428 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
6429 treat it as an empty parameter list.
6431 2005-10-26 Raja R Harinath <rharinath@novell.com>
6434 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
6435 ResolveAsTypeStep silent.
6436 * statement.cs (Block.AddConstant): Mark block as used.
6437 (Block.ResolveMeta): Avoid piling on error messages
6438 if a constant initializer resolution fails.
6440 2005-10-25 Raja R Harinath <rharinath@novell.com>
6442 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
6444 (NamespaceEntry.VerifyAllUsing): New.
6445 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
6446 behaviour. Delegates actual resolution of alias to ...
6447 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
6448 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
6450 * driver.cs (Driver.MainDriver): Update.
6452 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
6453 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
6455 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
6457 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
6458 RootNamespace.DefineNamespacesForAll.
6460 2005-10-24 Raja R Harinath <harinath@gmail.com>
6462 * typemanager.cs (assemblies, external_aliases, modules)
6463 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
6464 (ComputeNamespaces, GetRootNamespace): Remove extra staging
6465 overhead. Move resposibility ...
6466 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
6467 * driver.cs, attribute.cs, codegen.cs: Update to changes.
6469 2005-10-23 Raja R Harinath <harinath@gmail.com>
6471 * namespace.cs (RootNamespace.all_namespaces): Renamed from
6472 cached_namespaces. Improve usage.
6473 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
6474 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
6475 Move from GlobalRootNamespace and simplify.
6476 (RootNamespace.Global): Make instance variable.
6477 (RootNamespace.RootNamespace): Add "alias name" parameter.
6478 (GlobalRootNamespace): Simplify drastically.
6479 (Namespace.Lookup): Don't use GetNamespace.
6480 * typemanager.cs (GetRootNamespace): Rename from
6481 ComputeNamespaceForAlias.
6482 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
6484 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6486 * anonymous.cs (AnonymousContainer): Don't crash when container
6489 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6491 * expression.cs (Binary.DoResolve): Warn when comparing same
6494 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6497 * expression.cs (Binary.DoResolve): It looks like there are no
6498 convetsion rules in enum context.
6500 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6502 Add support for extern alias qualifiers.
6503 * typemanager.cs: Move some LookupTypeReflection code
6504 to namespace.cs, to have cleaner code. Added some methods
6505 to help us keep track of the extern aliased references.
6506 * driver.cs: Add suport for extern alias assemblies on command
6507 line and check for their warnings/errors. Also keep track of the
6508 extern aliased assemblies.
6509 * namespace.cs: Move the global functionality of Namespace
6510 to GlobalRootNamespace/RootNamespace. Now the global namespace
6511 is GlobalRootNamespace.Globa. Also the code moved from
6512 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
6513 Finally added LocalAliasEntry (AliasEntry before) and
6514 ExternAliasEntry, to handle alias statements.
6515 * cs-parser.jay: Add support in the grammar for extern alias
6517 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
6518 Update callings to Namespace (now in GlobalRootNamespace).
6520 2005-10-18 Raja R Harinath <rharinath@novell.com>
6523 * class.cs (TypeContainer.DefineType): Move updating of
6524 topological sort earlier in the code.
6525 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
6527 2005-10-18 Marek Safar <marek.safar@seznam.cz>
6530 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
6532 * constant.cs (Constant.TryReduce): Moved from Cast class.
6533 (Reduce): Made little bit more OO and fixed missing conversions.
6535 * ecore.cs (Reduce): Implemented.
6536 (Binary.EnumLiftUp): New method to upgrade values to enum values.
6538 * literal.cs (Reduce): Implemented.
6540 * class.cs: Reverted Miguel's wrong commit.
6542 2005-10-14 Miguel de Icaza <miguel@novell.com>
6544 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
6546 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
6548 * cs-parser.jay, expression.cs : CS0214 was missing error location
6549 for constants. Fixed bug #76404.
6551 2005-10-11 Marek Safar <marek.safar@seznam.cz>
6554 * convert.cs (ExplicitConversionCore): Fixed object->enum
6557 2005-10-10 Raja R Harinath <rharinath@novell.com>
6559 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
6561 (PropertyExpr.EmitCall): Likewise.
6562 * expression.cs (Invocation.EmitArguments): Handle case where
6564 (Invocation.EmitCall): Avoid allocating temporary variable if
6565 there are no arguments.
6567 2005-10-07 Raja R Harinath <rharinath@novell.com>
6570 * convert.cs (ImplicitConversionStandard): Move conversion of
6571 void* to arbitrary pointer types ...
6572 (ExplicitConversionStandard): .. here.
6573 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
6574 error to always print typenames.
6576 2005-10-07 Raja R Harinath <rharinath@novell.com>
6578 * convert.cs (GetConversionOperator): Rename from
6579 GetConversionOperators. Move operator selection code from ...
6580 (UserDefinedConversion): ... here.
6582 2005-10-06 Marek Safar <marek.safar@seznam.cz>
6584 * convert.cs (ExplicitConversionCore): Removed duplicate enum
6587 2005-10-05 Marek Safar <marek.safar@seznam.cz>
6589 * assign.cs (Assign.DoResolve): Error method changed.
6591 * cfold.cs (DoConstantNumericPromotions): Error method changed.
6593 * const.cs (ResolveValue): Reset in_transit immediately.
6595 * constant.cs: Error method changed.
6597 * convert.cs: Removed useless location parameter.
6598 (ExplicitNumericConversion): Don't do double enum check.
6599 (ExplicitConversionCore): Renamed from ExplicitConversion.
6600 (ExplicitUnsafe): Extracted from ExplicitConversion.
6601 (ExplicitConversion): Uses for error reporting.
6603 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
6605 (ResolveBoolean): Uses common error method.
6606 (CastToDecimal): Get rid of ec.
6607 (CastFromDecimal): Optimized.
6608 (ConvCast): Get rid of ec.
6610 * enum.cs (ResolveValue): Reset in_transit immediately.
6611 (Emit): Return after first error.
6613 * expression.cs: Convert changes.
6615 * literal.cs: Error method changed.
6617 * statement.cs: Error method changed.
6619 2005-10-03 Raja R Harinath <rharinath@novell.com>
6621 * support.cs (SeekableStreamReader.Position): Don't error out when
6622 the requested position is just beyond the end of the current
6625 2005-09-28 Raja R Harinath <rharinath@novell.com>
6627 * support.cs (SeekableStreamReader): Simplify drastically. Don't
6628 try to keep in sync with the byte count of the underlying Stream.
6629 However, this limits us to a window size of 2048 characters: i.e.,
6630 the maximum lookahead of our lexer/parser can be 2048 characters.
6632 2005-09-28 Marek Safar <marek.safar@seznam.cz>
6635 * driver.cs: Fix compilation files with full root path.
6637 2005-09-25 Miguel de Icaza <miguel@novell.com>
6639 * report.cs (SymbolRelatedToPreviousError): Format the output so
6640 it does not use an open parenthesis that is never closed.
6642 * driver.cs: Follow coding guidelines
6644 2005-09-27 Marek Safar <marek.safar@seznam.cz>
6647 * const.cs (Const.ResolveValue): Check for assigning non-null
6648 value to reference type.
6650 2005-09-27 Marek Safar <marek.safar@seznam.cz>
6652 * anonymous.cs: Implemented ExprClassName.
6654 * assign.cs (Assign.DoResolve): Don't chrash when type is not
6657 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
6660 * class.cs (StaticClass.DefineContainerMembers): Report protected
6663 * codegen.cs: if(ed) PRODUCTION.
6665 * convert.cs (Error_CannotImplicitConversion): Better error
6668 * cs-parser.jay: More error checks.
6670 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
6672 * driver.cs (CSCParseOption): Enabled wrong option check.
6674 * ecore.cs (Expression.ExprClassName): Turned to property.
6675 (MemberExpr.CheckIntermediateModification): For checking boxed
6676 value types modification.
6678 * statement.cs (Fixed.Resolve): Expression type must be
6679 convertible to fixed type.
6680 (CollectionForeach.GetEnumeratorFilter,TryType):
6681 Small refactoring for easier error checking.
6683 2005-09-26 Marek Safar <marek.safar@seznam.cz>
6685 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
6688 * class.cs (GeneratedBaseInitializer): New class for customization
6689 compiler generated initializers.
6690 (MemberBase.DoDefine): Check Obsolete attribute here.
6691 (FieldMember.DoDefine): Ditto.
6693 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
6696 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
6697 (MemberCore.GetObsoleteAttribute): Removed argument.
6698 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
6699 (MemberCore.CheckObsoleteType): New helper.
6703 * statement.cs: Updates after MemberCore changes.
6705 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
6706 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
6708 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
6709 obsolete attribute for compiler construct.
6710 (As.DoResolve): Cache result.
6712 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
6714 2005-09-26 Raja R Harinath <rharinath@novell.com>
6717 * expression.cs (This.VerifyFixed): In a value type T, the type of
6718 'this' is T&, iow, 'this' is either an out or ref parameter. In a
6719 value type R, 'this' is treated as a value parameter.
6721 2005-09-22 Miguel de Icaza <miguel@novell.com>
6723 * statement.cs (Lock): Use the TemporaryVariable class instead of
6724 manually using local variables as those do not work when variables
6727 * ecore.cs: Moved the TemporaryVariable class from being a nested
6728 class inside Foreach to be a public class that can be employed in
6731 2005-09-19 Marek Safar <marek.safar@seznam.cz>
6733 * cs-parser.jay: interface_accessors replaced by
6734 accessor_declarations.
6736 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
6739 * statement.cs (GotoCase.Resolve): Convert null constant to
6741 (SwitchLabel.ResolveAndReduce): Ditto.
6742 (SwitchLabel.NullStringCase): Custom null stamp.
6743 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
6745 typemanager.cs (CSharpSignature): Don't skip first argument
6748 2005-09-18 Miguel de Icaza <miguel@novell.com>
6750 * driver.cs: Set InEmacs based on the environment variable EMACS.
6752 * location.cs (InEmacs): in this mode, do not report column
6753 location as it confuses Emacs.
6755 2005-09-16 Marek Safar <marek.safar@seznam.cz>
6757 * cfold.cs, constant.cs, convert.cs, ecore.cs,
6758 expression.cs, iterators.cs, literal.cs: Store constants and
6761 * class.cs (MemberBase.ShortName): Pass location.
6763 * cs-parser.jay: Some location fixes.
6765 * ecore.cs (Expression.Location): Made virtual.
6767 2005-09-05 Miguel de Icaza <miguel@novell.com>
6769 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
6770 if the underlying types are the same, otherwise we need to produce
6771 code that will do the proper cast.
6773 This was exposed by Marek's constant rewrite which produced
6774 invalid code for the call site:
6777 void Method (X v) {}
6781 This fixes test-49.cs
6783 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
6785 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
6786 Type/Object should be allowed as well. Fixed bug #75968.
6788 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
6790 * expression.cs : (Binary.DoResolve): when one is enum constant and
6791 another is constant 0, then return enum one *as enum type*.
6794 2005-09-02 Raja R Harinath <rharinath@novell.com>
6796 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
6800 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
6801 flow-branching for LocalVariableReferences in case we were invoked
6802 from a MemberAccess.
6803 * expression.cs (LocalVariableReference.VerifyAssigned): New.
6805 (LocalVariableReference.DoResolveBase): ... this.
6806 (MemberAccess.Resolve): Do the check that was disabled during
6809 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
6812 (PartialContainer.Create): check abstract/sealed/static strictly
6813 but abstract/sealed can exist only at one side. Fixed bug #75883.
6815 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
6818 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
6819 specified, don't default to UnmanagedType.I4.
6821 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
6823 * expression.cs : conditional operator should check possibly
6824 incorrect assign expression. Fixed bug #75946.
6826 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
6828 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
6829 Reverting the change. gmcs is much complex than mcs on this matter.
6831 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
6833 * cs-tokenizer.cs : To read another token ahead of the actual
6834 consumption, use new SavedToken and cache token instead of moving
6835 back the stream with SeekableStreamReader (it seemed problematic).
6837 driver.cs : Thus use StreamReader directly.
6838 * support.cs : Thus removed SeekableStreamReader.
6840 2005-08-30 Raja R Harinath <rharinath@novell.com>
6843 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
6844 (ScopeInfo.EmitScopeType): Use it to construct field names from
6845 names of captured locals.
6848 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
6849 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
6850 Pass 'target_type' to BoxedCast. Don't default to 'object'.
6851 (ExplicitConversion): Remove enum cases already handled by
6852 implicit conversion. Move implicit conversion check to the beginning.
6853 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
6854 * expression.cs (ArrayCreation.EmitDynamicInitializers):
6855 Don't treat System.Enum as a struct.
6857 2005-08-30 Jb Evain <jbevain@gmail.com>
6859 * attribute.cs: handles as expression in parameters.
6861 2005-08-30 Raja R Harinath <rharinath@novell.com>
6864 * class.cs (TypeContainer.VerifyClsName): Don't use a
6865 PartialContainer when verifying CLS compliance.
6866 (AbstractPropertyEventMethod): Set Parent here, ...
6867 (PropertyMethod): ... not here.
6869 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
6871 * attribute.cs : escaped attribute name should not be allowed to be
6872 resolved (e.g. @class as classAttribute). Fixed bug #75930.
6874 2005-08-29 Raja R Harinath <rharinath@novell.com>
6877 * convert.cs (ImplicitStandardConversionExists): Allow zero also
6878 when converting a long constant to unsigned long.
6879 * expression.cs (Invocation.OverloadResolve): Add sanity check to
6880 detect where IsApplicable and VerifyArgumentsCompat disagree.
6882 2005-08-29 Raja R Harinath <rharinath@novell.com>
6883 and Carlos Alberto Cortez <carlos@unixmexico.org>
6886 * class.cs (TypeContainer.CanElideInitializer): New helper.
6887 (TypeContainer.EmitFieldInitializers): Use it to determine if we
6888 can safely emitting the initializer of a field.
6890 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
6892 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
6893 allowed inside a switch (without loop). Fixed bug #75433.
6895 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
6897 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
6898 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
6900 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
6902 * driver.cs : kinda reverting the default encoding changes (not exact
6903 revert since I noticed that "codepage:reset" might not work fine).
6905 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
6907 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
6908 Location. Now getter and setter store location correctly.
6909 (errors/cs0111-12.cs now reports the expected location.)
6911 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
6913 * driver.cs : Use default encoding on the environment.
6914 Removed (now that) extra parameter for SeekableStreamReader.
6915 * support.cs : (SeekableStreamReader) third .ctor() argument for
6916 StreamReader is not required (always true). preamble size could
6917 be acquired in simpler and safe way.
6919 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
6921 * cs-parser.jay: report CS0642 at warning level 3
6922 and report CS0642 for an if else statement also
6923 fixes bug #74745. Patch by John Luke (and a bit
6925 Removed extra CS0642 warning check for "while",
6927 * statement.cs: In Block.Resolve(), CS0642 check
6928 is reimplemented to check a sequence of an empty
6929 statement and a block.
6931 Both fix bug #66777.
6933 2005-08-24 Marek Safar <marek.safar@seznam.cz>
6935 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
6936 detection until I fix it.
6938 * cs-tokenizer.cs: Changed error message.
6940 * cs-parser.jay: Fixed 2 error locations.
6942 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
6943 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
6946 * enum.cs (GetSignatureForError): Fixed.
6948 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
6952 * typemanager.cs (RegisterProperty): Removed.
6954 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
6956 2005-08-24 Raja R Harinath <rharinath@novell.com>
6959 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
6960 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
6962 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
6964 * expression.cs : tiny fix is required for not warning positive ulong.
6967 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
6969 * expression.cs : add CS0652 check for constant and integral
6970 expression. Fixed bug #53974.
6972 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
6974 * expression.cs : in DoNumericPromotions(), check if there is implicit
6975 conversion overload for string (to check CS0034). Fixed bug #52492.
6977 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
6979 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
6981 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
6983 * ecore.cs : report location when it is *not* Null.
6985 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
6991 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
6992 correctly. Fixed bug #75721.
6994 2005-08-23 Raja R Harinath <rharinath@novell.com>
6996 * support.cs (SeekableStreamReader.Position): Avoid an expensive
6997 loop that performs 'min (pos, char_count)'.
7000 * expression.cs (Unary.ResolveOperator): Don't discard implicit
7001 converted value in Operator.OnesComplement.
7003 2005-08-22 Ben Maurer <bmaurer@ximian.com>
7005 * anonymous.cs: If the anon method is pulled into a helper class,
7006 it needs to be `internal' not `private'. Fixes runtime behavior on
7009 2005-08-20 Martin Baulig <martin@ximian.com>
7011 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7012 scope if we don't already have it.
7014 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
7015 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
7018 2005-08-17 Marek Safar <marek.safar@seznam.cz>
7021 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
7024 2005-08-16 Marek Safar <marek.safar@seznam.cz>
7026 The big constants rewrite
7027 Fix #75746, #75685 and more
7028 As a side effect saved 1MB for MWF ;-)
7030 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
7031 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
7032 enum based for corlib compilation.
7034 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
7037 * class.cs (FixedField.Define): Use ResolveAsConstant.
7039 * const.cs (IConstant): Interface constants and enums.
7040 (Const.ResolveValue): New method for constant resolvning.
7041 (ExternalConstant): Constants from imported assemblies.
7043 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
7044 conversion; like enums.
7045 (Constant.ToType): Converts this constant to different type.
7046 (Constant.Increment): Adds 1.
7048 * convert.cs (ImplicitConversionRequired): Simplified.
7050 * cs-parser.jay: Create EnumMember directly.
7052 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
7054 * doc.cs (GenerateEnumDocComment): Removed.
7056 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
7057 (ConvertIntLiteral): Removed.
7058 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
7060 * enum.cs (EnumMember): Implement IConstant.
7061 (Enum.IsValidEnumConstant): Removed.
7062 (Enum.GetNextDefaultValue): Removed.
7063 (Enum.FindMembers): Updated.
7064 (Enum.GenerateDocComment): Iterate enum members.
7066 * expression.cs (Cast.TryReduce): Handle enums correctly.
7067 (New.Constantify): Made public.
7068 (MemberAccess.DoResolve): Removed contant specific if(s).
7070 * literal.cs (NullLiteral): Implement new abstract methods.
7072 * statement.cs (GotoCase.Resolve): Use new constant methods.
7073 (SwitchLabel.ResolveAndReduce): Use new constant methods.
7075 * typemanager.cs (LookupEnum): Removed.
7076 (IsEnumType): Fixed to work with corlib.
7077 (RegisterConstant): Removed.
7078 (LookupConstant): Removed.
7079 (GetConstant): Changed to work with IConstant.
7081 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
7083 * location.cs : Fixed overflown (>255) column number.
7085 2005-08-03 Raja R Harinath <rharinath@novell.com>
7087 First cut of the qualified-alias-member feature.
7088 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
7090 * cs-parser.jay (DOUBLE_COLON): New token.
7091 (namespace_or_type_name): Add rule for recognizing
7092 qualified-alias-members.
7093 (primary_expression): Likewise.
7094 (element_access): Allow QualifiedAliasMember as a possible
7095 type-bearing expression.
7096 (local_variable_type, local_variable_pointer_type): Likewise.
7097 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
7098 aliases in the current and enclosing namespace declarations.
7099 (NamespaceEntry.UsingAlias): Add CS0440 warning.
7100 * decl.cs (MemberName.is_double_colon): New.
7101 (MemberName.MemberName): Add new constructor for alias-member.
7102 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
7103 * expression.cs (QualifiedAliasMember): New expression type.
7105 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7107 * location.cs : it borked when no argument was specified.
7109 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7111 * location.cs : tiny ToString() format fix.
7113 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7115 * statement.cs : oops, it was missing.
7117 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7119 A set of fixes for precise line/column location.
7122 "token" field now holds a file/line "delta", a line number offset
7123 from the segment, and a column number. See also:
7124 http://lists.ximian.com/pipermail/mono-devel-list/2004-
7125 December/009508.html
7126 Removed static IsNull. Use instance IsNull property instead.
7128 For some tokens it stores Location. For Identifier it stores
7129 LocatedToken which is a pair of string name and location.
7130 Column numbers are adjusted only at getChar().
7132 Use Location.ToString() for reporting (it now contains column).
7134 Largely modified to use LocatedToken instead of
7135 string (IDENTIFIER), and to acquire Location from some tokens.
7136 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
7137 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
7139 Now MemberName holds Location. DeclSpace.ctor() receives Location
7140 as a parameter. Removed extra parameters to all derived classes.
7141 Replaced Location.IsNull() with instance property.
7142 * assign.cs, expression.cs :
7143 Added .ctor() overload that omits Location.
7145 Added "nameEscaped" flag that indicates the identifier was escaped
7146 in the source file. This fixes bug #57047.
7148 2005-08-02 Marek Safar <marek.safar@seznam.cz>
7150 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
7151 New method, looking for lo-case imported cls type.
7153 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
7156 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
7158 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
7160 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
7162 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
7164 Optimized to save 3.5 MB for SWF compilation.
7166 2005-08-01 Marek Safar <marek.safar@seznam.cz>
7168 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
7169 (PartialContainer.Create): Moved logic AddToContainer.
7170 (PartialContainer.MarkForDuplicationCheck): Shares name.
7172 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
7175 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
7177 (Namespace.GetSignatureForError): New method.
7179 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
7180 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
7182 2005-08-01 Raja R Harinath <rharinath@novell.com>
7185 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
7186 member lookup rather than qualifier_type, since qualifier_type can
7189 2005-08-01 Marek Safar <marek.safar@seznam.cz>
7191 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
7194 2005-07-31 Miguel de Icaza <miguel@novell.com>
7196 * statement.cs: Copy the local exception into the exception
7197 captured local. Fixes 75674
7199 2005-07-31 Raja R Harinath <harinath@gmail.com>
7202 * expression.cs (Invocation.OverloadResolve): Don't report error
7203 CS1501 if error CS1502 has been reported.
7204 (New.DoResolve): Delegate CS1501 reporting to
7205 Invocation.OverloadResolve.
7208 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
7209 invariant-meaning-in-block property in an enclosing block if
7212 2005-07-29 Marek Safar <marek.safar@seznam.cz>
7214 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
7215 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
7216 (Switch.CheckSwitch): Just save 50kb for SWF.
7218 2005-07-27 Martin Baulig <martin@ximian.com>
7220 * anonymous.cs (CaptureContext.AddField): Added
7221 `AnonymousContainer am' argument; compute its toplevel scope if
7222 it's not already computed. Fixes #75649.
7224 2005-07-26 Raja R Harinath <rharinath@novell.com>
7227 * class.cs (Constructor.Emit): Reset block to null if the block
7230 2005-07-25 Marek Safar <marek.safar@seznam.cz>
7232 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
7234 2005-07-25 Marek Safar <marek.safar@seznam.cz>
7236 * class.cs (MethodData.Define): Check whether accessor implementing
7237 interface is public.
7239 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
7241 2005-07-22 Marek Safar <marek.safar@seznam.cz>
7244 * namespace.cs (LookupType): Moved same type check to...
7246 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
7249 2005-07-21 Raja R Harinath <rharinath@novell.com>
7251 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
7252 already found a typebuilder.
7253 * class.cs (MethodCore.IsDuplicateImplementation): Compare
7254 MemberNames, not strings.
7256 * const.cs (Error_ExpressionMustBeConst):
7257 Rename from Error_EpressionMustBeConst.
7258 * const.cs, class.cs, statement.cd: Update.
7260 2005-07-21 Marek Safar <marek.safar@seznam.cz>
7264 * const.cs (Const.LookupConstantValue): Report missing contant expression
7266 (Error_EpressionMustBeConstant): Only one error method.
7268 * class.cs, statement.c: Updated.
7270 2005-07-20 Raja R Harinath <rharinath@novell.com>
7272 * statement.cs (Block.Flags): Add back HasVarargs.
7273 (Block.flags): Make protected.
7274 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
7276 * typemanager.cs (types, typecontainers, user_types): Remove.
7277 (UserTypes, TypeContainers): Likewise.
7278 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
7279 (CleanUp, Reset): Update.
7280 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
7281 (GetNestedType): Use Type.GetNestedType.
7282 (CoreLookupType): Take two arguments, the namespace and the
7283 basename of the type. Update to use the Namespace.Lookup
7285 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
7286 (RealMemberLookup): Use IsNestedChildOf instead of playing with
7287 string concatenation and substring matches.
7288 * class.cs, enum.cs, delegate.cs: Update to changes.
7290 2005-07-20 Marek Safar <marek.safar@seznam.cz>
7292 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
7293 Expression and made virtual.
7295 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
7296 (ImplicitStandardConversionExists): Fixed `byte' typo ?
7298 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
7300 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
7303 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
7306 2005-07-18 Marek Safar <marek.safar@seznam.cz>
7309 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
7310 AssemblyCultureAttribute is not used on executable.
7313 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
7315 2005-07-16 Raja R Harinath <rharinath@novell.com>
7318 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
7319 New. Reports CS0252/CS0253.
7320 Mostly taken from preliminary patch by Duncak Mak.
7321 (Binary.DoResolveOperator): Store results of operator lookup.
7322 Use them to detect if we need to warn about unintended reference
7325 2005-07-15 Raja R Harinath <rharinath@novell.com>
7328 * namespace.cs (Namespace.Lookup): Add back location parameter.
7329 (Namespace.LookupType): Add CS0436 report. Add location parameter.
7330 * delegate.cs, ecore.cs, expression.cs: Update to changes.
7332 * codegen.cs (EmitContext.DeclSpace): Make readonly.
7333 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
7334 (Namespace.LookupType): ... this.
7335 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
7337 * typemanager.cs (LookupTypeReflection): Remove buggy code that
7338 purported to handle pointers.
7339 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
7342 2005-07-15 Marek Safar <marek.safar@seznam.cz>
7344 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
7347 2005-07-15 Raja R Harinath <rharinath@novell.com>
7349 * namespace.cs (Namespace.Lookup): Drop location parameter.
7350 (NamespaceEntry.LookupAlias): Remove. Merge into ...
7351 (NamespaceEntry.Lookup): ... this.
7352 (NamespaceEntry.Error_AmbiguousTypeReference):
7353 Move here from DeclSpace.
7354 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
7356 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
7357 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
7358 Move to NamespaceEntry.
7359 * delegate.cs, expression.cs: Update to changes.
7361 2005-07-14 Marek Safar <marek.safar@seznam.cz>
7363 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
7364 CheckAttributeType and refactored.
7365 (Attribute.ResolvePossibleAttributeType): Changed to reuse
7366 ResolveAsTypeTerminal error handling.
7367 (ResolveAsTypeTerminal): Introduced because of global attributes extra
7369 (GetSignatureForError): Print errors in same way.
7372 * codegen.cs: Reflect attribute GetSignatureForError change.
7375 * expression.cs: Add silent parameter to ResolveAsTypeStep.
7377 * namespace.cs (UsingEntry): Refactored to make fields private.
7380 statement.cs: Error_UnexpectedKind has extra parameter.
7382 2005-07-14 Raja R Harinath <rharinath@novell.com>
7384 * ecore.cs (IAlias): Remove.
7385 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
7386 that implement the interface.
7387 * namespace.cs (Namespace): Likewise.
7388 (Namespace.declspaces): Renamed from 'defined_names'.
7389 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
7390 DeclSpace instead of an IAlias.
7391 * tree.cs (Tree.AddDecl): Update.
7393 2005-07-12 Raja R Harinath <rharinath@novell.com>
7395 * statement.cs (Block.Flags); Remove HasVarargs.
7396 (Block.HasVarargs): Move to ToplevelBlock.
7397 (Block.ThisVariable, Block.AddThisVariable): Likewise.
7398 (Block.Variables): Make protected. Initialize variable hashtable
7400 (Block.AddVariable): Update.
7401 (Block.Resolve): Update to changes.
7402 (ToplevelBlock.HasVarargs): New boolean.
7403 (ToplevelBlock.ThisVariable): Move here from Block.
7404 (ToplevelBlock.AddThisVariable): Likewise.
7405 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
7406 * expression.cs (This.ResolveBase): Update to changes.
7407 (ArglistAccess.DoResolve): Likewise.
7409 2005-07-11 Marek Safar <marek.safar@seznam.cz>
7412 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
7414 * class.cs (TypeContainer.VerifyMembers): Distinguish between
7415 not used and not used & assigned.
7416 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
7418 2005-07-11 Marek Safar <marek.safar@seznam.cz>
7421 * expression.cs (Is.DoResolve): null is never provided type.
7423 2005-07-08 Marek Safar <marek.safar@seznam.cz>
7426 * cs-parser.jay: Less strict event error rule to catch more errors.
7428 2005-07-08 Martin Baulig <martin@ximian.com>
7430 Fix test-iter-10.cs - distinguish whether we `yield' in a property
7431 gettter (allowed) or setter (not allowed).
7433 * class.cs (Accessor): Implement IIteratorContainer.
7434 (Accessor.Yields): New public field.
7435 (PropertyBase.PropertyMethod.Define): Handle iterators on a
7439 (get_accessor_declaration, set_accessor_declaration): Set the
7440 `yields' flag on the accessor, not the property.
7441 (property_declaration): Do the iterators check on a per-accessor
7442 basis and not for the whole property.
7444 2005-07-08 Martin Baulig <martin@ximian.com>
7446 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
7447 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
7449 2005-07-07 Marek Safar <marek.safar@seznam.cz>
7452 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
7453 (ExtractSecurityPermissionSet): Cope with self referencing security
7454 attributes properly.
7456 * driver.cs (SetOutputFile): Made public property OutputFile.
7458 2005-07-07 Raja R Harinath <rharinath@novell.com>
7461 * class.cs (TypeContainer.first_nonstatic_field): Rename from
7462 has_nonstatic_fields. Make into a FieldBase pointer.
7463 (TypeContainer.AddField): Add CS0282 check.
7464 (TypeContainer.EmitType): Update.
7466 2005-07-06 Miguel de Icaza <miguel@novell.com>
7468 * cs-tokenizer.cs (consume_identifier): Do not create strings to
7469 compare if they start with __.
7471 2005-07-06 Raja R Harinath <rharinath@novell.com>
7473 * statement.cs (Switch.SwitchGoverningType): Only look at
7474 UserCasts that don't need implicit standard conversions to one of
7475 the allowed switch types (Fixes test-322.cs).
7476 (LocalInfo.Resolve): Re-enable sanity-test.
7478 2005-07-06 Marek Safar <marek.safar@seznam.cz>
7480 * cs-tokenizer.cs (consume_identifier): Detect double undescores
7482 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
7484 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
7486 2005-07-06 Raja R Harinath <rharinath@novell.com>
7489 * ecore.cs (SimpleName.GetSignatureForError): Add.
7490 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
7491 (MemberAccess.GetSignatureForError): Add.
7493 2005-07-05 Marek Safar <marek.safar@seznam.cz>
7495 The big error and warning messages review.
7525 * typemanager.cs: Updated.
7527 * class.cs: (MethodCore.SetYields): Moved here to share.
7528 (PropertyMethod.Define): Moved iterator setup here.
7530 * iterators.cs: Add orig_method to have full access to parent
7533 2005-07-05 Raja R Harinath <rharinath@novell.com>
7535 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
7536 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
7537 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
7538 variable of struct type.
7539 * expression.cs (Unary.ResolveOperator): Update to change.
7540 (Indirection.VerifyFixed): Likewise.
7541 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
7542 (ParameterReference.VerifyFixed): Value parameters are fixed.
7543 (This.VerifyFixed): Treat 'this' as a value parameter.
7544 * statement.cs (LocalInfo.IsFixed): Remove.
7546 2005-07-01 Martin Baulig <martin@ximian.com>
7548 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
7549 `ec.EmitThis ()' to get the correct scope.
7551 2005-07-01 Martin Baulig <martin@ximian.com>
7553 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
7554 instance is a ParameterReference; fixes #75299.
7556 2005-07-01 Martin Baulig <martin@ximian.com>
7558 Reverted Marek's latest patch (r46725):
7559 - it contains structural changes which are neither mentioned in
7560 the ChangeLog nor explained anywhere; for example the additional
7561 argument of EmitContext's and Iterator's .ctor's and the
7562 TypeContainer.DefineMembers() change.
7563 - structural changes like this should go in in seperate patches
7564 and not be hidden in a huge patch which just seems to affect
7565 warnings and errors.
7566 a big and hard to understand patch.
7567 - it breaks iterators and causes regressions, for instance in
7570 2005-06-30 Raja R Harinath <rharinath@novell.com>
7573 * expression.cs (Indexers.map): Remove.
7574 (Indexers.Append): Filter out inaccessible setters and getters.
7575 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
7578 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
7580 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
7581 (FieldExpr.Emit, PropertyExpr.Emit): Update.
7582 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
7583 * expression.cs (Invocation.EmitCall): Add CS0120 check.
7585 2005-06-30 Marek Safar <marek.safar@seznam.cz>
7588 * class.cs (FieldBase.GetInitializerExpression): One more field
7591 2005-06-28 Miguel de Icaza <miguel@novell.com>
7593 * pending.cs: Do not define a proxy if the base method is virtual,
7594 it will be picked up by the runtime (bug 75270).
7596 2005-06-08 Martin Baulig <martin@ximian.com>
7598 The big Iterators rewrite :-)
7600 * iterators.cs: Rewrite this to use the anonymous methods framework.
7602 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
7603 before the TypeContainers; see 2test-21.cs.
7606 (TypeContainer.DefineType): Don't create a new EmitContext if we
7607 already have one (this only happens if we're an Iterator).
7608 (TypeContainer.Define): Also call Define() on all our iterators.
7609 (Method.CreateEmitContext): Added support for iterators.
7612 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
7613 (AnonymousContainer.CreateMethodHost): Moved here from
7614 AnonymousMethod and made abstract.
7615 (AnonymousContainer.CreateScopeType): New abstract method.
7616 (AnonymousContainer.IsIterator): New public property.
7617 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
7618 get the ScopeTypeBuilder rather than manually defining it here.
7619 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
7622 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
7623 before RootContext.DefineTypes().
7625 * codegen.cs (EmitContext.RemapToProxy): Removed.
7626 (EmitContext.CurrentAnonymousMethod): Changed type from
7627 AnonymousMethod -> AnonymousContainer.
7628 (EmitContext.ResolveTopBlock): Protect from being called twice.
7629 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
7630 (EmitContext.EmitThis): Removed the iterators hacks; use the
7631 anonymous methods framework for that.
7634 (ToplevelBlock.Container): Make this a property, not a field.
7635 (ToplevelBlock.ReParent): New public method; move the
7636 ToplevelBlock into a new container.
7637 (Foreach.TemporaryVariable): Simplify.
7639 2005-06-05 Martin Baulig <martin@ximian.com>
7641 * statement.cs (LocalInfo.CompilerGenerated): New flag.
7642 (Block.AddTemporaryVariable): New public method; creates a new
7643 `LocalInfo' for a temporary variable.
7644 (Block.EmitMeta): Create the LocalBuilders for all the temporary
7646 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
7647 non-iterator variables.
7649 2005-06-05 Martin Baulig <martin@ximian.com>
7651 * statement.cs (Foreach.TemporaryVariable): Create the
7652 LocalBuilder in the Emit phase and not in Resolve since in some
7653 situations, we don't have an ILGenerator during Resolve; see
7654 2test-19.cs for an example.
7656 2005-06-04 Martin Baulig <martin@ximian.com>
7658 **** Merged r45395 from GCS ****
7660 The big Foreach rewrite - Part II.
7662 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
7663 with `PropertyInfo ienumerator_getcurrent'.
7665 * codegen.cs (VariableStorage): Removed.
7668 (Foreach): Derive from Statement, not ExceptionStatement.
7669 (Foreach.CollectionForeach): New nested class. Moved all the code
7670 dealing with collection foreach here.
7671 (Foreach.ForeachHelperMethods): Removed.
7672 (Foreach.TemporaryVariable): Implement IMemoryLocation.
7674 2005-05-23 Martin Baulig <martin@ximian.com>
7676 * statement.cs (Try.DoResolve): Don't create a `finally' if we
7677 don't need to. Fix #75014.
7679 2005-05-20 Martin Baulig <martin@ximian.com>
7681 Merged r44808 from GMCS.
7683 * class.cs (TypeContainer.CircularDepException): Removed.
7684 (TypeContainer.DefineType): Removed the `InTransit' stuff.
7685 (TypeContainer.CheckRecursiveDefinition): Check for circular class
7686 (CS0146) and interface (CS0529) dependencies here.
7688 2005-06-21 Raja R Harinath <rharinath@novell.com>
7690 * expression.cs (Invocation.EmitCall): Fix initialization
7691 'this_call' to reflect current behaviour. Fix indentation.
7693 * convert.cs (FindMostEncompassedType): Add two trivial special
7694 cases (number_of_types == 0 || number_of_types == 1).
7695 (FindMostEncompasingType): Likewise.
7697 2005-06-17 Raja R Harinath <rharinath@novell.com>
7699 Some cleanups preparing for the fix of #75283.
7700 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
7702 (EventExpr.InstanceResolve): Likewise.
7703 (EventExpr.DoResolve): Remove redundant checks.
7705 2005-06-10 Duncan Mak <duncan@novell.com>
7707 * cs-tokenizer.cs (process_directives): New flag for controlling
7708 the processing of preprocessor directives.
7709 (x_token): After seeing a '#', return Token.NONE instead of going
7710 to handle_preprocessing_directive() when not processing
7711 directives. This avoids unnecessary processing during the token peek in
7716 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
7717 the existing error reporting methods instead of Report.Error.
7719 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
7720 after Raja's rewrite.
7722 2005-06-08 Miguel de Icaza <miguel@novell.com>
7724 * class.cs: Small fix.
7726 2005-06-08 Raja R Harinath <rharinath@novell.com>
7729 * class.cs (GetPartialBases): Fix return value check of
7732 2005-06-07 Raja R Harinath <rharinath@novell.com>
7734 Ensure that partial classes are registered in their enclosing
7735 namespace. Initial part of fix of #75160.
7736 * tree.cs (Tree.RecordDecl): Add new namespace argument.
7737 Register declspace with namespace here, not in
7738 DeclSpace.RecordDecl.
7739 * cs-parser.jay: Pass namespace to RecordDecl.
7740 * class.cs (PartialContainer.Create): Likewise.
7741 (ClassPart.DefineType): New sanity-check. Throws an exception if
7743 * decl.cs (Declspace.RecordDecl): Remove.
7744 * namespace.cs (NamespaceEntry.DefineName): Remove.
7746 2005-06-06 Marek Safar <marek.safar@seznam.cz>
7748 * rootcontext.cs: Reset TargetExt as well.
7750 2005-06-03 Raja R Harinath <rharinath@novell.com>
7752 * ecore.cs (Expression.Resolve): Emit CS0654 error when
7755 2005-06-02 Raja R Harinath <rharinath@novell.com>
7757 Fix #75080, cs0119.cs.
7758 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
7760 (Expression.Resolve): ... this. Use it. Remove bogus code
7761 allowing ExprClass.Type and ExprClass.Namespace for
7762 ResolveFlags.VariableOrValue.
7763 (Expression.Resolve) [1-argument variant]: Change default resolve
7764 flags based on language version.
7765 (Expression.Error_UnexpectedKind): Use a simple string array
7766 rather than an ArrayList.
7767 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
7769 (TypeOfVoid.DoResolve): Likewise.
7770 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
7771 flags argument -- it always has the same value.
7773 2005-05-31 Raja R Harinath <rharinath@novell.com>
7776 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
7777 Use it in the error message.
7778 * assign.cs, expression.cs, statement.cs: Update.
7780 2005-05-30 Raja R Harinath <rharinath@novell.com>
7783 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
7784 the "almostMatchedMember" case too.
7785 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
7786 that failed the accessibility checks to 'almost_match'.
7788 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
7790 * attribute.cs: Use internal MethodBuilder methods to set
7791 ExactSpelling and SetLastError on PInvoke methods, instead
7792 of passing them via charset. Fixes #75060.
7794 2005-05-27 Raja R Harinath <rharinath@novell.com>
7796 * parameter.cs (Parameter): Remove TODO comment.
7797 (Parameter.DefineParameter): Remove Location parameter.
7798 (Parameters.LabelParameters): Likewise.
7799 * class.cs (Constructor.Emit): Update to change.
7800 (MethodData.Emit): Likewise.
7801 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
7802 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
7804 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
7807 Removed Parameters.Location and added Parameter.Location instead.
7808 Removed Location parameter from Emit() and GetSignature().
7815 Modified all related calls.
7817 2005-05-26 Raja R Harinath <rharinath@novell.com>
7819 Improve user-defined conversion handling.
7820 * convert.cs (GetConversionOperators): Rewrite. Return only the
7821 applicable operators.
7822 (AddConversionOperators): New. Helper for GetConversionOperators.
7823 (FindMostEncompassedType, FindMostEncompassingType): Verify that
7824 there is only one most encompassed/encompassing type.
7825 (FindMostSpecificSource, FindMostSpecificTarget): Remove
7826 "applicable operator" handling.
7827 (UserConversion): Move cache here from GetConversionOperators.
7828 Directly cache the chosen operator, rather than the whole
7830 (ExplicitNumericConversion): Fix buggy implementation of Decimal
7831 case. Allow conversion of decimal to sbyte and byte too.
7832 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7833 New static methods. Used to avoid allocating EmptyExpressions in
7836 2005-05-24 Duncan Mak <duncan@novell.com>
7838 * ecore.cs (CastFromDecimal): New class for casting a decimal to
7839 another class, used in Convert.ExplicitNumericConversion.
7840 (CastToDecimal): New class, similar to above, but casts to
7841 System.Decimal, used in Convert.ImplicitNumericConversion and also
7842 in explicit convesion from double/float to decimal.
7844 * convert.cs (ImplicitNumericConversion): Handle implicit
7845 conversions to System.Decimal.
7846 (ExplicitNumericConversion): handle explicit conversions to
7851 2005-05-20 Miguel de Icaza <miguel@novell.com>
7853 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
7854 know the type at this stage, just break through. Fixes #75008
7856 2005-05-19 Martin Baulig <martin@ximian.com>
7859 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
7860 to disable error reporting.
7862 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
7863 here since we don't want to report an error; see the new test-336.cs.
7865 2005-05-19 Raja R Harinath <rharinath@novell.com>
7867 * statement.cs (ToplevelBlock.GetParameterReference)
7868 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
7869 Move here from class Block.
7870 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
7871 * expression.cs (ParameterReference.DoResolveBase): Likewise.
7873 2005-05-18 Martin Baulig <martin@ximian.com>
7878 (FlowBranching.Reachability): Add non-static public And() and Or()
7880 (FlowBranchingSwitch): New class; do the `break_origins' thing
7881 like in FlowBranchingLoop.
7882 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
7883 reachability, not just locals and parameters.
7884 (FlowBranching.MergeChild): Remove some of the hacks for loop and
7885 switch; MergeBreakOrigins() now takes care of that.
7887 2005-05-18 Martin Baulig <martin@ximian.com>
7889 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7890 a loop and may leave it, reset the barrier; fixes #74974.
7892 2005-05-17 Marek Safar <marek.safar@seznam.cz>
7894 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
7897 * cs-parser.jay: Catch more lexical errors.
7899 * report.cs: Add one more Error method.
7902 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
7904 2005-05-17 Martin Baulig <martin@ximian.com>
7906 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
7909 2005-05-16 Raja R Harinath <rharinath@novell.com>
7911 Fix test-382.cs. Emit values of decimal constants.
7912 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
7914 (TypeContainer.AddField): ... this.
7915 (TypeContainer.EmitFieldInitializers): Allow the list of fields
7916 with initializers to include 'Const's.
7917 (ClassPart.RegisterFieldForInitialization): Forward to
7919 * const.cs (Const.Const): Pass initializer to base class.
7920 (Const.Define): In case of decimal constants, register them for
7921 initialization in a static constructor.
7923 2005-05-14 Martin Baulig <martin@ximian.com>
7925 * statement.cs (Block.Resolve): Correctly handle unreachable code;
7926 do not call ResolveUnreachable() on unreachable statements in
7927 here, see the comment in the source code.
7929 2005-05-13 Raja R Harinath <rharinath@novell.com>
7932 * expression.cs (BinaryResolveOperator): If one of the operands of
7933 an equality comparison is 'null' and the other is a pointer type,
7934 convert the null to a NullPointer.
7935 * convert.cs (ImplicitReferenceConversion): If the expression is a
7936 NullLiteral and the target type is a pointer type, return a
7937 NullPointer instead.
7938 (ImplicitConversionStandard): Likewise.
7940 2005-05-13 Marek Safar <marek.safar@seznam.cz>
7942 * cs-parser.jay: Set readonly context based on special constructs.
7944 * expression.cs (LocalVariableReference.DoResolveBase): Improved
7945 readonly variable error handling.
7947 * rootcontext.cs (EmitCode): Don't verify members when error
7950 * statement.cs (LocalInfo): Add reaodnly context information.
7951 (SetReadOnlyContext, GetReadOnlyContext): New methods.
7953 2005-05-13 Raja R Harinath <rharinath@novell.com>
7955 * statement.cs (Block.Resolve): Revert change below. Modify fix
7956 for #74041 to initialize 'resolved' to false only for explicit
7957 blocks. Fixes #74873.
7959 2005-05-12 Raja R Harinath <harinath@gmail.com>
7962 * typemanager.cs (unmanaged_enclosing_types): New.
7963 (IsUnmanagedType): Avoid infloops by using
7964 'unmanaged_enclosing_types' to talk with recursive invocations.
7966 2005-05-13 Martin Baulig <martin@ximian.com>
7968 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
7969 instance variable, not a local. Fix #74873.
7970 (Block.ResolveUnreachable): Set it to true here.
7972 2005-05-11 Duncan Mak <duncan@novell.com>
7974 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
7975 continuing to process for 'arg'.
7976 (handle_preprocessing_directive): Check the argument of the #endif
7977 directive and report error CS1025 if there are any trailing
7980 According to the C# spec, having even whitespace after the #endif
7981 directive is illegal; however, because we call arg.TrimEnd ()
7982 beforehand, we have the same behavior as csc, allowing whitespace
7983 after the directive.
7987 2005-05-11 Marek Safar <marek.safar@seznam.cz>
7991 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
7992 (Constructor.GetObsoleteAttribute): Implemented correctly.
7994 2005-05-10 Martin Baulig <martin@ximian.com>
7996 * support.cs (ReflectionParameters.ParameterModifier): Use
7997 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
7998 and `ParameterAttributes.In'. Fixes #74884.
8000 2005-05-10 Marek Safar <marek.safar@seznam.cz>
8002 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
8004 * expression.cs (Argument.GetParameterModifier): Turned to property.
8005 (Invocation.Error_InvalidArguments): Add more descriptive errors.
8007 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
8010 2005-05-09 Raja R Harinath <rharinath@novell.com>
8013 * decl.cs (MemberCache.AddMethods): Register override methods,
8014 rather than non-override methods.
8015 * typemanager.cs (RegisterOverride): New.
8016 (IsOverride): Update.
8018 2005-05-09 Marek Safar <marek.safar@seznam.cz>
8022 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
8023 recursive declaration.
8025 * statement.cs (Block.ResolveMeta): Report any error in resolving.
8027 2005-05-06 Marek Safar <marek.safar@seznam.cz>
8029 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
8031 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
8033 2005-05-05 Raja R Harinath <rharinath@novell.com>
8036 * decl.cs (DeclSpace.FamilyAccessible):
8037 Use TypeManager.IsNestedFamilyAccessible.
8039 Fix reopened #64812.
8040 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
8043 2005-05-04 Raja R Harinath <rharinath@novell.com>
8044 Abin Thomas <projectmonokochi@rediffmail.com>
8045 Anoob V E <projectmonokochi@rediffmail.com>
8046 Harilal P R <projectmonokochi@rediffmail.com>
8049 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
8050 allow access to all static members.
8052 2005-05-04 Martin Baulig <martin@ximian.com>
8054 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
8056 2005-05-04 Martin Baulig <martin@ximian.com>
8060 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
8061 section at the end; make things work if `default' is not the last
8064 2005-05-04 Martin Baulig <martin@ximian.com>
8068 * statement.cs (Switch): Replaced the `got_default' field with a
8069 `default_section' one.
8070 (Switch.CheckSwitch): Set `default_section' here.
8071 (Switch.Resolve): If we're a constant switch and the constant is
8072 not found, use the default section.
8074 2005-05-03 Martin Baulig <martin@ximian.com>
8076 * expression.cs (ArrayAccess.EmitGetLength): New public method.
8078 * statement.cs (Foreach.ArrayForeach): New nested class.
8079 (Foreach.TemporaryVariable): New nested class.
8080 (Foreach.EmitArrayForeach): Removed; this is now in the new
8083 2005-05-03 Raja R Harinath <rharinath@novell.com>
8085 * pending.cs (BaseImplements): Move the #74773 fix here. This is
8087 (VerifyPendingMethods): Revert change below.
8089 * typemanager.cs (IsOverride, RegisterNonOverride): New.
8090 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
8091 that used to trigger warning -28. Remove warning -28.
8092 * expression.cs (Invocation.OverloadResolve): Use
8093 TypeManager.IsOverride to distinguish override methods.
8096 * pending.cs (VerifyPendingMethods): If a base type implements the
8097 requested interface, don't bother checking individual methods of
8098 the base type. As a side-effect, this prevents the creation of
8099 unnecessary proxies.
8101 2005-05-02 Martin Baulig <martin@ximian.com>
8105 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8106 Also `And' the locals if the old vector is null.
8107 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
8108 null; in this case we basically reset all the variables.
8110 2005-05-02 Martin Baulig <martin@ximian.com>
8114 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
8115 Added `FlowBranching branching' argument; always `and' the
8116 variables instead of `or'ing them unless we're an infinite loop.
8118 * statement.cs (While.Resolve): Create a new sibling unless we're
8121 2005-05-02 Martin Baulig <martin@ximian.com>
8125 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
8126 arguments; use it instead of creating a new TopLevelBlock.
8127 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
8128 our ConstructorInitializer.
8131 (TopLevelBlock.TopLevelBranching): New public property.
8132 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
8133 and create our `TopLevelBranching'.
8135 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
8136 anonymous method host, use `block.TopLevelBranching' rather than
8137 creating a new branching.
8139 2005-04-20 Miguel de Icaza <miguel@novell.com>
8141 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
8142 a ScopeInfo, if any of the current children is a child of the new
8143 entry, move those children there.
8145 2005-04-30 Martin Baulig <martin@ximian.com>
8147 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
8148 at the beginning of a SwitchSection. Fix #73335.
8150 2005-04-27 Marek Safar <marek.safar@seznam.cz>
8153 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
8155 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
8156 (FieldExpr.DoResolve): Obsolete members are ignored for field
8159 2005-04-26 Marek Safar <marek.safar@seznam.cz>
8161 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
8162 of arrays detection.
8164 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
8166 (Field.VerifyClsCompliance): Volatile fields are not compliant.
8168 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
8171 2005-04-25 Ben Maurer <bmaurer@ximian.com>
8173 * cs-parser.jay: Use the prefered version of -unsafe in error
8176 2005-04-22 Marek Safar <marek.safar@seznam.cz>
8178 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
8181 2005-04-20 John Luke <john.luke@gmail.com>
8183 * driver.cs: fix typo in error message, --outout to --output
8185 2005-04-20 Marek Safar <marek.safar@seznam.cz>
8187 * codegen.cs (InRefOutArgumentResolving): New field.
8189 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
8190 fields outside contructor.
8192 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
8194 2005-04-19 Miguel de Icaza <miguel@novell.com>
8196 * anonymous.cs (CaptureContext.EmitParameterInstance): The
8197 parameter code was not completed ever, so it was not as up-to-date
8198 as local variables. Must finish it.
8200 The bug fix was to compare the Toplevel of the block, not the
8201 current block. Thanks for Ben for pointing this out.
8203 2005-04-19 Raja R Harinath <rharinath@novell.com>
8205 * decl.cs (AddMethods): Use the declaring type of the problem
8206 method to determine if we want to squash a warning.
8208 2005-04-19 Marek Safar <marek.safar@seznam.cz>
8210 * attribute.cs: Removed debug output.
8212 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
8214 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
8217 2005-04-18 Raja R Harinath <rharinath@novell.com>
8220 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
8221 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
8222 all null comparisons against reference types.
8224 2005-04-18 Marek Safar <marek.safar@seznam.cz>
8227 * class.cs (TypeContainer.CircularDepException) New nested
8229 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
8230 (TypeContainer.DefineType): Removed error, reset InTransit before
8232 (Class.DefineType): Throw exception when is in Transit.
8233 Catch exception and report error.
8234 (Struct.DefineType): Throw exception when is in Transit.
8235 Catch exception and report error.
8236 (Interface.DefineType): Throw exception when is in Transit.
8237 Catch exception and report error.
8239 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
8240 handle nested exception handlers.
8242 * flowanalysis.cs (InTryWithCatch): New method, search for try with
8245 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
8246 InFinally and InCatch storage.
8248 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
8249 (Catch.Resolve): Set and Restore ec.InCatch.
8250 (Try.Resolve): Set and Restore ec.InFinally.
8251 (Try.HasCatch): True when try has catch.
8253 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
8255 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
8256 for the same event member, so exclude such cases from warning 419.
8259 2005-04-16 Miguel de Icaza <miguel@novell.com>
8261 * expression.cs (Binary.ResolveOperator): Apply patch from John
8262 Luke to fix bug 59864: operators &, | and ^ on enumerations
8263 require that the same enum type on both sides.
8265 * driver.cs: Add warnings to old flag usage, this is to assist
8266 people who produce Makefiles and hope that the Makefiles will be
8269 * class.cs (TypeContainer.EmitType): Moved the definition of the
8270 special $PRIVATE$ field from the resolve phase to the Emit phase.
8271 During resolve we do not know if we are a struct with
8272 HasExplicitLayout, we know this only after the attributes for the
8275 Set the FieldOffset to zero on the dummy field that we create for
8276 the class. Fixes 74590.
8278 2005-04-16 Raja R Harinath <rharinath@novell.com>
8281 * ecore.cs (PropertyExpr.resolved): New.
8282 (DoResolve): Use it to handle a case of double resolution here.
8283 Handle a case of identical-name-and-type-name.
8284 * expression.cs (ArrayCreation.CheckIndices): Avoid double
8285 resolution by storing the results of expression resolution back
8286 into the "probes" array.
8288 2005-04-15 Raja R Harinath <rharinath@novell.com>
8290 Fix cs0208-7.cs and cs0208-8.cs.
8291 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
8292 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
8293 error reporting to point out the reason a struct is not unmanaged.
8295 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8297 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
8298 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
8300 2005-04-13 Raja R Harinath <rharinath@novell.com>
8303 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
8304 IdenticalNameAndTypeName here.
8305 (EventExpr.InstanceResolve): Likewise.
8307 2005-04-13 Marek Safar <marek.safar@seznam.cz>
8309 C# 2.0 DefaultCharSetAttribute implementation
8311 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
8312 which allows us to set GlobalNamespace for every resolve.
8313 (Attribute.ResolveArguments): Cut from Resolve.
8314 (Attribute.GetCharSetValue): Returns CharSet named argument.
8315 (Attribute.DefinePInvokeMethod): Gets default charset from
8317 (GlobalAttribute.ResolveAsTypeStep): Override.
8318 (GlobalAttribute.ResolveArguments): Override.
8320 * class.cs (TypeAttr): Is protected.
8322 * codegen.cs (ModuleClass.DefaultCharSet): New member.
8323 (ModuleClass.DefaultCharSetType): New memeber.
8324 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
8326 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
8327 charset from module.
8329 * delegate.cs (TypeAttr): Override.
8330 (Delegate.DefineType): Use this TypeAttr.
8332 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
8333 at very early stage (before types are defined) to resolve model
8334 module attributes. It will probably not work with corlib but it
8337 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
8338 charset from module.
8340 * typemanager.cs (default_charset_type): New type.
8342 2005-04-13 Raja R Harinath <rharinath@novell.com>
8344 * decl.cs (MemberCache.AddMethods): Don't warn if
8345 System.Object.Finalize has buggy MethodAttributes.
8347 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
8350 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8352 * doc.cs : detect ambiguous reference to overloaded members.
8353 Fixed bug #71603. MS 1.1 csc does not detect it.
8355 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8357 * doc.cs : delegates must not be referenced with parameters.
8360 2005-04-12 Miguel de Icaza <miguel@novell.com>
8362 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
8364 2005-04-10 Miguel de Icaza <miguel@novell.com>
8366 * driver.cs (MainDriver): Stop processing if the CLS stage found
8369 (CompilerCallableEntryPoint.InvokeCompiler): Always
8370 reset after execution; Take a TextWriter argument for the
8373 * report.cs: Use the error stream instead of hardcoding stderr.
8375 2005-04-09 Miguel de Icaza <miguel@novell.com>
8377 * class.cs: Reduce code paths to test, too small of an
8378 optimization to make it worth the extra testing. Always perform
8381 2005-04-08 Raja R Harinath <rharinath@novell.com>
8384 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
8385 operators that had errors reported on them.
8387 2005-04-08 Marek Safar <marek.safar@seznam.cz>
8389 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
8391 (Attribute.Resolve): Add named argument type checking.
8393 * class.cs (FixedField.Define): Use IsPrimitiveType
8395 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
8397 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
8398 unsafe parameter types.
8400 * statement.cs (Using.ResolveExpression): Add better error description.
8402 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
8404 2005-04-08 Raja R Harinath <rharinath@novell.com>
8407 * attribute.cs (Attribute.GetAttributeUsage): Resolve
8408 AttributeUsageAttribute in the emitcontext of the attribute class,
8409 not in the emitcontext of the attributable entity it was attached to.
8410 * cs-parser.jay: Use 'current_class', not 'current_container',
8411 when creating a GlobalAttribute.
8413 2005-04-08 Alp Toker <alp@atoker.com>
8415 * pending.cs: The fix to #58413 failed to compile methods implementing
8416 interfaces with/without params modifiers and vice versa, even though
8417 params modifiers aren't part of the signature. Make the modifier check
8418 less strict as in csc.
8420 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
8421 Anoob V E <projectmonokochi@rediffmail.com>
8422 Harilal P R <projectmonokochi@rediffmail.com>
8425 * pending.cs (TypeAndMethods.mods): New. Store the parameter
8426 modifiers of pending methods.
8427 (PendingImplementation.PendingImplementation): Initialize it.
8428 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
8429 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
8430 with ParameterData. Add check for modifiers.
8431 * class.cs (MethodData.Define): Update to changes.
8433 2005-04-07 Raja R Harinath <rharinath@novell.com>
8435 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
8437 2005-04-07 Marek Safar <marek.safar@seznam.cz>
8439 * class.cs (PropertyMethod.Define): Check private accessor in abstract
8442 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
8445 * typemanager.cs: Registered RequiredAttributeAttribute.
8447 2005-04-06 Marek Safar <marek.safar@seznam.cz>
8449 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
8450 Warning CS0169 is back at level 3.
8451 (IMethodData.SetMemberIsUsed): New method.
8453 * decl.cs (IsUsed): New value; moved from FieldBase.Status
8454 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
8456 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
8458 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
8460 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
8463 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
8466 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
8467 to avoid the problems with nested types.
8469 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
8470 Anoob V.E <projectmonokochi@rediffmail.com>
8471 Harilal P.R <projectmonokochi@rediffmail.com>
8472 Raja R Harinath <rharinath@novell.com>
8475 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
8477 * typemanager (GetConstructor): Make public.
8479 2005-04-05 John Luke <john.luke@gmail.com>
8480 Raja R Harinath <rharinath@novell.com>
8483 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
8484 struct too. Return false quicker in a few cases.
8485 (VerifyUnManaged): Use it.
8487 2005-04-05 Raja R Harinath <rharinath@novell.com>
8490 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
8491 not 'unreachable_seen'.
8493 2005-04-04 Marek Safar <marek.safar@seznam.cz>
8495 * attribute.cs (Attribute.GetValue): Removed unused.
8497 * codegen.cs (CodeGen.TrimExt): Removed unused.
8499 * cs-parser.jay (output): Removed unused.
8501 * cs-tokenizer.cs (hex_digits): Removed unused.
8503 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
8505 * expression.cs (Indirection.LoadExprValue): Removed unused.
8506 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
8508 * iterators.cs (Iterator.param_types): Removed unused.
8510 * statement.cs (Goto.block): Removed unused.
8511 (ToplevelBlock.did): Removed unused.
8512 (Switch.ResolveConstantSwitch): Removed unused.
8514 2005-04-01 Ben Maurer <bmaurer@ximian.com>
8516 * rootcontext.cs: Allow mcs to bootstrap with the compilation
8519 2005-04-01 Raja R Harinath <rharinath@novell.com>
8521 Fix #74232 and cs0208-3.cs.
8522 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
8523 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
8524 unmanaged type. Don't use FieldBuilders when 't' is a
8525 TypeBuilder. Use ModFlags and MemberType fields.
8526 * class.cs (MemberBase.member_type): Rename from MemberType.
8527 (MemberBase.MemberType): New property. Determines member_type on
8529 (MemberBase.DoDefine): Don't initialize MemberType here.
8530 (FieldMember.Define): Likewise.
8532 2005-04-01 Marek Safar <marek.safar@seznam.cz>
8535 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
8536 Attributes are emitted there.
8538 2005-04-01 Raja R Harinath <rharinath@novell.com>
8540 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
8541 keyword in 'partial enum' too.
8542 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
8544 Report from Kamil Skalski <nazgul@omega.pl>.
8547 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
8548 have partial containers too.
8550 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
8551 in block' checks to Block.CheckInvariantMeaningInBlock.
8552 * statement.cs (Block.GetKnownVariableInfo): Make private.
8553 (Block.IsVariableUsedInChildBlock): Remove.
8554 (Block.IsVariableUsedInBlock): Likewise.
8555 (Block.CheckInvariantMeaningInBlock): New. Show location of
8556 conflicting declaration.
8557 (Block.AddVariable): Make error messages less long-winded and more
8558 specific. Show location of conflicting declaration.
8559 * parameter.cs (Parameters.Location): New readonly property.
8561 2005-03-31 Raja R Harinath <rharinath@novell.com>
8563 Clean up semantics of invoking ResolveMemberAccess.
8564 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
8565 can have an instance, ensure that we pass in a non-TypeExpression
8566 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
8567 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
8568 argument. Update to changes and simplify.
8569 (FieldExpr.Emitinstance): Remove CS0120 check.
8570 (PropertyExpr.EmitInstance): Likewise.
8571 * expression.cs (Argument.Resolve): Likewise.
8572 (Invocation.DoResolve): Update to changes in semantics of
8575 2005-03-31 Marek Safar <marek.safar@seznam.cz>
8578 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
8581 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
8583 2005-03-31 Raja R Harinath <rharinath@novell.com>
8585 Fix difference in behaviour with commandline invocation.
8586 * driver.cs (Driver.Reset): New.
8587 (CompilerCallableEntryPoint): Call it.
8589 * statement.cs (If.Resolve): Avoid spurious "uninitialized
8590 variable" warnings if the boolean expression failed to resolve.
8592 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
8594 * attribute.cs: Fix the union of several permissions when some of them
8595 are unrestricted (so the result isn't an unrestricted permission set).
8598 2005-03-30 Raja R Harinath <rharinath@novell.com>
8600 * ecore.cs (MemberExpr): New class. Convert from interface
8602 (MemberExpr.ResolveMemberAccess): Refactor and move here from
8603 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
8605 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
8606 (MethodGroupExpr.IsExplicitImpl): Remove.
8607 (Expression.GetFieldFromEvent): Remove.
8608 (SimpleName.MemberStaticCheck): Remove.
8609 (SimpleName.DoSimpleNameResolve): Update to changes.
8610 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
8611 (MemberAccess.IdenticalNameAndTypeName): Remove.
8612 (MemberAccess.error176): Move to MemberExpr.
8613 (MemberAccess.DoResolve): Update to changes.
8614 (BaseAccess.DoResolve): Likewise.
8616 2005-03-30 Marek Safar <marek.safar@seznam.cz>
8618 C# 2.0 Conditional attribute class implementation
8620 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
8621 Analyzes class whether it has attribute which has ConditionalAttribute
8622 and its condition is not defined.
8624 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
8625 (Class.IsExcluded): New method. Search for at least one defined
8626 condition in ConditionalAttribute of attribute class.
8628 2005-03-30 Raja R Harinath <rharinath@novell.com>
8630 * ecore.cs (PropertyExpr): Derive from Expression, not
8631 ExpressionStatement.
8632 (PropertyExpr.EmitStatement): Remove.
8634 2005-03-29 Raja R Harinath <rharinath@novell.com>
8637 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
8638 internal field "value__" of an enum be private. The examples for
8639 "value__" that I found on MSDN all used FieldAttributes.Private.
8641 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
8642 Don't mention IL method attribute names.
8644 Fix #47991. Remove a TODO.
8645 * statement.cs (Block.Toplevel): Make into a field.
8646 (Block.Parameters): Move into ToplevelBlock.
8647 (Block.known_variables): Rename from child_variable_names.
8648 (Block.Block): Remove variants that take Parameters. Initialize
8649 'Toplevel' with the immediately surrounding toplevel block.
8650 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
8651 LocalInfo parameter.
8652 (Block.GetKnownVariableInfo): New.
8653 (Block.IsVariableNameUsedInChildBlock): Update.
8654 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
8655 the block, even though it may not be in scope.
8656 (Block.AddVariable): Remove Parameters parameter. Use
8657 Toplevel.Parameters instead.
8658 (Block.AddConstant): Remove Parameters parameter.
8659 (Block.GetParameterReference): Update to use Toplevel.Parameters.
8660 (Block.IsParamaterReference): Likewise.
8661 (Block.IsLocalParameter): Likewise. Simplify a lot.
8662 (ToplevelBlock.Parameters): New. Moved from Block.
8663 (ToplevelBlock.ToplevelBlock): Update to changes. Always
8664 initialize Parameters to a non-null value.
8665 * cs-parser.jay: Update to changes.
8666 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
8667 simple names that mean different things in the same block. Use
8668 Block.IsVariableNameUsedInBlock.
8670 2005-03-28 Raja R Harinath <rharinath@novell.com>
8672 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
8673 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
8674 GetTypeHandle. It is possible for a reflected type to derive from
8675 a TypeBuilder (e.g., int[] derives from the TypeBuilder
8676 System.Array during mscorlib compilation).
8677 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
8678 contain a method_hash, don't create one either. Don't create a
8679 deep copy of the base cache's method_hash.
8680 (MemberCache.SetupCache): Rename back from DeepCopy.
8681 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
8682 already initialized. If we see an override function, add its
8683 underlying base virtual function to the member_hash too.
8685 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
8687 2005-03-26 Raja R Harinath <harinath@acm.org>
8690 * assign.cs (Assign.DoResolve): When the RHS of an assignment
8691 fails to resolve, ensure that the LHS is still resolved as an
8694 2005-03-25 Raja R Harinath <harinath@acm.org>
8696 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
8698 (Enum.current_ec): Remove.
8699 (Enum.LookupEnumValue): Remove EmitContext argument.
8700 Just uses the one created during DefineType.
8701 (Enum.FindMembers): Update.
8702 * expression.cs (MemberAccess.DoResolve): Update.
8704 2005-03-22 Marek Safar <marek.safar@seznam.cz>
8706 * assign.cs (Assign.DoResolve): Check for CS1717 when
8707 source and target are same (uses Equals).
8709 * expression.cs (LocalVariableReference, ParameterReference,
8710 This): Implemented Equals, GetHashCode.
8712 * statement.cs (Block.GetParameterReference): Removed useless
8715 2005-03-22 Raja R Harinath <rharinath@novell.com>
8718 * statement.cs (Block.AddVariable): Ensure that we skip implicit
8719 blocks before deciding whether the error is cs0136 or cs0128.
8721 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
8722 (using_alias_directive, using_namespace_directive): Pass
8723 MemberName, not an expression to Namespace.UsingAlias and
8725 (MakeName): Use the MemberName of the namespace.
8726 * namespace.cs (Namespace.MemberName): New.
8727 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
8728 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
8730 * decl.cs (MemberName.Name): Make readonly.
8731 (MemberName.FromDotted): New "constructor".
8732 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
8733 (MemberCore.Name): Compute from MemberName on demand.
8734 (MemberCore.SetMemberName): Provide a way to change the
8736 (MemberCore.AddToContainer): Don't take a fullname parameter.
8737 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
8738 fully qualified name of the container to the member name.
8739 (TypeContainer.AddToTypeContainer): Use a fully qualified name
8740 only if the type is a member of the root container.
8741 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
8742 MemberName.Left rather than searching for an embedded ".".
8743 (PartialContainer.CreatePart): Update to changes in RootContext.
8744 (MemberBase.ShortName): Turn into a property. Use
8745 MemberCore.SetMemberName.
8746 (MemberBase.ExplicitInterfaceName): Remove.
8747 (MemberBase.UpdateMemberName): Remove.
8748 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
8749 (PropertyBase.SetMemberName): New override.
8750 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
8751 (Tree.GetDecl): New.
8752 (Tree.AllDecls): Rename from Decls.
8753 * attribute.cs, enum.cs, report.cs: Update to changes.
8754 * driver.cs (MainDriver): Use MemberName.FromDotted on
8755 RootContext.MainClass.
8757 2005-03-21 Marek Safar <marek.safar@seznam.cz>
8759 * class.cs (FixedField.Define): Check for CS1664 and more sanity
8762 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
8764 2005-03-18 Marek Safar <marek.safar@seznam.cz>
8766 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
8767 property accessor modifiers.
8769 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
8770 fixed buffer attribute (CS1716).
8771 (PropertyMethod.HasCustomAccessModifier): When property accessor
8772 has custom modifier.
8774 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
8776 (PropertyExpr.DoResolveLValue): Add CS0272.
8778 2005-03-17 Miguel de Icaza <miguel@novell.com>
8780 * convert.cs: When converting to a pointer, use the proper Conv.U
8781 or Conv.I depending on the source data type.
8783 * cs-tokenizer.cs: Make the size for large decimal constants,
8786 2005-03-17 Martin Baulig <martin@ximian.com>
8788 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
8789 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
8791 2005-03-17 Martin Baulig <martin@ximian.com>
8793 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
8794 to bool so we can return an error condition.
8795 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
8798 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
8800 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
8803 2005-03-16 Raja R Harinath <rharinath@novell.com>
8805 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
8806 Refactor to avoid traversing the list of assemblies, and to avoid
8807 string concatenation.
8808 * typemanager.cs (guid_attr_type): Remove.
8809 (negative_hits, pointers, references): Remove hashes.
8811 (GetConstructedType): New. Uses type_hash to handle constructed
8812 types (arrays, references, pointers).
8813 (GetReferenceType, GetPointerType): Use it.
8814 (GetNestedType): New. Uses type_hash to handle nested types of
8816 (LookupType, LookupTypeDirect): Remove.
8817 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
8818 'types' hash and LookupTypeReflection directly.
8819 (params_string, params_object): Use GetConstructedType.
8820 * namespace.cs (Namespace.cached_types): New. Cache of reflected
8822 (Namespace.Lookup): Use cached_types.
8823 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
8824 provided by old TypeManager.LookupType.
8825 * rootcontext.cs (MakeFQN): Remove.
8826 * decl.cs (DeclSpace.MakeFQN): Likewise.
8827 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
8828 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
8829 TypeManager.GetConstructedType.
8830 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
8832 2005-03-15 Marek Safar <marek.safar@seznam.cz>
8834 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
8837 * cs-parser.jay: Reports CS1527 for any namespace element.
8839 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
8842 * expression.cs (ParameterReference.IsAssigned): Changed error to
8844 (Error_WrongNumArguments): Moved CS0245 detection here.
8846 * statement.cs (Return.Resolve): Add CS1622 report.
8848 2005-03-11 Marek Safar <marek.safar@seznam.cz>
8850 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
8852 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
8854 * attribute.cs expression.cs: Get rid of some allocations.
8856 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
8858 * doc.cs : just eliminate the latest change.
8860 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
8862 * doc.cs : commented out the latest change. It breaks xml-030.cs
8864 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
8866 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
8867 fail. So invoke CreateType() in FindDocumentedType().
8869 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
8871 * cs-tokenizer.cs : added IsKeyword().
8872 * doc.cs : Detect keyword incorrectly used as identifier.
8873 Allow identifiers prefixed by @.
8875 2005-03-10 Marek Safar <marek.safar@seznam.cz>
8877 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
8878 It caused exception in namespace resolving (again!).
8880 * class.cs (Class.ctor): Removed exit.
8881 (PropertyMethod.ctor): ditto.
8883 * codegen.cs (Codegen.Reset): Reset static data.
8884 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
8886 * cs-tokenizer.cs (Cleanup): Removed.
8888 * driver.cs (GetSystemDir): Rewrote to one line command.
8889 It caused problem with unloaded dynamic modules.
8890 (UnixParseOption): Removed Exit.
8891 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
8892 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
8893 Now can be mcs used as library.
8895 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
8898 * location.cs (Reset): Reset static data.
8900 * namespace.cs (Reset): Reset static data.
8902 * report.cs (Report.Reset): Reset static data.
8904 * rootcontext.cs (RootContext.Reset): Reset static data.
8906 * tree.cs (RootTypes.ctor): Use Location.Null
8908 * typemanager.cs (TypeManager.Reset): Reset static data.
8909 (CoreLookupType): Removed Exit.
8910 (TypeHandle.Reset): Reset static data.
8912 2005-03-10 Raja R Harinath <rharinath@novell.com>
8915 * typemanager.cs (ComputeNamespaces): Import namespaces from
8916 referenced modules too.
8918 2005-03-09 Raja R Harinath <rharinath@novell.com>
8920 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
8923 2005-03-09 Raja R Harinath <rharinath@novell.com>
8925 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
8926 enclosing DeclSpace. This ensures that a name-lookup populates
8927 more caches and there are fewer 'TypeExpression's. Carve out
8928 nested type lookup into ...
8929 (LookupNestedTypeInHierarchy): ... this.
8931 2005-03-09 Raja R Harinath <rharinath@novell.com>
8933 Clean up a few partial-class semantics.
8934 Fixes test-357.cs and cs1618-2.cs.
8935 * cs-parser.jay (struct_declaration): Use 'current_class' as
8936 parent of newly-created struct. Remove call to Register ().
8937 Use 'pop_current_class' to complete handing the current struct.
8938 (interface_declaration): Likewise.
8939 (class_declaration): Likewise.
8940 (enum_declaration): Use 'current_class' as parent of newly created
8942 (delegate_declaration): Likewise.
8943 (pop_current_class): New function. This is used to handle closing
8944 up the 'current_class' and 'current_container', and pointing them
8945 to the enclosing class/container.
8946 (CSharpParser): Initialize 'current_class' too.
8947 * decl.cs (MemberCore): Add check for invariant: a partial
8948 container is not a parsed entity, and thus does not enclose any
8950 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
8951 (DeclSpace.BaseTypeExpr): Use it.
8952 (DeclSpace.LookupType): Add check for invariant.
8953 * class.cs (TypeContainer): Add check for invariant: a nested
8954 class should have the same NamespaceEntry as its enclosing class.
8955 (TypeContainer.EmitFieldInitializers): Make virtual.
8956 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
8958 (TypeContainer.Register): Remove.
8959 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
8960 null. Use TypeResolveEmitContext for resolving base types and
8961 interfaces. Move initialization of Parts.TypeBuilder here from
8963 (TypeContainer.DefineNestedTypes): ... here.
8964 (PartialContainer): Take a Namespace not a NamespaceEntry.
8965 (PartialContainer.Create): Don't use Register. Call the
8966 appropriate Add... function directly.
8967 (ClassPart): Take both the PartialContainer and the enclosing
8968 class as constructor arguments.
8969 (ClassPart.EmitFieldInitializers): Override.
8970 (ClassPart.PartFindNestedTypes): Remove.
8971 (FieldBase.GetInitializerExpression): Resolve the initializer
8972 expression in the emit context of the enclosing class.
8973 * tree.cs (RootTypes): Remove Register ().
8975 2005-03-08 Marek Safar <marek.safar@seznam.cz>
8977 * cs-parser.jay: Removed CS0134.
8979 * driver.cs: Removed CS1901.
8981 * expression.cs (SizeOf.DoResolve): Don't report CS0233
8982 for predefined types.
8984 2005-03-07 Duncan Mak <duncan@novell.com>
8986 * codegen.cs (Save): Catch UnauthorizedAccessException as
8987 well. Fixes bug #73454.
8989 2005-03-07 Marek Safar <marek.safar@seznam.cz>
8991 * cs-tokenizer.cs (xtoken): Add CS1035.
8993 * class.cs (MethodData.Define): Add CS0683.
8994 (FieldMember.ctor): Add CS0681.
8996 2005-03-07 Raja R Harinath <rharinath@novell.com>
8998 * ecore.cs (SimpleName.DoResolve): Rename from
8999 SimpleName.DoResolveAllowStatic.
9000 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
9001 Pass 'intermediate' flag to MemberStaticCheck.
9002 (SimpleName.MemberStaticCheck): Skip "static check" only in case
9003 of "intermediate" lookups via MemberAccess.
9004 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
9005 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
9007 2005-03-07 Raja R Harinath <rharinath@novell.com>
9010 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
9011 slipped in because of variable names that are identical to a
9012 builtin type's BCL equivalent ('string String;', 'int Int32;').
9013 (PropertyExpr.EmitInstance): Likewise.
9015 2005-03-04 Marek Safar <marek.safar@seznam.cz>
9017 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
9019 * report.cs (warning_ignore_table): Made public.
9021 2005-03-04 Raja R Harinath <rharinath@novell.com>
9024 * class.cs (MethodData.Emit): Pass 'container' to
9025 container.GetObsoleteAttribute instead of 'container.Parent'.
9027 2005-03-03 Marek Safar <marek.safar@seznam.cz>
9029 * cs-parser.jay: Add 1534 error test.
9031 * iterators.cs (Yield.CheckContext): Add error 1629.
9032 (Iterator.ctor): Save unsafe modifier.
9033 (MoveNextMethod.DoEmit): Restore unsafe context.
9035 * namespace.cs (UsingAlias): Better error message.
9037 2005-03-03 Dan Winship <danw@novell.com>
9039 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
9040 the warning message [#73219]
9042 2005-03-03 Raja R Harinath <rharinath@novell.com>
9044 Fix compile with MCS 1.0.0.0.
9045 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
9046 w_restore to not depend on string constant folding.
9048 2005-03-03 Raja R Harinath <rharinath@novell.com>
9050 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
9051 CS0246 check to users who passed 'silent = false'.
9052 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
9054 (SimpleName.SimpleNameResolve): Update.
9055 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
9056 (MemberAccess.IdenticalNameAndTypeName): Update.
9057 * doc.cs (FindDocumentedTypeNonArray): Update.
9059 2005-03-03 Raja R Harinath <rharinath@novell.com>
9061 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
9062 * parameters.cs (ComputeAndDefineParameters): Remove.
9063 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
9064 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
9065 Use GetParameterInfo.
9067 2005-03-02 Marek Safar <marek.safar@seznam.cz>
9069 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
9071 2005-03-02 Raja R Harinath <rharinath@novell.com>
9073 Unify DeclSpace.LookupType and DeclSpace.FindType.
9074 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
9075 is in charge of defining nested types on demand.
9076 (DeclSpace.LookupType): Use it when the current_type is a
9077 TypeBuilder. Use LookupTypeDirect for reflected types.
9078 (DeclSpace.FindType): Remove.
9079 (DeclSpace.LookupInterfaceOrClass): Likewise.
9080 (DeclSpace.DefineTypeAndParents): Likewise.
9081 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
9082 DeclSpace.LookupType.
9083 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
9084 * typemanager.cs (LookupType): Simplify.
9085 (AddUserType): Remove type from negative_hits.
9086 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
9087 * class.cs (TypeContainer.FindMembers): Move handling of nested
9089 (TypeContainer.FindMembers_NestedTypes): ... here.
9090 (TypeContainer.FindNestedType): Implement override.
9091 (ClassPart.FindNestedType): Delegate to PartialContainer.
9092 (ClassPart.PartFindNestedType): Looks up the nested types of the
9095 2005-03-02 Martin Baulig <martin@ximian.com>
9097 * class.cs (TypeContainer.DoDefineMembers): We also need a default
9098 static constructor in static classes.
9100 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
9102 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
9103 sizeParamIndex is not specified.
9105 2005-03-01 Marek Safar <marek.safar@seznam.cz>
9108 * report.cs (WarningMessage.IsEnabled): Missing null check.
9110 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9112 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
9113 in the fields and not in the properties.
9115 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
9117 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
9120 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9122 * attribute.cs: Small refactoring (improved robustness).
9123 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
9124 (ValidateGuid): Removed.
9125 (Resolve): Removed referenced to above mentioned.
9126 (GetAttributeUsage): Made private and changed to work without
9128 (GetIndexerAttributeValue): Don't crash.
9129 (GetConditionalAttributeValue): Ditto.
9130 (GetClsCompliantAttributeValue): Ditto.
9131 (ExtractSecurityPermissionSet): All attributes exceptions are
9133 (GetPropertyValue): New helper.
9134 (GetMethodImplOptions): New method.
9135 (DefinePInvokeMethod): Reuse common code. Implemented handling of
9136 some missing properties.
9138 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
9139 (Method.ApplyAttributeBuilder): Updated.
9141 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
9144 2005-02-28 Raja R Harinath <rharinath@novell.com>
9147 * report.cs (Report.SymbolRelatedToPreviousError): Handle
9148 non-simple types (array, pointer, reference).
9150 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9152 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
9154 * class.cs (MethodCore.IsDuplicateImplementation): Special error
9156 (Method.CheckBase): Catch wrong destructor here.
9157 (MethodData.Define): Add errors 550, 668.
9159 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
9161 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
9163 * pending.cs (VerifyPendingMethods): Add error 551.
9165 * typemanager.cs (CSharpName): Next error report helper.
9167 2005-02-25 Marek Safar <marek.safar@seznam.cz>
9169 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
9170 attributes. Removed useless attribute double check.
9171 It saves almost 2MBs for corlib.
9173 2005-02-25 Raja R Harinath <rharinath@novell.com>
9176 * statement.cs (ExpressionStatement.Resolve): Make robust to being
9177 called twice in case of error.
9179 2005-02-23 Chris Toshok <toshok@ximian.com>
9181 Fix compiler portions of #72827.
9182 * statement.cs (Block.Emit): call Begin/EndScope on the
9183 EmitContext instead of the ILGenerator.
9185 * codegen.cs (EmitContext.BeginScope): new method, call
9186 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
9188 (EmitContext.BeginScope): same, but EndScope and CloseScope
9190 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
9191 offset and call the superclass's OpenScope(int) with it.
9192 (SymbolWriter.CloseScope): get the current il
9193 offset and call superclass's CloseScope(int) with it.
9195 2005-02-23 Marek Safar <marek.safar@seznam.cz>
9197 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
9198 CS1677 for out and ref as well.
9200 * class.cs (Method.Define): Add error CS1599 detection.
9202 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
9204 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
9206 * delegate.cs (Delegate.Define): Add error CS1599 detection.
9208 * support.cs.cs (ModifierDesc): New helper method.
9210 2005-02-23 Raja R Harinath <rharinath@novell.com>
9211 Abin Thomas <projectmonokochi@rediffmail.com>
9212 Anoob V E <projectmonokochi@rediffmail.com>
9213 Harilal P R <projectmonokochi@rediffmail.com>
9216 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
9217 MemberLookup (used for error reporting) actually returns a result.
9218 Fix error report number (122, not 112).
9220 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
9221 Anoob V E <projectmonokochi@rediffmail.com>
9222 Harilal P R <projectmonokochi@rediffmail.com>
9225 * pending.cs (PendingImplementation.GetAbstractMethods):
9226 Find NonPublic members too.
9228 2005-02-22 Marek Safar <marek.safar@seznam.cz>
9230 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
9233 * class.cs (MethodCore.CheckMethodAgainstBase):
9234 Add error 239 report.
9236 2005-02-21 Raja R Harinath <rharinath@novell.com>
9239 * expression.cs (Invocation.IsApplicable): Make public.
9240 (Invocation.IsParamsMethodApplicable): Likewise.
9241 * delegate.cs (Delegate.VerifyApplicability): Don't use
9242 Invocation.VerifyArgumentCompat for parameter applicability
9243 testing. Use Invocation.IsApplicable and
9244 Invocation.IsParamsMethodApplicable.
9246 2005-02-21 Marek Safar <marek.safar@seznam.cz>
9248 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
9250 * class.cs (Operator.Define): Add error 217 report.
9252 2005-02-21 Raja R Harinath <rharinath@novell.com>
9254 * namespace.cs (UsingEntry.Resolve): Undo change below.
9256 2005-02-21 Raja R Harinath <rharinath@novell.com>
9259 * ecore.cs (Expression.MemberLookupFailed): Add argument to
9260 disable the error message when the extended MemberLookup also
9262 (Expression.MemberLookupFinal): Update.
9263 (SimpleName.DoSimpleNameResolve): Update.
9264 * expression.cs (MemberAccess.ResolveNamespaceOrType):
9265 Don't use MemberLookupFinal.
9266 (New.DoResolve): Update.
9267 (BaseAccess.CommonResolve): Update.
9269 2005-02-21 Raja R Harinath <rharinath@novell.com>
9272 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
9273 occured previously, don't resolve again.
9275 2005-02-21 Marek Safar <marek.safar@seznam.cz>
9278 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
9279 argument. Call ResolveAttributeUsage for unresolved.
9280 when types doesn't match ctor arguments.
9282 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
9283 for nested attribute classes.
9284 (Class.attribute_usage): Removed.
9285 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
9286 for attribute class.
9288 * ecore.cs (IsAttribute): Removed.
9290 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
9292 * rootcontext.cs (RegisterAttribute): Removed, attributes are
9294 (attribute_types): Removed.
9295 (EmitCode): Global attributes are emited as the latest.
9297 2005-02-18 Marek Safar <marek.safar@seznam.cz>
9299 * class.cs (EmitFieldInitializers): Don't emit field initializer
9300 for default values when optimilization is on.
9302 * constant.cs (Constant.IsDefaultValue): New property.
9304 * driver.cs: Add /optimize handling.
9308 * literal.cs: Implement new IsDefaultValue property.
9310 * rootcontext.cs (Optimize): New field, holds /optimize option.
9312 2005-02-18 Raja R Harinath <rharinath@novell.com>
9314 Fix crasher in re-opened #72347.
9315 * namespace.cs (Namespace.Lookup): Return null if
9316 DeclSpace.DefineType returns null.
9319 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
9321 2005-02-18 Raja R Harinath <rharinath@novell.com>
9323 Fix remainder of #63202. Change semantics of DoResolveLValue: it
9324 now returns null if it cannot resolve to an lvalue.
9325 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
9326 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
9327 returned null. Remove check for SimpleName.
9328 (EventExpr.DoResolveLValue): New.
9329 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
9330 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
9332 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
9334 (Unary.ResolveOperator): Move CS0211 check ...
9335 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
9337 (Unary.DoResolveLValue): Simplify.
9338 (AddressOf.DoResolveLValue): New.
9339 (ArrayAccess.DoResolveLValue): New.
9341 2005-02-16 Marek Safar <marek.safar@seznam.cz>
9343 * attribute.cs (Attribute.Resolve): Add arguments casting for
9344 when types doesn't match ctor arguments.
9346 2005-02-16 Raja R Harinath <rharinath@novell.com>
9348 Fix parts of #63202.
9349 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
9350 lookup of operator in base type. Ensure that all checks happen
9351 when the operator resolves to an "op_..." method.
9353 2005-02-15 Raja R Harinath <rharinath@novell.com>
9356 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
9357 'ignore_cs0104' parameter. Pass it to ...
9358 (NamespaceEntry.Lookup): ... this.
9359 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
9360 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
9361 (TypeLookupExpression.DoResolveAsTypeStep): Update.
9362 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
9363 Update. Request that cs0104 errors be ignored.
9364 (ComposedCast.ResolveAsTypeStep): Update.
9366 2005-02-14 Raja R Harinath <rharinath@novell.com>
9369 * expression.cs (Invocation.BetterFunction): Remove support for
9370 comparing virtual functions and their overrides.
9371 (Invocation.IsOverride): New.
9372 (Invocation.OverloadResolve): Don't consider 'override' functions
9373 during candidate selection. Store them in a lookaside list.
9374 If the selected method is a 'virtual' function, use the list to
9375 find any overrides that are closer to the LHS type.
9377 2005-02-14 Marek Safar <marek.safar@seznam.cz>
9379 * expression.cs (New.DoResolve): Add complex core type reduction.
9380 (New.Constantify): Converts complex core type syntax like 'new int ()'
9383 2005-02-14 Raja R Harinath <rharinath@novell.com>
9385 * decl.cs (EntryType.EntryType): New constructor to create an
9386 updated copy of a cache entry.
9387 (MemberCache.AddMethods): Use it.
9388 (MemberCache.ClearDeclaredOnly): Remove.
9389 (MemberCache.MemberCache): Update.
9391 2005-02-11 Miguel de Icaza <miguel@novell.com>
9393 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
9394 variable. This one is represents the actual low-level declaration
9395 of the method, as opposed to the semantic level `IsStatic'.
9397 An anonymous method which is hosted into a static method might be
9398 actually an instance method. IsStatic would reflect the
9399 container, while MethodIsStatic represents the actual code
9402 * expression.cs (ParameterReference): Use the new MethodIsStatic
9403 instead of IsStatic.
9405 * anonymous.cs (AnonymousMethod.Compatible): Pass the
9406 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
9407 set on the current EmitContext.
9409 * expression.cs (Cast): Overload DoResolveLValue so we can pass
9410 resolve our casted expression as an LValue. This triggers the
9411 proper LValue processing that is later required by Assign.
9415 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
9417 2005-02-11 Marek Safar <marek.safar@seznam.cz>
9419 C# 2.0 Fixed buffer implementation
9421 * anonymous.cs: Update after RegisterHelperClass renaming.
9423 * attribute.cs (AttributeTester.fixed_buffer_cache):
9424 Cache of external fixed buffers.
9425 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
9426 implementation if field is fixed buffer else null.
9429 (TypeContainer.AddField): Accept FieldMember instead of Field.
9430 (FieldBase.IsFieldClsCompliant): Extracted code from
9431 VerifyClsCompliance descendant customization.
9432 (FixedField): New class handles fixed buffer fields.
9433 (FixedFieldExternal): Keeps information about imported fixed
9435 (IFixedField): Make access to internal or external fixed buffer
9438 * cs-parser.jay: Add fixed buffer parsing.
9440 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
9443 * expression.cs (Indirection): Extended implementation to accept
9445 (PointerArithmetic.Emit): Get element from fixed buffer as well.
9446 (ElementAccess.MakePointerAccess): Get type as parameter.
9447 (DoResolve): Add fixed buffer field expression conversion.
9448 (DoResolveLValue): Ditto.
9449 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
9450 (ArrayPtr): Derives from FixedBufferPtr.
9451 (ArrayPtr.Emit): Add extra emit for array elements.
9453 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
9455 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
9456 for compiler generated types.
9457 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
9459 * statement.cs (Fixed): Refactored to be easier add fixed buffer
9460 and consume less memory.
9461 (Fixed.Resolve): Add fixed buffer case.
9463 * typemanager.cs (compiler_generated_attr_ctor,
9464 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
9465 (HasElementType): Add our own implementation to work on every
9468 2005-02-11 Miguel de Icaza <miguel@novell.com>
9470 * anonymous.cs (CaptureContext): Track whether `this' has been
9473 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
9474 only captured `this' if it was implicitly done (instance
9475 methods/variables were used).
9477 * codegen.cs (EmitContext.CaptureThis): New method to flag that
9478 `this' must be captured.
9480 2005-01-30 Miguel de Icaza <miguel@novell.com>
9482 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
9483 is null it means that there has been no need to capture anything,
9484 so we just create a sibling.
9486 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
9488 Just a partial fix. The other half is fairly elusive.
9490 2005-02-10 Raja R Harinath <rharinath@novell.com>
9492 Fix #52586, cs0121-4.cs.
9493 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
9494 and return a hashtable.
9495 (MemberCache.ClearDeclaredOnly): New.
9496 (MemberCache.MemberCache): Update to change. Make a deep copy of
9497 the method_hash of a base type too.
9498 (MemberCache.AddMethods): Adapt to having a deep copy of the base
9499 type methods. Overwrite entries with the same MethodHandle so
9500 that the ReflectedType is correct. The process leaves in base
9501 virtual functions and their overrides as distinct entries.
9502 (CacheEntry): Now a class instead of a struct. It shouldn't alter
9503 matters since it was boxed in a ArrayList before.
9504 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
9506 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
9507 case of a virtual function and its override (choose the overload
9509 (Invocation.OverloadResolve): Avoid 'override' members during
9510 'applicable_type' calculation.
9512 2005-02-09 Raja R Harinath <rharinath@novell.com>
9514 Combine two near-redundant caches.
9515 * typemanager.cs (method_params): Rename from method_internal_params.
9516 (TypeManager.GetParameterData): New. Replace
9517 Invocation.GetParameterData.
9518 (TypeManager.LookupParametersByBuilder): Remove.
9519 * expression.cs (Invocation.method_parameter_cache): Remove.
9520 (Invocation.GetParameterData): Remove.
9522 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
9525 2005-02-08 Raja R Harinath <rharinath@novell.com>
9528 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
9529 TypeManager.multicast_delegate_type is null, resolve it by looking
9530 up "System.MulticastDelegate".
9531 * rootcontext.cs (RootContext.ResolveCore): Simplify.
9533 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
9534 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
9535 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
9538 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
9539 (LabeledStatement.AddReference): New. Set 'referenced'.
9540 (Goto.Resolve): Use it.
9542 2005-02-05 John Luke <john.luke@gmail.com>
9544 * driver.cs: remove duplicate -doc line in Usage ()
9546 2005-02-04 Raja R Harinath <rharinath@novell.com>
9548 * location.cs (Location.AddFile): Fix CS2002 error report.
9550 2005-02-02 Martin Baulig <martin@ximian.com>
9552 * delegate.cs (Delegate.DefineType): Report an internal error if
9553 TypeManager.multicast_delegate_type is null. See bug #72015 for
9556 2005-02-02 Raja R Harinath <rharinath@novell.com>
9558 Fix a crasher in a variant of #31984.
9559 * const.cs (Constant.CheckBase): New override that defers the
9560 new-or-override check in case the base type hasn't been populated
9562 (Constant.Define): Ensure the new-or-override check is performed.
9564 2005-02-01 Duncan Mak <duncan@ximian.com>
9566 * const.cs (LookupConstantValue): Check that `ce' is not null
9567 before calling GetValue ().
9569 2005-02-01 Raja R Harinath <rharinath@novell.com>
9571 Fix test-334.cs (#69519).
9572 * cs-parser.jay (using_alias_directive): Pass in an expression to
9573 NamespaceEntry.UsingAlias.
9574 (using_namespace_directive): Pass in an expression to
9575 NamespaceEntry.Using.
9576 (namespace_name): Don't flatten to a string.
9577 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
9578 (NamespaceEntry.AliasEntry.Resolve): Lookup using
9580 (NamespaceEntry.UsingEntry): Likewise.
9581 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
9583 (NamespaceEntry.LookupForUsing): Remove.
9584 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
9586 (NamespaceEntry.Lookup): Remove support for dotted names.
9588 2005-02-01 Raja R Harinath <rharinath@novell.com>
9590 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
9592 (NamespaceEntry.ImplicitParent): Compute on demand.
9593 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
9594 parallels the current.
9595 (NamespaceEntry.LookupForUsing): Use it.
9596 (NamespaceEntry.Lookup): If the current namespace-entry is
9597 implicit, don't search aliases and using tables.
9599 2005-02-01 Raja R Harinath <rharinath@novell.com>
9602 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
9604 (TypeContainer.BaseCache): Compute on demand.
9605 (TypeContainer.FindMembers): Define constants and types if they're
9606 not already created.
9607 (FieldMember.Define): Move resetting of ec.InUnsafe before error
9609 * const.cs (Constant.Define): Make idempotent.
9611 2005-01-29 Miguel de Icaza <miguel@novell.com>
9613 * pending.cs: Produce better code (no nops produced by using Ldarg
9616 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
9617 i - 1' it should be arg + 1.
9621 2005-01-28 Raja R Harinath <rharinath@novell.com>
9623 * attribute.cs (Attribute.CheckAttributeType): Make private
9625 (Attribute.ResolveType): Make virtual.
9626 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
9627 handling of RootContext.Tree.Types.
9629 2005-01-27 Raja R Harinath <rharinath@novell.com>
9631 Update attribute-handling to use the SimpleName/MemberAccess
9633 * cs-parser.jay (attribute): Pass in an expression to the
9634 constructors of Attribute and GlobalAttribute.
9635 * attribute.cs (Attribute): Take an expression for the name.
9636 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
9637 passed in attribute name expression.
9638 (Attribute.CheckAttributeType): Use it.
9639 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
9640 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
9641 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
9642 argument to prevent error messages if the lookup fails.
9644 2005-01-27 Marek Safar <marek.safar@seznam.cz>
9646 * expression.cs (Indirection): Implemented IVariable interface
9647 to support indirection in AddressOf operator.
9648 (PointerArithmetic.Emit): Add optimalization for case where
9649 result can be precomputed.
9651 2005-01-26 Martin Baulig <martin@ximian.com>
9653 * class.cs (TypeContainer.AttributeTargets): Return the correct
9654 AttributeTargets depending on our `Kind' instead of throwing an
9655 exception; fixes #71632.
9657 2005-01-26 Marek Safar <marek.safar@seznam.cz>
9660 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
9663 2005-01-25 Raja R Harinath <rharinath@novell.com>
9666 * expression.cs (MemberAccess.DoResolve): Don't complain with
9667 cs0572 when the LHS of a member access has identical name and type
9670 2005-01-25 Marek Safar <marek.safar@seznam.cz>
9673 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
9675 Create custom PermissionSet only for PermissionSetAttribute.
9677 2005-01-24 Marek Safar <marek.safar@seznam.cz>
9680 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
9681 delegates in static class.
9683 2005-01-24 Martin Baulig <martin@ximian.com>
9685 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9686 merging an implicit block, just use its reachability.
9688 * statement.cs (Block.Resolve): Make the unreachable code check
9689 work wrt. implicit blocks; see test-337 from #63842.
9691 2005-01-21 Alp Toker <alp@atoker.com>
9693 * cs-parser.jay: destructor_declaration's container is PartialContainer
9694 not Class when partial types are used, so use Kind prop instead of
9697 2005-01-22 Miguel de Icaza <miguel@ximian.com>
9699 * cs-parser.jay: Improve error reporting when an interface
9702 2005-01-20 Dick Porter <dick@ximian.com>
9704 * support.cs: SeekableStreamReader fix from Sandor Dobos
9705 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
9706 chars are read. Fixes bug 70369.
9708 2005-01-20 Raja R Harinath <rharinath@novell.com>
9710 * cs-parser.jay (catch_clause): Simplify current_block handling
9713 2005-01-17 Miguel de Icaza <miguel@ximian.com>
9715 * convert.cs (ImplicitStandardConversionExists): Synchronize the
9716 code with ImplicitStandardConversion to handle the implicit
9717 conversion of method groups into valid delegate invocations.
9719 The problem is that in parameter handling we were using this code
9720 path. Fixes bug #64698
9722 2005-01-19 Raja R Harinath <rharinath@novell.com>
9724 * cs-parser.jay: Fix several infelicities.
9725 - Avoid assigning to the parser value stack. Code like
9726 '$3 = null' is unclean. Synthesize a value for the code block
9728 - Avoid using oob_stack for storing location information. Use ...
9729 (_mark_): ... this. New (empty) rule. Saves the current location
9731 (foreach_statement): Avoid using oob_stack for current_block
9732 handling. Use technique used in for_statement and
9733 using_statement. Synthesize a value for the code block to store
9734 additional intermediate information.
9736 2005-01-13 Miguel de Icaza <miguel@ximian.com>
9738 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
9739 of a different type is only allowed to private fields of a
9740 containing type, not on fields of a base class.
9742 See test-174.cs and error cs0122-9.cs
9744 2005-01-13 Raja R Harinath <rharinath@novell.com>
9746 Fix test-335.cs (bug #58126).
9747 * cs-parser.jay (argument): Split out non-expression parts of the
9748 rule into 'non_simple_argument'.
9749 (invocation_expression): Support parenthesized invocations with
9750 multiple arguments, and with single non-simple arguments.
9752 2005-01-13 Raja R Harinath <rharinath@novell.com>
9754 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
9757 2005-01-12 Raja R Harinath <rharinath@novell.com>
9759 Fix cs0038-1.cs, cs1640-6.cs.
9760 * ecore.cs (Expression.Resolve): Remove special-case for
9761 SimpleName in error-handling.
9762 (Expression.almostMatchedMembers): Relax access permission to
9764 (Expression.MemberLookupFailed): Handle duplicates in
9765 almostMatchedMembers list.
9766 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
9767 * expression.cs (New.DoResolve): Report CS1540 for more cases.
9768 * typemanager.cs (GetFullNameSignature): Use the MethodBase
9769 overload if the passed in MemberInfo is a MethodBase.
9771 2005-01-12 Marek Safar <marek.safar@seznam.cz>
9774 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
9775 for non-CAS & merge permission sets properly.
9777 2005-01-11 Raja R Harinath <rharinath@novell.com>
9779 Improve standard-compliance of simple name and member access
9780 resolution. Fixes bugs #52697, #57200, #67520, #69519.
9781 * ecore.cs (FullNamedExpression): New abstract base class
9782 for Namespaces and TypeExpressions.
9783 (ResolveFlags.SimpleName): Remove.
9784 (SimpleName): Remove support for dotted names.
9785 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
9786 DeclSpace.FindType and DeclSpace.LookupType.
9787 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
9788 (Expression.ExprClassName): Make member function.
9789 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
9790 a namespace. Remove creation of dotted "SimpleName"s.
9791 (MemberAccess.DoResolve): Likewise.
9792 * decl.cs (DeclSpace.Cache): Make private.
9793 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
9794 (DeclSpace.FindType): Update.
9795 (DeclSpace.LookupType): Move here from RootContext. Return a
9796 FullNamedExpression.
9797 * namespace.cs (Namespace): Derive from FullNamedExpression
9798 so that it can be part of expression resolution.
9799 (Namespace.Lookup): Return an FullNamedExpression.
9800 (NamespaceEntry.LookupAlias): Lookup aliases only in current
9802 * rootcontext.cs (NamespaceLookup): Remove.
9803 (LookupType): Move to DeclSpace.
9804 * attribute.cs (CheckAttributeType): Update.
9805 * doc.cs (FindDocumentedType): Remove allowAlias argument.
9806 (FindDocumentedTypeNonArray): Likewise.
9808 2005-01-11 Raja R Harinath <rharinath@novell.com>
9810 Fix cs0509.cs, cs1632.cs.
9811 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
9812 is the same as IsInterface.
9813 (TypeContainer.GetClassBases): Likewise.
9814 * statement.cs (LabeledStatement.ig): New field.
9815 (LabeledStatement.LabelTarget): Save ILGenerator which created the
9817 (LabeledStatement.DoEmit): Check that the label was created with
9818 the same ILGenerator.
9820 2005-01-10 Marek Safar <marek.safar@seznam.cz>
9823 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
9824 accessors to its properties.
9826 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
9827 from accessors to property.
9829 2005-01-10 Marek Safar <marek.safar@seznam.cz>
9832 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
9835 2005-01-08 Miguel de Icaza <miguel@ximian.com>
9837 * attribute.cs: Check for null and empty strings.
9839 I have lost another battle to Paolo.
9841 2005-01-07 Marek Safar <marek.safar@seznam.cz>
9844 * class.cs (PropertyMethod): Set Parent field in ctors.
9845 (SetMethod.InternalParameters): Add unsafe switch hack.
9846 Override MarkForDuplicationCheck where it is appropriate.
9848 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
9849 It says whether container allows members with the same name.
9851 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
9852 Removed is_method parameter.
9854 2005-01-06 Duncan Mak <duncan@ximian.com>
9856 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
9857 because the previous change led to incorrect reporting of CS1032
9858 ("Cannot define/undefine preprocessor symbols after first token in
9859 file"). Instead of using `tokens_seen' as the only flag that
9860 triggers CS1040, introduce `comments_seen'. This new flag is used
9861 to signify having seen comments on the current line, so it is
9862 unset after a newline.
9864 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
9866 * doc.cs : When searching for a type, find nested type too.
9867 This fixes bug #71040.
9869 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
9872 - Warn missing member comment on those classes which also does not
9873 have doc comments. Fixed bug #71041.
9874 - Don't warn missing doc comment on default constructor.
9877 2005-01-06 Duncan Mak <duncan@ximian.com>
9879 * cs-tokenizer.cs (xtoken): After handling traditional C-style
9880 comments, set `tokens_seen' to true. This allows us to detect
9881 misplaced preprocessor directives (i.e. not at the beginning of
9882 the a line, nor after whitespaces). In that case, report error
9883 CS1040. This fixes bug #56460.
9885 * cs-parser.jay (interface_member_declaration): Add checks for
9886 IsExplicitImpl, and report CS0541 error if an interface member is
9887 defined as an explicit interface declaration.
9889 2005-01-06 Marek Safar <marek.safar@seznam.cz>
9892 * class.cs (PropertyMethod): Set Parent field in ctors.
9893 (SetMethod.InternalParameters): Add unsafe switch hack.
9895 * decl.cs (MemberCore.Parent): Cannot be readonly.
9897 2005-01-06 Raja R Harinath <rharinath@novell.com>
9899 * decl.cs (DeclSpace.ResolveType): Remove.
9900 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
9901 Merge in code from ...
9902 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
9903 * class.cs, enum.cs: Update to changes.
9905 2005-01-06 Miguel de Icaza <miguel@ximian.com>
9907 * anonymous.cs: Ensure that we init the scope of our parent if it
9908 has not been initialized yet.
9910 2004-12-30 Duncan Mak <duncan@ximian.com>
9912 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
9913 if field.FieldBuilder is null. Fixes #70758.
9915 * convert.cs: Fixed some typos and updated some of the comments.
9916 (ImplicitStandardConversionExists):
9917 (TryImplicitIntConversion): If `target_type' is an interface and
9918 the type of `ic' implements this interface, return true or a new
9919 BoxedCast instead of null. This fixes #70468.
9921 2004-12-29 Duncan Mak <duncan@ximian.com>
9923 * expression.cs (Argument.Emit): Check that Expr is
9924 IMemoryLocation before casting to it, and report CS1510 otherwise.
9928 2004-12-21 Ben Maurer <bmaurer@ximian.com>
9930 * statement.cs (Block.ThisVariable): remove the recursion here, to
9931 make the --profile more sane.
9933 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
9935 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
9936 assembly, by JB Evain.
9938 2004-12-17 Raja R Harinath <rharinath@novell.com>
9940 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
9941 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
9942 "parent" refers to enclosing type/class. "base" refers to superclass.
9944 2004-12-17 Raja R Harinath <rharinath@novell.com>
9946 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9947 Ensure that we only have GlobalAttributes.
9948 * attribute.cs (Attribute.Emit): Make non-virtual.
9949 (GlobalAttribute.Emit): Remove.
9950 (Attribute.Resolve): Make virtual.
9951 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
9952 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
9953 the argument. Don't create one.
9954 (Attribute.GetObsoleteAttribute): Likewise.
9955 (Attribute.GetClsCompliantAttributeValue): Likewise.
9956 * class.cs, decl.cs: Update to changes.
9958 2004-12-17 Marek Safar <marek.safar@seznam.cz>
9960 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
9962 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
9964 * statement.cs (Foreach.Resolve): Add error 186 report.
9966 2004-12-16 Marek Safar <marek.safar@seznam.cz>
9968 * expression.cs (Conditional.DoResolve): Add warning 429.
9970 * statement.cs (If.Resolve): Add warning 665.
9972 2004-12-16 Raja R Harinath <rharinath@novell.com>
9974 New invariant: RootContext.Tree.Types.NamespaceEntry == null
9975 except when in the parser, and in GlobalAttribute.
9976 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
9977 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
9978 RootContext.Tree.Types.NamespaceEntry once work is done.
9979 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
9980 and resets RootContext.Tree.Types.NamespaceEntry.
9982 2004-12-15 Marek Safar <marek.safar@seznam.cz>
9984 * cs-parser.jay: Don't create a block for every variable.
9986 2004-12-14 Miguel de Icaza <miguel@ximian.com>
9988 * location.cs: Provide extra information.
9990 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
9991 variables from the captured environment, it is the ldarg_0.
9993 2004-12-14 Marek Safar <marek.safar@seznam.cz>
9995 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
9998 * class.cs: Changed warning level for 169 to avoid developer
9999 displeasure from warning flooding. It will be changed back when they
10000 fix most of current BCL warnings.
10002 * RootContext.cs: Pushed default WarningLevel to 3.
10004 * statement.cs: Removed unused variable.
10006 2004-12-14 Marek Safar <marek.safar@seznam.cz>
10008 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
10009 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
10010 Add error 502 report.
10011 (StaticClass.DefineType): Add error 441 report.
10012 (Class.AllowedModifiersProp): New virtual property as temporary
10013 extension to AllowedModifiers.
10014 (Class.DefineType): Add error 418 report. Moved ModFlags check here
10015 to share implementation with StaticClass and don't call virtual
10018 * driver.cs (MainDriver): Add error 1558 test.
10020 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
10021 report. Moved error 36 test here.
10023 * statement.cs (Throw.Resolve): Add error 724 report.
10025 * typemanager.cs: Add out_attribute_type core type.
10027 2004-12-13 Marek Safar <marek.safar@seznam.cz>
10029 * class.cs (TypeContainer.VerifyClsCompliance): Add error
10031 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
10033 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
10036 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
10038 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
10039 Add error 3023 report.
10040 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
10042 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
10045 2004-12-12 John Luke <john.luke@gmail.com>
10047 * driver.cs (AddArgs): take -- into account when
10048 adding arguments, fixes bug 65710
10050 2004-12-12 Martin Baulig <martin@ximian.com>
10052 * expression.cs (Unary.TryReduceNegative): Added support for
10053 SByteConstant and ByteConstant.
10054 (Unary.Reduce): Check error values from TryReduceNegative().
10056 2004-12-10 Marek Safar <marek.safar@seznam.cz>
10058 * attributes.cs (Attribute.Resolve): Avoid multiple error report
10059 and report exception as error 182.
10061 2004-12-10 Raja R Harinath <rharinath@novell.com>
10063 * driver.cs (Main): Fix message when there are warnings.
10065 2004-12-09 Miguel de Icaza <miguel@ximian.com>
10067 * delegate.cs: Fixed my fix from yesterday, sorry about that.
10069 2004-12-09 Marek Safar <marek.safar@seznam.cz>
10071 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
10072 Reduced number of warnings.
10074 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
10076 2004-12-08 Miguel de Icaza <miguel@ximian.com>
10078 * driver.cs: Removed message.
10080 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
10082 2004-12-08 <vargaz@freemail.hu>
10084 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
10086 2004-12-08 Martin Baulig <martin@ximian.com>
10088 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
10089 instead of a CS3002 for properties and indexer.
10091 2004-12-08 Martin Baulig <martin@ximian.com>
10093 * decl.cs (MemberName.ToString): Make this work again.
10095 2004-12-08 Marek Safar <marek.safar@seznam.cz>
10097 * attribute.cs (Resolve): Add error 591 detection.
10099 * class.cs (FieldMember.Define): Add error 1547 detection.
10100 (Indexer.Define): Add error 620 detection.
10101 (Operator.Define): Add error 590 detection.
10103 * ecore.cs: Missing argument for error 79.
10105 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
10108 2004-12-07 Marek Safar <marek.safar@seznam.cz>
10111 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
10114 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
10116 * cs-parser.jay : handle doc comments on implicit/explicit operators.
10117 Some operator comments were suppressed.
10118 * doc.cs : Implicit/explicit operator name in doc comments are like
10119 "op_Explicit(type)~returnType", so added suffix handling.
10121 2004-12-07 Martin Baulig <martin@ximian.com>
10124 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
10125 (MemberCore.GetClsCompliantAttributeValue): Likewise.
10126 (DeclSpace.ec): New protected field; store the EmitContext here.
10127 (DeclSpace.EmitContext): New public property; moved here from
10129 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
10132 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
10133 (Enum.Emit): Don't create a new EmitContext.
10135 * delegate.cs (Delegate.DefineType): Always create the
10138 * iterators.cs (Iterators.DefineIterator): Create a new
10139 EmitContext and store it in `ec'.
10141 2004-08-24 Martin Baulig <martin@ximian.com>
10144 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
10145 this for accessibility checks.
10146 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
10147 IsNestedFamilyAccessible.
10148 (TypeManager.IsSubclassOf): New method, do what the name actually
10151 2004-12-06 Raja R Harinath <rharinath@novell.com>
10153 Fix crash on cs0657-17.cs.
10154 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10155 Use RootContext.Tree.Types, not 'new RootTypes ()'.
10156 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
10157 the case where the NamespaceEntry gets overwritten.
10159 2004-12-06 Marek Safar <marek.safar@seznam.cz>
10161 Fixed #69195, #56821
10162 * ecore.cs (ResolveBoolean): Tiny refactoring.
10164 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
10165 of right expression resolving when left is false constant and
10166 operator is LogicalAnd OR true constant and operator is LogicalOr.
10168 * statement.cs (ResolveUnreachable): Always reports warning.
10170 2004-12-05 Miguel de Icaza <miguel@ximian.com>
10172 * class.cs: Distinguish between 1721 and 1722 (just a little help
10173 for the programmer).
10175 2004-12-03 Miguel de Icaza <miguel@ximian.com>
10177 * delegate.cs: Only allow this on new versions of the language.
10179 2004-12-02 Duncan Mak <duncan@ximian.com>
10181 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
10183 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
10184 here as a static method. Take an additional bool out parameter
10185 `must_do_cs1540_check' for signaling to InstanceResolve.
10186 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
10187 member field from PropertyExpr class and made it an argument of
10188 the method instead.
10189 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
10190 check for MarshalByRefObject, and report CS0122 instead of CS1540.
10191 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
10192 and `remove_accessor' as well as InstanceResolve: report CS0122
10197 2004-12-03 Raja R Harinath <rharinath@novell.com>
10199 Fix test-327.cs, test-328.cs, and put in early infrastructure
10200 for eventually fixing #52697.
10201 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
10202 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
10203 from other methods.
10204 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
10205 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
10206 (VerifyUsing, error246): Update.
10207 * rootcontext.cs (RootContext.NamespaceLookup): Just use
10208 'NamespaceEntry.LookupNamespaceOrType'.
10210 2004-12-03 Martin Baulig <martin@ximian.com>
10212 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10213 method as our child, call AnonymousMethod.Compatible() on it.
10215 2004-12-03 Raja R Harinath <rharinath@novell.com>
10217 Disable XML documentation support in 'basic' profile.
10218 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
10219 Redirect XmlElement to System.Object.
10220 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
10221 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
10222 * mcs.exe.sources: Add doc-bootstrap.cs.
10223 * doc-bootstrap.cs: New file. Contains empty stub implementation
10226 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
10228 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
10229 comments are allowed.
10231 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10233 * delegate.cs: Add checks for subtypes in paramaters and return values
10234 in VerifyMethod () to add support for Covariance/Contravariance
10237 2004-12-02 Miguel de Icaza <miguel@ximian.com>
10239 * report.cs: Remove extra closing parenthesis.
10241 * convert.cs (Error_CannotImplicitConversion): If the name of the
10242 types are the same, provide some extra information.
10244 * class.cs (FieldBase): Use an unused bit field from the field to
10245 encode the `has_offset' property from the FieldMember. This saves
10246 a couple of Ks on bootstrap compilation.
10248 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10249 method as our child, return the AnonymousMethod resolved
10252 * expression.cs (New.DoResolve): Allow return values from
10253 NewDelegate to also include AnonymousMethods.
10257 2004-12-02 Marek Safar <marek.safar@seznam.cz>
10260 * attribute.cs (Resolve): Improved implementation of params
10261 attribute arguments.
10263 * support.cs (ParameterData): Add HasParams to be faster.
10265 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
10267 all things are for /doc support:
10269 * doc.cs: new file that supports XML documentation generation.
10270 * mcs.exe.sources: added doc.cs.
10272 Handle /doc command line option.
10273 Report error 2006 instead of 5 for missing file name for /doc.
10274 Generate XML documentation when required, after type resolution.
10276 Added support for picking up documentation (/// and /** ... */),
10277 including a new XmlCommentState enumeration.
10279 Added lines to fill Documentation element for field, constant,
10280 property, indexer, method, constructor, destructor, operator, event
10281 and class, struct, interface, delegate, enum.
10282 Added lines to warn incorrect comment.
10284 Added Documentation field (passed only when /doc was specified).
10286 Added DocComment, DocCommentHeader, GenerateDocComment() and
10287 OnGenerateDocComment() and some supporting private members for
10288 /doc feature to MemberCore.
10290 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
10292 Added overriden DocCommentHeader.
10294 Added overriden DocCommentHeader and GenerateDocComment().
10296 2004-12-01 Miguel de Icaza <miguel@ximian.com>
10298 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
10299 unwrapping the enumeration values, chain to
10300 DoConstantNumericPromotions again, so we can promote things to the
10301 fundamental types (takes care of enums that are bytes, sbytes).
10305 2004-12-01 Raja R Harinath <rharinath@novell.com>
10307 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
10308 Fix long-standing bug in type-lookup. Use FindType instead of
10309 LookupType when ec.ResolvingTypeTree.
10310 (Attribute.ResolveType, Attribute.Resolve)
10311 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
10313 (Attributes.Search): Remove internal version. Update.
10314 (Attributes.SearchMulti): Update.
10315 (Attributes.GetClsCompliantAttribute): Remove.
10316 (Attributes.GetIndexerNameAttribute): Remove.
10317 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
10318 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
10319 * class.cs (Indexer.Define): Likewise.
10321 2004-12-01 Marek Safar <marek.safar@seznam.cz>
10324 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
10325 MarshallByReference members access.
10327 * expression.cs: Use CheckMarshallByRefAccess;
10328 Better error CS0197 message.
10330 * report.cs: Print whole related error message.
10332 2004-11-30 Raja R Harinath <rharinath@novell.com>
10334 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
10335 the current directory to help debugging.
10337 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10339 * class (GetClassBases): Better error 60 report.
10340 (EventProperty): Disabled warning 67 detection.
10342 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10345 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
10347 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
10350 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10353 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
10355 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
10357 2004-11-26 Miguel de Icaza <miguel@ximian.com>
10359 * attribute.cs (Attribute.Resolve): Refine error reporting and
10360 report a cs0117 if the identifier does not exist, to distinguish
10361 from 0617 which is a miss-use of the actual identifier.
10363 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
10364 between cs0070 and cs0079.
10366 * class.cs (MemberBase.DoDefine): When reporting a wrong
10367 accessibility level, we use MethodCore to compare instead of
10368 Method (this was a regression in some refactoring effort).
10370 So now we correctly report cs0056 again.
10372 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
10373 testing the target_type (which was known to be object_type) and
10374 not the source type (which is anonymous_method).
10376 Fixed reporting of error cs1660.
10378 * expression.cs (UserCast.Source): Expose the underlying cast.
10380 * statement.cs (Switch.SwitchGoverningType): Sort the list of
10381 allowed types to find a match to int32 first (most common).
10383 In addition, it ignores any ImplicitUserConversions that did an
10384 internal implicit conversion (as the switch statement allows only
10385 one integral conversion to exist).
10387 * class.cs (PartialContainer.Create): rename `name' to
10388 `member_name' for clarity. Then replace the string calls with a
10389 call to MemberName.GetPartialName, as now using
10390 MemberName.ToString is an error (this is due to the side effects
10391 it had, that were fixed in the past).
10393 This will restore the error reporting on a number of partial class
10394 errors that were missusing this (and getting an exception as a
10395 results, which is now just a plain textual warning, because
10396 yyparse debug output would crash otherwise).
10398 2004-11-26 Raja R Harinath <rharinath@novell.com>
10400 * Makefile (PROGRAM_INSTALL_DIR): Remove.
10402 2004-11-25 Ben Maurer <bmaurer@ximian.com>
10404 * rootcontext.cs (LookupType): Make sure to cache lookups that
10405 don't give us a negative result. This saves about 5% of corlib
10408 2004-11-25 Miguel de Icaza <miguel@ximian.com>
10410 * report.cs (AbstractMessage.Print): messages are sent to stderr
10412 * class.cs (TypeContainer.GetClassBases): It is an error to have a
10413 non-interface in the list of interfaces (at this point, either
10414 parent was properly set, or a base class is being listed in the
10415 interfaces section).
10417 This flags error 1722, and resolves the crash from bug 69259.
10419 2004-11-25 Ben Maurer <bmaurer@ximian.com>
10421 * statement.cs (Using.EmitExpressionFinally): make this work right
10422 for valuetypes. Fixes 69926.
10424 2004-11-25 Miguel de Icaza <miguel@ximian.com>
10426 * const.cs (Const.ChangeType): Cope with the "0 literal can be
10427 converted to an enum" here, before we try to change the underlying
10428 type. This code exists, but it is a different code path than the
10429 one used while encoding constants.
10431 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
10432 old bug: when converting from the null literal to a pointer,
10433 return an EmptyCast, not the NullLiteral.
10435 This fixes #69921, the recent null_type changes probably made this
10436 bug more prominent.
10438 (ImplicitReferenceConversionExists): In addition, resynchronized
10439 the code here, so it matches the same code in
10440 ImplicitReferenceConversionExists for the `from any class-type S
10441 to any interface-type T'.
10444 2004-11-25 Marek Safar <marek.safar@seznam.cz>
10446 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
10448 2004-11-24 Miguel de Icaza <miguel@ximian.com>
10450 * cs-parser.jay: Use verbosity accordingly.
10452 2004-11-24 Marek Safar <marek.safar@seznam.cz>
10454 * expression.cs (Unary.ResolveOperator): Do not report warning;
10455 AddressOf reads from variable.
10457 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
10459 2004-11-24 Marek Safar <marek.safar@seznam.cz>
10463 * attribute.cs (Attributable): Removed CheckTargets.
10464 (Attributes.Emit): Explicit attribute targets are tested here.
10466 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
10467 not enabled for interfaces.
10469 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
10470 (GetAssemblyName): Ouch next bug there.
10472 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10474 * expression.cs: Error 275 added.
10476 2004-11-23 Marek Safar <marek.safar@seznam.cz>
10478 Fix bug #69177 (Implemented decimal constant support)
10480 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
10481 (BinaryFold): Add DecimalConstant.
10483 * const.cs (Define): Decimal constant
10485 (ChangeType): Add decimal type handling.
10486 (LookupConstantValue): Don't set value for decimal type but
10487 emit DecimalConstantAttribute. Needed for constant optimization.
10489 * constant.cs (ToDecimal): New method.
10490 (ConvertToDecimal): New method.
10491 (IntConstant): Implemented ConvertToDecimal.
10492 (DecimalConstant.Emit): Emit optimized version for decimals in
10495 * expression.cs (ResolveOperator): Changed order of constant
10496 reduction to work correctly with native types which have
10497 overloaded operators.
10498 (ResolveMemberAccess): Extract constant value from attribute
10501 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
10503 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
10504 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
10505 (ChangeType): Decimal is special.
10506 (TypeToCoreType): Add decimal type.
10508 2004-11-22 Marek Safar <marek.safar@seznam.cz>
10510 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
10513 2004-11-22 Marek Safar <marek.safar@seznam.cz>
10515 * class.cs (EventField.ApplyAttributeBuilder): Fix error
10518 2004-11-19 Marek Safar <marek.safar@seznam.cz>
10520 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
10522 * pending.cs (PendingImplementation): Grab only interfaces.
10524 2004-11-19 Marek Safar <marek.safar@seznam.cz>
10526 * statement.cs (ForeachHelperMethods): Add location member and
10527 error 202 detection.
10529 2004-11-19 Raja R Harinath <rharinath@novell.com>
10531 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
10532 automatically handled by executable.make.
10533 (PROGRAM): Make profile-specific.
10535 2004-11-18 Marek Safar <marek.safar@seznam.cz>
10537 * expression.cs (DoResolveBase): Fixed wrong warning for out
10540 2004-11-18 Martin Baulig <martin@ximian.com>
10542 Merged latest changes into gmcs. Please keep this comment in
10543 here, it makes it easier for me to see what changed in MCS since
10544 the last time I merged.
10546 2004-11-17 Raja R Harinath <rharinath@novell.com>
10548 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
10549 (TypeHandle.GetMemberCache): New.
10550 (TypeHandle.TypeHandle): Update.
10551 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
10552 (TypeManager.LookupParentInterfacesCache):
10553 Rename from LookupInterfaceCache. Optimize slightly.
10554 (TypeManager.MemberLookup_FindMembers): Update.
10555 * decl.cs (MemberCache.MemberCache): Set Container to null in the
10556 multi-type variant.
10557 (AddCacheContents): Rename from AddHashtable.
10558 * class.cs (TypeContainer.parent_container): Remove.
10559 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
10560 (TypeContainer.DoDefineMembers): Don't initialize it.
10561 Update to name changes.
10563 2004-11-17 Miguel de Icaza <miguel@ximian.com>
10565 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
10566 that factors the code to check access modifiers on override.
10568 (PropertyBase): Use the code here.
10570 Patch from Lluis S'anchez, fixes bug #69361.
10572 2004-11-15 Miguel de Icaza <miguel@ximian.com>
10574 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
10575 routine that is used to report the use of a captured variable
10576 whose address has been taken.
10578 There are two checks: one when variables are being captured and
10579 the other check is when the address of a variable is taken.
10581 (because an anonymous methods might be resolved before *or* after
10582 the address has been taken) and
10584 * expression.cs (Conditional.DoResolve): Remove the special
10585 casing that Martin added to trueExpr and falseExpr being both
10586 NullLiteral. We get the right behavior now just by introducing
10587 the null_type into the compiler.
10589 * convert.cs (ExplicitConversion): Change the code to use
10590 null_type instead of testing `expr is NullLiteral'.
10591 (ImplicitConversionStandard): use null_type too.
10592 (ImplicitReferenceConversionExists): use null_type too.
10593 (ImplicitReferenceConversion): use null_type too.
10595 * literal.cs: The type of `NullLiteral' is now null_type instead
10597 (Resolve): Set the type here.
10599 * typemanager.cs: Introduce null_type.
10601 2004-11-17 Martin Baulig <martin@ximian.com>
10603 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
10604 direction, like FindMembers() does. Fixes #69546, testcase is in
10607 2004-11-16 Martin Baulig <martin@ximian.com>
10609 This is based on a patch from Marek Safar, see bug #69082.
10610 Fixes bugs #63705 and #67130.
10612 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
10613 method; create a MemberCache for an interface type and cache the
10616 * decl.cs (IMemberContainer.ParentContainer): Removed.
10617 (IMemberContainer.ParentCache): New property.
10618 (MemberCache.SetupCacheForInterface): Removed.
10619 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
10620 to create a cache for an interface's "parent".
10622 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
10625 2004-11-16 Martin Baulig <martin@ximian.com>
10627 Merged back from gmcs; these changes already went into gmcs a
10628 couple of weeks ago.
10631 (TypeManager.AddUserType): Removed the `ifaces' argument.
10632 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
10634 (TypeManager.AddUserInterface): Removed.
10635 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
10637 (TypeManager.GetInterfaces): Likewise.
10638 (TypeManager.GetExplicitInterfaces): Likewise.
10640 * ecore.cs (TypeExpr.GetInterfaces): Removed.
10642 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
10643 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
10645 2004-11-14 Ben Maurer <bmaurer@ximian.com>
10647 * statement.cs: Avoid adding bools to a hashtable.
10649 2004-11-07 Miguel de Icaza <miguel@ximian.com>
10651 * expression.cs (Invocation.OverloadResolve): Flag error if we are
10652 calling an unsafe method from a safe location.
10654 2004-11-06 Marek Safar <marek.safar@seznam.cz>
10657 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
10659 2004-11-06 Miguel de Icaza <miguel@ximian.com>
10661 * namespace.cs (VerifyUsing): use GetPartialName instead of
10664 2004-11-05 Miguel de Icaza <miguel@ximian.com>
10666 * statement.cs (Return.Resolve): Fix regression in typo: if
10667 `in_exc', we have to request a NeedReturnLabel, this was a typo
10668 introduced in the anonymous method check-in. Fixes #69131.
10670 * Indexers were using the ShortName when defining themselves,
10671 causing a regression in the compiler bootstrap when applying the
10672 patch from 2004-11-02 (first part), now they use their full name
10673 and the bug is gone.
10675 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
10677 * driver.cs: Strip the path from the names of embedded resources. Fixes
10680 2004-11-04 Raja R Harinath <rharinath@novell.com>
10682 Fix error message regression: cs0104-2.cs.
10683 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
10684 (AliasEntry.Resolve): Update.
10685 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
10687 (RootContext.LookupType): Update.
10689 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
10691 * cs-parser.jay: Add support for handling accessor modifiers
10692 * class: Add support port accessor modifiers and error checking,
10693 define PropertyMethod.Define as virtual (not abstract anymore)
10694 * ecore.cs: Add checking for proeprties access with access modifiers
10695 * iterators.cs: Modify Accessor constructor call based in the modified
10697 2004-11-02 Ben Maurer <bmaurer@ximian.com>
10699 * expression.cs (StringConcat): Handle being called twice,
10700 as when we have a concat in a field init with more than two
10703 2004-11-02 Miguel de Icaza <miguel@ximian.com>
10705 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
10706 special case explicit implementations, we should always produce
10707 the .property or .event declaration.
10709 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
10710 since it will not return correct data if people use this
10711 unresolved in the presence of using statements (see test-313).
10713 * class.cs (MethodData.Define): If we are an explicit interface
10714 implementation, set the method name to the full name of the
10715 interface plus the name of the method.
10717 Notice that using the method.MethodName.GetFullName() does not
10718 work, as it will only contain the name as declared on the source
10719 file (it can be a shorthand in the presence of using statements)
10720 and not the fully qualifed type name, for example:
10724 class D : ICloneable {
10725 object ICloneable.Clone () {
10729 Would produce a method called `ICloneable.Clone' instead of
10730 `System.ICloneable.Clone'.
10732 * namespace.cs (Alias.Resolve): Use GetPartialName.
10734 2004-11-01 Marek Safar <marek.safar@seznam.cz>
10736 * cs-parser.jay: Add error 1055 report.
10738 2004-11-01 Miguel de Icaza <miguel@ximian.com>
10740 * assign.cs (Assign.DoResolve): Only do the transform of
10741 assignment into a New if the types are compatible, if not, fall
10742 through and let the implicit code deal with the errors and with
10743 the necessary conversions.
10745 2004-11-01 Marek Safar <marek.safar@seznam.cz>
10747 * cs-parser.jay: Add error 1031 report.
10749 * cs-tokenizer.cs: Add location for error 1038.
10751 2004-10-31 Marek Safar <marek.safar@seznam.cz>
10753 * cs-parser.jay: Add error 1016 report.
10755 2004-10-31 Marek Safar <marek.safar@seznam.cz>
10757 * cs-parser.jay: Add errors 1575,1611 report.
10759 2004-10-31 Marek Safar <marek.safar@seznam.cz>
10761 * cs-parser.jay: Add error 1001 report.
10763 2004-10-31 Marek Safar <marek.safar@seznam.cz>
10766 * attribute.cs (GetMarshal): Add method argument for
10767 caller identification.
10769 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
10770 agument for GetMarshal and RuntimeMissingSupport.
10772 2004-10-31 Marek Safar <marek.safar@seznam.cz>
10774 * attribute.cs (ExtractSecurityPermissionSet): Removed
10775 TypeManager.code_access_permission_type.
10777 * typemanager.cs: Removed TypeManager.code_access_permission_type.
10779 2004-10-27 Miguel de Icaza <miguel@ximian.com>
10781 * expression.cs (LocalVariableReference.DoResolveLValue): Check
10782 for obsolete use of a variable here. Fixes regression on errors
10783 cs0619-25 and cs0619-26.
10785 2004-10-27 Marek Safar <marek.safar@seznam.cz>
10787 Fix #62358, implemented security attribute encoding.
10789 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
10790 Tests permitted SecurityAction for assembly or other types.
10791 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
10792 data from SecurityPermissionAttribute to PermisionSet class.
10794 * class.cs (ApplyAttributeBuilder): Added special handling
10795 for System.Security.Permissions.SecurityAttribute based types.
10797 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
10798 special handling for System.Security.Permissions.SecurityAttribute
10801 * enum.cs (ApplyAttributeBuilder): Added special handling
10802 for System.Security.Permissions.SecurityAttribute based types.
10804 * parameter.cs (ApplyAttributeBuilder): Added special handling
10805 for System.Security.Permissions.SecurityAttribute based types.
10807 * rootcontext.cs: Next 2 core types.
10809 * typemanager.cs (TypeManager.security_permission_attr_type):
10810 Built in type for the SecurityPermission Attribute.
10811 (code_access_permission_type): Build in type.
10813 2004-10-17 Miguel de Icaza <miguel@ximian.com>
10815 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
10816 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
10817 all of this information into
10818 EmitContext.EmitCapturedVariableInstance.
10820 * codegen.cs (EmitCapturedVariableInstance): move here the
10821 funcionality of emitting an ldarg.0 in the presence of a
10822 remapping. This centralizes the instance emit code.
10824 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
10825 then emit a load of this: it means that we have reached the
10826 topmost ScopeInfo: the one that contains the pointer to the
10827 instance of the class hosting the anonymous method.
10829 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
10830 captures to the topmost CaptureContext.
10832 2004-10-12 Miguel de Icaza <miguel@ximian.com>
10834 * expression.cs (LocalVariableReference): Move the knowledge about
10835 the iterators into codegen's EmitCapturedVariableInstance.
10837 2004-10-11 Miguel de Icaza <miguel@ximian.com>
10839 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
10840 all code paths return a value from an anonymous method (it is the
10841 same as the 161 error, but for anonymous methods).
10843 2004-10-08 Miguel de Icaza <miguel@ximian.com>
10845 The introduction of anonymous methods in the compiler changed
10846 various ways of doing things in the compiler. The most
10847 significant one is the hard split between the resolution phase
10848 and the emission phases of the compiler.
10850 For instance, routines that referenced local variables no
10851 longer can safely create temporary variables during the
10852 resolution phase: they must do so from the emission phase,
10853 since the variable might have been "captured", hence access to
10854 it can not be done with the local-variable operations from the runtime.
10858 (Block.Flags): New flag `IsTopLevel' to indicate that this block
10859 is a toplevel block.
10861 (ToplevelBlock): A new kind of Block, these are the blocks that
10862 are created by the parser for all toplevel method bodies. These
10863 include methods, accessors and anonymous methods.
10865 These contain some extra information not found in regular blocks:
10866 A pointer to an optional CaptureContext (for tracking captured
10867 local variables and parameters). A pointer to the parent
10870 (Return.Resolve): Catch missmatches when returning a value from an
10871 anonymous method (error 1662).
10872 Invoke NeedReturnLabel from the Resolve phase instead of the emit
10875 (Break.Resolve): ditto.
10877 (SwitchLabel): instead of defining the labels during the
10878 resolution phase, we now turned the public ILLabel and ILLabelCode
10879 labels into methods called GetILLabelCode() and GetILLabel() that
10880 only define the label during the Emit phase.
10882 (GotoCase): Track the SwitchLabel instead of the computed label
10883 (its contained therein). Emit the code by using
10884 SwitchLabel.GetILLabelCode ().
10886 (LocalInfo.Flags.Captured): A new flag has been introduce to track
10887 whether the Local has been captured or not.
10889 (LocalInfo.IsCaptured): New property, used to tell whether the
10890 local has been captured.
10892 * anonymous.cs: Vastly updated to contain the anonymous method
10895 The main classes here are: CaptureContext which tracks any
10896 captured information for a toplevel block and ScopeInfo used to
10897 track the activation frames for various local variables.
10899 Each toplevel block has an optional capture context associated
10900 with it. When a method contains an anonymous method both the
10901 toplevel method and the anonymous method will create a capture
10902 context. When variables or parameters are captured, they are
10903 recorded on the CaptureContext that owns them, for example:
10907 MyDelegate d = delegate {
10912 Here `a' will be recorded as captured on the toplevel
10913 CapturedContext, the inner captured context will not have anything
10914 (it will only have data if local variables or parameters from it
10915 are captured in a nested anonymous method.
10917 The ScopeInfo is used to track the activation frames for local
10918 variables, for example:
10920 for (int i = 0; i < 10; i++)
10921 for (int j = 0; j < 10; j++){
10922 MyDelegate d = delegate {
10927 At runtime this captures a single captured variable `i', but it
10928 captures 10 different versions of the variable `j'. The variable
10929 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
10930 recorded on a child.
10932 The toplevel ScopeInfo will also track information like the `this'
10933 pointer if instance variables were referenced (this is necessary
10934 as the anonymous method lives inside a nested class in the host
10935 type of the method).
10937 (AnonymousMethod): Expanded to track the Toplevel, implement
10938 `AnonymousMethod.Compatible' to tell whether an anonymous method
10939 can be converted to a target delegate type.
10941 The routine now also produces the anonymous method content
10943 (AnonymousDelegate): A helper class that derives from
10944 DelegateCreation, this is used to generate the code necessary to
10945 produce the delegate for the anonymous method that was created.
10947 * assign.cs: API adjustments for new changes in
10948 Convert.ImplicitStandardConversionExists.
10950 * class.cs: Adjustments to cope with the fact that now toplevel
10951 blocks are of type `ToplevelBlock'.
10953 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
10954 insteda of standard blocks.
10956 Flag errors if params arguments are passed to anonymous methods.
10958 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
10959 `CurrentAnonymousMethod' which points to the current Anonymous
10960 Method. The variable points to the AnonymousMethod class that
10961 holds the code being compiled. It is set in the new EmitContext
10962 created for the anonymous method.
10964 (EmitContext.Phase): Introduce a variable and an enumeration to
10965 assist in enforcing some rules about when and where we are allowed
10966 to invoke certain methods (EmitContext.NeedsReturnLabel is the
10967 only one that enfonces this right now).
10969 (EmitContext.HaveCaptureInfo): new helper method that returns
10970 whether we have a CapturedContext initialized.
10972 (EmitContext.CaptureVariable): New method used to register that a
10973 LocalInfo must be flagged for capturing.
10975 (EmitContext.CapturedParameter): New method used to register that a
10976 parameters must be flagged for capturing.
10978 (EmitContext.CapturedField): New method used to register that a
10979 field must be flagged for capturing.
10981 (EmitContext.HaveCapturedVariables,
10982 EmitContext.HaveCapturedFields): Return whether there are captured
10983 variables or fields.
10985 (EmitContext.EmitMethodHostInstance): This is used to emit the
10986 instance for the anonymous method. The instance might be null
10987 (static methods), this (for anonymous methods that capture nothing
10988 and happen to live side-by-side with the current method body) or a
10989 more complicated expression if the method has a CaptureContext.
10991 (EmitContext.EmitTopBlock): Routine that drives the emission of
10992 code: it will first resolve the top block, then emit any metadata
10993 and then emit the code. The split is done so that we can extract
10994 any anonymous methods and flag any captured variables/parameters.
10996 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
10997 during this phase, the ILGenerator should not be used as labels
10998 and local variables declared here might not be accessible to any
10999 code that is part of an anonymous method.
11001 Exceptions to this include the temporary variables that are
11002 created by some statements internally for holding temporary
11005 (EmitContext.EmitMeta): New routine, in charge of emitting all the
11008 (EmitContext.TemporaryReturn): This method is typically called
11009 from the Emit phase, and its the only place where we allow the
11010 ReturnLabel to be defined other than the EmitMeta. The reason is
11011 that otherwise we would have to duplicate a lot of logic in the
11012 Resolve phases of various methods that today is on the Emit
11015 (EmitContext.NeedReturnLabel): This no longer creates the label,
11016 as the ILGenerator is not valid during the resolve phase.
11018 (EmitContext.EmitThis): Extended the knowledge in this class to
11019 work in anonymous methods in addition to iterators.
11021 (EmitContext.EmitCapturedVariableInstance): This emits whatever
11022 code is necessary on the stack to access the instance to a local
11023 variable (the variable will be accessed as a field).
11025 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
11026 EmitContext.EmitAddressOfParameter): Routines to support
11027 parameters (not completed at this point).
11029 Removals: Removed RemapLocal and RemapLocalLValue. We probably
11030 will also remove the parameters.
11032 * convert.cs (Convert): Define a `ConstantEC' which points to a
11033 null. This is just to prefity some code that uses
11034 ImplicitStandardConversion code and do not have an EmitContext
11037 The idea is to flag explicitly that at that point in time, it is
11038 known that the conversion will not trigger the delegate checking
11039 code in implicit conversions (which requires a valid
11042 Everywhere: pass new EmitContext parameter since
11043 ImplicitStandardConversionExists now requires it to check for
11044 anonymous method conversions.
11046 (Convert.ImplicitStandardConversionExists): If the type of an
11047 expression is the anonymous_method_type, and the type is a
11048 delegate, we invoke the AnonymousMethod.Compatible method to check
11049 whether an implicit conversion is possible.
11051 (Convert.ImplicitConversionStandard): Only do implicit method
11052 group conversions if the language level is not ISO_1.
11054 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
11055 MethodInfo for the Invoke method. used by Delegate and
11058 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
11059 method conversions if the target type is a delegate.
11061 Removed extra debugging nops.
11063 (LocalVariableReference): Turn the `local_info' into a public
11066 Add `prepared' field, the same hack used for FieldExprs to cope
11067 with composed assignments, as Local variables do not necessarily
11068 operate purely on the stack as they used to: they can be captured
11071 Add `temp' for a temporary result, like fields.
11073 Refactor DoResolve and DoResolveLValue into DoResolveBase.
11075 It now copes with Local variables that are captured and emits the
11076 proper instance variable to load it from a field in the captured
11079 (ParameterReference.DoResolveBase): During the resolve phase,
11080 capture parameters if we are in an anonymous method.
11082 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
11083 anonymous method, use the EmitContext helper routines to emit the
11084 parameter reference.
11086 * iterators.cs: Set RemapToProxy to true/false during the
11089 * parameters.cs (GetParameterByName): New helper method.
11091 * typemanager.cs (anonymous_method_type) a new type that
11092 represents an anonyous method. This is always an internal type,
11093 used as a fencepost to test against the anonymous-methodness of an
11096 2004-10-20 Marek Safar <marek.safar@seznam.cz>
11098 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
11100 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
11102 2004-10-18 Martin Baulig <martin@ximian.com>
11104 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
11105 `Type' directly, but call ResolveType() on it.
11106 (Catch.Resolve): Likewise.
11107 (Foreach.Resolve): Likewise.
11109 2004-10-18 Martin Baulig <martin@ximian.com>
11111 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
11112 `Type' directly, but call ResolveType() on it.
11113 (Probe.DoResolve): Likewise.
11114 (ArrayCreation.LookupType): Likewise.
11115 (TypeOf.DoResolve): Likewise.
11116 (SizeOf.DoResolve): Likewise.
11118 2004-10-18 Martin Baulig <martin@ximian.com>
11120 * expression.cs (Invocation.BetterFunction): Put back
11121 TypeManager.TypeToCoreType().
11123 2004-10-18 Raja R Harinath <rharinath@novell.com>
11125 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
11128 2004-10-18 Martin Baulig <martin@ximian.com>
11130 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
11131 `Type' directly, but call ResolveType() on it.
11133 2004-10-18 Martin Baulig <martin@ximian.com>
11135 * class.cs (FieldMember.Define): Don't access the TypeExpr's
11136 `Type' directly, but call ResolveType() on it.
11137 (MemberBase.DoDefine): Likewise.
11139 * expression.cs (New.DoResolve): Don't access the TypeExpr's
11140 `Type' directly, but call ResolveType() on it.
11141 (ComposedCast.DoResolveAsTypeStep): Likewise.
11143 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
11144 `Type' directly, but call ResolveType() on it.
11146 2004-10-17 John Luke <john.luke@gmail.com>
11148 * class.cs (Operator.GetSignatureForError): use CSharpName
11150 * parameter.cs (Parameter.GetSignatureForError): Returns
11151 correct name even if was not defined.
11153 2004-10-13 Raja R Harinath <rharinath@novell.com>
11156 * class.cs (TypeContainer.EmitContext): New property.
11157 (DefineNestedTypes): Create an emitcontext for each part.
11158 (MethodCore.DoDefineParameters): Use container's emitcontext.
11159 Pass type array to InternalParameters.
11160 (MemberBase.DoDefine): Use container's emitcontext.
11161 (FieldMember.Define): Likewise.
11162 (Event.Define): Likewise.
11163 (SetMethod.GetParameterInfo): Change argument to EmitContext.
11164 Pass type array to InternalParameters.
11165 (SetIndexerMethod.GetParameterInfo): Likewise.
11166 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
11167 * delegate.cs (Define): Pass emitcontext to
11168 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
11169 array to InternalParameters.
11170 * expression.cs (ParameterReference.DoResolveBase): Pass
11171 emitcontext to GetParameterInfo.
11172 (ComposedCast.DoResolveAsTypeStep): Remove check on
11173 ec.ResolvingTypeTree.
11174 * parameter.cs (Parameter.Resolve): Change argument to
11175 EmitContext. Use ResolveAsTypeTerminal.
11176 (Parameter.GetSignature): Change argument to EmitContext.
11177 (Parameters.ComputeSignature): Likewise.
11178 (Parameters.ComputeParameterTypes): Likewise.
11179 (Parameters.GetParameterInfo): Likewise.
11180 (Parameters.ComputeAndDefineParameterTypes): Likewise.
11181 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
11182 * support.cs (InternalParameters..ctor): Remove variant that takes
11184 * typemanager.cs (system_intptr_expr): New.
11185 (InitExpressionTypes): Initialize it.
11187 2004-10-12 Chris Toshok <toshok@ximian.com>
11189 * cs-parser.jay: fix location for try_statement and catch_clause.
11191 2004-10-11 Martin Baulig <martin@ximian.com>
11193 * report.cs: Don't make --fatal abort on warnings, we have
11194 -warnaserror for that.
11196 2004-10-07 Raja R Harinath <rharinath@novell.com>
11198 More DeclSpace.ResolveType avoidance.
11199 * decl.cs (MemberCore.InUnsafe): New property.
11200 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
11201 with newly created EmitContext.
11202 (FieldMember.Define): Likewise.
11203 * delegate.cs (Delegate.Define): Likewise.
11204 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
11205 only if normal name-lookup fails.
11206 (TypeExpr.DoResolve): Enable error-checking.
11207 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
11208 (SizeOf.DoResolve): Likewise.
11209 (ComposedCast.DoResolveAsTypeStep): Likewise.
11210 (StackAlloc.DoResolve): Likewise.
11211 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
11212 (Block.Unsafe): New property.
11213 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
11214 (Unsafe): Set 'unsafe' flag of contained block.
11215 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
11216 (Fixed.Resolve): Likewise.
11217 (Catch.Resolve): Likewise.
11218 (Using.ResolveLocalVariableDecls): Likewise.
11219 (Foreach.Resolve): Likewise.
11221 2004-10-05 John Luke <john.luke@gmail.com>
11223 * cs-parser.jay: add location to error CS0175
11225 2004-10-04 Miguel de Icaza <miguel@ximian.com>
11227 * ecore.cs (Expression.Constantity): Add support for turning null
11230 * const.cs (Const.Define): Allow constants to be reference types
11231 as long as the value is Null.
11233 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
11235 * namespace.cs (NamespaceEntry.Using): No matter which warning
11236 level is set, check if this namespace name has already been added.
11238 2004-10-03 Ben Maurer <bmaurer@ximian.com>
11240 * expression.cs: reftype [!=]= null should always use br[true,false].
11243 2004-10-03 Marek Safar <marek.safar@seznam.cz>
11246 * attribute.cs: Enum conversion moved to
11247 GetAttributeArgumentExpression to be applied to the all
11250 2004-10-01 Raja R Harinath <rharinath@novell.com>
11252 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
11253 * class.c (TypeContainer.DefineType): Flag error if
11254 base types aren't accessible due to access permissions.
11255 * decl.cs (DeclSpace.ResolveType): Move logic to
11256 Expression.ResolveAsTypeTerminal.
11257 (DeclSpace.ResolveTypeExpr): Thin layer over
11258 Expression.ResolveAsTypeTerminal.
11259 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
11260 Refactor code into NestedAccess. Use it.
11261 (DeclSpace.NestedAccess): New.
11262 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
11263 argument to silence errors. Check access permissions.
11264 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
11265 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
11266 (Cast.DoResolve): Likewise.
11267 (New.DoResolve): Likewise.
11268 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
11269 (TypeOf.DoResolve): Likewise.
11271 * expression.cs (Invocation.BetterConversion): Return the Type of
11272 the better conversion. Implement section 14.4.2.3 more faithfully.
11273 (Invocation.BetterFunction): Make boolean. Make correspondence to
11274 section 14.4.2.2 explicit.
11275 (Invocation.OverloadResolve): Update.
11276 (Invocation): Remove is_base field.
11277 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
11278 (Invocation.Emit): Likewise.
11280 2004-09-27 Raja R Harinath <rharinath@novell.com>
11282 * README: Update to changes.
11284 2004-09-24 Marek Safar <marek.safar@seznam.cz>
11286 * cs-parser.jay: Reverted 642 warning fix.
11288 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11291 * decl.cs (FindMemberWithSameName): Indexer can have more than
11294 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11296 * expression.cs (LocalVariableReference.DoResolveLValue):
11297 Do not report warning 219 for out values.
11298 (EmptyExpression.Null): New member to avoid extra allocations.
11300 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11302 * cs-parser.jay: Fix wrong warning 642 report.
11304 * cs-tokenizer.cs (CheckNextToken): New helper;
11305 Inspect next character if is same as expected.
11307 2004-09-23 Martin Baulig <martin@ximian.com>
11309 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
11310 (Convert.ImplicitReferenceConversionExists): Likewise.
11312 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11314 * class.cs (Operator.Define): Add error 448 and 559 report.
11316 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11318 * class.cs (MemberBase.IsTypePermitted): New protected
11319 method for checking error CS0610.
11321 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11323 * class.cs (TypeContainer.HasExplicitLayout): New property
11324 Returns whether container has StructLayout attribute set Explicit.
11325 (FieldMember): New abstract class for consts and fields.
11326 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
11327 (Field): Reuse FieldMember.
11329 * const.cs (Const): Reuse FieldMember.
11331 * rootcontext.cs: EmitConstants call moved to class.
11333 2004-09-22 Martin Baulig <martin@ximian.com>
11335 Thanks to Peter Sestoft for this bug report.
11337 * expression.cs (Conditional): If both the `trueExpr' and the
11338 `falseExpr' is a NullLiteral, return a NullLiteral.
11340 2004-09-22 Martin Baulig <martin@ximian.com>
11342 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
11343 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
11344 for the "get_Current" call.
11346 2004-09-22 Martin Baulig <martin@ximian.com>
11348 Marek and me just fixed one of our oldest bugs: #28562 :-)
11350 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
11352 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
11353 we're an EnumConstant, just return that.
11354 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
11355 an EnumConstant. In this case, we need to use GetValueAsEnumType()
11356 to get the value which'll actually be written into the attribute.
11357 However, we have to use GetValue() to access the attribute's value
11360 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11362 * constant.cs (Constant.IsNegative): New abstract property
11365 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
11366 (StackAlloc.DoResolve): Reused IsNegative.
11368 2004-09-21 Martin Baulig <martin@ximian.com>
11370 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
11371 if we're used in an iterator, we may be called from different
11374 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
11375 we actually have an exception block.
11377 2004-09-20 John Luke <jluke@cfl.rr.com>
11379 * class.cs, cs-parser.jay: Improve the error report for 1520:
11380 report the actual line where the error happens, not where the
11381 class was declared.
11383 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
11384 Pass location information that was available elsewhere.
11386 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
11388 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
11389 runtime to delay sign assemblies.
11391 2004-09-19 Miguel de Icaza <miguel@ximian.com>
11393 * cs-parser.jay: Do not report the stack trace, this is barely
11396 2004-08-22 John Luke <john.luke@gmail.com>
11398 * driver.cs : check that a resource id is not already used
11399 before adding it, report CS1508 if it is, bug #63637
11401 2004-09-19 Miguel de Icaza <miguel@ximian.com>
11403 * ecore.cs: Removed dead code.
11405 2004-09-18 Marek Safar <marek.safar@seznam.cz>
11407 * class.cs: Do not report warning CS0067 on the interfaces.
11409 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11411 * cs-parser.jay: Add error 504 report.
11413 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11415 * rootcontext.cs: WarningLevel is 4 by default now.
11417 * statement.cs (Fixed.Resolve): Do not null
11420 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11423 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
11424 deep search when property is not virtual.
11425 (PropertyExpr.ResolveAccessors): Make one call for both
11428 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11431 * statement.cs: Error 152 report constains also location.
11433 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11436 * const.cs: Explicitly set constant as static.
11438 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11441 * cs-parser.jay: Add error 1017 report.
11443 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11445 Fixed bug #59980, #64224
11446 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
11448 * typemanager.cs (IsSpecialMethod): Simplified
11450 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11452 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
11453 condition with better params.
11455 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11458 * attribute.cs (Resolve): Property has to have both
11461 2004-09-14 Martin Baulig <martin@ximian.com>
11463 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
11465 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11468 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
11469 called and is obsolete then this member suppress message
11470 when call is inside next [Obsolete] method or type.
11472 * expression.cs: Use TestObsoleteMethodUsage member.
11474 2004-09-14 Martin Baulig <martin@ximian.com>
11476 * cs-parser.jay: Sync a bit with the GMCS version.
11478 2004-09-14 Martin Baulig <martin@ximian.com>
11480 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
11481 (CSharpParser.yacc_verbose_flag): New public field.
11483 * genericparser.cs: Removed.
11485 2004-09-14 Raja R Harinath <rharinath@novell.com>
11487 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
11489 2004-09-13 Marek Safar <marek.safar@seznam.cz>
11491 * class.cs (MethodCore.CheckBase): Fix bug #65757.
11493 2004-09-10 Martin Baulig <martin@ximian.com>
11495 Backported my MemberName changes from GMCS into MCS.
11497 - we are now using a special `MemberName' class instead of using
11498 strings; in GMCS, the `MemberName' also contains the type
11501 - changed the grammar rules a bit:
11502 * the old `member_name' is now a `namespace_or_type_name':
11503 The rule is that we use `namespace_or_type_name' everywhere
11504 where we expect either a "member name" (GetEnumerator) or a
11505 "member name" with an explicit interface name
11506 (IEnumerable.GetEnumerator).
11507 In GMCS, the explicit interface name may include type arguments
11508 (IEnumerable<T>.GetEnumerator).
11509 * we use `member_name' instead of just `IDENTIFIER' for
11511 The rule is that we use `member_name' wherever a member may
11512 have type parameters in GMCS.
11514 * decl.cs (MemberName): New public class.
11515 (MemberCore.MemberName): New public readonly field.
11516 (MemberCore.ctor): Take a `MemberName' argument, not a string.
11517 (DeclSpace): Likewise.
11519 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
11520 * enum.cs (Enum.ctor): Likewise.
11522 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
11524 (AliasEntry.ctor): Take a MemberName, not an Expression.
11525 (AliasEntry.UsingAlias): Likewise.
11527 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
11528 (IMethodData.MemberName): Changed type from string to MemberName.
11529 (MemberBase.ExplicitInterfaceName): Likewise.
11530 (AbstractPropertyEventMethod.SetupName): Make this private.
11531 (AbstractPropertyEventMethod.ctor): Added `string prefix'
11532 argument; compute the member name here.
11533 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
11534 on the `member.MemberName' and the `prefix'.
11536 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
11538 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
11539 thus, we get a `MemberName' instead of a `string'. These
11540 declarations may have type parameters in GMCS.
11541 (interface_method_declaration, delegate_declaration): Likewise.
11542 (class_declaration, interface_declaration): Likewise.
11543 (method_header): Use `namespace_or_type_name' instead of
11544 `member_name'. We may be an explicit interface implementation.
11545 (property_declaration, event_declaration): Likewise.
11546 (member_name): This is now just an `IDENTIFIER', not a
11547 `namespace_or_type_name'.
11548 (type_name, interface_type): Removed.
11549 (namespace_or_type_name): Return a MemberName, not an Expression.
11550 (primary_expression): Use `member_name' instead of `IDENTIFIER';
11551 call GetTypeExpression() on the MemberName to get an expression.
11552 (IndexerDeclaration.interface_type): Changed type from string to
11554 (MakeName): Operate on MemberName's instead of string's.
11556 2004-09-13 Raja R Harinath <rharinath@novell.com>
11559 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
11560 (NamespaceEntry.Lookup): Add new argument to flag if we want the
11561 lookup to avoid symbols introduced by 'using'.
11562 * rootcontext.cs (NamespaceLookup): Update.
11564 2004-09-12 Marek Safar <marek.safar@seznam.cz>
11566 * class.cs (TypeContainer.DoDefineMembers): Do not call
11567 DefineDefaultConstructor for static classes.
11569 2004-09-12 Marek Safar <marek.safar@seznam.cz>
11571 * attribute.cs (Attribute.Resolve): Add error 653 report.
11573 * class.cs (Class.ApplyAttributeBuilder): Add error 641
11575 (Method.ApplyAttributeBuilder): Add error 685 report.
11576 (Operator.Define): Add error 564 report.
11578 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
11580 * expression.cs (Invocation.DoResolve): Add error
11581 245 and 250 report.
11583 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
11586 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11588 * class.cs (ConstructorInitializer.Resolve):
11589 Wrong error number (515->516).
11591 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11593 * class.cs (Indexer.Define): Add error 631 report.
11595 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11597 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
11599 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11601 * expression.cs (Probe.DoResolve): Add error CS0241 report.
11603 2004-09-10 Marek Safar <marek.safar@seznam.cz>
11605 * cs-parser.jay: Added error CS0241 report.
11607 2004-09-10 Raja R Harinath <rharinath@novell.com>
11609 * cs-parser.jay (fixed_statement): Introduce a scope for the
11610 declaration in the 'fixed' statement.
11612 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11614 * cs-parser.jay: Added CS0230 error report.
11616 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11618 * cs-parser.jay: Added errors CS0231 and CS0257 report.
11620 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11622 * expression.cs (Argument.Resolve): Added error CS0192 and
11625 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11627 C# 2.0 #pragma warning feature
11629 * cs-tokenizer.cs (PreProcessPragma): New method;
11630 Handles #pragma directive.
11632 * report.cs (WarningRegions): New class; Support
11633 class for #pragma warning directive. It tests whether
11634 warning is enabled for a given line.
11636 2004-09-08 Miguel de Icaza <miguel@ximian.com>
11638 * const.cs: Add more descriptive error report, tahnks to
11641 2004-09-08 Marek Safar <marek.safar@seznam.cz>
11643 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
11645 2004-09-07 Miguel de Icaza <miguel@ximian.com>
11647 * expression.cs: Apply patch from Ben: Remove dead code from
11648 ArrayCreation, and remove the TurnintoConstant call in const.cs,
11649 as that code just threw an exception anwyays.
11651 * const.cs: Remove the call to the turnintoconstant, for details
11654 * literal.cs: The type of the null-literal is the null type; So
11655 we use a placeholder type (literal.cs:System.Null, defined here)
11658 * expression.cs (Conditional.DoResolve): Remove some old code that
11659 is no longer needed, conversions have been fixed.
11661 (ArrayCreationExpression.DoResolve): Return false if we fail to
11662 resolve the inner expression.
11664 2004-09-07 Raja R Harinath <rharinath@novell.com>
11667 * cs-parser.jay (delegate_declaration): Record a delegate
11668 declaration as a type declaration.
11669 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
11671 2004-09-06 Miguel de Icaza <miguel@ximian.com>
11673 * parameter.cs: Do not crash if the type can not be resolved.
11675 * expression.cs: Report errors with unsafe pointers, fixes #64896
11677 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
11679 * expression.cs: Pointer arith always needs to do a conv.i
11680 if the operand is a long. fix 65320
11682 2004-09-04 Marek Safar <marek.safar@seznam.cz>
11684 Fixed cs0619-37.cs, cs0619-38.cs
11686 * enum.cs (GetObsoleteAttribute): Removed.
11688 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
11689 on Enum member is double staged. The first is tested member
11692 2004-09-04 Marek Safar <marek.safar@seznam.cz>
11694 Fixed #56986, #63631, #65231
11696 * class.cs: (TypeContainer.AddToMemberContainer): New method,
11697 adds member to name container.
11698 (TypeContainer.AddToTypeContainer): New method, adds type to
11700 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
11701 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
11702 AddOperator): Simplified by reusing AddToMemberContainer.
11703 (TypeContainer.UserDefinedStaticConstructor): Changed to property
11705 (Method.CheckForDuplications): Fixed implementation to test all
11707 (MemberBase): Detection whether member is explicit interface
11708 implementation is now in constructor.
11709 (MemberBase.UpdateMemberName): Handles IndexerName.
11710 (Accessor): Changed to keep also location information.
11711 (AbstractPropertyEventMethod): Is derived from MemberCore.
11712 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
11713 will be emited or not.
11714 (PropertyBase.AreAccessorsDuplicateImplementation):
11715 Tests whether accessors are not in collision with some method.
11716 (Operator): Is derived from MethodCore to simplify common
11719 * decl.cs (Flags.TestMethodDuplication): Test for duplication
11721 (DeclSpace.AddToContainer): Adds the member to defined_names
11722 table. It tests for duplications and enclosing name conflicts.
11724 * enum.cs (EnumMember): Clean up to reuse the base structures
11726 2004-09-03 Martin Baulig <martin@ximian.com>
11728 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
11729 into TypeContainer, to make partial classes work again.
11731 2004-09-03 Martin Baulig <martin@ximian.com>
11733 * rootcontext.cs (RootContext.V2): Removed.
11735 2004-03-23 Martin Baulig <martin@ximian.com>
11737 * expression.cs (Invocation.OverloadResolve): Added `bool
11738 may_fail' argument and use it instead of the Location.IsNull() hack.
11740 2004-09-03 Martin Baulig <martin@ximian.com>
11742 Merged latest changes into gmcs. Please keep this comment in
11743 here, it makes it easier for me to see what changed in MCS since
11744 the last time I merged.
11746 2004-09-03 Raja R Harinath <rharinath@novell.com>
11749 * expression.cs (BetterConversion): Don't allow either conversion
11750 to be null. Remove redundant implicit conversion test when 'q ==
11751 null' -- when this function is invoked, we already know that the
11752 implicit conversion exists.
11753 (BetterFunction): Assume that 'best' is non-null. Remove
11754 redundant reimplementation of IsApplicable when 'best' is null.
11755 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
11756 number of arguments.
11757 (IsAncestralType): Extract from OverloadResolve.
11758 (OverloadResolve): Make robust to the MethodGroupExpr being
11759 unsorted. Implement all the logic of Section 14.5.5.1, and
11760 support overloading of methods from multiple applicable types.
11761 Clean up logic somewhat. Don't pass null methods to BetterFunction.
11763 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
11764 (RealError, Warning): Append type of report to related symbol.
11766 2004-09-03 Marek Safar <marek.safar@seznam.cz>
11768 * enum.cs: Fixed CLS-Compliance checks for enum members.
11769 Error tests cs3008-8.cs, cs3014-8.cs
11771 2004-09-02 Marek Safar <marek.safar@seznam.cz>
11773 Fixed bug #62342, #63102
11774 * class.cs: ImplementIndexer uses member.IsExplicitImpl
11775 like ImplementMethod.
11777 2004-09-02 Marek Safar <marek.safar@seznam.cz>
11779 * attribute.cs (Attribute.GetAttributeArgumentExpression):
11782 2004-09-02 Martin Baulig <martin@ximian.com>
11784 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
11785 TypeManager.GetArgumentTypes() rather than calling GetParameters()
11788 2004-09-01 Marek Safar <marek.safar@seznam.cz>
11790 C# 2.0 Static classes implemented
11792 * class.cs (TypeContainer): instance_constructors,
11793 initialized_fields, initialized_static_fields,
11794 default_constructor, base_inteface_types are protected to be
11795 accessible from StaticClass.
11796 (TypeContainer.DefineDefaultConstructor): New virtual method
11797 for custom default constructor generating
11798 (StaticClass): New class to handle "Static classes" feature.
11800 * cs-parser.jay: Handle static keyword on class like instance
11803 * driver.cs: Added "/langversion" command line switch with two
11804 options (iso-1, default).
11806 2004-08-31 Marek Safar <marek.safar@seznam.cz>
11808 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
11810 2004-08-31 Miguel de Icaza <miguel@ximian.com>
11812 * delegate.cs: Style.
11814 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
11816 * delegate.cs: Add seperate instance expr field for miguel.
11818 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
11820 * PointerArithmetic (Resolve): make sure we are not doing
11821 pointer arith on void*. Also, make sure we are resolved
11822 by not setting eclass until resolve.
11824 All callers: Make sure that PointerArithmetic gets resolved.
11826 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
11828 * ArrayCreation (LookupType): If the type does not resolve
11829 to an array, give an error.
11831 2004-08-27 Marek Safar <marek.safar@seznam.cz>
11833 * statement.cs (Try.Resolve): Fixed bug #64222
11835 2004-08-27 Martin Baulig <martin@ximian.com>
11838 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
11841 2004-08-26 Marek Safar <marek.safar@seznam.cz>
11843 * ecore.cs (Constantify): Get underlying type via
11844 System.Enum.GetUnderlyingType to avoid StackOverflow on the
11845 Windows in special cases.
11847 2004-08-26 Marek Safar <marek.safar@seznam.cz>
11849 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
11850 for obtaining also private methods.
11851 (GetRemoveMethod): Used GetRemoveMethod (true)
11852 for obtaining also private methods.
11854 2004-08-24 Martin Baulig <martin@ximian.com>
11856 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
11857 MethodAttributes.HideBySig for operators.
11859 2004-08-23 Martin Baulig <martin@ximian.com>
11861 Back to the old error reporting system :-)
11863 * report.cs (Message): Removed.
11864 (Report.MessageData, ErrorData, WarningData): Removed.
11865 (Report.Error, Warning): Back to the old system.
11867 2004-08-23 Martin Baulig <martin@ximian.com>
11869 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
11871 * class.cs (TypeContainer.ParentContainer): New public virtual
11872 method; replaces the explicit interface implementation.
11873 (ClassPart.ParentContainer): Override.
11875 2004-08-23 Martin Baulig <martin@ximian.com>
11877 * statement.cs (Switch): Added support for constant switches; see
11878 #59428 or test-285.cs.
11880 2004-08-22 Marek Safar <marek.safar@seznam.cz>
11883 * statement.cs (GetEnumeratorFilter): Removed useless
11884 logic because C# specs is strict. GetEnumerator must be
11887 2004-08-22 Martin Baulig <martin@ximian.com>
11889 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11890 a switch and may break, reset the barrier. Fixes #59867.
11892 2004-08-22 Marek Safar <marek.safar@seznam.cz>
11894 CLS-Compliance speed up (~5% for corlib)
11896 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
11897 New method. Tests container for CLS-Compliant names
11899 * class.cs (TypeContainer.VerifyClsName): New method.
11900 Checks whether container name is CLS Compliant.
11901 (Constructor): Implements IMethodData.
11903 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
11904 low-case table for CLS Compliance test.
11905 (MemberCache.VerifyClsParameterConflict): New method.
11906 Checks method parameters for CS3006 error.
11908 * enum.cs (EnumMember): Is derived from MemberCore.
11909 (Enum.VerifyClsName): Optimized for better performance.
11911 2004-08-06 Marek Safar <marek.safar@seznam.cz>
11913 * report.cs: Renamed Error_T to Error and changed all
11916 2004-08-06 Marek Safar <marek.safar@seznam.cz>
11918 * class.cs (TypeContainer.IndexerArrayList): New inner class
11919 container for indexers.
11920 (TypeContainer.DefaultIndexerName): New constant for default
11921 indexer name. Replaced all "Item" with this constant.
11922 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
11924 * typemanager.cs (TypeManager.default_member_ctor): Cache here
11925 DefaultMemberAttribute constructor.
11927 2004-08-05 Martin Baulig <martin@ximian.com>
11929 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
11932 2004-08-05 Marek Safar <marek.safar@seznam.cz>
11934 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
11935 multi platforms problem.
11937 * compiler.csproj: Included shared files.
11939 2004-08-04 Marek Safar <marek.safar@seznam.cz>
11941 Fix bug 60333, 55971 in the more general way
11942 * attribute.cs (Attribute.GetAttributeArgumentExpression):
11943 Added arg_type argument for constant conversion.
11944 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
11946 2004-08-04 Marek Safar <marek.safar@seznam.cz>
11949 * class.cs (TypeContainer ): New inner classes MethodArrayList,
11950 OperatorArrayList, MethodCoreArrayList for typecontainer
11951 containers. Changed class member types to these new types.
11952 (MethodArrayList.DefineMembers): Added test for CS0659.
11954 2004-08-04 Miguel de Icaza <miguel@ximian.com>
11956 * cfold.cs: Synchronize the folding with the code in expression.cs
11957 Binary.DoNumericPromotions for uint operands.
11959 * attribute.cs: Revert patch from Raja, it introduced a regression
11960 while building Blam-1.2.1 (hard to isolate a test case).
11962 2004-08-04 Marek Safar <marek.safar@seznam.cz>
11966 (TypeContainer.Define): Renamed to DefineContainerMembers because of
11968 (MethodCore.parent_method): New member. The method we're overriding
11969 if this is an override method.
11970 (MethodCore.CheckBase): Moved from Method class and made common.
11971 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
11973 (MethodCore.CheckForDuplications): New abstract method. For custom
11974 member duplication search in a container
11975 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
11976 method and its return type.
11977 (Event.conflict_symbol): New member. Symbol with same name in the
11981 (MemberCache.FindMemberWithSameName): New method. The method
11982 is looking for conflict with inherited symbols.
11984 2004-08-04 Martin Baulig <martin@ximian.com>
11986 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
11988 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
11990 2004-08-03 Marek Safar <marek.safar@seznam.cz>
11992 * report.cs (Message): New enum for better error, warning reference in
11994 (MessageData): New inner abstract class. It generally handles printing of
11995 error and warning messages.
11996 Removed unused Error, Warning, Message methods.
11998 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12000 Fix for cs0592-8.cs test
12002 (Attributable.ValidAttributeTargets): Made public.
12003 (Attribute.ExplicitTarget): New member for explicit target value.
12004 (Attribute.CheckTargets): Now we translate explicit attribute
12005 target to Target here.
12007 2004-08-03 Ben Maurer <bmaurer@ximian.com>
12009 * ecore.cs (MethodGroupExpr): new IsBase property.
12011 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
12013 * delegate.cs (DelegateCreation): store a MethodGroupExpr
12014 rather than an instance expr.
12016 (DelegateCreation.Emit): Use the method group rather than
12017 the instance expression. Also, if you have base.Foo as the
12018 method for a delegate, make sure to emit ldftn, not ldftnvirt.
12020 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
12022 (NewDelegate.DoResolve): Only check for the existance of Invoke
12023 if the method is going to be needed. Use MethodGroupExpr.
12025 (NewDelegate.Emit): Remove, DelegateCreation implements this.
12027 * expression.cs: For pointer arith., make sure to use
12028 the size of the type, not the size of the pointer to
12031 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12034 * class.cs (Class): Added error CS0502 test.
12036 2004-08-03 John Luke <jluke@cfl.rr.com>
12037 Raja R Harinath <rharinath@novell.com>
12040 * attribute.cs (Attribute.complained_before): New flag.
12041 (Attribute.ResolveType, Attribute.Resolve),
12042 (Attribute.DefinePInvokeMethod): Set it.
12043 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
12045 2004-08-03 Martin Baulig <martin@ximian.com>
12047 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
12048 use a user-defined operator; we still need to do numeric
12049 promotions in case one argument is a builtin type and the other
12050 one has an implicit conversion to that type. Fixes #62322.
12052 2004-08-02 Martin Baulig <martin@ximian.com>
12054 * statement.cs (LocalInfo.Flags): Added `IsThis'.
12055 (LocalInfo.IsThis): New public property.
12056 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
12058 2004-08-01 Martin Baulig <martin@ximian.com>
12060 * class.cs (TypeContainer.GetClassBases): Don't set the default
12061 here since we may get called from GetPartialBases().
12062 (TypeContainer.DefineType): If GetClassBases() didn't return a
12063 parent, use the default one.
12065 2004-07-30 Duncan Mak <duncan@ximian.com>
12067 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
12069 2004-07-30 Martin Baulig <martin@ximian.com>
12071 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
12073 * class.cs (SourceMethod): New public class, derive from the
12074 symbol writer's ISourceMethod.
12075 (Method): Use the new symbol writer API.
12077 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
12078 as argument and use the new symbol writer.
12081 (SourceFile): Implement the symbol writer's ISourceFile.
12082 (Location.SymbolDocument): Removed.
12083 (Location.SourceFile): New public property.
12085 * symbolwriter.cs: Use the new symbol writer API.
12087 2004-07-30 Raja R Harinath <rharinath@novell.com>
12089 * Makefile (install-local): Remove. Functionality moved to
12092 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
12094 * Makefile: Install mcs.exe.config file together with mcs.exe.
12095 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
12096 correct runtime version.
12098 2004-07-25 Martin Baulig <martin@ximian.com>
12101 (TypeContainer.RegisterOrder): Removed, this was unused.
12102 (TypeContainer, interface_order): Removed.
12103 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
12104 TypeContainer as argument since we can also be called with a
12105 `PartialContainer' for a partial class/struct/interface.
12106 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
12107 of checking whether we're an `Interface' - we could be a
12108 `PartialContainer'.
12109 (PartialContainer.Register): Override; call
12110 AddClass()/AddStruct()/AddInterface() on our parent.
12112 * cs-parser.jay (interface_member_declaration): Add things to the
12113 `current_container', not the `current_class'.
12115 * rootcontext.cs (RegisterOrder): The overloaded version which
12116 takes an `Interface' was unused, removed.
12118 * typemanager.cs (TypeManager.LookupInterface): Return a
12119 `TypeContainer', not an `Interface'.
12120 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
12121 contain a `PartialContainer' for an interface, so check it's
12122 `Kind' to figure out what it is.
12124 2004-07-25 Martin Baulig <martin@ximian.com>
12126 * class.cs (Class.DefaultTypeAttributes): New public constant.
12127 (Struct.DefaultTypeAttributes): Likewise.
12128 (Interface.DefaultTypeAttributes): Likewise.
12129 (PartialContainer.TypeAttr): Override this and add the
12130 DefaultTypeAttributes.
12132 2004-07-25 Martin Baulig <martin@ximian.com>
12134 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
12135 we can just use the `Parent' field instead.
12137 2004-07-25 Martin Baulig <martin@ximian.com>
12139 * class.cs (TypeContainer.Emit): Renamed to EmitType().
12141 2004-07-25 Martin Baulig <martin@ximian.com>
12143 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
12144 our parts before defining any methods.
12145 (TypeContainer.VerifyImplements): Make this virtual.
12146 (ClassPart.VerifyImplements): Override and call VerifyImplements()
12147 on our PartialContainer.
12149 2004-07-25 Martin Baulig <martin@ximian.com>
12151 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
12153 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
12154 argument, we can just use the `Parent' field instead.
12157 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
12158 (MemberBase.DoDefine): Likewise.
12160 2004-07-24 Martin Baulig <martin@ximian.com>
12162 * decl.cs (MemberCore.Parent): New public field.
12163 (DeclSpace.Parent): Moved to MemberCore.
12165 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
12166 (MemberBase.ctor): Added TypeContainer argument, pass it to our
12168 (FieldBase, Field, Operator): Likewise.
12169 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
12170 (EventField, Event): Likewise.
12172 2004-07-23 Martin Baulig <martin@ximian.com>
12174 * class.cs (PartialContainer): New public class.
12175 (ClassPart): New public class.
12176 (TypeContainer): Added support for partial classes.
12177 (TypeContainer.GetClassBases): Splitted some of the functionality
12178 out into GetNormalBases() and GetPartialBases().
12180 * cs-tokenizer.cs (Token.PARTIAL): New token.
12181 (Tokenizer.consume_identifier): Added some hacks to recognize
12182 `partial', but only if it's immediately followed by `class',
12183 `struct' or `interface'.
12185 * cs-parser.jay: Added support for partial clases.
12187 2004-07-23 Martin Baulig <martin@ximian.com>
12189 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
12190 a `DeclSpace' and also made it readonly.
12191 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
12192 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
12193 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
12195 * cs-parser.jay: Pass the `current_class', not the
12196 `current_container' (at the moment, this is still the same thing)
12197 to a new Method, Property, Event, Indexer or Constructor.
12199 2004-07-23 Martin Baulig <martin@ximian.com>
12201 * cs-parser.jay (CSharpParser): Added a new `current_class' field
12202 and removed the `current_interface' one.
12203 (struct_declaration, class_declaration, interface_declaration):
12204 Set `current_class' to the newly created class/struct/interface;
12205 set their `Bases' and call Register() before parsing their body.
12207 2004-07-23 Martin Baulig <martin@ximian.com>
12209 * class.cs (Kind): New public enum.
12210 (TypeContainer): Made this class abstract.
12211 (TypeContainer.Kind): New public readonly field.
12212 (TypeContainer.CheckDef): New public method; moved here from
12214 (TypeContainer.Register): New public abstract method.
12215 (TypeContainer.GetPendingImplementations): New public abstract
12217 (TypeContainer.GetClassBases): Removed the `is_class' and
12218 `is_iface' parameters.
12219 (TypeContainer.DefineNestedTypes): Formerly known as
12221 (ClassOrStruct): Made this class abstract.
12223 * tree.cs (RootTypes): New public type.
12225 2004-07-20 Martin Baulig <martin@ximian.com>
12227 * tree.cs (Tree.RecordNamespace): Removed.
12228 (Tree.Namespaces): Removed.
12230 * rootcontext.cs (RootContext.IsNamespace): Removed.
12232 * cs-parser.jay (namespace_declaration): Just create a new
12233 NamespaceEntry here.
12235 2004-07-20 Martin Baulig <martin@ximian.com>
12237 * statement.cs (ExceptionStatement): New abstract class. This is
12238 now used as a base class for everyone who's using `finally'.
12239 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
12240 our local variables before using them.
12242 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
12243 virtual method. This is used by Yield.Resolve() to "steal" an
12244 outer block's `finally' clauses.
12245 (FlowBranchingException): The .ctor now takes an ExceptionStatement
12248 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
12249 version which takes an ExceptionStatement. This version must be
12250 used to create exception branchings.
12253 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
12254 (Iterator.EmitMoveNext): Added exception support; protect the
12255 block with a `fault' clause, properly handle 'finally' clauses.
12256 (Iterator.EmitDispose): Run all the `finally' clauses here.
12258 2004-07-20 Martin Baulig <martin@ximian.com>
12260 * iterator.cs: This is the first of a set of changes in the
12261 iterator code. Match the spec more closely: if we're an
12262 IEnumerable, then GetEnumerator() must be called. The first time
12263 GetEnumerator() is called, it returns the current instance; all
12264 subsequent invocations (if any) must create a copy.
12266 2004-07-19 Miguel de Icaza <miguel@ximian.com>
12268 * expression.cs: Resolve the constant expression before returning
12271 2004-07-19 Martin Baulig <martin@ximian.com>
12273 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
12274 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
12275 the return type of the new EmitContext.
12277 2004-07-18 Martin Baulig <martin@ximian.com>
12279 * class.cs (Property.Define): Fix iterators.
12281 * iterators.cs (Iterator.Define): Moved the
12282 `container.AddInterator (this)' call here from the .ctor; only do
12283 it if we resolved successfully.
12285 2004-07-17 Miguel de Icaza <miguel@ximian.com>
12287 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
12288 `true' for preprocessing directives that we parse. The return
12289 value indicates whether we should return to regular tokenizing or
12290 not, not whether it was parsed successfully.
12292 In the past if we were in: #if false ... #line #endif, we would
12293 resume parsing after `#line'. See bug 61604.
12295 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
12296 building: IsEnumType should return true only for enums, not for
12297 enums or System.Enum itself. This fixes #61593.
12299 Likely what happened is that corlib was wrong: mcs depended on
12300 this bug in some places. The bug got fixed, we had to add the
12301 hack, which caused bug 61593.
12303 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
12304 that was a workaround for the older conditions.
12306 2004-07-16 Ben Maurer <bmaurer@ximian.com>
12308 * assign.cs: IAssignMethod has a new interface, as documented
12309 inline. All assignment code now uses this new api.
12311 * ecore.cs, expression.cs: All classes which implement
12312 IAssignMethod now use the new interface.
12314 * expression.cs (Invocation): add a hack to EmitCall so that
12315 IndexerAccess can be the target of a compound assignment without
12316 evaluating its arguments twice.
12318 * statement.cs: Handle changes in Invocation api.
12320 2004-07-16 Martin Baulig <martin@ximian.com>
12322 * iterators.cs: Rewrote this. We're now using one single Proxy
12323 class for both the IEnumerable and the IEnumerator interface and
12324 `Iterator' derives from Class so we can use the high-level API.
12326 * class.cs (TypeContainer.AddIterator): New method.
12327 (TypeContainer.DoDefineType): New protected virtual method, which
12328 is called from DefineType().
12329 (TypeContainer.DoDefineMembers): Call DefineType() and
12330 DefineMembers() on all our iterators.
12331 (TypeContainer.Emit): Call Emit() on all our iterators.
12332 (TypeContainer.CloseType): Call CloseType() on all our iterators.
12334 * codegen.cs (EmitContext.CurrentIterator): New public field.
12336 2004-07-15 Martin Baulig <martin@ximian.com>
12339 (TypeManager.not_supported_exception_type): New type.
12341 2004-07-14 Martin Baulig <martin@ximian.com>
12343 * iterators.cs: Use real error numbers.
12345 2004-07-14 Martin Baulig <martin@ximian.com>
12347 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
12348 requires this to be a System.Collection.IEnumerable and not a
12349 class implementing that interface.
12350 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
12352 2004-07-13 Marek Safar <marek.safar@seznam.cz>
12354 * class.cs: Fixed previous fix, it broke some error tests.
12356 2004-07-12 Martin Baulig <martin@ximian.com>
12358 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
12361 2004-07-09 Miguel de Icaza <miguel@ximian.com>
12363 * assign.cs (LocalTemporary): Add new argument: is_address,If
12364 `is_address' is true, then the value that we store is the address
12365 to the real value, and not the value itself.
12367 * ecore.cs (PropertyExpr): use the new local temporary
12368 stuff to allow us to handle X.Y += z (where X is a struct)
12370 2004-07-08 Martin Baulig <martin@ximian.com>
12372 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
12373 not always return, just like we're doing in Using.Resolve().
12375 2004-07-07 Miguel de Icaza <miguel@ximian.com>
12377 * cs-parser.jay (fixed_statement): flag this as Pinned.
12379 2004-07-06 Miguel de Icaza <miguel@ximian.com>
12381 * typemanager.cs (TypeManager): Removed MakePinned method, this
12382 mechanism is replaced with the .NET 2.x compatible mechanism of
12383 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
12385 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
12386 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
12387 `IsFixed' property which has a different meaning.
12389 2004-07-02 Raja R Harinath <rharinath@novell.com>
12391 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
12392 visible from inside a nested class, not just the names of the
12393 immediately enclosing class.
12394 Fix for bug #60730.
12396 2004-06-24 Raja R Harinath <rharinath@novell.com>
12398 * expression.cs (BetterConversion): Remove buggy special-case
12399 handling of "implicit constant expression conversions". At this
12400 point, we already know that the conversion is possible -- we're
12401 only checking to see which is better.
12403 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12405 * cs-parser.jay: Added error CS0210 test.
12407 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12409 * cs-parser.jay: Added error CS0134 test.
12411 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12414 * cs-parser.jay: Added error CS0145 test.
12416 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12418 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
12420 2004-06-23 Ben Maurer <bmaurer@ximian.com>
12422 * expression.cs (StackAlloc.Resolve): The argument may not
12423 be a constant; deal with this case.
12425 2004-06-23 Marek Safar <marek.safar@seznam.cz>
12427 * attribute.cs (IndexerName_GetIndexerName): Renamed to
12428 GetIndexerAttributeValue.
12429 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
12431 * class.cs (Indexer.Define): Added error tests for CS0415,
12434 2004-06-23 Miguel de Icaza <miguel@ximian.com>
12436 * attribute.cs (Attribute.Resolve): Keep field code in sync with
12439 2004-06-23 Martin Baulig <martin@ximian.com>
12441 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
12442 neither return nor throw, reset the barrier as well. Fixes #60457.
12444 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
12446 * class.cs : EventAttributes is now set to None by default.
12447 This fixes bug #60459.
12449 2004-06-18 Marek Safar <marek.safar@seznam.cz>
12452 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12453 Don't throw exception but return null (it's sufficient now).
12455 2004-06-18 Marek Safar <marek.safar@seznam.cz>
12457 * typemanager.cs (GetArgumentTypes): Faster implementation.
12459 2004-06-18 Martin Baulig <martin@ximian.com>
12461 * attribute.cs (Attribute.Resolve): Check whether we're an
12462 EmptyCast which a Constant child. Fixes #60333.
12464 2004-06-17 Ben Maurer <bmaurer@ximian.com>
12466 * statement.cs (EmitCollectionForeach): Account for the fact that
12467 not all valuetypes are in areas which we can take the address of.
12468 For these variables, we store to a temporary variable. Also, make
12469 sure that we dont emit a `callvirt' on a valuetype method.
12471 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12473 * expression.cs (StackAlloc.DoReSolve): Added test for
12474 negative parameter (CS0247).
12476 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12479 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
12481 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12484 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
12487 2004-06-14 Marek Safar <marek.safar@seznam.cz>
12489 Fix bug #58254 & cs1555.cs, cs1556.cs
12490 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
12492 2004-06-14 Marek Safar <marek.safar@seznam.cz>
12494 * cs-parser.jay: Added error CS1669 test for indexers.
12496 2004-06-11 Martin Baulig <martin@ximian.com>
12498 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
12499 call this twice: for params and varargs methods.
12501 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12504 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
12506 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12508 * attribute.cs (Attribute.GetValidTargets): Made public.
12511 (AbstractPropertyEventMethod): New class for better code sharing.
12512 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
12514 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
12516 2004-06-11 Raja R Harinath <rharinath@novell.com>
12519 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
12520 that the call to Resolve is part of a MemberAccess.
12521 (Expression.Resolve): Use it for SimpleName resolution.
12522 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
12523 Add 'intermediate' boolean argument.
12524 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
12525 error message when the SimpleName can be resolved ambiguously
12526 between an expression and a type.
12527 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
12529 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
12530 call on the left-side.
12532 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12535 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
12537 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12539 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
12541 2004-06-11 Martin Baulig <martin@ximian.com>
12543 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
12544 varargs methods if applicable.
12546 2004-06-11 Martin Baulig <martin@ximian.com>
12548 * expression.cs (Invocation.EmitCall): Don't use
12549 `method.CallingConvention == CallingConventions.VarArgs' since the
12550 method could also have `CallingConventions.HasThis'.
12552 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12554 * class.cs (Event.GetSignatureForError): Implemented.
12555 Fixed crash in error test cs3010.cs
12557 2004-06-10 Miguel de Icaza <miguel@ximian.com>
12559 * cs-tokenizer.cs: Change the way we track __arglist to be
12560 consistent with the other keywords.
12562 2004-06-09 Miguel de Icaza <miguel@ximian.com>
12564 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
12567 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
12569 * codegen.cs: Check that all referenced assemblies have a strongname
12570 before strongnaming the compiled assembly. If not report error CS1577.
12571 Fix bug #56563. Patch by Jackson Harper.
12572 * typemanager.cs: Added a method to return all referenced assemblies.
12573 Fix bug #56563. Patch by Jackson Harper.
12575 2004-06-08 Marek Safar <marek.safar@seznam.cz>
12578 (Method.ApplyAttributeBuilder): Moved and added conditional
12579 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
12582 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
12584 2004-06-08 Marek Safar <marek.safar@seznam.cz>
12587 * class.cs: (EventField.attribute_targets): Changed default target.
12589 2004-06-08 Martin Baulig <martin@ximian.com>
12591 * expression.cs (Invocation.EmitCall): Enable varargs methods.
12593 2004-06-08 Martin Baulig <martin@ximian.com>
12595 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
12597 2004-06-07 Martin Baulig <martin@ximian.com>
12599 Added support for varargs methods.
12601 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
12604 * cs-parser.jay: Added support for `__arglist'.
12606 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
12608 * expression.cs (Argument.AType): Added `ArgList'.
12609 (Invocation): Added support for varargs methods.
12610 (ArglistAccess): New public class.
12611 (Arglist): New public class.
12613 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
12615 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
12616 a method's top-level block if the method has varargs.
12618 * support.cs (ReflectionParameters, InternalParameters): Added
12619 support for varargs methods.
12621 2004-06-07 Miguel de Icaza <miguel@ximian.com>
12623 * class.cs: Provide location in indexer error report.
12625 * driver.cs: Use standard names.
12627 * namespace.cs: Catch the use of using after a namespace has been
12628 declared also on using aliases.
12630 2004-06-03 Raja R Harinath <rharinath@novell.com>
12633 * typemanager.cs (closure_private_ok, closure_invocation_type)
12634 (closure_qualifier_type, closure_invocation_assembly)
12635 (FilterWithClosure): Move to ...
12636 (Closure): New internal nested class.
12637 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
12638 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
12639 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
12640 (MemberLookup, MemberLookupFailed): Use it.
12641 * expression.cs (New.DoResolve): Treat the lookup for the
12642 constructor as being qualified by the 'new'ed type.
12643 (Indexers.GetIndexersForTypeOrInterface): Update.
12645 2004-06-03 Marek Safar <marek.safar@seznam.cz>
12648 (GetConditionalAttributeValue): New method. Returns
12649 condition of ConditionalAttribute.
12650 (SearchMulti): New method. Returns all attributes of type 't'.
12651 Use it when attribute is AllowMultiple = true.
12652 (IsConditionalMethodExcluded): New method.
12655 (Method.IsExcluded): Implemented. Returns true if method has conditional
12656 attribute and the conditions is not defined (method is excluded).
12657 (IMethodData): Extended interface for ConditionalAttribute support.
12658 (PropertyMethod.IsExcluded): Implemented.
12661 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
12664 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
12667 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
12669 * expression.cs (ArrayCreationExpression): Make this just an
12670 `expression'. It can't be a statement, so the code here was
12673 2004-06-02 Marek Safar <marek.safar@seznam.cz>
12676 * typemanager.cs (GetFullNameSignature): New method for
12679 2004-06-02 Marek Safar <marek.safar@seznam.cz>
12682 * class.cs (MemberBase.GetSignatureForError): New virtual method.
12683 Use this method when MethodBuilder is null.
12684 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
12685 Added test for error CS0626 (MONO reports error for this situation).
12686 (IMethodData.GetSignatureForError): Extended interface.
12688 2004-06-01 Marek Safar <marek.safar@seznam.cz>
12691 (AttributeTester.GetObsoleteAttribute): Returns instance of
12692 ObsoleteAttribute when type is obsolete.
12695 (TypeContainer.VerifyObsoleteAttribute): Override.
12696 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
12697 (MethodCode.VerifyObsoleteAttribute): Override.
12698 (MemberBase.VerifyObsoleteAttribute): Override.
12701 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
12702 and report proper error.
12705 Delegate.VerifyObsoleteAttribute): Override.
12708 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
12709 and report proper error.
12710 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
12713 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
12717 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
12718 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
12719 Added test for ObsoleteAttribute.
12722 (Catch): Derived from Statement.
12724 2004-06-01 Marek Safar <marek.safar@seznam.cz>
12726 Fixed bug #59071 & cs0160.cs
12728 * statement.cs (Try.Resolve): Check here whether order of catch
12729 clauses matches their dependencies.
12731 2004-05-31 Miguel de Icaza <miguel@ximian.com>
12733 * Reverted patch to namespace.cs (Use lookuptypedirect). This
12734 caused a regression: #59343. Referencing nested classes from an
12735 assembly stopped working.
12737 2004-05-31 Martin Baulig <martin@ximian.com>
12739 MCS is now frozen for beta 2.
12741 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
12743 * convert.cs: add a trivial cache for overload operator resolution.
12745 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
12747 * decl.cs: If possible, use lookuptypedirect here. We can only do
12748 this if there is no `.' after the namespace. Avoids using
12749 LookupType, which does lots of slow processing.
12750 (FindNestedType) New method, does what it says :-).
12751 * namespace.cs: use LookupTypeDirect.
12752 * rootcontext.cs: use membercache, if possible.
12753 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
12755 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
12758 According to the spec,
12760 In a member access of the form E.I, if E is a single identifier,
12761 and if the meaning of E as a simple-name (§7.5.2) is a constant,
12762 field, property, localvariable, or parameter with the same type as
12763 the meaning of E as a type-name (§3.8), then both possible
12764 meanings of E are permitted.
12766 We did not check that E as a simple-name had the same type as E as
12769 This trivial check gives us 5-7% on bootstrap time.
12771 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
12773 * expression.cs (Invocation.OverloadResolve): Avoid the
12774 use of hashtables and boxing here by allocating on demand.
12776 2004-05-30 Martin Baulig <martin@ximian.com>
12778 * rootcontext.cs (RootContext.LookupType): Don't cache things if
12779 we're doing a silent lookup. Don't try to lookup nested types in
12780 TypeManager.object_type (thanks to Ben Maurer).
12782 2004-05-30 Martin Baulig <martin@ximian.com>
12784 Committing a patch from Ben Maurer.
12786 * rootcontext.cs (RootContext.LookupType): Cache negative results.
12788 2004-05-29 Martin Baulig <martin@ximian.com>
12790 * class.cs (IMethodData.ShouldIgnore): New method.
12792 * typemanager.cs (TypeManager.MethodFlags): Don't take a
12793 `Location' argument, we don't need it anywhere. Use
12794 `IMethodData.ShouldIgnore ()' instead of
12795 `MethodData.GetMethodFlags ()'.
12796 (TypeManager.AddMethod): Removed.
12797 (TypeManager.AddMethod2): Renamed to AddMethod.
12799 2004-05-29 Martin Baulig <martin@ximian.com>
12801 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
12803 * convert.cs (Convert.ImplicitReferenceConversion): If we're
12804 converting from a class type S to an interface type and we already
12805 have an object on the stack, don't box it again. Fixes #52578.
12807 2004-05-29 Martin Baulig <martin@ximian.com>
12809 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12810 Added support for `params' parameters. Fixes #59267.
12812 2004-05-29 Martin Baulig <martin@ximian.com>
12814 * literal.cs (NullPointer): Provide a private .ctor which sets
12815 `type' to TypeManager.object_type. Fixes #59048.
12817 2004-05-29 Martin Baulig <martin@ximian.com>
12819 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
12820 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
12822 * ecore.cs (EventExpr.instance_expr): Make the field private.
12824 2004-05-26 Marek Safar <marek.safar@seznam.cz>
12826 Fixed bug #50080 & cs0214-2.cs
12827 * expression.cs (Cast.DoResolve): Check unsafe context here.
12829 * statement.cs (Resolve.DoResolve): Likewise.
12831 2004-05-26 Martin Baulig <martin@ximian.com>
12833 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
12835 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
12836 (RootContext.LookupType): Pass down the `silent' flag.
12838 2004-05-25 Martin Baulig <martin@ximian.com>
12841 (MethodGroupExpr.IdenticalTypeName): New public property.
12842 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
12843 expression actually refers to a type.
12845 2004-05-25 Martin Baulig <martin@ximian.com>
12847 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
12848 for #56176 and made it actually work.
12850 2004-05-25 Martin Baulig <martin@ximian.com>
12852 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
12853 (FieldExpr, PropertyExpr): Override and implement
12854 CacheTemporaries. Fixes #52279.
12856 2004-05-25 Miguel de Icaza <miguel@ximian.com>
12858 * location.cs: In the new compiler listing a file twice is a
12859 warning, not an error.
12861 2004-05-24 Martin Baulig <martin@ximian.com>
12863 * enum.cs (Enum.DefineType): For the `BaseType' to be a
12864 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
12866 2004-05-24 Martin Baulig <martin@ximian.com>
12868 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
12869 walking the `using' list. Fixes #53921.
12871 2004-05-24 Martin Baulig <martin@ximian.com>
12873 * const.cs (Const.LookupConstantValue): Added support for
12874 EmptyCast's; fixes #55251.
12876 2004-05-24 Martin Baulig <martin@ximian.com>
12878 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
12879 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
12880 which does the CS0135 check. The reason is that we first need to
12881 check whether the variable actually exists.
12883 2004-05-24 Martin Baulig <martin@ximian.com>
12885 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
12886 than RootContext.LookupType() to find the explicit interface
12887 type. Fixes #58584.
12889 2004-05-24 Raja R Harinath <rharinath@novell.com>
12891 * Makefile: Simplify. Use executable.make.
12892 * mcs.exe.sources: New file. List of sources of mcs.exe.
12894 2004-05-24 Anders Carlsson <andersca@gnome.org>
12898 Use the invariant culture when doing String.Compare for CLS case
12901 2004-05-23 Martin Baulig <martin@ximian.com>
12903 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
12904 don't have any dots. Fixes #52622, added cs0246-8.cs.
12906 * namespace.cs (NamespaceEntry.Lookup): Likewise.
12908 2004-05-23 Marek Safar <marek.safar@seznam.cz>
12910 * class.cs (MemberBase.Define): Reuse MemberType member for
12911 resolved type. Other methods can use it too.
12913 2004-05-23 Martin Baulig <martin@ximian.com>
12915 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
12916 the variable also exists in the current block (otherwise, we need
12917 to report a CS0103). Fixes #58670.
12919 2004-05-23 Martin Baulig <martin@ximian.com>
12921 * flowanalysis.cs (Reachability.Reachable): Compute this
12922 on-the-fly rather than storing it as a field.
12924 2004-05-23 Martin Baulig <martin@ximian.com>
12926 * flowanalysis.cs (Reachability.And): Manually compute the
12927 resulting `barrier' from the reachability.
12929 2004-05-23 Marek Safar <marek.safar@seznam.cz>
12932 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
12933 instance of ObsoleteAttribute when symbol is obsolete.
12936 (IMethodData): Extended interface for ObsoleteAttribute support.
12938 2004-05-22 Marek Safar <marek.safar@seznam.cz>
12940 * attribute.cs: Fix bug #55970
12942 2004-05-22 Marek Safar <marek.safar@seznam.cz>
12946 (GetObsoleteAttribute): New method. Creates the instance of
12948 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
12949 ObsoleteAttribute when member is obsolete.
12950 (AttributeTester.Report_ObsoleteMessage): Common method for
12951 Obsolete error/warning reporting.
12954 (TypeContainer.base_classs_type): New member for storing parent type.
12957 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
12958 for this MemberCore.
12960 2004-05-21 Marek Safar <marek.safar@seznam.cz>
12962 * attribute.cs, const.cs: Fix bug #58590
12964 2004-05-21 Martin Baulig <martin@ximian.com>
12966 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
12967 out parameters if the end of the method is unreachable. Fixes
12970 2004-05-21 Marek Safar <marek.safar@seznam.cz>
12972 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
12973 Hari was right, why extra method.
12975 2004-05-21 Marek Safar <marek.safar@seznam.cz>
12977 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
12979 2004-05-20 Martin Baulig <martin@ximian.com>
12981 Merged this back from gmcs to keep the differences to a minumum.
12983 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
12984 instead of a Declspace.
12985 (Attribute.ResolveType): Likewise.
12986 (Attributes.Search): Likewise.
12987 (Attributes.Contains): Likewise.
12988 (Attributes.GetClsCompliantAttribute): Likewise.
12990 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
12992 (MethodData.ApplyAttributes): Take an EmitContext instead of a
12995 2004-05-19 Marek Safar <marek.safar@seznam.cz>
12997 Fix bug #58688 (MCS does not report error when the same attribute
13000 * attribute.cs (Attribute.Emit): Distinction between null and default.
13002 2004-05-19 Raja R Harinath <rharinath@novell.com>
13004 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
13005 of a top-level attribute without an attribute target.
13006 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
13008 (Attribute.Conditional_GetConditionName),
13009 (Attribute.Obsolete_GetObsoleteMessage): Update.
13010 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
13011 part of ScanForIndexerName.
13012 (Attribute.CanIgnoreInvalidAttribute): New function.
13013 (Attribute.ScanForIndexerName): Move to ...
13014 (Attributes.ScanForIndexerName): ... here.
13015 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
13016 (Attributes.Search): New internal variant that can choose not to
13017 complain if types aren't resolved. The original signature now
13019 (Attributes.GetClsCompliantAttribute): Use internal variant, with
13020 complaints suppressed.
13021 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
13022 only if it not useful.
13023 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
13024 top-level for attributes that are shared between the assembly
13025 and a top-level class.
13026 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
13027 * class.cs: Update to reflect changes.
13028 (DefineIndexers): Fuse loops.
13029 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
13030 a couple more variants of attribute names.
13032 2004-05-18 Marek Safar <marek.safar@seznam.cz>
13034 Fix bug #52585 (Implemented explicit attribute declaration)
13037 (Attributable.ValidAttributeTargets): New abstract method. It gets
13038 list of valid attribute targets for explicit target declaration.
13039 (Attribute.Target): It holds target itself.
13040 (AttributeSection): Removed.
13041 (Attribute.CheckTargets): New method. It checks whether attribute
13042 target is valid for the current element.
13045 (EventProperty): New class. For events that are declared like
13046 property (with add and remove accessors).
13047 (EventField): New class. For events that are declared like field.
13050 * cs-parser.jay: Implemented explicit attribute target declaration.
13052 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
13053 Override ValidAttributeTargets.
13056 (ReturnParameter): Class for applying custom attributes on
13058 (ParameterAtribute): New class. Class for applying custom
13059 attributes on the parameter type.
13061 2004-05-17 Miguel de Icaza <miguel@ximian.com>
13063 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
13066 (Method): Allow UNSAFE here.
13068 * modifiers.cs: Support unsafe reporting.
13070 2004-05-17 Marek Safar <marek.safar@seznam.cz>
13072 * decl.cs: Fix bug #58478.
13074 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13076 * statement.cs: When checking for unreachable code on an EmptyStatement,
13077 set the location. Fixes bug #58488.
13079 2004-05-13 Miguel de Icaza <miguel@ximian.com>
13081 * driver.cs: Add -pkg handling.
13083 From Gonzalo: UseShelLExecute=false
13085 2004-05-12 Marek Safar <marek.safar@seznam.cz>
13088 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
13090 (Attribute.IsClsCompliaceRequired): Moved to base for better
13092 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
13093 when attribute is AttributeUsageAttribute.
13094 (Attribute.GetValidTargets): Simplified.
13095 (Attribute.GetAttributeUsage): New method returns AttributeUsage
13096 attribute for this type.
13097 (Attribute.ApplyAttributes): Method renamed to Emit and make
13099 (GlobalAttributeSection): New class for special handling of global
13100 attributes (assembly, module).
13101 (AttributeSection.Emit): New method.
13103 * class.cs: Implemented Attributable abstract methods.
13104 (MethodCore.LabelParameters): Moved to Parameter class.
13105 (Accessor): Is back simple class.
13106 (PropertyMethod): Implemented Attributable abstract class.
13107 (DelegateMethod): Implemented Attributable abstract class.
13108 (Event): New constructor for disctintion between normal Event
13109 and Event with accessors.
13111 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
13113 * codegen.cs, const.cs, decl.cs, delegate.cs:
13114 (CommonAssemblyModulClass): Implemented Attributable abstract class
13117 * enum.cs: Implement IAttributeSupport interface.
13118 (EnumMember): New class for emum members. Implemented Attributable
13122 (ParameterBase): Is abstract.
13123 (ReturnParameter): New class for easier [return:] attribute handling.
13125 * typemanager.cs: Removed builder_to_attr.
13127 2004-05-11 Raja R Harinath <rharinath@novell.com>
13130 * attribute.cs (Attribute.GetPositionalValue): New function.
13131 * class.cs (TypeContainer.VerifyMembers): New function.
13132 (TypeContainer.Emit): Use it.
13133 (ClassOrStruct): New base class for Class and Struct.
13134 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
13135 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
13137 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
13138 then each non-static field should have a FieldOffset attribute.
13139 Otherwise, none of the fields should have a FieldOffset attribute.
13140 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
13141 and FieldOffset attributes.
13142 * typemanager.cs (TypeManager.struct_layout_attribute_type)
13143 (TypeManager.field_offset_attribute_type): New core types.
13144 (TypeManager.InitCoreTypes): Initialize them.
13146 2004-05-11 Michal Moskal <malekith@pld-linux.org>
13148 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
13149 Return correct type.
13152 2004-05-09 Miguel de Icaza <miguel@ximian.com>
13154 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
13155 be implicitly converted to ulong.
13157 * expression.cs: The logic for allowing operator &, | and ^ worked
13158 was wrong, it worked before because we did not report an error in
13159 an else branch. Fixes 57895.
13161 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
13162 allow volatile fields to be reference types.
13164 2004-05-07 Miguel de Icaza <miguel@ximian.com>
13166 * driver.cs: Add support for /debug-
13168 2004-05-07 Raja R Harinath <rharinath@novell.com>
13170 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
13171 Add a 'complain' parameter to silence errors.
13172 (Attribute.Resolve): Update to changes. Put in sanity check to catch
13173 silently overlooked type-resolutions.
13174 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
13175 to reflect changes.
13176 (Attributes.Search): New function.
13177 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
13178 (Attributes.GetAttributeFullName): Remove hack.
13179 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
13180 Update to reflect changes.
13181 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13182 Use Attributes.Search instead of nested loops.
13184 2004-05-07 Marek Safar <marek.safar@seznam.cz>
13187 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
13188 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
13189 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
13191 * report.cs: (Report.Warning): Renamed to Warning_T because of
13192 parameter collision.
13194 2004-05-05 Raja R Harinath <rharinath@novell.com>
13196 * expression.cs (MemberAccess.ResolveMemberAccess):
13197 Exit with non-zero status after Report.Error.
13198 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
13200 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
13202 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
13204 * support.cs: Don't hang when the file is empty.
13206 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
13208 * support.cs: In SeekableStreamReader, compute the preamble size of the
13209 underlying stream. Position changes should take into account that initial
13212 2004-05-03 Todd Berman <tberman@sevenl.net>
13214 * driver.cs: remove unused GetSysVersion function.
13216 2004-05-03 Todd Berman <tberman@sevenl.net>
13218 * driver.cs: Remove the hack from saturday, as well as the hack
13219 from jackson (LoadAssemblyFromGac), also adds the CWD to the
13220 link_paths to get that bit proper.
13222 2004-05-01 Todd Berman <tberman@sevenl.net>
13224 * driver.cs: Try a LoadFrom before a Load, this checks the current
13225 path. This is currently a bug in mono that is be fixed, however, this
13226 provides a workaround for now. This will be removed when the bug
13229 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
13231 * CryptoConvert.cs: Updated to latest version. Fix issue with
13232 incomplete key pairs (#57941).
13234 2004-05-01 Todd Berman <tberman@sevenl.net>
13236 * driver.cs: Remove '.' from path_chars, now System.* loads properly
13239 2004-04-30 Jackson Harper <jackson@ximian.com>
13241 * codegen.cs: Open keys readonly.
13243 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13245 * typemanager.cs: don't report cyclic struct layout when a struct
13246 contains 2 or more fields of the same type. Failed for Pango.AttrShape
13247 which has 2 Pango.Rectangle fields.
13249 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
13251 * expression.cs: Handle IntPtr comparisons with IL code
13252 rather than a method call.
13254 2004-04-29 Martin Baulig <martin@ximian.com>
13256 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
13257 the list of PropertyInfo's in class hierarchy and find the
13258 accessor. Fixes #56013.
13260 2004-04-29 Martin Baulig <martin@ximian.com>
13262 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
13264 2004-04-29 Martin Baulig <martin@ximian.com>
13266 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13268 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
13270 2004-04-29 Martin Baulig <martin@ximian.com>
13272 * class.cs (ConstructorInitializer.Resolve): Check whether the
13273 parent .ctor is accessible. Fixes #52146.
13275 2004-04-29 Martin Baulig <martin@ximian.com>
13277 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13279 * statement.cs (Using.EmitLocalVariableDecls): Use
13280 TypeManager.idisposable_type, not typeof (IDisposable).
13281 (Foreach.EmitCollectionForeach): Added support for valuetypes.
13283 2004-04-29 Martin Baulig <martin@ximian.com>
13285 * class.cs (Event.Define): Don't emit the field and don't set
13286 RTSpecialName and SpecialName for events on interfaces. Fixes
13289 2004-04-29 Raja R Harinath <rharinath@novell.com>
13291 Refactor Attribute.ApplyAttributes.
13292 * attribute.cs (Attributable): New base class for objects that can
13293 have Attributes applied on them.
13294 (Attribute): Make AttributeUsage fields public.
13295 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
13296 (Attribute.IsInternalCall): New property.
13297 (Attribute.UsageAttr): Convert to a public read-only property.
13298 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
13299 (Attribute.ResolveType, Attribute.Resolve)
13300 (Attribute.ScanForIndexerName): Update to reflect changes.
13301 (Attribute.CheckAttributeTarget): Re-format.
13302 (Attribute.ApplyAttributes): Refactor, to various
13303 Attributable.ApplyAttributeBuilder methods.
13304 * decl.cs (MemberCore): Make Attributable.
13305 * class.cs (Accessor): Make Attributable.
13306 (MethodData.ApplyAttributes): Use proper attribute types, not
13308 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
13309 (TypeContainer.ApplyAttributeBuilder)
13310 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
13311 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
13312 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
13313 (Operator.ApplyAttributeBuilder): New factored-out methods.
13314 * const.cs (Const.ApplyAttributeBuilder): Likewise.
13315 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
13316 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
13317 * parameter.cs (ParameterBase): New Attributable base class
13318 that can also represent Return types.
13319 (Parameter): Update to the changes.
13321 2004-04-29 Jackson Harper <jackson@ximian.com>
13323 * driver.cs: Prefer the corlib system version when looking for
13324 assemblies in the GAC. This is still a hack, but its a better hack
13327 2004-04-29 Marek Safar <marek.safar@seznam.cz>
13329 * decl.cs, enum.cs: Improved error 3005 reporting.
13331 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
13332 (related_symbols): New private member for list of symbols
13333 related to reported error/warning.
13335 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
13337 2004-04-29 Martin Baulig <martin@ximian.com>
13339 * ecore.cs (Expression.Constantify): If we're an enum and
13340 TypeManager.TypeToCoreType() doesn't give us another type, use
13341 t.UnderlyingSystemType. Fixes #56178.
13343 2004-04-29 Martin Baulig <martin@ximian.com>
13345 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
13346 interfaces and for each interface, only add members directly
13347 declared in that interface. Fixes #53255.
13349 2004-04-28 Martin Baulig <martin@ximian.com>
13351 * expression.cs (ConditionalLogicalOperator): Use a temporary
13352 variable for `left' to avoid that we evaluate it more than once;
13355 2004-04-28 Martin Baulig <martin@ximian.com>
13357 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
13360 2004-04-28 Martin Baulig <martin@ximian.com>
13362 * statement.cs (LocalInfo.Resolve): Check whether the type is not
13365 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
13366 whether the type is not void (CS1547).
13368 2004-04-28 Martin Baulig <martin@ximian.com>
13370 * expression.cs (Unary.DoResolveLValue): Override this and report
13371 CS0131 for anything but Operator.Indirection.
13373 2004-04-28 Martin Baulig <martin@ximian.com>
13375 Committing a patch from Ben Maurer; see bug #50820.
13377 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13380 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13383 2004-04-28 Martin Baulig <martin@ximian.com>
13385 Committing a patch from Ben Maurer; see bug #50820.
13387 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13390 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13393 2004-04-28 Martin Baulig <martin@ximian.com>
13395 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
13396 (Block.AddLabel): Call DoLookupLabel() to only search in the
13399 2004-04-28 Martin Baulig <martin@ximian.com>
13401 * cfold.cs (ConstantFold.BinaryFold): Added special support for
13402 comparing StringConstants and NullLiterals in Equality and Inequality.
13404 2004-04-28 Jackson Harper <jackson@ximian.com>
13406 * driver.cs: Attempt to load referenced assemblies from the
13407 GAC. This is the quick and dirty version of this method that
13408 doesnt take into account versions and just takes the first
13409 canidate found. Will be good enough for now as we will not have more
13410 then one version installed into the GAC until I update this method.
13412 2004-04-28 Martin Baulig <martin@ximian.com>
13414 * typemanager.cs (TypeManager.CheckStructCycles): New public
13415 static method to check for cycles in the struct layout.
13417 * rootcontext.cs (RootContext.PopulateTypes): Call
13418 TypeManager.CheckStructCycles() for each TypeContainer.
13419 [Note: We only need to visit each type once.]
13421 2004-04-28 Martin Baulig <martin@ximian.com>
13423 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
13425 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
13426 success and added `out object value'. Use a `bool resolved' field
13427 to check whether we've already been called rather than
13428 `ConstantValue != null' since this breaks for NullLiterals.
13430 2004-04-28 Raja R Harinath <rharinath@novell.com>
13432 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
13433 setting of this flag, since the 'set' method may be non-public.
13435 2004-04-28 Raja R Harinath <rharinath@novell.com>
13437 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
13438 check on current_vector.Block.
13440 2004-04-27 Martin Baulig <martin@ximian.com>
13442 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
13443 a field initializer. Fixes #56459.
13445 2004-04-27 Martin Baulig <martin@ximian.com>
13447 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
13448 we're not attempting to use an indexer. Fixes #52154.
13450 2004-04-27 Martin Baulig <martin@ximian.com>
13452 * statement.cs (Return): Don't create a return label if we don't
13453 need it; reverts my change from January 20th. Thanks to Ben
13456 2004-04-27 Martin Baulig <martin@ximian.com>
13458 According to the spec, `goto' can only leave a nested scope, but
13461 * statement.cs (Block.LookupLabel): Only lookup in the current
13462 block, don't recurse into parent or child blocks.
13463 (Block.AddLabel): Check in parent and child blocks, report
13464 CS0140/CS0158 if we find a duplicate.
13465 (Block): Removed this indexer for label lookups.
13466 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
13467 this already does the error reporting for us.
13470 (FlowBranching.UsageVector.Block): New public variable; may be null.
13471 (FlowBranching.CreateSibling): Added `Block' argument.
13472 (FlowBranching.LookupLabel): New public virtual method. Lookup a
13473 label for the target of a `goto' and check whether we're not
13474 leaving a `finally'.
13476 2004-04-27 Martin Baulig <martin@ximian.com>
13478 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13479 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
13482 2004-04-27 Martin Baulig <martin@ximian.com>
13484 * statement.cs (Block.AddLabel): Also check for implicit blocks
13485 and added a CS0158 check.
13487 2004-04-27 Martin Baulig <martin@ximian.com>
13489 * flowanalysis.cs (FlowBranchingLoop): New class.
13490 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
13491 UsageVector's instead of an ArrayList.
13492 (FlowBranching.Label): Likewise.
13493 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
13494 (FlowBranching.AddBreakVector): New method.
13496 2004-04-27 Miguel de Icaza <miguel@ximian.com>
13498 * attribute.cs: Small regression fix: only convert the type if we
13499 the type is different, fixes System.Drawing build.
13501 2004-04-27 Martin Baulig <martin@ximian.com>
13503 * attribute.cs (Attribute.Resolve): If we have a constant value
13504 for a named field or property, implicity convert it to the correct
13507 2004-04-27 Raja R Harinath <rharinath@novell.com>
13509 * statement.cs (Block.Block): Implicit blocks share
13510 'child_variable_names' fields with parent blocks.
13511 (Block.AddChildVariableNames): Remove.
13512 (Block.AddVariable): Mark variable as "used by a child block" in
13513 every surrounding block.
13514 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
13515 been used in a child block, complain about violation of "Invariant
13516 meaning in blocks" rule.
13517 * cs-parser.jay (declare_local_variables): Don't use
13518 AddChildVariableNames.
13519 (foreach_statement): Don't create an implicit block: 'foreach'
13520 introduces a scope.
13522 2004-04-23 Miguel de Icaza <miguel@ximian.com>
13524 * convert.cs (ImplicitNumericConversion): 0 is also positive when
13525 converting from 0L to ulong. Fixes 57522.
13527 2004-04-22 Marek Safar <marek.safar@seznam.cz>
13529 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
13530 derived class hides via 'new' keyword field from base class (test-242.cs).
13531 TODO: Handle this in the more general way.
13533 * class.cs (CheckBase): Ditto.
13535 2004-04-22 Marek Safar <marek.safar@seznam.cz>
13537 * decl.cs (caching_flags): New member for storing cached values
13539 (MemberCore.Flags): New enum where bit flags for caching_flags
13541 (MemberCore.cls_compliance): Moved to caching_flags.
13542 (DeclSpace.Created): Moved to caching_flags.
13544 * class.cs: Use caching_flags instead of DeclSpace.Created
13546 2004-04-21 Miguel de Icaza <miguel@ximian.com>
13548 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
13549 if we are only a derived class, not a nested class.
13551 * typemanager.cs: Same as above, but do this at the MemberLookup
13552 level (used by field and methods, properties are handled in
13553 PropertyExpr). Allow for the qualified access if we are a nested
13556 2004-04-21 Marek Safar <marek.safar@seznam.cz>
13558 * class.cs: Refactoring.
13559 (IMethodData): New inteface; Holds links to parent members
13560 to avoid member duplication (reduced memory allocation).
13561 (Method): Implemented IMethodData interface.
13562 (PropertyBase): New inner classes for get/set methods.
13563 (PropertyBase.PropertyMethod): Implemented IMethodData interface
13564 (Event): New inner classes for add/remove methods.
13565 (Event.DelegateMethod): Implemented IMethodData interface.
13567 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
13568 EmitContext (related to class.cs refactoring).
13570 2004-04-21 Raja R Harinath <rharinath@novell.com>
13572 * delegate.cs (Delegate.VerifyApplicability): If the number of
13573 arguments are the same as the number of parameters, first try to
13574 verify applicability ignoring any 'params' modifier on the last
13578 2004-04-16 Raja R Harinath <rharinath@novell.com>
13580 * class.cs (TypeContainer.AddIndexer): Use
13581 'ExplicitInterfaceName' to determine if interface name was
13582 explicitly specified. 'InterfaceType' is not initialized at this time.
13583 (TypeContainer.DefineIndexers): Remove use of temporary list. The
13584 Indexers array is already in the required order. Initialize
13585 'IndexerName' only if there are normal indexers.
13586 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
13587 (TypeContainer.Emit): Emit DefaultMember attribute only if
13588 IndexerName is initialized.
13591 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
13593 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
13596 2004-04-15 Raja R Harinath <rharinath@novell.com>
13598 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
13602 * attribute.cs (Attribute.Resolve): Check for duplicate named
13606 2004-04-15 Miguel de Icaza <miguel@ximian.com>
13608 * iterators.cs (MarkYield): track whether we are in an exception,
13609 and generate code accordingly. Use a temporary value to store the
13610 result for our state.
13612 I had ignored a bit the interaction of try/catch with iterators
13613 since their behavior was not entirely obvious, but now it is
13614 possible to verify that our behavior is the same as MS .NET 2.0
13618 2004-04-14 Miguel de Icaza <miguel@ximian.com>
13620 * iterators.cs: Avoid creating temporaries if there is no work to
13623 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
13624 Enumerations, use TypeManager.EnumToUnderlying and call
13627 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
13630 (This.Emit): Use EmitContext.EmitThis to emit our
13633 (This.EmitAssign): Ditto.
13635 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
13636 codepaths, we will move all the functionality into
13639 (FieldExpr.EmitAssign): Ditto.
13641 This fixes several hidden bugs that I uncovered while doing a code
13642 review of this today.
13644 * codegen.cs (EmitThis): reworked so the semantics are more clear
13645 and also support value types "this" instances.
13647 * iterators.cs: Changed so that for iterators in value types, we
13648 do not pass the value type as a parameter.
13650 Initialization of the enumerator helpers is now done in the caller
13651 instead of passing the parameters to the constructors and having
13652 the constructor set the fields.
13654 The fields have now `assembly' visibility instead of private.
13656 2004-04-11 Miguel de Icaza <miguel@ximian.com>
13658 * expression.cs (Argument.Resolve): Check if fields passed as ref
13659 or out are contained in a MarshalByRefObject.
13661 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
13662 another compiler type.
13664 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
13666 * class.cs (Indexer.Define): use the new name checking method.
13667 Also, return false on an error.
13668 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
13669 (is_identifier_[start/part]_character): make static.
13671 2004-04-10 Miguel de Icaza <miguel@ximian.com>
13673 * expression.cs (Binary.ResolveOperator): Do no append strings
13674 twice: since we can be invoked more than once (array evaluation)
13675 on the same concatenation, take care of this here. Based on a fix
13676 from Ben (bug #56454)
13678 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
13680 * codegen.cs: Fix another case where CS1548 must be reported (when
13681 delay-sign isn't specified and no private is available #56564). Fix
13682 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
13683 error when MCS is used on the MS runtime and we need to delay-sign
13684 (which seems unsupported by AssemblyBuilder - see #56621).
13686 2004-04-08 Marek Safar <marek.safar@seznam.cz>
13688 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
13689 (TypeManager.ComputeNamespaces): Faster implementation for
13692 * compiler.csproj: Updated AssemblyName to mcs.
13694 2004-04-07 Miguel de Icaza <miguel@ximian.com>
13696 * rootcontext.cs: Add new types to the boot resolution.
13698 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
13699 MulticastDelegate is not allowed.
13701 * typemanager.cs: Add new types to lookup: System.TypedReference
13704 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
13705 check for TypedReference or ArgIterator, they are not allowed.
13707 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
13708 makes us properly catch 1510 in some conditions (see bug 56016 for
13711 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
13713 * CryptoConvert.cs: update from corlib version
13716 2004-04-05 Miguel de Icaza <miguel@ximian.com>
13718 * class.cs (Indexer.Define): Check indexername declaration
13720 2004-04-05 Marek Safar <marek.safar@seznam.cz>
13722 * attribute.cs (IsClsCompliant): Fixed problem with handling
13723 all three states (compliant, not-compliant, undetected).
13725 2004-03-30 Marek Safar <marek.safar@seznam.cz>
13727 * attribute.cs (Attribute): Location is now public.
13728 (Resolve): Store resolved arguments (pos_values) in attribute class.
13729 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
13730 (GetClsCompliantAttributeValue): New method that gets
13731 CLSCompliantAttribute value.
13732 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
13733 if exists else null.
13734 (AttributeTester): New class for CLS-Compliant verification routines.
13736 * class.cs (Emit): Add CLS-Compliant verification.
13737 (Method.GetSignatureForError): Implemented.
13738 (Constructor.GetSignatureForError): Implemented
13739 (Constructor.HasCompliantArgs): Returns if constructor has
13740 CLS-Compliant arguments.
13741 (Constructor.Emit): Override.
13742 (Construcor.IsIdentifierClsCompliant): New method; For constructors
13743 is needed to test only parameters.
13744 (FieldBase.GetSignatureForError): Implemented.
13745 (TypeContainer): New member for storing base interfaces.
13746 (TypeContainer.FindMembers): Search in base interfaces too.
13748 * codegen.cs (GetClsComplianceAttribute): New method that gets
13749 assembly or module CLSCompliantAttribute value.
13750 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
13752 (ModuleClass.Emit): Add error 3012 test.
13754 * const.cs (Emit): Override and call base for CLS-Compliant tests.
13756 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
13757 state for all decl types.
13758 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
13759 if CLS-Compliant tests are required.
13760 (IsClsCompliaceRequired): New method. Analyze whether code
13761 must be CLS-Compliant.
13762 (IsExposedFromAssembly): New method. Returns true when MemberCore
13763 is exposed from assembly.
13764 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
13765 value or gets cached value.
13766 (HasClsCompliantAttribute): New method. Returns true if MemberCore
13767 is explicitly marked with CLSCompliantAttribute.
13768 (IsIdentifierClsCompliant): New abstract method. This method is
13769 used to testing error 3005.
13770 (IsIdentifierAndParamClsCompliant): New method. Common helper method
13771 for identifier and parameters CLS-Compliant testing.
13772 (VerifyClsCompliance): New method. The main virtual method for
13773 CLS-Compliant verifications.
13774 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
13775 null. I don't know why is null (too many public members !).
13776 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
13777 and get value of first CLSCompliantAttribute that found.
13779 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
13780 (VerifyClsCompliance): Override and add extra tests.
13782 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
13783 clscheck- disable CLS-Compliant verification event if assembly is has
13784 CLSCompliantAttribute(true).
13786 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
13787 ApllyAttribute is now called in emit section as in the other cases.
13788 Possible future Emit integration.
13789 (IsIdentifierClsCompliant): New override.
13790 (VerifyClsCompliance): New override.
13791 (GetEnumeratorName): Returns full enum name.
13793 * parameter.cs (GetSignatureForError): Implemented.
13795 * report.cs (WarningData): New struct for Warning message information.
13796 (LocationOfPreviousError): New method.
13797 (Warning): New method. Reports warning based on the warning table.
13798 (Error_T): New method. Reports error based on the error table.
13800 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
13801 verifications are done here.
13803 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
13805 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
13806 CLSCompliantAttribute.
13807 (all_imported_types): New member holds all imported types from other
13809 (LoadAllImportedTypes): New method fills static table with exported types
13810 from all referenced assemblies.
13811 (Modules): New property returns all assembly modules.
13813 2004-03-30 Miguel de Icaza <miguel@ximian.com>
13815 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
13816 throwing a parser error.
13818 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
13819 which removes the hardcoded get_/set_ prefixes for properties, as
13820 IL allows for the properties to be named something else.
13824 * expression.cs: Do not override operand before we know if it is
13825 non-null. Fix 56207
13827 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
13829 * typemanager.cs: support for pinned variables.
13831 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
13833 * decl.cs, typemanager.cs: Avoid using an arraylist
13834 as a buffer if there is only one result set.
13836 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
13838 * expression.cs: Make sure you cant call a static method
13839 with an instance expression, bug #56174.
13841 2004-03-29 Miguel de Icaza <miguel@ximian.com>
13843 * class.cs (IsDuplicateImplementation): Improve error reporting to
13844 flag 663 (method only differs in parameter modifier).
13846 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
13847 in preprocessor directives.
13849 * location.cs (LookupFile): Allow for the empty path.
13851 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
13852 better approach for some of that patch, but its failing with the
13853 CharSet enumeration. For now try/catch will do.
13855 * typemanager.cs: Do not crash if a struct does not have fields.
13858 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
13860 * expression.cs: cs0213, cant fix a fixed expression.
13863 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
13865 * cs-parser.jay: detect invalid embeded statements gracefully.
13868 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
13870 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
13873 the invocation type may not be a subclass of the tye of the item/
13874 The type of the item must be a subclass of the invocation item.
13879 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
13881 * attribute.cs: Added methods to get a string and a bool from an
13882 attribute. Required to information from AssemblyKeyFileAttribute,
13883 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
13884 * codegen.cs: Modified AssemblyName creation to include support for
13885 strongnames. Catch additional exceptions to report them as CS1548.
13886 * compiler.csproj: Updated include CryptoConvert.cs.
13887 * compiler.csproj.user: Removed file - user specific configuration.
13888 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
13889 Mono.Security assembly. The original class is maintained and tested in
13890 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
13891 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
13892 like CSC 8.0 (C# v2) supports.
13893 * Makefile: Added CryptoConvert.cs to mcs sources.
13894 * rootcontext.cs: Added new options for strongnames.
13896 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
13898 * driver.cs: For --expect-error, report error code `2'
13899 if the program compiled with no errors, error code `1' if
13900 it compiled with an error other than the one expected.
13902 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
13904 * compiler.csproj: Updated for Visual Studio .NET 2003.
13905 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
13906 * compiler.sln: Updated for Visual Studio .NET 2003.
13908 2004-03-24 Ravi Pratap M <ravi@ximian.com>
13910 * expression.cs: Fix bug #47234. We basically need to apply the
13911 rule that we prefer the conversion of null to a reference type
13912 when faced with a conversion to 'object' (csc behaviour).
13914 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
13916 * statement.cs: Shorter form for foreach, eliminates
13917 a local variable. r=Martin.
13919 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
13921 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
13922 checks if we can use brtrue/brfalse to test for 0.
13923 * expression.cs: use the above in the test for using brtrue/brfalse.
13924 cleanup code a bit.
13926 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
13928 * expression.cs: Rewrite string concat stuff. Benefits:
13930 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
13931 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
13932 rather than a concat chain.
13934 * typemanager.cs: Add lookups for more concat overloads.
13936 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
13938 * expression.cs: Emit shorter il code for array init.
13955 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
13957 * statement.cs: Before, two switch blocks would be merged if the
13958 total size of the blocks (end_item - begin_item + 1) was less than
13959 two times the combined sizes of the blocks.
13961 Now, it will only merge if after the merge at least half of the
13966 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
13968 * class.cs : csc build fix for GetMethods(). See bug #52503.
13970 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
13972 * expression.cs: Make sure fp comparisons work with NaN.
13973 This fixes bug #54303. Mig approved this patch a long
13974 time ago, but we were not able to test b/c the runtime
13977 2004-03-19 Miguel de Icaza <miguel@ximian.com>
13979 * ecore.cs (TypExpr.GetHashCode): implement this overload.
13981 2004-03-19 Martin Baulig <martin@ximian.com>
13983 * class.cs (MemberCore.IsDuplicateImplementation): Report the
13984 error here and not in our caller.
13986 2004-03-19 Martin Baulig <martin@ximian.com>
13988 * interface.cs: Completely killed this file.
13989 (Interface): We're now a TypeContainer and live in class.cs.
13991 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
13992 argument; we're now also called for interfaces.
13993 (TypeContainer.DefineMembers): Allow this method being called
13995 (TypeContainer.GetMethods): New public method; formerly known as
13996 Interface.GetMethod(). This is used by PendingImplementation.
13997 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
13998 it's now private and non-static.
13999 (Interface): Moved this here; it's now implemented similar to
14001 (Method, Property, Event, Indexer): Added `bool is_interface'
14002 argument to their .ctor's.
14003 (MemberBase.IsInterface): New public field.
14005 * cs-parser.jay: Create normal Method, Property, Event, Indexer
14006 instances instead of InterfaceMethod, InterfaceProperty, etc.
14007 (opt_interface_base): Removed; we now use `opt_class_base' instead.
14008 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
14010 2004-03-19 Martin Baulig <martin@ximian.com>
14012 * class.cs (MethodCore.IsDuplicateImplementation): New private
14013 method which does the CS0111 checking.
14014 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
14015 Use IsDuplicateImplementation().
14017 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
14019 * decl.cs (FindMemberToOverride): New method to find the correct
14020 method or property to override in the base class.
14022 - Make Method/Property use the above method to find the
14023 version in the base class.
14024 - Remove the InheritableMemberSignatureCompare as it is now
14027 This patch makes large code bases much faster to compile, as it is
14028 O(n) rather than O(n^2) to do this validation.
14030 Also, it fixes bug 52458 which is that nested classes are not
14031 taken into account when finding the base class member.
14033 Reviewed/Approved by Martin.
14035 2004-03-17 Marek Safar <marek.safar@seznam.cz>
14037 * interface.cs: In all interface classes removed redundant
14038 member initialization.
14040 2004-03-16 Martin Baulig <martin@ximian.com>
14042 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
14044 2004-03-15 Miguel de Icaza <miguel@ximian.com>
14046 * decl.cs (DefineTypeAndParents): New helper method to define a
14047 type's containers before the type itself is defined; This is a
14048 bug exposed by the recent changes to Windows.Forms when an
14049 implemented interface was defined inside a class that had not been
14052 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
14054 (Check): Loop correctly to report errors modifiers
14055 (UNSAFE was not in the loop, since it was the same as TOP).
14057 * interface.cs: Every interface member now takes a ModFlags,
14058 instead of a "is_new" bool, which we set on the base MemberCore.
14060 Every place where we called "UnsafeOk" in the interface, now we
14061 call the proper member (InterfaceMethod.UnsafeOK) instead to get
14062 the unsafe settings from the member declaration instead of the
14063 container interface.
14065 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
14067 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
14068 `set_indexer_name' to the pending bits (one per type).
14070 We fixed a bug today that was picking the wrong method to
14071 override, since for properties the existing InterfaceMethod code
14072 basically ignored the method name. Now we make sure that the
14073 method name is one of the valid indexer names.
14075 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
14077 * support.cs (SeekableStreamReader): Keep track of stream byte
14078 positions and don't mix them with character offsets to the buffer.
14080 Patch from Gustavo Giráldez
14082 2004-03-15 Marek Safar <marek.safar@seznam.cz>
14084 * interface.cs (InterfaceSetGetBase): Removed double member
14085 initialization, base class does it as well.
14087 2004-03-13 Martin Baulig <martin@ximian.com>
14089 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
14090 when compiling corlib.
14092 2004-03-13 Miguel de Icaza <miguel@ximian.com>
14094 * convert.cs (ExplicitConversion): We were reporting an error on
14095 certain conversions (object_type source to a value type, when the
14096 expression was `null') before we had a chance to pass it through
14097 the user defined conversions.
14099 * driver.cs: Replace / and \ in resource specifications to dots.
14102 * class.cs: Add check for duplicate operators. Fixes 52477
14104 2004-03-11 Miguel de Icaza <miguel@ximian.com>
14106 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
14107 that are in the middle of the statements, not only at the end.
14110 * class.cs (TypeContainer.AddField): No longer set the
14111 `HaveStaticConstructor' flag, now we call it
14112 `UserDefineStaticConstructor' to diferentiate the slightly
14113 semantic difference.
14115 The situation is that we were not adding BeforeFieldInit (from
14116 Modifiers.TypeAttr) to classes that could have it.
14117 BeforeFieldInit should be set to classes that have no static
14122 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
14124 And most importantly Zoltan's comment:
14126 http://bugzilla.ximian.com/show_bug.cgi?id=44229
14128 "I think beforefieldinit means 'it's ok to initialize the type sometime
14129 before its static fields are used', i.e. initialization does not need
14130 to be triggered by the first access to the type. Setting this flag
14131 helps the JIT to compile better code, since it can run the static
14132 constructor at JIT time, and does not need to generate code to call it
14133 (possibly lots of times) at runtime. Unfortunately, mcs does not set
14134 this flag for lots of classes like String.
14136 csc sets this flag if the type does not have an explicit static
14137 constructor. The reasoning seems to be that if there are only static
14138 initalizers for a type, and no static constructor, then the programmer
14139 does not care when this initialization happens, so beforefieldinit
14142 This bug prevents the AOT compiler from being usable, since it
14143 generates so many calls to mono_runtime_class_init that the AOT code
14144 is much slower than the JITted code. The JITted code is faster,
14145 because it does not generate these calls if the vtable is type is
14146 already initialized, which is true in the majority of cases. But the
14147 AOT compiler can't do this."
14149 2004-03-10 Miguel de Icaza <miguel@ximian.com>
14151 * class.cs (MethodData.Emit): Refactor the code so symbolic
14152 information is generated for destructors; For some reasons we
14153 were taking a code path that did not generate symbolic information
14156 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
14158 * class.cs: Create a Constructor.CheckBase method that
14159 takes care of all validation type code. The method
14160 contains some code that was moved from Define.
14162 It also includes new code that checks for duplicate ctors.
14163 This fixes bug #55148.
14165 2004-03-09 Joshua Tauberer <tauberer@for.net>
14167 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
14168 a { ... }-style array creation invokes EmitStaticInitializers
14169 which is not good for reference-type arrays. String, decimal
14170 and now null constants (NullCast) are not counted toward
14171 static initializers.
14173 2004-03-05 Martin Baulig <martin@ximian.com>
14175 * location.cs (SourceFile.HasLineDirective): New public field;
14176 specifies whether the file contains or is referenced by a "#line"
14178 (Location.DefineSymbolDocuments): Ignore source files which
14179 either contain or are referenced by a "#line" directive.
14181 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
14183 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
14184 direct access to our parent, so check the method inline there.
14186 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
14188 * expression.cs (Invocation.EmitCall): Miguel's last commit
14189 caused a regression. If you had:
14194 In Foo the implict this would be null.
14196 2004-02-27 Miguel de Icaza <miguel@ximian.com>
14198 * expression.cs (Invocation.EmitCall): If the method is not
14199 virtual, do not emit a CallVirt to it, use Call.
14201 * typemanager.cs (GetFullNameSignature): Improve the method to
14202 cope with ".ctor" and replace it with the type name.
14204 * class.cs (ConstructorInitializer.Resolve): Now the method takes
14205 as an argument the ConstructorBuilder where it is being defined,
14206 to catch the recursive constructor invocations.
14208 2004-02-26 Miguel de Icaza <miguel@ximian.com>
14210 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
14211 routines to check if a type is an enumerable/enumerator allow
14212 classes that implement the IEnumerable or IEnumerator interfaces.
14214 * class.cs (Property, Operator): Implement IIteratorContainer, and
14215 implement SetYields.
14217 (Property.Define): Do the block swapping for get_methods in the
14218 context of iterators. We need to check if Properties also
14219 include indexers or not.
14221 (Operator): Assign the Block before invoking the
14222 OperatorMethod.Define, so we can trigger the Iterator code
14225 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
14226 Property and Operator classes are not created when we parse the
14227 declarator but until we have the block completed, so we use a
14228 singleton SimpleIteratorContainer.Simple to flag whether the
14229 SetYields has been invoked.
14231 We propagate this setting then to the Property or the Operator to
14232 allow the `yield' to function.
14234 2004-02-25 Marek Safar <marek.safar@seznam.cz>
14236 * codegen.cs: Implemented attribute support for modules.
14237 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
14238 Assembly/Module functionality.
14240 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
14241 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
14242 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
14244 2004-02-16 Marek Safar <marek.safar@seznam.cz>
14246 * interface.cs (FindMembers): The operation is performed on all base
14247 interfaces and not only on the first. It is required for future CLS Compliance patch.
14249 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
14251 * statement.cs, codegen.cs:
14252 This patch deals with patterns such as:
14254 public class List : IEnumerable {
14256 public MyEnumerator GetEnumerator () {
14257 return new MyEnumerator(this);
14260 IEnumerator IEnumerable.GetEnumerator () {
14264 public struct MyEnumerator : IEnumerator {
14269 Before, there were a few things we did wrong:
14270 1) we would emit callvirt on a struct, which is illegal
14271 2) we emited ldarg when we needed to emit ldarga
14272 3) we would mistakenly call the interface methods on an enumerator
14273 type that derived from IEnumerator and was in another assembly. For example:
14275 public class MyEnumerator : IEnumerator
14277 Would have the interface methods called, even if there were public impls of the
14278 method. In a struct, this lead to invalid IL code.
14280 2004-02-11 Marek Safar <marek.safar@seznam.cz>
14282 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
14285 * delegate.cs (Define): Fixed crash when delegate type is undefined.
14287 2004-02-11 Miguel de Icaza <miguel@ximian.com>
14289 * cs-parser.jay: Fix small regression: we were not testing V2
14290 compiler features correctly.
14292 * interface.cs: If the emit context is null, then create one
14294 2004-02-09 Marek Safar <marek.safar@seznam.cz>
14296 * decl.cs (GetSignatureForError): New virtual method to get full name
14297 for error messages.
14299 * attribute.cs (IAttributeSupport): New interface for attribute setting.
14300 Now it is possible to rewrite ApplyAttributes method to be less if/else.
14302 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
14303 Duplicated members and code in these classes has been removed.
14304 Better encapsulation in these classes.
14306 2004-02-07 Miguel de Icaza <miguel@ximian.com>
14308 * assign.cs (Assign.DoResolve): When dealing with compound
14309 assignments, there is a new rule in ECMA C# 2.4 (might have been
14310 there before, but it is documented here) that states that in:
14314 If b is of type int, and the `op' is a shift-operator, then the
14315 above is evaluated as:
14319 * expression.cs (Binary.ResolveOperator): Instead of testing for
14320 int/uint/long/ulong, try to implicitly convert to any of those
14321 types and use that in pointer arithmetic.
14323 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
14324 method to print information for from the type, not from the
14325 null-method we were given.
14327 2004-02-01 Duncan Mak <duncan@ximian.com>
14329 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
14330 parsing for cmd, fixes bug #53694.
14332 2004-02-04 Marek Safar <marek.safar@seznam.cz>
14334 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
14335 in the member name duplication tests. Property and operator name duplication
14336 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
14338 2004-02-03 Marek Safar <marek.safar@seznam.cz>
14340 * interface.cs (PopulateMethod): Fixed crash when interface method
14341 returns not existing type (error test cs0246-3.cs).
14343 2004-02-02 Ravi Pratap M <ravi@ximian.com>
14345 * cs-parser.jay (interface_accessors): Re-write actions to also
14346 store attributes attached to get and set methods. Fix spelling
14349 (inteface_property_declaration): Modify accordingly.
14351 (InterfaceAccessorInfo): New helper class to store information to pass
14352 around between rules that use interface_accessors.
14354 * interface.cs (Emit): Apply attributes on the get and set
14355 accessors of properties and indexers too.
14357 * attribute.cs (ApplyAttributes): Modify accordingly to use the
14358 right MethodBuilder when applying attributes to the get and set accessors.
14360 2004-01-31 Miguel de Icaza <miguel@ximian.com>
14362 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
14364 2004-01-26 Miguel de Icaza <miguel@ximian.com>
14366 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
14368 2004-01-25 Miguel de Icaza <miguel@ximian.com>
14370 * cs-parser.jay: Remove YIELD token, instead use the new grammar
14371 changes that treat `yield' specially when present before `break'
14372 or `return' tokens.
14374 * cs-tokenizer.cs: yield is no longer a keyword.
14376 2004-01-23 Marek Safar <marek.safar@seznam.cz>
14378 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
14379 setting for default constructors.
14380 For default constructors are almost every time set wrong Modifier. The
14381 generated IL code has been alright. But inside mcs this values was
14382 wrong and this was reason why several of my CLS Compliance tests
14385 2004-01-22 Martin Baulig <martin@ximian.com>
14387 * cs-parser.jay (namespace_or_type_name): Return an Expression,
14388 not a QualifiedIdentifier. This is what `type_name_expression'
14389 was previously doing.
14390 (type_name_expression): Removed; the code is now in
14391 `namespace_or_type_name'.
14392 (qualified_identifier): Removed, use `namespace_or_type_name'
14394 (QualifiedIdentifier): Removed this class.
14396 2004-01-22 Martin Baulig <martin@ximian.com>
14398 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
14399 not a string as alias name.
14401 2004-01-21 Miguel de Icaza <miguel@ximian.com>
14403 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
14404 #52730 bug, and instead compute correctly the need to use a
14405 temporary variable when requesting an address based on the
14406 static/instace modified of the field and the constructor.
14408 2004-01-21 Martin Baulig <martin@ximian.com>
14410 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
14411 class and namespace before looking up aliases. Fixes #52517.
14413 2004-01-21 Martin Baulig <martin@ximian.com>
14415 * flowanalysis.cs (UsageVector.Merge): Allow variables being
14416 assinged in a 'try'; fixes exception4.cs.
14418 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14419 * class.cs : Implemented parameter-less constructor for TypeContainer
14421 * decl.cs: Attributes are now stored here. New property OptAttributes
14423 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
14425 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
14427 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14429 * typemanager.cs (CSharpSignature): Now reports also inner class name.
14430 (CSharpSignature): New method for indexer and property signature.
14432 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14434 * pending.cs (IsVirtualFilter): Faster implementation.
14436 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14438 * typemanager.cs: Avoid inclusion of same assembly more than once.
14440 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14442 * cs-parser.jay: Fixed problem where the last assembly attribute
14443 has been applied also to following declaration (class, struct, etc.)
14445 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14447 * class.cs: Added error CS0538, CS0539 reporting.
14448 Fixed crash on Microsoft runtime when field type is void.
14450 * cs-parser.jay: Added error CS0537 reporting.
14452 * pending.cs: Added error CS0535 reporting.
14453 Improved error report for errors CS0536, CS0534.
14455 2004-01-20 Miguel de Icaza <miguel@ximian.com>
14457 Merge a few bits from the Anonymous Method MCS tree.
14459 * statement.cs (ToplevelBlock): New class for toplevel methods,
14460 will hold anonymous methods, lifted variables.
14462 * cs-parser.jay: Create toplevel blocks for delegates and for
14463 regular blocks of code.
14465 2004-01-20 Martin Baulig <martin@ximian.com>
14467 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
14468 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
14469 and `NeedExplicitReturn'; added `IsLastStatement'.
14470 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
14471 have a `ReturnLabel' or we're not unreachable.
14473 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
14474 child's reachability; don't just override ours with it. Fixes
14475 #58058 (lluis's example).
14476 (FlowBranching): Added public InTryOrCatch(), InCatch(),
14477 InFinally(), InLoop(), InSwitch() and
14478 BreakCrossesTryCatchBoundary() methods.
14480 * statement.cs (Return): Do all error checking in Resolve().
14481 Unless we are the last statement in a top-level block, always
14482 create a return label and jump to it.
14483 (Break, Continue): Do all error checking in Resolve(); also make
14484 sure we aren't leaving a `finally'.
14485 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
14486 statement in a top-level block.
14487 (Block.Flags): Added `IsDestructor'.
14488 (Block.IsDestructor): New public property.
14490 2004-01-20 Martin Baulig <martin@ximian.com>
14492 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
14494 2004-01-20 Martin Baulig <martin@ximian.com>
14496 * statement.cs (Statement.ResolveUnreachable): New public method.
14497 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
14498 (Block.Resolve): Resolve unreachable statements.
14500 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
14502 * expression.cs: We need to fix the case where we do
14503 not have a temp variable here.
14505 * assign.cs: Only expression compound assignments need
14506 temporary variables.
14508 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
14510 * flowanalysis.cs: Reduce memory allocation in a few ways:
14511 - A block with no variables should not allocate a bit
14513 - A method with no out parameters does not need any tracking
14514 for assignment of the parameters, so we need not allocate
14517 public readonly Type[] VariableTypes;
14518 public readonly string[] VariableNames;
14519 Are redundant. The data is already stored in the variable
14520 map, so we need not allocate another array for it.
14521 - We need to add alot of checks for if (params | locals) == null
14522 due to the first two changes.
14524 2004-01-18 Miguel de Icaza <miguel@ximian.com>
14526 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
14527 implement IMemoryLocation, we store a copy on a local variable and
14528 take the address of it. Patch from Benjamin Jemlich
14530 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
14531 to use a special "type_name_expression" rule which reduces the
14532 number of "QualifiedIdentifier" classes created, and instead
14533 directly creates MemberAccess expressions.
14535 2004-01-17 Miguel de Icaza <miguel@ximian.com>
14537 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
14538 that fixes #52853. Null literal assignment to ValueType
14540 * class.cs (MethodData.Emit): Instead of checking the name of the
14541 method to determine if its a destructor, create a new derived
14542 class from Method called Destructor, and test for that.
14544 * cs-parser.jay: Create a Destructor object instead of a Method.
14546 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
14550 2004-01-16 Miguel de Icaza <miguel@ximian.com>
14552 * expression.cs (Binary.ResolveOperator): Perform an implicit
14553 conversion from MethodGroups to their delegate types on the
14554 Addition operation.
14556 * delegate.cs: Introduce a new class DelegateCreation that is the
14557 base class for `NewDelegate' and `ImplicitDelegateCreation',
14558 factor some code in here.
14560 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
14561 conversion from MethodGroups to compatible delegate types.
14563 * ecore.cs (Expression.Resolve): Do not flag error 654
14564 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
14565 we allow conversions from MethodGroups to delegate types now.
14567 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
14568 assignments in v2 either.
14570 2004-01-10 Miguel de Icaza <miguel@ximian.com>
14572 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
14573 static read-only fields in ctors.
14575 Applied patch from Benjamin Jemlich
14577 * expression.cs (UnaryMutator): Avoid leaking local variables.
14579 2004-01-09 Miguel de Icaza <miguel@ximian.com>
14581 * cs-tokenizer.cs (IsCastToken): Allow the various native types
14582 here to return true, as they can be used like this:
14584 (XXX) int.MEMBER ()
14586 Fixed 49836 and all the other dups
14588 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
14590 * driver.cs: Implement /win32res and /win32icon.
14592 2004-01-08 Miguel de Icaza <miguel@ximian.com>
14594 * cs-parser.jay: Add a rule to improve error handling for the
14595 common mistake of placing modifiers after the type.
14597 2004-01-07 Miguel de Icaza <miguel@ximian.com>
14599 * cs-parser.jay (interface_event_declaration): Catch
14600 initialization of events on interfaces, and report cs0068
14602 * cs-parser.jay (interface_event_declaration): Catch
14603 initialization of events.
14605 * ecore.cs: Better report missing constructors.
14607 * expression.cs (Binary.ResolveOperator): My previous bug fix had
14608 the error reporting done in the wrong place. Fix.
14610 * expression.cs (Binary.ResolveOperator): Catch the
14611 operator + (E x, E y) error earlier, and later allow for implicit
14612 conversions in operator +/- (E e, U x) from U to the underlying
14615 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
14616 52596, if the container class is abstract, the default constructor
14617 is protected otherwise its public (before, we were always public).
14619 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
14622 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
14623 Jemlich that fixes bug #52597, MCS was generating invalid code for
14624 idisposable structs. Thanks to Ben for following up with this
14627 2004-01-06 Miguel de Icaza <miguel@ximian.com>
14629 * driver.cs: Allow assemblies without code to be generated, fixes
14632 2004-01-07 Nick Drochak <ndrochak@gol.com>
14634 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
14636 2004-01-05 Miguel de Icaza <miguel@ximian.com>
14638 * cs-parser.jay: Add rules to improve error reporting if fields or
14639 methods are declared at the namespace level (error 116)
14641 * Add rules to catch event add/remove
14643 2004-01-04 David Sheldon <dave-mono@earth.li>
14645 * expression.cs: Added matching ")" to error message for
14648 2004-01-03 Todd Berman <tberman@gentoo.org>
14650 * ecore.cs, attribute.cs:
14651 Applying fix from #52429.
14653 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
14655 * ecore.cs, expression.cs, statement.cs:
14656 Total rewrite of how we handle branching. We
14657 now handle complex boolean expressions with fewer
14658 jumps. As well if (x == 0) no longer emits a ceq.
14660 if (x is Foo) is much faster now, because we generate
14663 Overall, we get a pretty big improvement on our benchmark
14664 tests. The code we generate is smaller and more readable.
14666 I did a full two-stage bootstrap. The patch was reviewed
14667 by Martin and Miguel.
14669 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
14671 * cs-parser.jay: Make primary_expression not take a QI.
14672 we dont need this because the member_access rule covers
14673 us here. So we replace the rule with just IDENTIFIER.
14675 This has two good effects. First, we remove a s/r conflict.
14676 Second, we allocate many fewer QualifiedIdentifier objects.
14678 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
14680 * attribute.cs: Handle MarshalAs attributes as pseudo, and
14681 set the correct information via SRE. This prevents
14682 hanging on the MS runtime. Fixes #29374.
14684 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
14686 * convert.cs: correctly handle conversions to value types
14687 from Enum and ValueType as unboxing conversions.
14689 Fixes bug #52569. Patch by Benjamin Jemlich.
14691 2004-01-02 Ravi Pratap <ravi@ximian.com>
14693 * expression.cs (BetterConversion): Prefer int -> uint
14694 over int -> ulong (csc's behaviour). This fixed bug #52046.
14696 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
14698 * decl.cs (MemberCache.FindMembers): now returns a
14701 * typemanager.cs: In general, go with with ^^.
14702 (CopyNewMethods): take an IList.
14703 (RealMemberLookup): Only allocate an arraylist
14704 if we copy from two sets of methods.
14706 This change basically does two things:
14707 1) Fewer array lists allocated due to CopyNewMethods.
14708 2) the explicit cast in MemberList costed ALOT.
14710 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
14712 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
14713 a hashtable to avoid needless string allocations when an identifier is
14714 used more than once (the common case).
14716 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
14718 * pending.cs: MS's TypeBuilder.GetInterfaces ()
14719 is broken, it will not return anything. So, we
14720 have to use the information we have in mcs to
14723 * typemanager.cs: Add a cache for GetInterfaces,
14724 since this will now be used more often (due to ^^)
14726 (GetExplicitInterfaces) New method that gets the
14727 declared, not effective, interfaces on a type
14728 builder (eg, if you have interface IFoo, interface
14729 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
14732 This patch makes MCS able to bootstrap itself on
14735 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
14737 * expression.cs: Remove the Nop's that Miguel put
14740 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
14742 * report.cs, codegen.cs: Give the real stack trace to
14743 the error when an exception is thrown.
14745 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
14747 * decl.cs: only allocate hashtables for ifaces if
14750 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
14752 * expression.cs: fix the error from cs0121-2.cs
14753 (a parent interface has two child interfaces that
14754 have a function with the same name and 0 params
14755 and the function is called through the parent).
14757 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
14759 * class.cs, rootcontext.cs, typmanager.cs: do not
14762 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
14764 * codegen.cs: remove stack for the ec flow branching.
14765 It is already a linked list, so no need.
14767 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
14769 * Makefile: Allow custom profiler here.
14771 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
14773 * typemanager.cs (LookupType):
14774 - Use a static char [], because split takes
14775 a param array for args, so it was allocating
14777 - Do not store true in a hashtable, it boxes.
14779 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
14781 * flowanalysis.cs: bytify common enums.
14783 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
14785 * modifiers.cs: Add a new set of flags for the
14786 flags allowed on explicit interface impls.
14787 * cs-parser.jay: catch the use of modifiers in
14788 interfaces correctly.
14789 * class.cs: catch private void IFoo.Blah ().
14791 All related to bug #50572.
14793 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
14795 * decl.cs: Rewrite the consistant accessability checking.
14796 Accessability is not linear, it must be implemented in
14797 a tableish way. Fixes #49704.
14799 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
14801 * expression.cs: Handle negation in a checked context.
14802 We must use subtraction from zero. Fixes #38674.
14804 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
14806 * class.cs: Ignore static void main in DLLs.
14807 * rootcontext.cs: Handle the target type here,
14808 since we are have to access it from class.cs
14809 * driver.cs: account for the above.
14811 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
14813 * report.cs: Give line numbers and files if available.
14815 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
14817 * driver.cs: Implement /addmodule.
14819 * typemanager.cs: Change 'modules' field so it now contains Modules not
14822 2003-12-20 Martin Baulig <martin@ximian.com>
14824 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
14825 (FieldBase.IsAssigned): Removed this field.
14826 (FieldBase.SetAssigned): New public method.
14827 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
14829 2003-12-20 Martin Baulig <martin@ximian.com>
14831 * expression.cs (LocalVariableReference.DoResolve): Don't set
14832 `vi.Used' if we're called from DoResolveLValue().
14834 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
14835 returns the usage vector it just merged into the current one -
14836 pass this one to UsageWarning().
14837 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
14838 of the `EmitContext', don't call this recursively on our children.
14840 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
14842 * driver.cs: Implement /target:module.
14844 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
14846 * support.cs (CharArrayHashtable): New helper class.
14848 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
14849 char arrays, not strings, so we can avoid creating a string in
14850 consume_identifier if the identifier is a keyword.
14852 2003-12-16 Martin Baulig <martin@ximian.com>
14854 * statement.cs (LocalInfo.Assigned): Removed this property.
14855 (LocalInfo.Flags): Removed `Assigned'.
14856 (LocalInfo.IsAssigned): New public method; takes the EmitContext
14857 and uses flow analysis.
14858 (Block.UsageWarning): Made this method private.
14859 (Block.Resolve): Call UsageWarning() if appropriate.
14861 * expression.cs (LocalVariableReference.DoResolve): Always set
14862 LocalInfo.Used here.
14864 2003-12-13 Martin Baulig <martin@ximian.com>
14866 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
14867 any value here; we're now using flow analysis to figure out
14868 whether a statement/block returns a value.
14870 2003-12-13 Martin Baulig <martin@ximian.com>
14872 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
14874 (FlowBranching.MergeFinally): Don't call
14875 `branching.CheckOutParameters()' here, this is called in
14877 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
14878 when adding the `finally' vector.
14880 2003-12-13 Martin Baulig <martin@ximian.com>
14883 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
14884 actually work and also fix #48962.
14886 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
14888 * decl.cs: Do not check System.Object for nested types,
14889 since we know it does not have any. Big bang for buck:
14892 Run 1: 8.35 seconds
14893 Run 2: 8.32 seconds
14894 corlib: 17.99 seconds
14896 Run 1: 8.17 seconds
14897 Run 2: 8.17 seconds
14898 corlib: 17.39 seconds
14900 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
14902 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
14903 time we are returning 0 members, so we save alot here.
14905 2003-12-11 Martin Baulig <martin@ximian.com>
14907 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
14908 `MergeChild()', also just take the `FlowBranching' as argument;
14909 call Merge() on it and return the result.
14910 (FlowBranching.Merge): We don't need to do anything if we just
14913 2003-12-11 Martin Baulig <martin@ximian.com>
14915 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
14916 them in an `ArrayList' to reduce memory usage. Thanks to Ben
14917 Maurer for this idea.
14919 2003-12-11 Martin Baulig <martin@ximian.com>
14921 * flowanalysis.cs (MergeResult): This class is now gone; we now
14922 use the `UsageVector' for this. The reason for this is that if a
14923 branching just has one sibling, we don't need to "merge" them at
14924 all - that's the next step to do.
14925 (FlowBranching.Merge): We now return a `UsageVector' instead of a
14928 2003-12-11 Martin Baulig <martin@ximian.com>
14930 Reworked flow analyis and made it more precise and bug-free. The
14931 most important change is that we're now using a special `Reachability'
14932 class instead of having "magic" meanings of `FlowReturns'. I'll
14933 do some more cleanups and optimizations and also add some more
14934 documentation this week.
14936 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
14937 largely reworked this class.
14938 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
14939 the new `Reachability' class instead of having "magic" values here.
14940 (FlowBranching): We're now using an instance of `Reachability'
14941 instead of having separate `Returns', `Breaks' etc. fields.
14943 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
14944 based on flow analysis; ignore the return value of block.Emit ().
14946 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
14948 * driver.cs typemanager.cs: Find the mono extensions to corlib even
14949 if they are private.
14951 2003-12-09 Martin Baulig <martin@ximian.com>
14953 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
14954 call them directly on the UsageVector.
14956 2003-12-09 Martin Baulig <martin@ximian.com>
14958 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
14959 Changed return type from `FlowReturns' to `Reachability'.
14961 2003-12-09 Martin Baulig <martin@ximian.com>
14963 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
14964 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
14965 `Reachable' fields with a single `Reachability' one.
14967 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
14969 * class.cs (FindMembers): Remove foreach's.
14974 Run 1: 8.74 seconds
14975 Run 2: 8.71 seconds
14978 Run 1: 8.64 seconds
14979 Run 2: 8.58 seconds
14982 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
14987 This patch does a few things:
14988 1. EmptyStatement is now a singleton, so it is never reallocated.
14989 2. All blah is EmptyStatement constructs have been changed to
14990 blah == EmptyStatement.Value, which is much faster and valid
14991 now that EmptyStatement is a singleton.
14992 3. When resolving a block, rather than allocating a new array for
14993 the non-empty statements, empty statements are replaced with
14994 EmptyStatement.Value
14995 4. Some recursive functions have been made non-recursive.
14996 Mainly the performance impact is from (3), however (1) and (2) are needed for
14997 this to work. (4) does not make a big difference in normal situations, however
14998 it makes the profile look saner.
15003 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15004 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15005 Total memory allocated: 56397 KB
15008 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
15009 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
15010 Total memory allocated: 55666 KB
15012 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15014 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
15015 than the hashtable in a hashtable version
15017 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
15018 we always end up concating a string. This results in a huge perf
15019 loss, because many strings have to be tracked by the GC. In this
15020 patch, we first use a hashtable that works with two keys, so that
15021 the strings do not need to be concat'ed.
15025 Run 1: 8.74 seconds
15026 Run 2: 8.71 seconds
15029 Run 1: 8.65 seconds
15030 Run 2: 8.56 seconds
15032 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15034 * Makefile: Add a new target `do-time' that does a quick and simple
15035 profile, leaving easy to parse output.
15037 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
15039 * codegen.cs (Init): Create the dynamic assembly with
15040 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
15042 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
15044 * support.cs: Make the PtrHashtable use only one
15045 instance of its comparer.
15047 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
15049 * typemanager.cs: Fix lookup of GetNamespaces.
15051 2003-11-29 Miguel de Icaza <miguel@ximian.com>
15053 * expression.cs: Removed redundant line.
15055 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
15056 ArrayLists, use for loops with bounds.
15058 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
15061 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
15062 arraylists, use for loop with bounds.
15064 The above three changes give us a 0.071 second performance
15065 improvement out of 3.294 seconds down to 3.223. On my machine
15066 the above changes reduced the memory usage by 1,387 KB during
15067 compiler bootstrap.
15069 * cs-parser.jay (QualifiedIdentifier): New class used to represent
15070 QualifiedIdentifiers. Before we created a new string through
15071 concatenation, and mostly later on, the result would be
15072 manipulated by DecomposeQI through string manipulation.
15074 This reduced the compiler memory usage for bootstrapping from
15075 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
15076 compile times in 0.05 seconds.
15078 2003-11-28 Dick Porter <dick@ximian.com>
15080 * support.cs: Do string compares with the Invariant culture.
15088 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
15089 the comparison is done with the Invariant culture.
15091 2003-11-27 Miguel de Icaza <miguel@ximian.com>
15093 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
15094 GetEnumerator method.
15096 (ProbeCollectionType): Iterate starting at the most specific type
15097 upwards looking for a GetEnumerator
15099 * expression.cs: Shift count can be up to 31 for int/uint and 63
15102 2003-11-26 Miguel de Icaza <miguel@ximian.com>
15104 * statement.cs (Block.LookupLabel): Also look for the label on the
15105 children blocks. Use a hash table to keep track of visited
15108 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
15109 we actually did transform the other operand, otherwise fall back
15110 to the common codepath that casts to long.
15112 * cs-tokenizer.cs: Use the same code pattern as the int case.
15113 Maybe I should do the parsing myself, and avoid depending on the
15114 Parse routines to get this done.
15116 2003-11-25 Miguel de Icaza <miguel@ximian.com>
15118 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
15119 which fixes bug 51347. This time test it.
15121 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
15122 attributes for example can not tell the difference between these.
15123 The difference was only a syntax feature of the language.
15125 * attribute.cs: Apply attributes to delegates.
15127 * delegate.cs: Call the apply attributes method.
15129 2003-11-24 Miguel de Icaza <miguel@ximian.com>
15131 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
15132 comparing 0 vs Byte.MinValue, not the value
15134 (ImplicitConversionRequired): When reporting a conversion error,
15135 use error 31 to print out the constant error instead of the
15138 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
15139 which fixes bug 51347.
15141 2003-11-22 Miguel de Icaza <miguel@ximian.com>
15143 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
15144 which fixes the -warnaserror command line option.
15146 2003-11-21 Miguel de Icaza <miguel@ximian.com>
15148 * cfold.cs (DoNumericPromotions): During constant folding of
15149 additions on UIntConstant, special case intconstants with
15150 IntConstants like we do on the expression binary operator.
15152 2003-11-12 Miguel de Icaza <miguel@ximian.com>
15154 * convert.cs (ImplicitReferenceConversion): We were missing a case
15155 (System.Enum are not value types or class types, so we need to
15156 classify them separatedly).
15158 * driver.cs: We do not support error 2007.
15160 2003-11-12 Jackson Harper <jackson@ximian.com>
15162 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
15163 system directory. Also use the full file name so users can
15164 libraries names mscorlib-o-tron.dll in a non system dir.
15166 2003-11-10 Martin Baulig <martin@ximian.com>
15168 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
15169 (TypeManager.InitCoreTypes): Initialize them here, but instead of
15170 calling `ResolveType()' on them, directly assign their `Type'.
15172 2003-11-08 Martin Baulig <martin@ximian.com>
15174 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
15175 return value and the `out parent' parameter.
15176 (TypeContainer.DefineType): Moved the CS0644 check into
15177 GetClassBases(). Don't pass the interface types to the
15178 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
15179 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
15181 * ecore.cs (TypeExpr.IsAttribute): New property.
15182 (TypeExpr.GetInterfaces): New method.
15184 * interface.cs (Interface.GetInterfaceTypeByName): Return a
15185 TypeExpr instead of a Type.
15186 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
15187 (Interface.DefineType): Don't pass the interface types to the
15188 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
15189 them later and then call `TypeBulider.AddInterfaceImplementation()'.
15191 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
15192 instead of a `Type[]'.
15193 (TypeManager.RegisterBuilder): Likewise.
15194 (TypeManager.AddUserInterface): Likewise.
15195 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
15196 `Type[]' and also return a `TypeExpr[]'.
15197 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
15199 2003-11-08 Martin Baulig <martin@ximian.com>
15201 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
15204 2003-11-08 Martin Baulig <martin@ximian.com>
15206 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
15207 TypeManager.ResolveExpressionTypes().
15209 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
15210 instead of an Expression.
15211 (TypeExpr): This is now an abstract base class for `TypeExpression'.
15212 (TypeExpression): New public class; formerly known as `TypeExpr'.
15214 * expression.cs (ComposedCast): Derive from TypeExpr.
15216 * typemanager.cs (TypeManager.system_*_expr): These are now
15217 TypExpr's instead of Expression's.
15218 (TypeManager.ResolveExpressionTypes): New public static function;
15219 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
15222 2003-11-06 Miguel de Icaza <miguel@ximian.com>
15224 * expression.cs (New.DoResolve): Do not dereference value that
15225 might be a null return.
15227 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
15228 sure that the constant value has the right type. Fixes an
15229 unreported bug, similar to 50425.
15231 * const.cs (Const.LookupConstantValue): Call
15232 ImplicitStandardConversionExists before doing a conversion to
15233 avoid havng the TypeManager.ChangeType do conversions.
15235 Reduced the number of casts used
15237 (Const.ChangeType): New routine to enable reuse of the constant
15238 type changing code from statement.
15240 * typemanager.cs (ChangeType): Move common initialization to
15241 static global variables.
15245 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
15246 every value type to go through, even if it was void. Fix that.
15248 * cs-tokenizer.cs: Use is_identifier_start_character on the start
15249 character of the define, and the is_identifier_part_character for
15250 the rest of the string.
15252 2003-11-05 Miguel de Icaza <miguel@ximian.com>
15254 * expression.cs (UnaryMutator.EmitCode): When I updated
15255 LocalVariableReference.DoResolve, I overdid it, and dropped an
15256 optimization done on local variable references.
15258 2003-11-04 Miguel de Icaza <miguel@ximian.com>
15260 * ecore.cs: Convert the return from Ldlen into an int.
15262 2003-10-20 Miguel de Icaza <miguel@ximian.com>
15264 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
15265 the accessibility, this is a special case for toplevel non-public
15266 classes (internal for instance).
15268 2003-10-20 Nick Drochak <ndrochak@gol.com>
15270 * ecore.cs: Fix typo and build. Needed another right paren.
15272 2003-10-19 Miguel de Icaza <miguel@ximian.com>
15274 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
15275 `internal' case regular and protected, but not allowing protected
15276 to be evaluated later. Bug 49840
15278 2003-10-15 Miguel de Icaza <miguel@ximian.com>
15280 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
15281 to kb.Nlast, and not the kb.nFirst to isolate the switch
15284 Extract the underlying type, so enumerations of long/ulong are
15285 treated like long/ulong.
15287 2003-10-14 Miguel de Icaza <miguel@ximian.com>
15289 * expression.cs (New): Overload the meaning of RequestedType to
15290 track the possible creation of the NewDelegate type, since
15291 DoResolve is invoked more than once for new constructors on field
15294 See bugs: #48800 and #37014
15296 * cs-parser.jay (declare_local_constants): Take an arraylist
15297 instead of a single constant.
15299 (local_constant_declaration): It should take a
15300 constant_declarators, not a constant_declarator. Fixes 49487
15302 * convert.cs: Fix error report.
15304 2003-10-13 Jackson Harper <jackson@ximian.com>
15306 * typemanager.cs (TypeToCoreType): Add float and double this fixes
15309 2003-10-09 Martin Baulig <martin@ximian.com>
15311 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
15313 (MethodCore.DoDefineParameters): Removed the TypeContainer
15314 argument; use the DeclSpace which was passed to the .ctor instead.
15315 (MethodCore.CheckParameter): Take a DeclSpace instead of a
15316 TypeContainer; we only need a DeclSpace here.
15318 2003-10-09 Martin Baulig <martin@ximian.com>
15320 * class.cs (MethodData): Added additional `DeclSpace ds' argument
15322 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
15323 EmitContext's .ctor.
15325 2003-10-09 Martin Baulig <martin@ximian.com>
15327 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
15328 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
15329 AsAccessible(), moved them as well.
15331 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
15333 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
15335 * cs-parser.jay : Renamed yyName to yyNames related to jay.
15337 2003-10-07 Miguel de Icaza <miguel@ximian.com>
15339 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
15340 generation for >=, as spotted by Paolo, bug 48679.
15341 Patch from David Waite.
15343 * cs-tokenizer.cs: Add handling for #pragma.
15345 * cs-parser.jay: Allow for both yield and yield return in the
15346 syntax. The anti-cobolization of C# fight will go on!
15348 * class.cs (TypeBuilder.DefineType): Catch error condition here
15349 (Parent.DefineType erroring out and returning null).
15351 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15352 coping with enumerations variables, we were mistakenly processing
15353 them as a regular value type instead of built-in types. Fixes the
15356 * typemanager.cs (IsBuiltinOrEnum): New method.
15358 2003-09-30 Miguel de Icaza <miguel@ximian.com>
15360 * cs-parser.jay: Upgrade: yield now needs the return clause.
15362 2003-09-19 Martin Baulig <martin@ximian.com>
15364 * decl.cs (MemberCache.SetupCacheForInterface): Take a
15365 `MemberCache parent' argument. Normally, an interface doesn't
15366 have a parent type except System.Object, but we use this in gmcs
15367 for generic type parameters.
15369 2003-09-18 Martin Baulig <martin@ximian.com>
15371 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
15372 on `type.IsInterface'; don't check whether the type has a parent
15373 to determine whether it's an interface.
15375 2003-09-15 Martin Baulig <martin@ximian.com>
15377 * class.cs (TypeContainer.DefineType): Added an error flag to
15378 avoid reporting duplicate CS0146's ("class definition is
15381 * driver.cs (Driver.MainDriver): Abort if
15382 RootContext.ResolveTree() reported any errors.
15384 2003-09-07 Martin Baulig <martin@ximian.com>
15386 * report.cs (Error, Warning): Added overloaded versions which take
15387 a `params object[] args' and call String.Format().
15389 2003-09-07 Martin Baulig <martin@ximian.com>
15391 * decl.cs (DeclSpace..ctor): Don't call
15392 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
15393 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
15394 (DeclSpace.RecordDecl): New method.
15396 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
15398 2003-09-02 Ravi Pratap <ravi@ximian.com>
15400 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
15401 value attributes to be applied to ParameterBuilders.
15403 * class.cs (MethodCore.LabelParameters): Make static and more
15404 generic so that it can be used from other places - like interface
15405 methods, for instance.
15407 * interface.cs (Interface.Emit): Call LabelParameters before
15408 emitting attributes on the InterfaceMethod.
15410 2003-08-26 Martin Baulig <martin@ximian.com>
15412 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
15413 resolving aliases; fixes #47927.
15415 2003-08-26 Martin Baulig <martin@ximian.com>
15417 * statement.cs (Using.DoResolve): This is internally emitting a
15418 try/finally clause, so we need to set ec.NeedExplicitReturn if we
15419 do not always return. Fixes #47681.
15421 2003-08-26 Martin Baulig <martin@ximian.com>
15423 * decl.cs (MemberCore): Moved WarningNotHiding(),
15424 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
15426 (AdditionResult): Make this nested in DeclSpace.
15427 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
15428 argument; call NamespaceEntry.Define() unless we're nested in a
15431 * namespace.cs (Namespace.DefineName): New public function. This
15432 is called from DeclSpace's .ctor to add
15433 (Namespace.Lookup): Include DeclSpaces in the lookup.
15435 * class.cs (Operator): Derive from MemberBase, not MemberCore.
15437 * const.cs (Const): Derive from MemberBase, not MemberCore.
15439 2003-08-25 Martin Baulig <martin@ximian.com>
15441 * convert.cs (Convert.ExplicitReferenceConversion): When
15442 converting from an interface type to a class, unbox if the target
15443 type is a struct type. Fixes #47822.
15445 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15447 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
15450 2003-08-22 Martin Baulig <martin@ximian.com>
15452 * class.cs (TypeManager.DefineType): When defining a nested type,
15453 call DefineType() on our parent; fixes #47801.
15455 2003-08-22 Martin Baulig <martin@ximian.com>
15457 * class.cs (MethodData.Define): While checking if a method is an
15458 interface implementation, improve the test a bit more to fix #47654.
15460 2003-08-22 Martin Baulig <martin@ximian.com>
15462 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
15463 correctly; fixes #47722.
15465 2003-08-22 Martin Baulig <martin@ximian.com>
15467 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
15468 LocalVariableReference, ensure it's not read-only. Fixes #47536.
15470 * statement.cs (Fixed.DoResolve): Make all variables read-only.
15472 2003-08-22 Martin Baulig <martin@ximian.com>
15474 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
15475 can only be assigned in static constructors. Fixes #47161.
15477 2003-08-22 Martin Baulig <martin@ximian.com>
15479 Rewrote and improved the flow analysis code.
15481 * flowbranching.cs (FlowBranching): Make this class abstract.
15482 (FlowBranching.CreateBranching): New static function to create a
15483 new flow branching.
15484 (FlowBranchingBlock, FlowBranchingException): New classes.
15485 (FlowBranching.UsageVector.Type): New public readonly field.
15486 (FlowBranching.UsageVector.Breaks): Removed the setter.
15487 (FlowBranching.UsageVector.Returns): Removed the setter.
15488 (FlowBranching.UsageVector): Added Break(), Return(),
15489 NeverReachable() and Throw() methods to modify the reachability.
15490 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
15491 done by FlowBranching.Merge().
15492 (FlowBranching.UsageVector.MergeChild): New method; merges the
15493 merge result into the current vector.
15494 (FlowBranching.Merge): New abstract method to merge a branching.
15496 2003-08-12 Martin Baulig <martin@ximian.com>
15498 * expression.cs (Indirection.CacheTemporaries): Create the
15499 LocalTemporary with the pointer type, not its element type.
15501 2003-08-10 Miguel de Icaza <miguel@ximian.com>
15503 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
15504 token was a keyword or not.
15506 Add `error' options where an IDENTIFIER was expected; Provide
15507 CheckToken and CheckIdentifierToken convenience error reporting
15510 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
15512 * decl.cs: Rename `NamespaceEntry Namespace' public field into
15513 NameSpaceEntry NameSpaceEntry.
15515 (LookupInterfaceOrClass): Avoid creating a full qualified name
15516 from namespace and name: avoid doing lookups when we know the
15517 namespace is non-existant. Use new Tree.LookupByNamespace which
15518 looks up DeclSpaces based on their namespace, name pair.
15520 * driver.cs: Provide a new `parser verbose' to display the
15521 exception thrown during parsing. This is turned off by default
15522 now, so the output of a failure from mcs is more graceful.
15524 * namespace.cs: Track all the namespaces defined in a hashtable
15527 (IsNamespace): New method
15529 2003-08-09 Miguel de Icaza <miguel@ximian.com>
15531 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
15532 we know that we need to concatenate (full typename can never be
15537 * statement.cs: Use a bitfield; Do not initialize to null things
15538 which are done by the constructor by default.
15540 * cs-parser.jay: bug fix, parameter was 4, not 3.
15542 * expression.cs: Just use the property;
15544 * statement.cs: No need for GetVariableInfo method.
15546 2003-08-08 Martin Baulig <martin@ximian.com>
15548 * flowanalysis.cs (FlowReturns): This is now nested in the
15549 `FlowBranching' class.
15550 (MyBitVector): Moved this here from statement.cs.
15551 (FlowBranching.SiblingType): New enum type.
15552 (FlowBranching.CreateSibling): Added `SiblingType' argument.
15554 2003-08-07 Martin Baulig <martin@ximian.com>
15556 * flowanalysis.cs (FlowBranchingType): This is now nested in the
15557 `FlowBranching' class and called `BranchingType'.
15559 2003-08-07 Martin Baulig <martin@ximian.com>
15561 * flowanalysis.cs: Moved all the control flow analysis code into
15564 2003-08-07 Martin Baulig <martin@ximian.com>
15566 * assign.cs (Assign.DoResolve): `target' must either be an
15567 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
15570 2003-08-07 Miguel de Icaza <miguel@ximian.com>
15572 * expression.cs (BinaryMethod): This kind of expression is created by the
15573 Binary class if it determines that the operator has to be handled
15576 (BinaryDelegate): This kind of expression is created if we are
15577 dealing with a + or - operator on delegates.
15579 (Binary): remove method, argumetns, and DelegateOperator: when
15580 dealing with methods,
15582 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
15584 * statement.cs (Block): use bitfields for the three extra booleans
15585 we had in use. Remove unused topblock parameter.
15587 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
15589 * assign.cs: Drop extra unneeded tests.
15591 2003-08-06 Miguel de Icaza <miguel@ximian.com>
15593 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
15595 * statement.cs (Foreach): Use VariableStorage instead of
15598 * codegen.cs (VariableStorage): New class used by clients that
15599 require a variable stored: locals or fields for variables that
15600 need to live across yield.
15602 Maybe provide a convenience api for EmitThis+EmitLoad?
15604 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
15607 2003-08-05 Miguel de Icaza <miguel@ximian.com>
15609 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
15610 RemapParameterLValue): New methods that are used to turn a
15611 precomputed FieldInfo into an expression like this:
15615 The idea is to use this instead of making LocalVariableReference
15616 have more than one meaning.
15618 * cs-parser.jay: Add error production to BASE.
15620 * ecore.cs: Deal with TypeManager.GetField returning null, which
15621 is now a valid return value.
15623 (FieldExprNoAddress): New expression for Fields whose address can
15626 * expression.cs (LocalVariableReference): During the resolve
15627 phases, create new expressions if we are in a remapping context.
15628 Remove code that dealt with remapping here.
15630 (ParameterReference): same.
15632 (ProxyInstance): New expression, like the `This' expression, but
15633 it is born fully resolved. We know what we are doing, so remove
15634 the errors that are targeted to user-provided uses of `this'.
15636 * statement.cs (Foreach): our variable is now stored as an
15637 Expression; During resolution, follow the protocol, dont just
15638 assume it will return this.
15640 2003-08-06 Martin Baulig <martin@ximian.com>
15642 * support.cs (SeekableStreamReader.cs): New public class.
15644 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
15645 SeekableStreamReader instead of the normal StreamReader.
15647 2003-08-04 Martin Baulig <martin@ximian.com>
15649 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
15650 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
15651 deambiguate casts and delegate invocations.
15652 (parenthesized_expression): Use the new tokens to ensure this is
15653 not a cast of method invocation.
15655 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
15656 when reading a `)' and Deambiguate_CloseParens () was previously
15659 * expression.cs (ParenthesizedExpression): New class. This is
15660 just used for the CS0075 test.
15661 (Binary.DoResolve): Check for CS0075.
15663 2003-07-29 Ravi Pratap <ravi@ximian.com>
15665 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
15666 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
15667 reference comparison.
15669 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
15670 examine the ReturnType for equality - this is necessary in the
15671 cases of implicit and explicit operators whose signature also
15672 includes the return type.
15674 2003-07-26 Miguel de Icaza <miguel@ximian.com>
15676 * namespace.cs: Cache the result of the namespace computation,
15677 instead of computing it every time.
15679 2003-07-24 Miguel de Icaza <miguel@ximian.com>
15681 * decl.cs: Use a global arraylist that we reuse over invocations
15682 to avoid excesive memory consumption. Reduces memory usage on an
15683 mcs compile by one meg (45 average).
15685 * typemanager.cs (LookupTypeReflection): In .NET pointers are
15686 private, work around that.
15688 2003-07-23 Miguel de Icaza <miguel@ximian.com>
15690 * literal.cs (IntLiteral): Define Zero and One static literals.
15692 * cs-parser.jay (integer_literal): use static literals to reduce
15693 memory usage for the most used literals (0, 1 and -1). 211kb
15694 reduced in memory usage.
15696 Replace all calls to `new ArrayList' with `new
15697 ArrayList(4)' which is a good average number for most allocations,
15698 and also requires only 16 bytes of memory for its buffer by
15701 This reduced MCS memory usage in seven megabytes for the RSS after
15704 2003-07-28 Ravi Pratap <ravi@ximian.com>
15706 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
15707 handle params methods the correct way by forming only one
15708 applicable set with params and normal methods in them. Earlier we
15709 were looking at params methods only if we found no normal methods
15710 which was not the correct thing to do.
15712 (Invocation.BetterFunction): Take separate arguments indicating
15713 when candidate and the best method are params methods in their
15716 This fixes bugs #43367 and #46199.
15718 * attribute.cs: Documentation updates.
15720 (CheckAttribute): Rename to CheckAttributeTarget.
15721 (GetValidPlaces): Rename to GetValidTargets.
15723 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
15724 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
15728 2003-07-28 Martin Baulig <martin@ximian.com>
15730 * class.cs (TypeContainer.DefineMembers): Use the base type's full
15731 name when looking up the base class of a nested class. Fixes #46977.
15733 2003-07-26 Martin Baulig <martin@ximian.com>
15735 * expression.cs (Indexers.Indexer): New nested struct; contains
15736 getter, setter and the indexer's type.
15737 (Indexers.Properties): This is now an ArrayList of
15738 Indexers.Indexer's.
15739 (IndexerAccess.DoResolveLValue): Correctly set the type if the
15740 indexer doesn't have any getters.
15742 * assign.cs (Assign.DoResolve): Also do the implicit conversions
15743 for embedded property and indexer assignments.
15745 2003-07-26 Martin Baulig <martin@ximian.com>
15747 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
15748 preprocessor directive is not the first non-whitespace character
15751 2003-07-26 Martin Baulig <martin@ximian.com>
15753 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
15754 namespace parsing, follow the spec more closely.
15756 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
15757 NamespaceEntry.Lookup().
15759 2003-07-25 Martin Baulig <martin@ximian.com>
15761 * MethodCore.cs (OverridesSomething): New public field; it's set
15762 from TypeContainer.DefineMembers if this method overrides
15763 something (which doesn't need to be a method). Fix #39462.
15765 2003-07-25 Ravi Pratap <ravi@ximian.com>
15767 * typemanager.cs (GetMembers): Ensure that the list of members is
15768 reversed. This keeps things in sync.
15770 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
15771 find an AttributeUsage attribute.
15773 * expression.cs (Invocation.OverloadResolve): Perform the check
15774 which disallows Invoke to be directly called on a Delegate.
15776 (Error_InvokeOnDelegate): Report error cs1533.
15778 2003-07-25 Martin Baulig <martin@ximian.com>
15780 * expression.cs (Indexers.GetIndexersForType): Only look in the
15781 interface hierarchy if the requested type is already an
15782 interface. Fixes #46788 while keeping #46502 fixed.
15784 2003-07-25 Martin Baulig <martin@ximian.com>
15786 * class.cs (TypeContainer.DefineMembers): Check whether all
15787 readonly fields have been assigned and report warning CS0649 if
15790 * statement.cs (LocalInfo.IsFixed): Always return true if this is
15793 2003-07-24 Ravi Pratap <ravi@ximian.com>
15795 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
15796 returned from GetMethods to make things consistent with the
15797 assumptions MCS makes about ordering of methods.
15799 This should comprehensively fix bug #45127 and it does :-)
15801 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
15802 ordering is actually reverse.
15804 * Clean up some debug messages I left lying around.
15806 * interface.cs (Populate*): Get rid of code which emits attributes
15807 since the stage in which we emit attributes is the 'Emit' stage,
15808 not the define stage.
15810 (Emit): Move attribute emission for interface members here.
15812 2003-07-22 Ravi Pratap <ravi@ximian.com>
15814 * expression.cs (Invocation.OverloadResolve): Follow the spec more
15815 closely: we eliminate methods in base types when we have an
15816 applicable method in a top-level type.
15818 Please see section 14.5.5.1 for an exact description of what goes
15821 This fixes bug #45127 and a host of other related to corlib compilation.
15823 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
15824 array is the method corresponding to the top-level type (this is
15825 because of the changes made to icall.c) so we change this
15828 (MethodGroupExpr.Name): This too.
15830 * typemanager.cs (GetElementType): New method which does the right
15831 thing when compiling corlib.
15833 * everywhere: Make use of the above in the relevant places.
15835 2003-07-22 Martin Baulig <martin@ximian.com>
15837 * cs-parser.jay (invocation_expression): Moved
15838 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
15839 `cast_expression', but create a InvocationOrCast which later
15840 resolves to either an Invocation or a Cast.
15842 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
15843 method; call this before EmitStatement() to make sure that this
15844 expression can be used as a statement.
15846 * expression.cs (InvocationOrCast): New class; resolves to either
15847 an Invocation or a Cast.
15849 * statement.cs (StatementExpression): Call ResolveStatement() on
15850 the ExpressionStatement before emitting it.
15852 2003-07-21 Martin Baulig <martin@ximian.com>
15854 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
15855 `ref' and `out' attributes match; fixes #46220.
15856 (MemberAccess.ResolveMemberAccess): You can't reference a type
15857 through an expression; fixes #33180.
15858 (Indexers.GetIndexersForType): Don't return the indexers from
15859 interfaces the class implements; fixes #46502.
15861 2003-07-21 Martin Baulig <martin@ximian.com>
15863 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
15864 CS0661 checks; fixes bug #30442.
15866 2003-07-21 Martin Baulig <martin@ximian.com>
15868 * decl.cs (AdditionResult): Added `Error'.
15870 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
15872 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
15873 makes cs0031.cs actually work.
15875 2003-07-20 Martin Baulig <martin@ximian.com>
15877 * namespace.cs: Fixed that bug which caused a crash when compiling
15878 the debugger's GUI.
15880 2003-07-20 Miguel de Icaza <miguel@ximian.com>
15882 * typemanager.cs (LookupTypeReflection): Never expose types which
15883 are NotPublic, NestedPrivate, NestedAssembly, or
15884 NestedFamANDAssem. We used to return these, and later do a check
15885 that would report a meaningful error, but the problem is that we
15886 would not get the real match, if there was a name override.
15888 2003-07-18 Miguel de Icaza <miguel@ximian.com>
15890 * namespace.cs (Namespace, Name): Do not compute the namespace
15891 name dynamically, compute it in the constructor. This reduced
15892 memory usage by 1697 KB.
15894 * driver.cs: Use --pause to pause at the end.
15896 2003-07-17 Peter Williams <peter@newton.cx>
15898 * Makefile: Change the name of the test target so that it doesn't
15899 conflict with the recursive test target.
15901 2003-07-17 Miguel de Icaza <miguel@ximian.com>
15903 * expression.cs (LocalVariableReference.Emit, EmitAssign,
15904 AddressOf): Do not use EmitThis, that was wrong, use the actual
15907 2003-07-15 Miguel de Icaza <miguel@ximian.com>
15909 * class.cs (MethodData.Define): While checking if a method is an
15910 interface implementation, improve the test: If we are not public
15911 (use new test here: use the computed MethodAttributes directly,
15912 instead of the parsed modifier flags) check if the `implementing'
15913 method comes from an interface or not.
15915 * pending.cs (VerifyPendingMethods): Slightly better error
15918 * makefile: add test target that does the mcs bootstrap.
15920 2003-07-16 Ravi Pratap <ravi@ximian.com>
15922 * interface.cs (Define): Do nothing here since there are no
15923 members to populate etc. Move the attribute emission out of here
15924 since this was just totally the wrong place to put it. Attribute
15925 application happens during the 'Emit' phase, not in the 'Define'
15928 (Emit): Add this method and move the attribute emission here
15930 * rootcontext.cs (EmitCode): Call the Emit method on interface
15933 2003-07-14 Ravi Pratap M <ravi@ximian.com>
15935 * expression.cs (OverloadResolve): Report error only if Location
15936 is not 'Null' which means that there was a probe going on.
15938 2003-07-14 Martin Baulig <martin@ximian.com>
15940 * expression.cs (ConditionalLogicalOperator): New public class to
15941 implement user defined conditional logical operators.
15942 This is section 14.11.2 in the spec and bug #40505.
15944 2003-07-14 Martin Baulig <martin@ximian.com>
15946 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
15948 2003-07-14 Martin Baulig <martin@ximian.com>
15950 * codegen.cs (EmitContext.InFixedInitializer): New public field.
15952 * ecore.cs (IVariable.VerifyFixed): New interface method.
15954 * expression.cs (Unary.ResolveOperator): When resolving the `&'
15955 operator, check whether the variable is actually fixed. Fixes bug
15956 #36055. Set a variable definitely assigned when taking its
15957 address as required by the spec.
15959 * statement.cs (LocalInfo.IsFixed): New field.
15960 (LocalInfo.MakePinned): Set `IsFixed' to true.
15962 2003-07-14 Ravi Pratap M <ravi@ximian.com>
15964 * attribute.cs (Attribute.Resolve): While doing a Member lookup
15965 for .ctors, ensure that we only ask for members declared in the
15966 attribute type (BindingFlags.DeclaredOnly).
15970 * expression.cs (Error_WrongNumArguments): Report error 1501
15971 correctly the way CSC does.
15973 2003-07-13 Martin Baulig <martin@ximian.com>
15975 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
15976 lookup on the fully qualified name, to make things like "X.X" work
15977 where "X.X" is a fully qualified type name, but we also have a
15978 namespace "X" in the using list. Fixes #41975.
15980 2003-07-13 Martin Baulig <martin@ximian.com>
15982 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
15983 function. If we're a CompoundAssign, we need to create an embedded
15984 CompoundAssign, not an embedded Assign.
15985 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
15988 2003-07-13 Martin Baulig <martin@ximian.com>
15990 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
15991 work to fix bug #46088.
15993 2003-07-13 Ravi Pratap <ravi@ximian.com>
15995 * class.cs (Operator.Emit): Do not emit attributes here - it is
15996 taken care of by the Method class that we delegate too. This takes
15997 care of bug #45876.
15999 2003-07-10 Martin Baulig <martin@ximian.com>
16001 * expression.cs (TypeOfVoid): New class.
16002 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
16004 2003-07-10 Martin Baulig <martin@ximian.com>
16006 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
16009 2003-07-10 Martin Baulig <martin@ximian.com>
16011 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
16012 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
16014 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
16016 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
16018 2003-07-10 Martin Baulig <martin@ximian.com>
16020 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
16021 of decimal. Fixes #42850.
16023 NOTE: I also fixed the created byte blob, but this doesn't work on
16024 the MS runtime and csc never produces any byte blobs for decimal
16027 2003-07-10 Martin Baulig <martin@ximian.com>
16029 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
16030 structs; fixes #32068.
16031 (Block.AddChildVariableNames): Fixed #44302.
16033 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16035 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
16037 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16039 * attribute.cs: And this test is onger needed.
16041 2003-07-08 Martin Baulig <martin@ximian.com>
16043 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
16044 inaccessible types. Fixes #36313.
16046 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
16048 * namespace.cs (NamespaceEntry): Create implicit entries for all
16049 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
16050 implicit entries for N1.N2 and N1.
16052 2003-07-08 Martin Baulig <martin@ximian.com>
16054 Rewrote the handling of namespaces to fix a lot of the issues
16055 wrt. `using' aliases etc.
16057 * namespace.cs (Namespace): Splitted this class into a
16058 per-assembly `Namespace' and a per-file `NamespaceEntry'.
16060 * typemanager.cs (TypeManager.IsNamespace): Removed.
16061 (TypeManager.ComputeNamespaces): Only compute namespaces from
16062 loaded assemblies here, not the namespaces from the assembly we're
16063 currently compiling.
16065 2003-07-08 Martin Baulig <martin@ximian.com>
16067 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
16069 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16071 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
16074 I thought about the memory savings here, but LookupTypeReflection
16075 is used under already very constrained scenarios. Compiling
16076 corlib or mcs only exposes one hit, so it would not really reduce
16077 any memory consumption.
16079 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16081 * typemanager.cs: fixes bug #45889 by only adding public types from
16082 other assemblies to the list of known types.
16084 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16086 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
16087 on the type we resolved.
16089 2003-07-05 Martin Baulig <martin@ximian.com>
16091 * pending.cs (PendingImplementation.ParentImplements): Don't
16092 create the proxy if the parent is abstract.
16094 * class.cs (TypeContainer.DefineIndexers): Process explicit
16095 interface implementations first. Fixes #37714.
16097 2003-07-04 Miguel de Icaza <miguel@ximian.com>
16099 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
16100 defined recursively; but since we modify the input parameters
16101 (left is set to `this' temporarily), we reset this value if the
16102 left_is_explicit is false, which gives the original semantics to
16105 * literal.cs (NullPointer): new class used to represent a null
16106 literal in a pointer context.
16108 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
16109 type is a pointer, use a NullPointer object instead of a
16110 NullLiteral. Closes 43687
16112 (ExplicitConversion): Convert pointer values using
16113 the conv opcode to the proper type.
16115 * ecore.cs (New): change ValueTypeVariable property into a method,
16116 that returns whether the valuetype is suitable for being used.
16118 * expression.cs (Binary.DoNumericPromotions): Only return if we
16119 the int constant was a valid uint, and we can return both left and
16120 right as uints. If not, we continue processing, to trigger the
16121 type conversion. This fixes 39018.
16123 * statement.cs (Block.EmitMeta): During constant resolution, set
16124 the CurrentBlock property on the emitcontext, so that we resolve
16125 constants propertly.
16127 2003-07-02 Martin Baulig <martin@ximian.com>
16129 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
16130 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
16132 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
16133 than emitting it here.
16135 * statement.cs: Fixed some more flow analysis bugs.
16137 2003-07-02 Martin Baulig <martin@ximian.com>
16139 * class.cs (MethodData.Define): When implementing interface
16140 methods, set Final unless we're Virtual.
16142 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
16143 check work for interface methods.
16145 2003-07-01 Martin Baulig <martin@ximian.com>
16147 * ecore.cs (EmitContext.This): Replaced this property with a
16148 GetThis() method which takes a Location argument. This ensures
16149 that we get the correct error location for a CS0188.
16151 2003-07-01 Miguel de Icaza <miguel@ximian.com>
16153 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
16154 ImplicitStandardConversion.
16156 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
16158 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
16160 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
16163 2003-06-30 Miguel de Icaza <miguel@ximian.com>
16165 * class.cs (Constructor.Define): Turn off initlocals for unsafe
16168 (MethodData.Define): Turn off initlocals for unsafe methods.
16170 2003-06-29 Miguel de Icaza <miguel@ximian.com>
16172 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
16173 complete; Fixes #37521.
16175 * delegate.cs: Use Modifiers.TypeAttr to compute the
16176 TypeAttributes, instead of rolling our own. This makes the flags
16177 correct for the delegates.
16179 2003-06-28 Miguel de Icaza <miguel@ximian.com>
16181 * class.cs (Constructor.Define): Set the private flag for static
16182 constructors as well.
16184 * cs-parser.jay (statement_expression): Set the return value to
16185 null, to avoid a crash when we catch an error.
16187 2003-06-24 Miguel de Icaza <miguel@ximian.com>
16189 * cs-parser.jay: Applied patch from Jackson that adds support for
16190 extern and unsafe modifiers to destructor declarations.
16192 * expression.cs: Report error 21 if the user is trying to index a
16195 * driver.cs: Add an error message, suggested by the bug report.
16197 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
16198 if we do not have a ": this ()" constructor initializer. Fixes 45149
16200 2003-06-14 Miguel de Icaza <miguel@ximian.com>
16202 * namespace.cs: Add some information to reduce FAQs.
16204 2003-06-13 Miguel de Icaza <miguel@ximian.com>
16206 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
16207 underlying enumeration types. Fixes #43915.
16209 * expression.cs: Treat ushort/short as legal values to be used in
16210 bitwise operations.
16212 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
16214 * delegate.cs: transfer custom attributes for paramenters from
16215 the delegate declaration to Invoke and BeginInvoke.
16217 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
16219 * attribute.cs: handle custom marshalers and emit marshal info
16222 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
16224 * makefile.gnu: Added anonymous.cs to the compiler sources.
16226 2003-05-28 Miguel de Icaza <miguel@ximian.com>
16228 * iterators.cs: Change the name of the proxy class to include two
16231 * cs-parser.jay: Update grammar to include anonymous methods.
16233 * anonymous.cs: new file.
16235 2003-05-27 Miguel de Icaza <miguel@ximian.com>
16237 * class.cs (Field.Define): Add missing test for pointers and
16240 2003-05-27 Ravi Pratap <ravi@ximian.com>
16242 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
16243 we use the stobj opcode.
16245 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
16246 since it wasn't the correct fix.
16248 It still is puzzling that we are required to use stobj for IntPtr
16249 which seems to be a ValueType.
16251 2003-05-26 Miguel de Icaza <miguel@ximian.com>
16253 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
16254 during regular simple name resolution. Now, the trick is that
16255 instead of returning for processing the simplename, we do a
16256 TypeManager.LookupType (ie, a rooted lookup as opposed to a
16257 contextual lookup type). If a match is found, return that, if
16258 not, return for further composition.
16260 This fixes long-standing 30485.
16262 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16263 using the address to initialize an object, do an Stobj instead of
16264 using the regular Stelem.
16266 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
16267 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
16268 Because if we are a BaseIndexerAccess that value will be true.
16271 * statement.cs (GotoCase.Resolve): Return after reporting an
16272 error, do not attempt to continue.
16274 * expression.cs (PointerArithmetic.Emit): If our operand is a
16275 long, convert our constants to match the operand before
16276 multiplying. Convert to I type before adding. Fixes 43670.
16278 2003-05-14 Ravi Pratap <ravi@ximian.com>
16280 * enum.cs (ImplicitConversionExists) : Rename to
16281 ImplicitEnumConversionExists to remove ambiguity.
16283 * ecore.cs (NullCast): New type of cast expression class which
16284 basically is very similar to EmptyCast with the difference being
16285 it still is a constant since it is used only to cast a null to
16287 (eg. (string) null)
16289 * convert.cs (ImplicitReferenceConversion): When casting a null
16290 literal, we return a NullCast.
16292 * literal.cs (NullLiteralTyped): Remove - I don't see why this
16293 should be around anymore.
16295 The renaming (reported was slightly wrong). Corrections:
16297 ConvertImplicitStandard -> ImplicitConversionStandard
16298 ConvertExplicitStandard -> ExplicitConversionStandard
16300 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
16301 before passing them in !
16303 * convert.cs (ImplicitConversionStandard): When comparing for
16304 equal expr and target types, ensure that expr is not a
16307 In general, we must not be checking (expr_type ==
16308 target_type) in the top level conversion methods
16309 (ImplicitConversion, ExplicitConversion etc). This checking is
16310 done in the methods that they delegate to.
16312 2003-05-20 Miguel de Icaza <miguel@ximian.com>
16314 * convert.cs: Move Error_CannotConvertType,
16315 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
16316 ImplicitNumericConversion, ImplicitConversionExists,
16317 ImplicitUserConversionExists, StandardConversionExists,
16318 FindMostEncompassedType, FindMostSpecificSource,
16319 FindMostSpecificTarget, ImplicitUserConversion,
16320 ExplicitUserConversion, GetConversionOperators,
16321 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
16322 TryImplicitIntConversion, Error_CannotConvertImplicit,
16323 ConvertImplicitRequired, ConvertNumericExplicit,
16324 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
16325 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
16328 Perform the following renames:
16330 StandardConversionExists -> ImplicitStandardConversionExists
16331 ConvertImplicit -> ImplicitConversion
16332 ConvertImplicitStandard -> ImplicitStandardConversion
16333 TryImplicitIntConversion -> ImplicitIntConversion
16334 ConvertImplicitRequired -> ImplicitConversionRequired
16335 ConvertNumericExplicit -> ExplicitNumericConversion
16336 ConvertReferenceExplicit -> ExplicitReferenceConversion
16337 ConvertExplicit -> ExplicitConversion
16338 ConvertExplicitStandard -> ExplicitStandardConversion
16340 2003-05-19 Martin Baulig <martin@ximian.com>
16342 * statement.cs (TypeInfo.StructInfo): Made this type protected.
16343 (TypeInfo): Added support for structs having structs as fields.
16345 * ecore.cs (FieldExpr): Implement IVariable.
16346 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
16347 VariableInfo for the field.
16349 2003-05-18 Martin Baulig <martin@ximian.com>
16351 * expression.cs (This.DoResolve): Report a CS0027 if we're
16352 emitting a field initializer.
16354 2003-05-18 Martin Baulig <martin@ximian.com>
16356 * expression.cs (This.ResolveBase): New public function.
16357 (This.DoResolve): Check for CS0188.
16359 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
16362 * ecore.cs (MethodGroupExpr.DoResolve): Set the
16363 `instance_expression' to null if we don't have any non-static
16366 2003-05-18 Martin Baulig <martin@ximian.com>
16368 Reworked the way how local variables and parameters are handled by
16369 the flow analysis code.
16371 * statement.cs (TypeInfo, VariableMap): New public classes.
16372 (VariableInfo): New public class. This is now responsible for
16373 checking whether a variable has been assigned. It is used for
16374 parameters and local variables.
16375 (Block.EmitMeta): Take the InternalParameters as argument; compute
16376 the layout of the flow vectors here.
16377 (Block.LocalMap, Block.ParameterMap): New public properties.
16378 (FlowBranching): The .ctor doesn't get the InternalParameters
16379 anymore since Block.EmitMeta() now computes the layout of the flow
16381 (MyStructInfo): This class is now known as `StructInfo' and nested
16382 in `TypeInfo'; we don't access this directly anymore.
16384 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
16385 property and removed IsAssigned(), IsFieldAssigned(),
16386 SetAssigned() and SetFieldAssigned(); we now call them on the
16387 VariableInfo so we don't need to duplicate this code everywhere.
16389 * expression.cs (ParameterReference): Added `Block block' argument
16391 (LocalVariableReference, ParameterReference, This): The new
16392 VariableInfo class is now responsible for all the definite
16395 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
16396 IsParameterAssigned, SetParameterAssigned): Removed.
16398 2003-05-18 Martin Baulig <martin@ximian.com>
16400 * typemanager.cs (InitCoreTypes): Try calling
16401 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
16402 the 3-args-version. Corlib now also needs our `void_type'.
16403 (GetMethod): Added overloaded version which takes an optional
16404 `bool report_errors' to allow lookups of optional methods.
16406 2003-05-12 Martin Baulig <martin@ximian.com>
16408 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
16409 only used for locals and not for parameters.
16411 2003-05-12 Miguel de Icaza <miguel@ximian.com>
16413 * support.cs (InternalParameters.ParameterType): Return the
16414 ExternalType of the parameter.
16416 * parameter.cs (Parameter.ExternalType): drop the two arguments,
16419 2003-05-11 Miguel de Icaza <miguel@ximian.com>
16421 * class.cs (MethodData.Define): Do not set the `newslot' on
16422 interface members, if they are also flagged as "override".
16424 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
16425 better code for ++i and i++. This only works for static fields
16426 and local variables.
16428 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
16429 want to pull the DeclSpace out of the builder_to_declspace instead
16430 of the TypeBuilder (like in TypeContainer.FindMembers).
16432 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
16433 instead of LookupTypeContainer. Fixes the crash on .NET for
16434 looking up interface members.
16436 * const.cs: Create our own emit context during the Definition
16437 stage, so that constants are evaluated in the proper context, when
16438 a recursive definition happens.
16440 2003-05-11 Martin Baulig <martin@ximian.com>
16442 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
16443 new block for a switch section.
16444 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
16445 the adding/lookup in the switch block. Fixes #39828.
16447 2003-05-09 Miguel de Icaza <miguel@ximian.com>
16449 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
16450 functionality: I needed to convert the data after I had performed
16451 the add/sub operation into the operands type size.
16453 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
16454 pass the type for the box operation, otherwise the resulting
16455 object would have been of type object.
16457 (BoxedCast): Add constructor to specify the type to box as.
16459 2003-05-07 Miguel de Icaza <miguel@ximian.com>
16461 * iterators.cs: I was reusing the `count' variable inadvertently,
16462 take steps to not allow this to happen.
16464 2003-05-06 Miguel de Icaza <miguel@ximian.com>
16466 * attribute.cs (Attribute.Resolve): Params attributes are encoded
16467 by creating an array at the point where the params starts and
16468 putting all those arguments there, then adjusting the size of the
16471 2003-05-05 Miguel de Icaza <miguel@ximian.com>
16473 * expression.cs (New.AddressOf): Implement interface
16474 IMemoryLocation. This is used when the `new' operator is used in
16475 the context of an invocation to a method on a value type.
16477 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
16480 * namespace.cs: Also check the using aliases here.
16482 * driver.cs: Move the test for using validity after the types have
16483 been entered, so we do a single pass that also includes the using
16486 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
16487 in the regular case. CreateSiblingForFinally is doing extra
16490 * attribute.cs (GetAttributeArgumentExpression): Store the result
16491 on an out value, and use the return value to indicate failure
16492 instead of using null (which is a valid return for Constant.GetValue).
16494 * statement.cs: Perform the analysis flow for the increment
16495 portion after the statement, because this will be the real flow of
16496 execution. Fixes #42385
16498 * codegen.cs (EmitContext.EmitArgument,
16499 EmitContext.EmitStoreArgument): New helper functions when the
16500 RemapToProxy flag is set.
16502 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
16505 Add support for remapping parameters.
16507 * iterators.cs: Propagate parameter values; Store parameter
16508 values in the proxy classes.
16510 2003-05-04 Miguel de Icaza <miguel@ximian.com>
16512 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
16513 need a proxy reference; I do not know what I was thinking
16515 * cs-parser.jay (constructor_initializer): catch another error,
16516 and display nice message.
16518 (field_declaration): catch void field declaration
16519 to flag a better error.
16521 * class.cs (MemberBase.CheckBase): Report an error instead of a
16522 warning if a new protected member is declared in a struct.
16523 (Field.Define): catch the error of readonly/volatile.
16525 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
16527 (FieldExpr.AddressOf): ditto. Catch error where the address of a
16528 volatile variable is taken
16530 2003-05-02 Miguel de Icaza <miguel@ximian.com>
16532 * statement.cs (Fixed.Resolve): Report an error if we are not in
16535 2003-05-01 Miguel de Icaza <miguel@ximian.com>
16537 * typemanager.cs: reuse the code that handles type clashes for
16538 delegates and enumerations.
16540 * class.cs (Report28): Always report.
16542 * expression.cs (EncodeAsAttribute): Allow nulls here.
16544 2003-04-28 Miguel de Icaza <miguel@ximian.com>
16546 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
16547 the functionality for testing whether an expression is valid for
16548 an attribute here. Also handle the case of arrays of elements
16551 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
16552 encoding a linear array into an array of objects that are suitable
16553 to be passed to an CustomAttributeBuilder.
16555 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
16557 * ecore.cs: (FieldExpr): Handle field remapping here.
16559 * iteratators.cs: Pass the instance variable (if the method is an
16560 instance method) to the constructors, so we can access the field
16561 variables on the class.
16563 TODO: Test this with structs. I think the THIS variable on
16564 structs might have to be a pointer, and not a refenrece
16566 2003-04-27 Miguel de Icaza <miguel@ximian.com>
16568 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
16569 local variables to fields in a proxy class.
16571 * iterators.cs (PopulateProxy): Rename our internal fields to
16573 Create a <THIS> field if we are an instance method, so we can
16574 reference our parent container variables.
16575 (MapVariable): Called back from the EmitContext code to enter a
16576 new variable to field mapping into the proxy class (we just create
16580 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
16581 for using the remapped locals to fields.
16583 I placed the code here, because that gives the same semantics to
16584 local variables, and only changes the Emit code.
16586 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
16587 statements inside iterators.
16588 (VariableInfo): Add a FieldBuilder for the cases when we are
16589 remapping local variables to fields in a proxy class
16591 * ecore.cs (SimpleNameResolve): Avoid testing two times for
16592 current_block != null.
16594 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
16595 not cope with strings, as it has been moved to the
16596 TableSwitchEmit. Fixed bug in switch generation.
16598 * expression.cs (New.DoResolve): Provide more context for the user
16599 when reporting an error.
16601 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
16604 * expression.cs (MemberAccess.DoResolve): When we get a type back,
16605 check the permissions for it. Note than in a type-resolution
16606 context the check was already present in DeclSpace.ResolveType,
16607 but was missing from the MemberAccess.
16609 (ArrayCreation.CheckIndices): warn if the user has
16610 more nested levels of expressions, but there are no more
16611 dimensions specified. Avoids crash on bug 41906.
16613 2003-04-26 Miguel de Icaza <miguel@ximian.com>
16615 * statement.cs (Block): replace Implicit bool, for a generic
16617 New flag: `Unchecked'. This is used during the EmitMeta phase
16618 (which is out-of-line with the regular Resolve/Emit process for a
16619 statement, as this is done ahead of time, but still gets a chance
16620 to call constant resolve).
16622 (Block.Flags): new enum for adding a new flag.
16624 (Block.EmitMeta): track the state of unchecked.
16626 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
16627 to enable constant resolution to work there as well.
16629 2003-04-22 Miguel de Icaza <miguel@ximian.com>
16631 * typemanager.cs (ienumerable_type): Also look up
16632 System.Collections.IEnumerable.
16634 2003-04-21 Miguel de Icaza <miguel@ximian.com>
16636 TODO: Test more than one conditional per method.
16638 * class.cs (Indexer.Define): Report the location where the user is
16639 referencing the unsupported feature.
16641 (MethodData): Overload the use of `conditionals' to
16642 minimize the creation of needless ArrayLists. This saves roughly
16643 212kb on my machine.
16645 (Method): Implement the new IIteratorContainer interface.
16646 (Method.SetYields): Implement the method by setting the ModFlags
16647 to contain METHOD_YIELDS.
16649 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
16650 which just got set to null.
16652 * iterators.cs: New file.
16654 (Yield, YieldBreak): New statements.
16656 * statement.cs (Return.Resolve): Flag an error if we are used in
16657 an iterator method.
16659 * codegen.cs (InIterator): New flag set if the code is being
16660 compiled in an iterator method.
16662 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
16663 internal modifier, and we just use it to avoid adding extra
16664 fields, as this is seldom used.
16666 * cs-parser.jay: Add yield_statement (yield and yield break).
16668 * driver.cs: New flag -v2 to turn on version 2 features.
16670 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
16671 hashtable when v2 is enabled.
16673 2003-04-20 Miguel de Icaza <miguel@ximian.com>
16675 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
16676 there is already a namespace defined with this name.
16678 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
16679 people upgraded their corlibs.
16681 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
16682 always use fully qualified types, no need to use the compiler
16685 (TypeManager.IsNamespace): Use binarysearch.
16687 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
16688 AddDelegate): I did not quite use the new IsValid API properly: I
16689 have to pass the short-name and the fullname. I was passing only
16690 the basename instead of the fullname sometimes.
16692 (TypeContainer.DefineType): call NamespaceClash.
16694 * interface.cs (Interface.DefineType): use NamespaceClash before
16697 * delegate.cs (Delegate.DefineType): use NamespaceClash before
16700 * enum.cs: (Enum.DefineType): use NamespaceClash before
16703 * typemanager.cs (: 3-line patch that gives us some tasty 11%
16704 speed increase. First, use the negative_hits cache when we get a
16705 negative. Second, add the type with its full original name
16706 instead of the new . and + encoded name (reflection uses + to
16707 separate type from a nested type). Use LookupTypeReflection
16708 directly which bypasses the type->name hashtable (that we already
16709 know does not contain the type.
16711 * decl.cs (DeclSpace.ResolveTypeExpr): track the
16712 location/container type.
16714 * driver.cs: When passing utf8, use directly the UTF8Encoding.
16716 2003-04-19 Miguel de Icaza <miguel@ximian.com>
16718 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
16720 * delegate.cs (NewDelegate.Resolve): Test whether an instance
16721 method is being referenced in the method group from a static
16722 context, and report error 120 if so.
16724 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
16727 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
16728 is created, we create the A namespace).
16730 * cs-parser.jay: A namespace also introduces a DeclarationFound.
16733 2003-04-18 Miguel de Icaza <miguel@ximian.com>
16735 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
16736 invocation to ModuleBuilder.GetType with the same values will
16737 return a new type instance, so we need to cache its return
16740 * expression.cs (Binary.ResolveOperator): Only allow the compare
16741 operators on enums if they are of the same type.
16743 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
16744 types of ValueType on their own case. Before we were giving them
16745 the same treatment as objects.
16747 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
16748 fullname. Short name is used to compare against container name.
16749 Fullname is used to check against defined namespace names.
16751 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
16752 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
16754 (Method.CheckBase): Call parent.
16755 (MemberBase.CheckBase): Check for protected members on sealed
16757 (PropertyBase.CheckBase): Call parent.
16758 (Field.Define): Call parent.
16760 * report.cs: Negative error codes are now mapped to 8000 - code,
16761 so that the display is render more nicely.
16763 * typemanager.cs: Do not use try/catch, instead report a regular
16766 (GetPointerType, GetReferenceType): These methods provide
16767 mechanisms to obtain the T* and T& from a T. We had the code
16768 previously scattered around the code base, and it also used
16769 TypeManager.LookupType that would go through plenty of caches.
16770 This one goes directly to the type source.
16772 In some places we did the Type.GetType followed by
16773 ModuleBuilder.GetType, but not in others, so this unifies the
16774 processing as well.
16776 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
16777 statements now that we have namespace information.
16779 * typemanager.cs (IsNamespace): New method, returns whether the
16780 string presented is a namespace or not.
16782 (ComputeNamespaces): New public entry point, computes the list of
16783 available namespaces, using the GetNamespaces API call in Mono, or
16784 the slower version in MS.NET.
16786 Now before we start the semantic analysis phase, we have a
16787 complete list of namespaces including everything that the user has
16790 Deleted old code to cache namespaces in .nsc files.
16792 2003-04-17 Miguel de Icaza <miguel@ximian.com>
16794 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
16795 class/struct location definition Location for the implicit
16796 constructor location.
16798 (Operator.Define): Use the location of the operator for the
16799 implicit Method definition.
16801 (Constructor.Emit): use the constructor location for the implicit
16802 base initializer constructor.
16804 * ecore.cs: Remove ITypeExpression. This interface is now gone,
16805 and the Expression class now contains two new methods:
16807 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
16808 isolate type lookup from the rest of the resolution process.
16810 Since we use Expressions to hold type definitions due to the way
16811 we parse the input we have historically overloaded Resolve to
16812 perform the Type lookups if a special flag is passed. Now this is
16813 eliminated and two methods take their place.
16815 The differences in the two methods between xStep and xTerminal is
16816 that xStep is involved in our current lookup system that uses
16817 SimpleNames to compose a name, while xTerminal is used just to
16818 catch the case where the simplename lookup failed.
16820 2003-04-16 Miguel de Icaza <miguel@ximian.com>
16822 * expression.cs (ResolveMemberAccess): Remove redundant code.
16823 TypeExpr expressions are always born fully resolved.
16825 * interface.cs (PopulateMethod): Do not lookup the types twice.
16826 We were doing it once during SemanticAnalysis and once during
16829 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
16830 in local variable type definitions, were being returned as a
16831 SimpleName (we decomposed everything into a string), that is
16832 because primary_expression was being used instead of a type in the
16833 grammar (reduce/reduce conflicts).
16835 The part that was wrong is that we converted the expression into a
16836 string (an oversimplification in one hand, compounded with primary
16837 expressions doing string concatenation).
16843 Would return "A.B.C[]" as a SimpleName. This stopped things like
16844 using clauses from working on this particular context. And a type
16845 was being matched directly against "A.B.C[]".
16847 We now use the correct approach, and allow for ComposedCast to be
16848 part of the unary expression. So the "A.B.C []" become a composed
16849 cast of "A.B.C" (as a nested group of MemberAccess with a
16850 SimpleName at the end) plus the rank composition "[]".
16854 2003-04-10 Miguel de Icaza <miguel@ximian.com>
16856 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
16857 for the access level checking.
16859 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
16860 `TypeContainer container', because I kept getting confused when I
16861 was debugging this code.
16863 * expression.cs (Indexers): Instead of tracking getters/setters,
16864 we now track them in parallel. We create one arraylist less, but
16865 most importantly it is possible now for the LValue code to find a
16866 matching get for a set.
16868 (IndexerAccess.DoResolveLValue): Update the code.
16869 GetIndexersForType has been modified already to extract all the
16870 indexers from a type. The code assumed it did not.
16872 Also make the code set the correct return type for the indexer.
16873 This was fixed a long time ago for properties, but was missing for
16874 indexers. It used to be void_type.
16876 (Binary.Emit): Test first for doubles instead of
16877 floats, as they are more common.
16879 (Binary.EmitBranchable): Use the .un version of the branch opcodes
16880 when dealing with floats and the <=, >= operators. This fixes bug
16883 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
16884 to load the array value by emitting a load on the foreach variable
16885 type. This was incorrect.
16887 We now emit the code to load an element using the the array
16888 variable type, and then we emit the conversion operator.
16892 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
16894 * attribute.cs: Avoid allocation of ArrayLists in the common case.
16896 2003-04-09 Miguel de Icaza <miguel@ximian.com>
16898 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
16899 test for protection before we test for signatures.
16901 (MethodSignature.ToString): implement.
16903 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
16904 to the case where we reduced into a LongConstant.
16906 * decl.cs (CheckAccessLevel): If the type is an array, we can not
16907 depend on whether the information is acurrate, because the
16908 Microsoft runtime will always claim that the array type is public,
16909 regardless of the real state.
16911 If the type is a pointer, another problem happens: the type is
16912 reported as non-public in Microsoft.
16914 In both cases we have to call CheckAccessLevel recursively with
16915 the underlying type as the argument to be tested.
16917 2003-04-08 Miguel de Icaza <miguel@ximian.com>
16919 * assign.cs (Assign.Emit): If we are dealing with a compound
16920 assignment expression, we should use the code path that stores the
16921 intermediate result in a temporary value. This fixes #40903.
16923 *expression.cs (Indirection.ToString): Provide ToString method for
16926 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
16928 * class.cs: Null out fields holding references to Block objects so
16929 they can be garbage collected.
16931 * expression.cs (OverloadResolve): Remove unused local.
16933 2003-04-07 Martin Baulig <martin@ximian.com>
16935 * codegen.cs (EmitContext.CurrentFile): New public field.
16936 (EmitContext.Mark): Use the CurrentFile to check whether the
16937 location is in the correct file.
16938 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
16940 2003-04-07 Martin Baulig <martin@ximian.com>
16942 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
16944 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
16945 location. [FIXME: The location argument which gets passed to this
16946 method is sometimes wrong!]
16948 2003-04-07 Nick Drochak <ndrochak@gol.com>
16950 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
16952 2003-04-07 Miguel de Icaza <miguel@ximian.com>
16954 * expression.cs (Indirection.EmitAssign): We were using the
16955 temporary, but returning immediately instead of continuing the
16958 2003-04-06 Martin Baulig <martin@ximian.com>
16960 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
16961 if it's a nested child, but also deriving from the outer class.
16964 * typemanager.cs (IsNestedChildOf): Make this work if it's a
16965 nested child, but also deriving from the outer class. See
16967 (FilterWithClosure): We may access private members of the outer
16968 class if we're a nested child and deriving from the outer class.
16969 (RealMemberLookup): Only set `closure_private_ok' if the
16970 `original_bf' contained BindingFlags.NonPublic.
16972 2003-04-05 Martin Baulig <martin@ximian.com>
16974 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
16976 2003-04-02 Miguel de Icaza <miguel@ximian.com>
16978 * class.cs (Event.Define): Do not allow abstract events to have
16981 2003-04-01 Miguel de Icaza <miguel@ximian.com>
16983 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
16984 block in event declarations.
16986 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
16987 value type, get its address.
16989 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
16990 leaving a class on the stack instead of a boolean value (int
16991 0/1). Change the code so we compare against null, and then the
16992 result against zero.
16994 * class.cs (TypeContainer.GetClassBases): We were checking for the
16995 parent class being sealed too late.
16997 * expression.cs (Binary.Emit): For <= and >= when dealing with
16998 floating point values, use cgt.un and clt.un instead of cgt and
17001 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
17003 * statement.cs: Apply the same optimization as MS: skip the
17004 GetEnumerator returning an IEnumerator, and use the one returning a
17005 CharEnumerator instead. This allows us to avoid the try-finally block
17008 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
17010 * cs-parser.jay: Attributes cannot be applied to
17011 namespaces. Fixes #40473
17013 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17016 (Add*): check if the name is valid using the full name for constants,
17017 fields, properties and events.
17019 2003-03-28 Miguel de Icaza <miguel@ximian.com>
17021 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
17022 char constants to be part of the enumeration.
17024 * expression.cs (Conditional.DoResolve): Add support for operator
17025 true. Implements the missing functionality from 14.12
17027 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
17028 operator true/false as required by the spec.
17030 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
17031 implicit conversion to boolean.
17033 * statement.cs (Statement.ResolveBoolean): A boolean expression is
17034 also one where the type implements `operator true'.
17036 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
17037 get an expression that will invoke operator true based on an
17040 (GetConversionOperators): Removed the hack that called op_True
17043 (Expression.ResolveBoolean): Move this from Statement.
17045 2003-03-17 Miguel de Icaza <miguel@ximian.com>
17047 * ecore.cs (FieldExpr): do not allow initialization of initonly
17048 fields on derived classes
17050 2003-03-13 Martin Baulig <martin@ximian.com>
17052 * statement.cs (Block.Emit): Call ig.BeginScope() and
17053 ig.EndScope() when compiling with debugging info; call
17054 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
17056 2003-03-08 Miguel de Icaza <miguel@ximian.com>
17058 * expression.cs (Indexers): Do not construct immediately, allow
17059 for new members to be appended as we go. Fixes 38143
17061 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17063 * expression.cs: save/restore context when resolving an unchecked
17066 2003-03-05 Miguel de Icaza <miguel@ximian.com>
17068 * cfold.cs: Catch division by zero in modulus operator during
17071 2003-03-03 Miguel de Icaza <miguel@ximian.com>
17073 * interface.cs (Interface.DefineMembers): Avoid defining members
17076 2003-02-27 Miguel de Icaza <miguel@ximian.com>
17078 * driver.cs: handle the +/- options for -noconfig
17080 * statement.cs (Unckeched.Resolve): Also track the state of
17081 unchecked in the Resolve phase.
17083 2003-02-27 Martin Baulig <martin@ximian.com>
17085 * ecore.cs (Expression.MemberLookup): Don't create a
17086 MethodGroupExpr for something which is not a method. Fixes #38291.
17088 2003-02-25 Miguel de Icaza <miguel@ximian.com>
17090 * class.cs (MemberBase.CheckParameters): Also check that the type
17091 is unmanaged if it is a pointer.
17093 * expression.cs (SizeOf.Resolve): Add location information.
17095 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
17096 a managed type is declared.
17098 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
17099 parameter modifiers as well. Fixes bug 38606
17101 * class.cs: Very sad. Am backing out the speed up changes
17102 introduced by the ArrayList -> Array in the TypeContainer, as they
17103 were not actually that much faster, and introduced a bug (no error
17104 reports on duplicated methods).
17106 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
17107 source first, this will guarantee that we have a valid expression
17108 before calling in lower levels functions that will require a
17109 resolved object. Then use this original_source in the
17110 target.ResolveLValue instead of the original source that was
17113 Another change. Use target.Resolve instead of LValueResolve.
17114 Although we are resolving for LValues, we will let the Assign code
17115 take care of that (it will be called again from Resolve). This
17116 basically allows code like this:
17118 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
17119 class Y { void A (X x) { x [0] += o; }
17121 The problem was that the indexer was trying to resolve for
17122 set_Item (idx, object o) and never finding one. The real set_Item
17123 was set_Item (idx, X). By delaying the process we get the right
17128 2003-02-23 Martin Baulig <martin@ximian.com>
17130 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
17131 while calling DoEmit ().
17133 * codegen.cs (EmitContext.Mark): Don't mark locations in other
17134 source files; if you use the #line directive inside a method, the
17135 compiler stops emitting line numbers for the debugger until it
17136 reaches the end of the method or another #line directive which
17137 restores the original file.
17139 2003-02-23 Martin Baulig <martin@ximian.com>
17141 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
17143 2003-02-23 Martin Baulig <martin@ximian.com>
17145 * statement.cs (Block.AddChildVariableNames): We need to call this
17146 recursively, not just for our immediate children.
17148 2003-02-23 Martin Baulig <martin@ximian.com>
17150 * class.cs (Event.Define): Always make the field private, like csc does.
17152 * typemanager.cs (TypeManager.RealMemberLookup): Make events
17153 actually work, fixes bug #37521.
17155 2003-02-23 Miguel de Icaza <miguel@ximian.com>
17157 * delegate.cs: When creating the various temporary "Parameters"
17158 classes, make sure that we call the ComputeAndDefineParameterTypes
17159 on those new parameters (just like we do with the formal ones), to
17160 allow them to be resolved in the context of the DeclSpace.
17162 This fixes the bug that Dick observed in Bugzilla #38530.
17164 2003-02-22 Miguel de Icaza <miguel@ximian.com>
17166 * expression.cs (ResolveMemberAccess): When resolving a constant,
17167 do not attempt to pull a constant if the value was not able to
17168 generate a valid constant.
17170 * const.cs (LookupConstantValue): Do not report more errors than required.
17172 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17174 * expression.cs: fixes bug #38328.
17176 2003-02-18 Miguel de Icaza <miguel@ximian.com>
17178 * class.cs: Changed all the various members that can be part of a
17179 class from being an ArrayList to be an Array of the right type.
17180 During the DefineType type_list, interface_list, delegate_list and
17181 enum_list are turned into types, interfaces, delegates and enums
17184 And during the member population, indexer_list, event_list,
17185 constant_list, field_list, instance_constructor_list, method_list,
17186 operator_list and property_list are turned into their real arrays.
17188 Although we could probably perform this operation earlier, for
17189 good error reporting we need to keep the lists and remove the
17190 lists for longer than required.
17192 This optimization was triggered by Paolo profiling the compiler
17193 speed on the output of `gen-sample-program.pl' perl script.
17195 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
17196 not crash in methods like MemberLookupFailed that use this field.
17198 This problem arises when the compiler fails to resolve a type
17199 during interface type definition for example.
17201 2003-02-18 Miguel de Icaza <miguel@ximian.com>
17203 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
17204 inherit from System.Object, so we have to stop at null, not only
17205 when reaching System.Object.
17207 2003-02-17 Miguel de Icaza <miguel@ximian.com>
17209 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
17210 DeclaredOnly because the parent indexer might have had a different
17211 name, but did not loop until the top of the hierarchy was reached.
17213 The problem this one fixes is 35492: when a class implemented an
17214 indexer from an interface, we were getting the interface method
17215 (which was abstract) and we were flagging an error (can not invoke
17218 This also keeps bug 33089 functioning, and test-148 functioning.
17220 * typemanager.cs (IsSpecialMethod): The correct way of figuring
17221 out if a method is special is to see if it is declared in a
17222 property or event, or whether it is one of the predefined operator
17223 names. This should fix correctly #36804.
17225 2003-02-15 Miguel de Icaza <miguel@ximian.com>
17227 The goal here is to remove the dependency on EmptyCast.Peel ().
17228 Killing it completely.
17230 The problem is that currently in a number of places where
17231 constants are expected, we have to "probe" for an EmptyCast, and
17232 Peel, which is not the correct thing to do, as this will be
17233 repetitive and will likely lead to errors.
17235 The idea is to remove any EmptyCasts that are used in casts that
17236 can be reduced to constants, so we only have to cope with
17239 This bug hunt was triggered by Bug 37363 and the desire to remove
17240 the duplicate pattern where we were "peeling" emptycasts to check
17241 whether they were constants. Now constants will always be
17244 * ecore.cs: Use an enumconstant here instead of wrapping with
17247 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
17248 throwing me off. By handling this we can get rid of a few hacks.
17250 * statement.cs (Switch): Removed Peel() code.
17252 2003-02-14 Miguel de Icaza <miguel@ximian.com>
17254 * class.cs: Location information for error 508
17256 * expression.cs (New.DoResolve): Add a guard against double
17257 resolution of an expression.
17259 The New DoResolve might be called twice when initializing field
17260 expressions (see EmitFieldInitializers, the call to
17261 GetInitializerExpression will perform a resolve on the expression,
17262 and later the assign will trigger another resolution
17264 This leads to bugs (#37014)
17266 * delegate.cs: The signature for EndInvoke should contain any ref
17267 or out parameters as well. We were not doing this in the past.
17269 * class.cs (Field.Define): Do not overwrite the type definition
17270 inside the `volatile' group. Turns out that volatile enumerations
17271 were changing the type here to perform a validity test, which
17274 2003-02-12 Miguel de Icaza <miguel@ximian.com>
17276 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
17277 and structs, we do not want to load the instance variable
17279 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
17280 enum_type has to be handled like an object reference (implicit
17281 conversions exists from this to object), but the regular IsClass
17282 and IsValueType tests will never return true for this one.
17284 Also we use TypeManager.IsValueType instead of type.IsValueType,
17285 just for consistency with the rest of the code (this is only
17286 needed if we ever use the construct exposed by test-180.cs inside
17287 corlib, which we dont today).
17289 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
17291 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
17294 2003-02-09 Martin Baulig <martin@ximian.com>
17296 * namespace.cs (Namespace..ctor): Added SourceFile argument.
17297 (Namespace.DefineNamespaces): New static public method; this is
17298 called when we're compiling with debugging to add all namespaces
17299 to the symbol file.
17301 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
17302 pass it to the Namespace's .ctor.
17304 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
17305 and MethodBase arguments; pass the namespace ID to the symwriter;
17306 pass the MethodBase instead of the token to the symwriter.
17307 (SymbolWriter.DefineNamespace): New method to add a namespace to
17310 2003-02-09 Martin Baulig <martin@ximian.com>
17312 * symbolwriter.cs: New file. This is a wrapper around
17313 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
17314 methods here in near future.
17316 2003-02-09 Martin Baulig <martin@ximian.com>
17318 * codegen.cs (EmitContext.Mark): Just pass the arguments to
17319 ILGenerator.MarkSequencePoint() which are actually used by the
17322 2003-02-09 Martin Baulig <martin@ximian.com>
17324 * location.cs (SourceFile): New public sealed class. This
17325 contains the name and an index which is used in the location's token.
17326 (Location): Reserve an appropriate number of bits in the token for
17327 the source file instead of walking over that list, this gives us a
17328 really huge performance improvement when compiling with debugging.
17330 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
17331 `SourceFile' argument instead of a string.
17332 (Driver.ProcessFile): Add all the files via Location.AddFile(),
17333 but don't parse/tokenize here, we need to generate the list of all
17334 source files before we do that.
17335 (Driver.ProcessFiles): New static function. Parses/tokenizes all
17338 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
17339 instead of a string.
17341 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
17344 2003-02-09 Martin Baulig <martin@ximian.com>
17346 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
17347 filename on `#line default'.
17349 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
17351 * statement.cs: don't clear the pinned var when the fixed statement
17352 returns from the method (fixes bug#37752).
17354 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
17356 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
17359 2003-02-07 Martin Baulig <martin@ximian.com>
17361 * driver.cs: Removed the `--debug-args' command line argument.
17363 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
17364 automatically by the AsssemblyBuilder.
17365 (CodeGen.InitializeSymbolWriter): We don't need to call any
17366 initialization function on the symbol writer anymore. This method
17367 doesn't take any arguments.
17369 2003-02-03 Miguel de Icaza <miguel@ximian.com>
17371 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
17372 from referenced assemblies as well.
17374 2003-02-02 Martin Baulig <martin@ximian.com>
17376 * class.cs (MethodData.Emit): Generate debugging info for external methods.
17378 2003-02-02 Martin Baulig <martin@ximian.com>
17380 * class.cs (Constructor.Emit): Open the symbol writer before
17381 emitting the constructor initializer.
17382 (ConstructorInitializer.Emit): Call ec.Mark() to allow
17383 single-stepping through constructor initializers.
17385 2003-01-30 Miguel de Icaza <miguel@ximian.com>
17387 * class.cs: Handle error 549: do not allow virtual methods in
17390 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
17392 * decl.cs: Check access levels when resolving types
17394 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
17396 * statement.cs: Add parameters and locals set in catch blocks that might
17397 return to set vector
17399 2003-01-29 Miguel de Icaza <miguel@ximian.com>
17401 * class.cs (Operator): Set the SpecialName flags for operators.
17403 * expression.cs (Invocation.DoResolve): Only block calls to
17404 accessors and operators on SpecialName methods.
17406 (Cast.TryReduce): Handle conversions from char constants.
17409 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
17411 * statement.cs: small memory and time optimization in FlowBranching.
17413 2003-01-28 Pedro Mart <yoros@wanadoo.es>
17415 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
17416 problem that the last fix but in the other sid (Set).
17418 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
17419 access when there is no indexer in the hierarchy.
17421 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
17423 * class.cs: Combine some if statements.
17425 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17427 * driver.cs: fixed bug #37187.
17429 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
17431 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
17432 any indexer, it's needed to build a list with all the indexers in the
17433 hierarchy (AllGetters), else we have problems. Fixes #35653.
17435 2003-01-23 Miguel de Icaza <miguel@ximian.com>
17437 * class.cs (MethodData.Define): It is wrong for an interface
17438 implementation to be static in both cases: explicit and implicit.
17439 We were only handling this in one case.
17441 Improve the if situation there to not have negations.
17443 * class.cs (Field.Define): Turns out that we do not need to check
17444 the unsafe bit on field definition, only on usage. Remove the test.
17446 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17448 * driver.cs: use assembly.Location instead of Codebase (the latest
17449 patch made mcs fail when using MS assemblies).
17451 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
17453 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
17454 get the path to *corlib.dll.
17456 2003-01-21 Nick Drochak <ndrochak@gol.com>
17460 * typemanager.cs: Remove compiler warnings
17462 2003-01-20 Duncan Mak <duncan@ximian.com>
17464 * AssemblyInfo.cs: Bump the version number to 0.19.
17466 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17468 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
17470 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
17472 * class.cs (Constructor::Emit): Emit debugging info for constructors.
17474 2003-01-17 Miguel de Icaza <miguel@ximian.com>
17476 * cs-parser.jay: Small fix: we were not comparing the constructor
17477 name correctly. Thanks to Zoltan for the initial pointer.
17479 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
17481 * cs-tokenizer.cs: Set file name when specified with #line
17483 2003-01-15 Miguel de Icaza <miguel@ximian.com>
17485 * cs-parser.jay: Only perform the constructor checks here if we
17486 are named like the class; This will help provider a better
17487 error. The constructor path is taken when a type definition is
17488 not found, but most likely the user forgot to add the type, so
17489 report that rather than the constructor error.
17491 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
17493 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
17496 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17498 * cs-parser.jay: Add cleanup call.
17500 2003-01-13 Duncan Mak <duncan@ximian.com>
17502 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
17503 consistent with other methods.
17505 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17507 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
17509 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
17511 * attribute.cs: only set GuidAttr to true when we have a
17514 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17518 * typemanager.cs: fixes to allow mcs compile corlib with the new
17519 Type.IsSubclassOf fix.
17521 2003-01-08 Miguel de Icaza <miguel@ximian.com>
17523 * expression.cs (LocalVariableReference.DoResolve): Classify a
17524 constant as a value, not as a variable. Also, set the type for
17527 * cs-parser.jay (fixed_statement): take a type instead of a
17528 pointer_type, so we can produce a better error message later.
17530 * statement.cs (Fixed.Resolve): Flag types that are not pointers
17533 (For.DoEmit): Make inifinite loops have a
17534 non-conditional branch back.
17536 (Fixed.DoEmit): First populate the pinned variables, then emit the
17537 statement, then clear the variables. Before I was emitting the
17538 code once for each fixed piece.
17541 2003-01-08 Martin Baulig <martin@ximian.com>
17543 * statement.cs (FlowBranching.MergeChild): A break in a
17544 SWITCH_SECTION does not leave a loop. Fixes #36155.
17546 2003-01-08 Martin Baulig <martin@ximian.com>
17548 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
17549 lives in the same number space than `param_map'. Fixes #36154.
17551 2003-01-07 Miguel de Icaza <miguel@ximian.com>
17553 * cs-parser.jay (constructor_declaration): Set the
17554 Constructor.ModFlags before probing for it. This makes the
17555 compiler report 514, 515 and 132 (the code was there, but got
17558 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
17559 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
17560 (GotoCase.Resolve): Set `Returns' to ALWAYS.
17562 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
17564 * enum.cs: create the enum static fields using the enum type.
17566 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
17568 * class.cs: don't try to create the ParamBuilder for the return
17569 type if it's not needed (and handle it breaking for the ms runtime
17572 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
17574 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
17576 2002-12-29 Miguel de Icaza <miguel@ximian.com>
17578 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
17579 the command. This showed up while compiling the JANET source
17580 code, which used \r as its only newline separator.
17582 2002-12-28 Miguel de Icaza <miguel@ximian.com>
17584 * class.cs (Method.Define): If we are an operator (because it
17585 reuses our code), then set the SpecialName and HideBySig. #36128
17587 2002-12-22 Miguel de Icaza <miguel@ximian.com>
17589 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
17590 exception, report error 120 `object reference required'.
17592 * driver.cs: Add --pause option, used during to measure the size
17593 of the process as it goes with --timestamp.
17595 * expression.cs (Invocation.DoResolve): Do not allow methods with
17596 SpecialName to be invoked.
17598 2002-12-21 Miguel de Icaza <miguel@ximian.com>
17600 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
17601 number before adding it.
17603 2002-12-21 Ravi Pratap <ravi@ximian.com>
17605 * ecore.cs (StandardImplicitConversion): When in an unsafe
17606 context, we allow conversion between void * to any other pointer
17607 type. This fixes bug #35973.
17609 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
17611 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
17612 is not thrown when extensionless outputs are used
17614 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17616 * rootcontext.cs: fixed compilation of corlib.
17618 2002-12-19 Miguel de Icaza <miguel@ximian.com>
17620 * attribute.cs (Attributes.Contains): Add new method.
17622 * class.cs (MethodCore.LabelParameters): if the parameter is an
17623 `out' parameter, check that no attribute `[In]' has been passed.
17625 * enum.cs: Handle the `value__' name in an enumeration.
17627 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
17629 * decl.cs: Added special case to allow overrides on "protected
17632 2002-12-18 Ravi Pratap <ravi@ximian.com>
17634 * attribute.cs (Attributes.AddAttributeSection): Rename to this
17635 since it makes much more sense.
17637 (Attributes.ctor): Don't require a Location parameter.
17639 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
17641 * attribute.cs (ApplyAttributes): Remove extra Location parameters
17642 since we already have that information per attribute.
17644 * everywhere : make appropriate changes.
17646 * class.cs (LabelParameters): Write the code which actually
17647 applies attributes to the return type. We can't do this on the MS
17648 .NET runtime so we flag a warning in the case an exception is
17651 2002-12-18 Miguel de Icaza <miguel@ximian.com>
17653 * const.cs: Handle implicit null conversions here too.
17655 2002-12-17 Ravi Pratap <ravi@ximian.com>
17657 * class.cs (MethodCore.LabelParameters): Remove the extra
17658 Type [] parameter since it is completely unnecessary. Instead
17659 pass in the method's attributes so that we can extract
17660 the "return" attribute.
17662 2002-12-17 Miguel de Icaza <miguel@ximian.com>
17664 * cs-parser.jay (parse): Use Report.Error to flag errors instead
17665 of ignoring it and letting the compile continue.
17667 * typemanager.cs (ChangeType): use an extra argument to return an
17668 error condition instead of throwing an exception.
17670 2002-12-15 Miguel de Icaza <miguel@ximian.com>
17672 * expression.cs (Unary.TryReduce): mimic the code for the regular
17673 code path. Perform an implicit cast in the cases where we can
17674 implicitly convert to one of the integral types, and then reduce
17675 based on that constant. This fixes bug #35483.
17677 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17679 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
17681 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17683 * namespace.cs: fixed bug #35489.
17685 2002-12-12 Miguel de Icaza <miguel@ximian.com>
17687 * class.cs: Remove some dead code.
17689 * cs-parser.jay: Estimate the number of methods needed
17690 (RootContext.MethodCount);
17692 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
17693 numbers instead of StringBuilders.
17695 * support.cs (PtrHashtable): Add constructor with initial size;
17696 We can now reduce reallocations of the method table.
17698 2002-12-10 Ravi Pratap <ravi@ximian.com>
17700 * attribute.cs (ApplyAttributes): Keep track of the emitted
17701 attributes on a per-target basis. This fixes bug #35413.
17703 2002-12-10 Miguel de Icaza <miguel@ximian.com>
17705 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
17706 default to the Windows 1252 encoding.
17708 (UnixParseOption): Support version, thanks to Alp for the missing
17711 * AssemblyInfo.cs: Add nice assembly information.
17713 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
17716 * cs-parser.jay: Allow a trailing comma before the close bracked
17717 in the attribute_section production.
17719 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
17720 address of the instance was being taken, I will take this out,
17721 because we take the address of the object immediately here.
17723 2002-12-09 Ravi Pratap <ravi@ximian.com>
17725 * typemanager.cs (AreMultipleAllowed): Take care of the most
17726 obvious case where attribute type is not in the current assembly -
17729 2002-12-08 Miguel de Icaza <miguel@ximian.com>
17731 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
17732 definitions, instead of doing that afterwards.
17734 Also we use a nice little hack, depending on the constructor, we
17735 know if we are a "composed" name or a simple name. Hence, we
17736 avoid the IndexOf test, and we avoid
17738 * codegen.cs: Add code to assist in a bug reporter to track down
17739 the source of a compiler crash.
17741 2002-12-07 Ravi Pratap <ravi@ximian.com>
17743 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
17744 types have been emitted for a given element and flag an error
17745 if something which does not have AllowMultiple set is used more
17748 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
17749 attribute types and their corresponding AllowMultiple properties
17751 (AreMultipleAllowed): Check the property for a given type.
17753 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
17754 property in the case we have a TypeContainer.
17756 (Attributes.AddAttribute): Detect duplicates and just skip on
17757 adding them. This trivial fix catches a pretty gross error in our
17758 attribute emission - global attributes were being emitted twice!
17760 Bugzilla bug #33187 is now fixed.
17762 2002-12-06 Miguel de Icaza <miguel@ximian.com>
17764 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
17765 instead of pp_and).
17767 * expression.cs (Binary.ResolveOperator): I can only use the
17768 Concat (string, string, string) and Concat (string, string,
17769 string, string) if the child is actually a concatenation of
17772 2002-12-04 Miguel de Icaza <miguel@ximian.com>
17774 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
17775 context where we need a 2-character lookahead.
17777 * pending.cs (PendingImplementation): Rework so we can keep track
17778 of interface types all the time, and flag those which were
17779 implemented by parents as optional.
17781 2002-12-03 Miguel de Icaza <miguel@ximian.com>
17783 * expression.cs (Binary.ResolveOperator): Use
17784 String.Concat(string,string,string) or
17785 String.Concat(string,string,string,string) when possible.
17787 * typemanager: More helper methods.
17790 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
17792 * pending.cs: remove the bogus return from GetMissingInterfaces()
17793 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
17795 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17797 * namespace.cs: avoid duplicated 'using xxx' being added to
17798 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
17799 when we get more than one 'using' statement for the same namespace.
17800 Report a CS0105 warning for it.
17802 2002-11-30 Miguel de Icaza <miguel@ximian.com>
17804 * cs-tokenizer.cs (consume_identifier): use read directly, instead
17805 of calling getChar/putback, uses internal knowledge of it.
17807 (xtoken): Reorder tokenizer so most common patterns are checked
17808 first. This reduces the compilation time in another 5% (from 8.11s
17809 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
17811 The parsing time is 22% of the compilation in mcs, and from that
17812 64% is spent on the tokenization process.
17814 I tried using a binary search for keywords, but this is slower
17815 than the hashtable. Another option would be to do a couple of
17818 * Not use a StringBuilder, instead use an array of chars,
17819 with a set value. Notice that this way we could catch
17820 the 645 error without having to do it *afterwards*.
17822 * We could write a hand-parser to avoid the hashtable
17823 compares altogether.
17825 The identifier consumption process takes 37% of the tokenization
17826 time. Another 15% is spent on is_number. 56% of the time spent
17827 on is_number is spent on Int64.Parse:
17829 * We could probably choose based on the string length to
17830 use Int32.Parse or Int64.Parse and avoid all the 64-bit
17833 Another 3% is spend on wrapping `xtoken' in the `token' function.
17835 Handle 0xa0 as whitespace (#34752)
17837 2002-11-26 Miguel de Icaza <miguel@ximian.com>
17839 * typemanager.cs (IsCLRType): New routine to tell whether a type
17840 is one of the builtin types.
17842 Maybe it needs to use TypeCodes to be faster. Maybe we could use
17843 typecode in more places instead of doing pointer comparissions.
17844 We could leverage some knowledge about the way the typecodes are
17847 New code to cache namespaces in assemblies, it is currently not
17848 invoked, to be used soon.
17850 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
17852 * expression.cs (Binary.ResolveOperator): specially handle
17853 strings, and do not perform user-defined operator overloading for
17856 2002-11-24 Miguel de Icaza <miguel@ximian.com>
17858 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
17859 internalcall as it is a pretty simple operation; Avoid whenever
17860 possible to call Char.IsLetter.
17862 (consume_identifier): Cut by half the number of
17863 hashtable calls by merging the is_keyword and GetKeyword behavior.
17865 Do not short-circuit, because if we do, we
17866 report errors (ie, #if false && true would produce an invalid
17870 2002-11-24 Martin Baulig <martin@ximian.com>
17872 * expression.cs (Cast.TryReduce): If we're in checked syntax,
17873 check constant ranges and report a CS0221. Fixes #33186.
17875 2002-11-24 Martin Baulig <martin@ximian.com>
17877 * cs-parser.jay: Make this work for uninitialized variable
17878 declarations in the `for' initializer. Fixes #32416.
17880 2002-11-24 Martin Baulig <martin@ximian.com>
17882 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
17883 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
17885 2002-11-24 Martin Baulig <martin@ximian.com>
17887 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
17888 argument; if true, we also check for user-defined conversions.
17889 This is only needed if both arguments are of a user-defined type.
17890 Fixes #30443, added test-175.cs.
17891 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
17893 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
17895 2002-11-24 Martin Baulig <martin@ximian.com>
17897 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
17898 function to get the store opcode.
17899 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
17900 only emit the Ldelema if the store opcode is Stobj. You must run
17901 both test-34 and test-167 to test this. Fixes #34529.
17903 2002-11-23 Martin Baulig <martin@ximian.com>
17905 * ecore.cs (Expression.MemberLookup): Added additional
17906 `qualifier_type' argument which is used when we're being called
17907 from MemberAccess.DoResolve() and null if we're called from a
17909 (Expression.MemberLookupFailed): New method to report errors; this
17910 does the CS1540 check and reports the correct error message.
17912 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
17913 argument for the CS1540 check and redone the way how we're dealing
17914 with private members. See the comment in the source code for details.
17915 (FilterWithClosure): Reverted this back to revision 1.197; renamed
17916 `closure_start_type' to `closure_qualifier_type' and check whether
17917 it's not null. It was not this filter being broken, it was just
17918 being called with the wrong arguments.
17920 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
17921 and pass it the correct `qualifier_type'; this also does the error
17924 2002-11-22 Miguel de Icaza <miguel@ximian.com>
17926 * expression.cs (Invocation.EmitParams): If the we are dealing
17927 with a non-built-in value type, load its address as well.
17929 (ArrayCreation): Use a a pretty constant instead
17930 of the hardcoded value 2. Use 6 instead of 2 for the number of
17931 static initializers.
17933 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
17934 because they are not really value types, just glorified integers.
17936 * driver.cs: Do not append .exe, the CSC compiler does not do it.
17938 * ecore.cs: Remove redundant code for enumerations, make them use
17939 the same code path as everything else, fixes the casting issue
17940 with enumerations in Windows.Forms.
17942 * attribute.cs: Do only cast to string if it is a string, the
17943 validation happens later.
17945 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
17946 people upgrade their corlibs.
17948 * ecore.cs: Oops, enumerations were not following the entire code path
17950 2002-11-21 Miguel de Icaza <miguel@ximian.com>
17952 * typemanager.cs (FilterWithClosure): Commented out the test for
17953 1540 in typemanager.cs, as it has problems when accessing
17954 protected methods from a parent class (see test-174.cs).
17956 * attribute.cs (Attribute.ValidateGuid): new method.
17957 (Attribute.Resolve): Use above.
17959 2002-11-19 Miguel de Icaza <miguel@ximian.com>
17961 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
17963 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
17964 handling for enumerations, as we only needed the TypeContainer
17965 functionality to begin with (this is required for the fix below to
17966 work for enums that reference constants in a container class for
17969 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
17971 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
17972 a valid TypeBuilder to perform lookups on.o
17974 * class.cs (InheritableMemberSignatureCompare): Use true in the
17975 call to GetGetMethod and GetSetMethod, because we are comparing
17976 the signature, and we need to get the methods *even* if they are
17979 (PropertyBase.CheckBase): ditto.
17981 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
17982 GotoCase.Resolve): Use Peel on EmpytCasts.
17984 * ecore.cs (EmptyCast): drop child, add Peel method.
17986 2002-11-17 Martin Baulig <martin@ximian.com>
17988 * ecore.cs (EmptyCast.Child): New public property.
17990 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
17991 label resolved to an EmptyCast. Fixes #34162.
17992 (GotoCase.Resolve): Likewise.
17993 (Block.EmitMeta): Likewise.
17995 2002-11-17 Martin Baulig <martin@ximian.com>
17997 * expression.cs (Invocation.BetterConversion): Prefer int over
17998 uint; short over ushort; long over ulong for integer literals.
17999 Use ImplicitConversionExists instead of StandardConversionExists
18000 since we also need to check for user-defined implicit conversions.
18001 Fixes #34165. Added test-173.cs.
18003 2002-11-16 Martin Baulig <martin@ximian.com>
18005 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
18006 with the `true' and `false' literals. Fixes #33151.
18008 2002-11-16 Martin Baulig <martin@ximian.com>
18010 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
18011 October 22nd; don't do the cs1540 check for static members.
18013 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
18014 now using our own filter here and doing the cs1540 check again.
18016 2002-11-16 Martin Baulig <martin@ximian.com>
18018 * support.cs (InternalParameters): Don't crash if we don't have
18019 any fixed parameters. Fixes #33532.
18021 2002-11-16 Martin Baulig <martin@ximian.com>
18023 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
18024 when looking up static methods to make this work on Windows.
18027 2002-11-16 Martin Baulig <martin@ximian.com>
18029 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
18030 a setter rather than using PropertyInfo.CanWrite.
18032 2002-11-15 Nick Drochak <ndrochak@gol.com>
18034 * class.cs: Allow acces to block member by subclasses. Fixes build
18037 2002-11-14 Martin Baulig <martin@ximian.com>
18039 * class.cs (Constructor.Emit): Added the extern/block check.
18042 2002-11-14 Martin Baulig <martin@ximian.com>
18044 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
18045 iteration while looking for indexers, this is needed because the
18046 indexer may have a different name in our base classes. Fixed the
18047 error reporting (no indexers at all, not get accessor, no
18048 overloaded match). Fixes bug #33089.
18049 (IndexerAccess.DoResolveLValue): Likewise.
18051 2002-11-14 Martin Baulig <martin@ximian.com>
18053 * class.cs (PropertyBase.CheckBase): Make this work for multiple
18054 indexers. Fixes the first part of bug #33089.
18055 (MethodSignature.InheritableMemberSignatureCompare): Added support
18058 2002-11-13 Ravi Pratap <ravi@ximian.com>
18060 * attribute.cs (Attribute.Resolve): Catch the
18061 NullReferenceException and report it since it isn't supposed to
18064 2002-11-12 Miguel de Icaza <miguel@ximian.com>
18066 * expression.cs (Binary.EmitBranchable): Also handle the cases for
18067 LogicalOr and LogicalAnd that can benefit from recursively
18068 handling EmitBranchable. The code now should be nice for Paolo.
18070 2002-11-08 Miguel de Icaza <miguel@ximian.com>
18072 * typemanager.cs (LookupType): Added a negative-hit hashtable for
18073 the Type lookups, as we perform quite a number of lookups on
18074 non-Types. This can be removed once we can deterministically tell
18075 whether we have a type or a namespace in advance.
18077 But this might require special hacks from our corlib.
18081 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
18082 and double which avoids a conversion from an integer to a double.
18084 * expression.cs: tiny optimization, avoid calling IsConstant,
18085 because it effectively performs the lookup twice.
18087 2002-11-06 Miguel de Icaza <miguel@ximian.com>
18089 But a bogus return here to keep the semantics of the old code
18090 until the Mono runtime is fixed.
18092 * pending.cs (GetMissingInterfaces): New method used to remove all
18093 the interfaces that are already implemented by our parent
18094 classes from the list of pending methods.
18096 * interface.cs: Add checks for calls after ResolveTypeExpr.
18098 2002-11-05 Miguel de Icaza <miguel@ximian.com>
18100 * class.cs (Class.Emit): Report warning 67: event not used if the
18101 warning level is beyond 3.
18103 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
18104 being a NullLiteral.
18106 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
18109 * class.cs (TypeContainer.GetClassBases): Cover a missing code
18110 path that might fail if a type can not be resolved.
18112 * expression.cs (Binary.Emit): Emit unsigned versions of the
18115 * driver.cs: use error 5.
18117 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
18119 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
18121 2002-11-01 Miguel de Icaza <miguel@ximian.com>
18123 * cs-parser.jay (switch_section): A beautiful patch from Martin
18124 Baulig that fixed 33094.
18126 2002-10-31 Miguel de Icaza <miguel@ximian.com>
18128 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
18129 Check whether the base is abstract and report an error if so.
18131 * expression.cs (IndexerAccess.DoResolveLValue,
18132 IndexerAccess.DoResolve): ditto.
18134 (Invocation.DoResolve): ditto.
18136 (Invocation.FullMethodDesc): Improve the report string.
18138 * statement.cs (Block): Eliminate IsVariableDefined as it is
18139 basically just a wrapper for GetVariableInfo.
18141 * ecore.cs (SimpleName): Use new
18143 * support.cs (ReflectionParamter.ParameterType): We unwrap the
18144 type, as we return the actual parameter ref/unref state on a
18147 2002-10-30 Miguel de Icaza <miguel@ximian.com>
18149 * support.cs: Return proper flags REF/OUT fixing the previous
18152 * expression.cs: Reverted last patch, that was wrong. Is_ref is
18153 not used to mean `ref' but `ref or out' in ParameterReference
18155 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
18156 full type signature instead of calling TypeManger.CSharpName
18159 * support.cs (InternalParameters.ParameterDesc): Do not compare
18160 directly to the modflags, because REF/OUT will actually be bitsets
18163 * delegate.cs (VerifyMethod): Check also the modifiers.
18165 * cs-tokenizer.cs: Fix bug where floating point values with an
18166 exponent where a sign was missing was ignored.
18168 * driver.cs: Allow multiple assemblies to be specified in a single
18171 2002-10-28 Miguel de Icaza <miguel@ximian.com>
18173 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
18174 because identifiers after a parenthesis would end up in this kind
18175 of production, and we needed to desamiguate it for having casts
18178 (UserDefinedType *) xxx
18180 2002-10-24 Miguel de Icaza <miguel@ximian.com>
18182 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
18183 we should set on the Bindingflags.NonPublic, but not turn on
18184 private_ok. private_ok controls whether a Private member is
18185 returned (this is chekced on the filter routine), while the
18186 BindingFlags.NonPublic just controls whether private/protected
18187 will be allowed. This fixes the problem part of the problem of
18188 private properties being allowed to be used in derived classes.
18190 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
18191 so we can call the children DoResolveLValue method (this will
18192 properly signal errors on lvalue assignments to base properties)
18194 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
18195 getter are null, and we have a property info, we know that this
18196 happened because the lookup failed, so we report an error 122 for
18197 protection level violation.
18199 We also silently return if setter and getter are null in the
18200 resolve functions, this condition only happens if we have flagged
18201 the error before. This is the other half of the problem.
18203 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
18204 not have accessibility information, that is why we were returning
18205 true in the filter function in typemanager.cs.
18207 To properly report 122 (property is inaccessible because of its
18208 protection level) correctly, we report this error in ResolveAccess
18209 by failing if both the setter and the getter are lacking (ie, the
18212 DoResolve and DoLResolve have been modified to check for both
18213 setter/getter being null and returning silently, the reason being
18214 that I did not want to put the knowledge about this error in upper
18217 int old = Report.Errors;
18218 x = new PropertyExpr (...);
18219 if (old != Report.Errors)
18224 So the property expr is returned, but it is invalid, so the error
18225 will be flagged during the resolve process.
18227 * class.cs: Remove InheritablePropertySignatureCompare from the
18228 class, as we no longer depend on the property signature to compute
18229 whether it is possible to implement a method or not.
18231 The reason is that calling PropertyInfo.GetGetMethod will return
18232 null (in .NET, in Mono it works, and we should change this), in
18233 cases where the Get Method does not exist in that particular
18238 class X { public virtual int A { get { return 1; } } }
18240 class Z : Y { public override int A { get { return 2; } } }
18242 Would fail in Z because the parent (Y) would not have the property
18243 defined. So we avoid this completely now (because the alternative
18244 fix was ugly and slow), and we now depend exclusively on the
18247 (PropertyBase.CheckBase): Use a method-base mechanism to find our
18248 reference method, instead of using the property.
18250 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
18251 routines are gone now.
18253 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
18254 names, they were incorrectly named.
18256 * cs-tokenizer.cs: Return are more gentle token on failure.
18258 * pending.cs (PendingImplementation.InterfaceMethod): This routine
18259 had an out-of-sync index variable, which caused it to remove from
18260 the list of pending methods the wrong method sometimes.
18262 2002-10-22 Miguel de Icaza <miguel@ximian.com>
18264 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
18265 CanWrite, because those refer to this particular instance of the
18266 property, and do not take into account the fact that we can
18267 override single members of a property.
18269 Constructor requires an EmitContext. The resolution process does
18270 not happen here, but we need to compute the accessors before,
18271 because the resolution does not always happen for properties.
18273 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
18274 subclass, before we did not update this flag, but we did update
18277 (GetAccessors): Drop this routine, as it did not work in the
18278 presence of partially overwritten set/get methods.
18280 Notice that this broke the cs1540 detection, but that will require
18283 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18287 * driver.cs: issue a warning instead of an error if we don't support
18288 debugging for the platform. Also ignore a couple of errors that may
18289 arise when trying to write the symbols. Undo my previous patch.
18291 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18293 * driver.cs: ignore /debug switch except for Unix platforms.
18295 2002-10-23 Nick Drochak <ndrochak@gol.com>
18297 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
18299 2002-10-21 Miguel de Icaza <miguel@ximian.com>
18301 * driver.cs: Do not make mcs-debug conditional, so we do not break
18302 builds that use it.
18304 * statement.cs (UsageVector.MergeChildren): I would like Martin to
18305 review this patch. But basically after all the children variables
18306 have been merged, the value of "Breaks" was not being set to
18307 new_breaks for Switch blocks. I think that it should be set after
18308 it has executed. Currently I set this to the value of new_breaks,
18309 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
18310 conservative, but I do not understand this code very well.
18312 I did not break anything in the build, so that is good ;-)
18314 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
18316 2002-10-20 Mark Crichton <crichton@gimp.org>
18318 * cfold.cs: Fixed compile blocker. Really fixed it this time.
18320 2002-10-20 Nick Drochak <ndrochak@gol.com>
18322 * cfold.cs: Fixed compile blocker.
18324 2002-10-20 Miguel de Icaza <miguel@ximian.com>
18326 * driver.cs: I was chekcing the key, not the file.
18328 2002-10-19 Ravi Pratap <ravi@ximian.com>
18330 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
18331 message that we were generating - we just need to silently return
18334 2002-10-19 Miguel de Icaza <miguel@ximian.com>
18336 * class.cs (Event.Define): Change my previous commit, as this
18337 breaks the debugger. This is a temporary hack, as it seems like
18338 the compiler is generating events incorrectly to begin with.
18340 * expression.cs (Binary.ResolveOperator): Added support for
18341 "U operator - (E x, E y)"
18343 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
18346 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
18347 init-only variables, but this path did not take into account that
18348 there might be also instance readonly variables. Correct this
18351 This fixes bug 32253
18353 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
18356 * driver.cs: Change the extension for modules to `netmodule'
18358 * cs-parser.jay: Improved slightly the location tracking for
18359 the debugger symbols.
18361 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
18362 modifiers that were specified instead of the hardcoded value
18363 (FamAndAssem). This was basically ignoring the static modifier,
18364 and others. Fixes 32429.
18366 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
18367 fixed a bug in the process (32476)
18369 * expression.cs (ArrayAccess.EmitAssign): Patch from
18370 hwang_rob@yahoo.ca that fixes bug 31834.3
18372 2002-10-18 Miguel de Icaza <miguel@ximian.com>
18374 * driver.cs: Make the module extension .netmodule.
18376 2002-10-16 Miguel de Icaza <miguel@ximian.com>
18378 * driver.cs: Report an error if the resource file is not found
18379 instead of crashing.
18381 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
18382 false, like Emit does.
18384 2002-10-16 Nick Drochak <ndrochak@gol.com>
18386 * typemanager.cs: Remove unused private member. Also reported mcs
18387 bug to report this as a warning like csc.
18389 2002-10-15 Martin Baulig <martin@gnome.org>
18391 * statement.cs (Statement.Emit): Made this a virtual method; emits
18392 the line number info and calls DoEmit().
18393 (Statement.DoEmit): New protected abstract method, formerly knows
18394 as Statement.Emit().
18396 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
18398 2002-10-11 Miguel de Icaza <miguel@ximian.com>
18400 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
18401 have fixed a remaining problem: not every AddXXXX was adding a
18402 fully qualified name.
18404 Now everyone registers a fully qualified name in the DeclSpace as
18405 being defined instead of the partial name.
18407 Downsides: we are slower than we need to be due to the excess
18408 copies and the names being registered this way.
18410 The reason for this is that we currently depend (on the corlib
18411 bootstrap for instance) that types are fully qualified, because
18412 we dump all the types in the namespace, and we should really have
18413 types inserted into the proper namespace, so we can only store the
18414 basenames in the defined_names array.
18416 2002-10-10 Martin Baulig <martin@gnome.org>
18418 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
18419 from bug #31834, see the bug report for a testcase which is
18422 2002-10-10 Martin Baulig <martin@gnome.org>
18424 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
18425 flow analysis code for this.
18427 * statement.cs (Do, While, For): Tell the flow analysis code about
18429 (FlowBranching.UsageVector): Added support for infinite loops.
18430 (Block.Resolve): Moved the dead code elimination here and use flow
18433 2002-10-09 Miguel de Icaza <miguel@ximian.com>
18435 * class.cs (Field.Define): Catch cycles on struct type
18438 * typemanager.cs (IsUnmanagedtype): Do not recursively check
18439 fields if the fields are static. We only need to check instance
18442 * expression.cs (As.DoResolve): Test for reference type.
18444 * statement.cs (Using.ResolveExpression): Use
18445 ConvertImplicitRequired, not ConvertImplicit which reports an
18447 (Using.ResolveLocalVariableDecls): ditto.
18449 * expression.cs (Binary.ResolveOperator): Report errors in a few
18450 places where we had to.
18452 * typemanager.cs (IsUnmanagedtype): Finish implementation.
18454 2002-10-08 Miguel de Icaza <miguel@ximian.com>
18456 * expression.cs: Use StoreFromPtr instead of extracting the type
18457 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
18459 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
18460 an enumeration value to a System.Enum, but System.Enum is not a
18461 value type, but an class type, so we need to box.
18463 (Expression.ConvertExplicit): One codepath could return
18464 errors but not flag them. Fix this. Fixes #31853
18466 * parameter.cs (Resolve): Do not allow void as a parameter type.
18468 2002-10-06 Martin Baulig <martin@gnome.org>
18470 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
18471 if it's a class type and not a struct. Fixes #31815.
18473 2002-10-06 Martin Baulig <martin@gnome.org>
18475 * statement.cs: Reworked the flow analysis code a bit to make it
18476 usable for dead code elimination.
18478 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18480 * cs-parser.jay: allow empty source files. Fixes bug #31781.
18482 2002-10-04 Miguel de Icaza <miguel@ximian.com>
18484 * expression.cs (ComposedCast.DoResolveType): A quick workaround
18485 to fix the test 165, will investigate deeper.
18487 2002-10-04 Martin Baulig <martin@gnome.org>
18489 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
18490 finally blocks actually work.
18491 (Try.Resolve): We don't need to create a sibling for `finally' if
18492 there is no finally block.
18494 2002-10-04 Martin Baulig <martin@gnome.org>
18496 * class.cs (Constructor.Define): The default accessibility for a
18497 non-default constructor is private, not public.
18499 2002-10-04 Miguel de Icaza <miguel@ximian.com>
18501 * class.cs (Constructor): Make AllowedModifiers public, add
18504 * cs-parser.jay: Perform the modifiers test here, as the
18505 constructor for the Constructor class usually receives a zero
18506 because of the way we create it (first we create, later we
18507 customize, and we were never checking the modifiers).
18509 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
18510 is a version of LookupTypeReflection that includes the type-name
18511 cache. This can be used as a fast path for functions that know
18512 the fully qualified name and are only calling into *.GetType() to
18513 obtain a composed type.
18515 This is also used by TypeManager.LookupType during its type
18518 (LookupType): We now also track the real type name, as sometimes
18519 we can get a quey for the real type name from things like
18520 ComposedCast. This fixes bug 31422.
18522 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
18523 complete type fullname, it does not have to go through the type
18524 resolution system to obtain the composed version of the type (for
18525 obtaining arrays or pointers).
18527 (Conditional.Emit): Use the EmitBoolExpression to
18528 generate nicer code, as requested by Paolo.
18530 (ArrayCreation.CheckIndices): Use the patch from
18531 hwang_rob@yahoo.ca to validate the array initializers.
18533 2002-10-03 Miguel de Icaza <miguel@ximian.com>
18535 * class.cs (ConstructorInitializer.Emit): simplify code by using
18536 Invocation.EmitCall, and at the same time, fix the bugs in calling
18537 parent constructors that took variable arguments.
18539 * ecore.cs (Expression.ConvertNumericExplicit,
18540 Expression.ImplicitNumericConversion): Remove the code that
18541 manually wrapped decimal (InternalTypeConstructor call is now gone
18544 * expression.cs (Cast.TryReduce): Also handle decimal types when
18545 trying to perform a constant fold on the type.
18547 * typemanager.cs (IsUnmanagedtype): Partially implemented.
18549 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
18550 that only turned off an error report, and did nothing else.
18552 2002-10-02 Miguel de Icaza <miguel@ximian.com>
18554 * driver.cs: Handle and ignore /fullpaths
18556 2002-10-01 Miguel de Icaza <miguel@ximian.com>
18558 * expression.cs (Binary.ResolveOperator): Catch the case where
18559 DoNumericPromotions returns true,
18561 (Binary.DoNumericPromotions): Simplify the code, and the tests.
18563 2002-09-27 Miguel de Icaza <miguel@ximian.com>
18565 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
18568 2002-09-26 Miguel de Icaza <miguel@ximian.com>
18570 * ecore.cs (ConvertNumericExplicit): It is not enough that the
18571 conversion exists, but it is also required that the conversion be
18572 performed. This manifested in "(Type64Enum) 2".
18574 * class.cs (TypeManager.AddMethod): The fix is not to change
18575 AddEnum, because that one was using a fully qualified name (every
18576 DeclSpace derivative does), but to change the AddMethod routine
18577 that was using an un-namespaced name. This now correctly reports
18578 the duplicated name.
18580 Revert patch until I can properly fix it. The issue
18581 is that we have a shared Type space across all namespaces
18582 currently, which is wrong.
18584 Options include making the Namespace a DeclSpace, and merge
18585 current_namespace/current_container in the parser.
18587 2002-09-25 Miguel de Icaza <miguel@ximian.com>
18589 * cs-parser.jay: Improve error reporting when we get a different
18590 kind of expression in local_variable_type and
18591 local_variable_pointer_type.
18593 Propagate this to avoid missleading errors being reported.
18595 * ecore.cs (ImplicitReferenceConversion): treat
18596 TypeManager.value_type as a target just like object_type. As
18601 Is valid, and needs to result in the int 1 being boxed before it
18602 is assigned to the value type v.
18604 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
18605 to validate the enumeration name.
18607 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
18608 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
18609 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
18611 * ecore.cs (TryImplicitIntConversion): When doing an
18612 implicit-enumeration-conversion, check if the type is 64-bits and
18613 perform a conversion before passing to EnumConstant.
18615 2002-09-23 Miguel de Icaza <miguel@ximian.com>
18617 * decl.cs (Error_AmbiguousTypeReference); New routine used to
18618 report ambiguous type references. Unlike the MS version, we
18619 report what the ambiguity is. Innovation at work ;-)
18621 (DeclSpace.FindType): Require a location argument to
18622 display when we display an ambiguous error.
18624 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
18626 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
18628 * expression.cs (EmitDynamicInitializers): Apply patch from
18629 hwang_rob@yahoo.ca that fixes the order in which we emit our
18632 2002-09-21 Martin Baulig <martin@gnome.org>
18634 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
18635 delegate takes no arguments.
18637 2002-09-20 Miguel de Icaza <miguel@ximian.com>
18639 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
18642 * expression.cs: Extract the underlying type.
18644 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
18646 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
18648 2002-09-19 Miguel de Icaza <miguel@ximian.com>
18650 * class.cs (TypeContainer.DefineType): We can not use the nice
18651 PackingSize with the size set to 1 DefineType method, because it
18652 will not allow us to define the interfaces that the struct
18655 This completes the fixing of bug 27287
18657 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
18658 means also structs. This fixes part of the problem.
18659 (Expresion.ImplicitReferenceConversionExists): ditto.
18661 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
18662 error if there were no errors reported during the type lookup
18663 process, to avoid duplicates or redundant errors. Without this
18664 you would get an ambiguous errors plus a type not found. We have
18665 beaten the user enough with the first error.
18667 (DeclSparce.FindType): Emit a warning if we have an ambiguous
18670 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
18671 during the resolution process, stop the lookup, this avoids
18672 repeated error reports (same error twice).
18674 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
18676 * typemanager.cs (LookupType): Redo the type lookup code to match
18677 the needs of System.Reflection.
18679 The issue is that System.Reflection requires references to nested
18680 types to begin with a "+" sign instead of a dot. So toplevel
18681 types look like: "NameSpace.TopLevelClass", and nested ones look
18682 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
18685 2002-09-19 Martin Baulig <martin@gnome.org>
18687 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
18688 says that a method always returns or always throws an exception,
18689 don't report the CS0161.
18691 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
18692 set `Returns = new_returns'.
18694 2002-09-19 Martin Baulig <martin@gnome.org>
18696 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
18697 to an enum constant, check for a CS0176.
18699 2002-09-18 Miguel de Icaza <miguel@ximian.com>
18701 * class.cs (TypeContainer.CheckPairedOperators): Now we check
18702 for operators that must be in pairs and report errors.
18704 * ecore.cs (SimpleName.DoResolveType): During the initial type
18705 resolution process, when we define types recursively, we must
18706 check first for types in our current scope before we perform
18707 lookups in the enclosing scopes.
18709 * expression.cs (MakeByteBlob): Handle Decimal blobs.
18711 (Invocation.VerifyArgumentsCompat): Call
18712 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
18713 I thought we were supposed to always call this, but there are a
18714 few places in the code where we dont do it.
18716 2002-09-17 Miguel de Icaza <miguel@ximian.com>
18718 * driver.cs: Add support in -linkres and -resource to specify the
18719 name of the identifier.
18721 2002-09-16 Miguel de Icaza <miguel@ximian.com>
18723 * ecore.cs (StandardConversionExists): Sync with the conversion
18724 code: allow anything-* to void* conversions.
18726 (FindMostSpecificSource): Use an Expression argument
18727 instead of a Type, because we might be handed over a Literal which
18728 gets a few more implicit conversions that plain types do not. So
18729 this information was being lost.
18731 Also, we drop the temporary type-holder expression when not
18734 2002-09-17 Martin Baulig <martin@gnome.org>
18736 * class.cs (PropertyBase.CheckBase): Don't check the base class if
18737 this is an explicit interface implementation.
18739 2002-09-17 Martin Baulig <martin@gnome.org>
18741 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
18742 different `IndexerName' attributes.
18744 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
18745 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
18746 virtual CommonResolve().
18748 2002-09-16 Miguel de Icaza <miguel@ximian.com>
18750 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
18751 and convert that to the UnderlyingType.
18753 * statement.cs (Foreach.Resolve): Indexers are just like variables
18754 or PropertyAccesses.
18756 * cs-tokenizer.cs (consume_string): Track line numbers and columns
18757 inside quoted strings, we were not doing this before.
18759 2002-09-16 Martin Baulig <martin@gnome.org>
18761 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
18762 resolve it. This is needed for the definite assignment check of the
18763 instance expression, fixes bug #29846.
18764 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
18766 2002-09-16 Nick Drochak <ndrochak@gol.com>
18768 * parameter.cs: Fix compile error. Cannot reference static member
18769 from an instance object. Is this an mcs bug?
18771 2002-09-14 Martin Baulig <martin@gnome.org>
18773 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
18774 multiple times. Fixes bug #30295, added test-166.cs.
18776 2002-09-14 Martin Baulig <martin@gnome.org>
18778 * statement.cs (Block.Emit): Don't emit unreachable code.
18779 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
18780 `break' statements.
18781 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
18783 2002-09-14 Martin Baulig <martin@gnome.org>
18785 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
18788 2002-09-14 Martin Baulig <martin@gnome.org>
18790 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
18791 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
18792 be false on the ms runtime.
18794 2002-09-13 Martin Baulig <martin@gnome.org>
18796 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
18797 the CS0038 error message.
18799 2002-09-12 Miguel de Icaza <miguel@ximian.com>
18801 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
18802 constant inside, return it.
18804 2002-09-12 Martin Baulig <martin@gnome.org>
18806 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
18807 implicit conversion can be done between enum types.
18809 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
18810 check whether an implicit conversion to the current enum's UnderlyingType
18811 exists and report an error if not.
18813 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
18814 without debugging support.
18816 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
18817 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
18819 2002-09-12 Martin Baulig <martin@gnome.org>
18821 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
18823 * ecore.cs (IMemberExpr.DeclaringType): New property.
18824 (SimpleName.SimpleNameResolve): Check whether we're accessing a
18825 nonstatic member of an outer type (CS0038).
18827 2002-09-11 Miguel de Icaza <miguel@ximian.com>
18829 * driver.cs: Activate the using-error detector at warning level
18830 4 (at least for MS-compatible APIs).
18832 * namespace.cs (VerifyUsing): Small buglett fix.
18834 * pending.cs (PendingImplementation): pass the container pointer.
18836 * interface.cs (GetMethods): Allow for recursive definition. Long
18837 term, I would like to move every type to support recursive
18838 definitions, not the current ordering mechanism that we have right
18841 The situation is this: Attributes are handled before interfaces,
18842 so we can apply attributes to interfaces. But some attributes
18843 implement interfaces, we will now handle the simple cases
18844 (recursive definitions will just get an error).
18846 * parameter.cs: Only invalidate types at the end if we fail to
18849 2002-09-09 Martin Baulig <martin@gnome.org>
18851 * ecore.cs (PropertyExpr.Emit): Also check for
18852 TypeManager.system_int_array_get_length so this'll also work when
18853 compiling corlib. Fixes #30003.
18855 2002-09-09 Martin Baulig <martin@gnome.org>
18857 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
18858 and throw an exception if we can't get the type's size. Fixed #30040,
18861 2002-09-09 Martin Baulig <martin@gnome.org>
18863 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
18865 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
18866 context. Fixes bug #30027.
18868 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
18869 virtual functions. Fixes bug #30043, added test-164.cs.
18871 2002-09-08 Ravi Pratap <ravi@ximian.com>
18873 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
18875 2002-09-08 Nick Drochak <ndrochak@gol.com>
18877 * driver.cs: Use an object to get the windows codepage since it's not a
18880 2002-09-08 Miguel de Icaza <miguel@ximian.com>
18882 * statement.cs (For.Emit): for infinite loops (test == null)
18883 return whether there is a break inside, not always "true".
18885 * namespace.cs (UsingEntry): New struct to hold the name of the
18886 using definition, the location where it is defined, and whether it
18887 has been used in a successful type lookup.
18889 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
18894 2002-09-06 Ravi Pratap <ravi@ximian.com>
18896 * attribute.cs : Fix incorrect code which relied on catching
18897 a NullReferenceException to detect a null being passed in
18898 where an object was expected.
18900 2002-09-06 Miguel de Icaza <miguel@ximian.com>
18902 * statement.cs (Try): flag the catch variable as assigned
18904 * expression.cs (Cast): Simplified by using ResolveType instead of
18905 manually resolving.
18907 * statement.cs (Catch): Fix bug by using ResolveType.
18909 2002-09-06 Ravi Pratap <ravi@ximian.com>
18911 * expression.cs (BetterConversion): Special case for when we have
18912 a NullLiteral as the argument and we have to choose between string
18913 and object types - we choose string the way csc does.
18915 * attribute.cs (Attribute.Resolve): Catch the
18916 NullReferenceException and report error #182 since the Mono
18917 runtime no more has the bug and having this exception raised means
18918 we tried to select a constructor which takes an object and is
18921 2002-09-05 Ravi Pratap <ravi@ximian.com>
18923 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
18924 message (1502, 1503) when we can't locate a method after overload
18925 resolution. This is much more informative and closes the bug
18928 * interface.cs (PopulateMethod): Return if there are no argument
18929 types. Fixes a NullReferenceException bug.
18931 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
18932 expressions too. Previously we were checking only in one place for
18933 positional arguments leaving out named arguments.
18935 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
18936 type to the enum type is not allowed. Remove code corresponding to
18939 (ConvertNumericExplicit): Allow explicit conversions from
18940 the underlying type to enum type. This precisely follows the spec
18941 and closes a bug filed by Gonzalo.
18943 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18946 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
18948 2002-09-03 Miguel de Icaza <miguel@ximian.com>
18950 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
18951 it was important that we stored the right value after the
18952 reduction in `converted'.
18954 2002-09-04 Martin Baulig <martin@gnome.org>
18956 * location.cs (Location.SymbolDocument): Use full pathnames for the
18959 2002-08-30 Miguel de Icaza <miguel@ximian.com>
18961 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
18962 of the expression resolve mechanism, because that will catch the
18963 SimpleName error failures.
18965 (Conditional): If we can not resolve the
18966 expression, return, do not crash.
18968 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18971 (location): display token name instead of its number.
18973 2002-08-28 Martin Baulig <martin@gnome.org>
18975 * expression.cs (Binary.ResolveOperator): Don't silently return
18976 but return an error if an operator cannot be applied between two
18979 2002-08-28 Martin Baulig <martin@gnome.org>
18981 * class.cs (Constructor.Define): Set the permission attributes
18982 correctly instead of making all constructors public.
18984 2002-08-28 Martin Baulig <martin@gnome.org>
18986 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
18987 for private members before reporting a CS0103; if we find anything,
18990 2002-08-28 Martin Baulig <martin@gnome.org>
18992 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
18993 to check whether `closure_start_type == closure_invocation_type',
18994 we also need to check whether `m.DeclaringType == closure_invocation_type'
18995 before bypassing the permission checks. We might be accessing
18996 protected/private members from the base class.
18997 (TypeManager.RealMemberLookup): Only set private_ok if private
18998 members were requested via BindingFlags.NonPublic.
19000 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
19002 * expression.cs (MemberAccess.ResolveMemberAccess): Set
19003 MethodGroupExpr.IsExplicitImpl if appropriate.
19004 (Invocation.DoResolve): Don't report the CS0120 for explicit
19005 interface implementations.
19007 2002-08-27 Martin Baulig <martin@gnome.org>
19009 * expression.cs (Invocation.DoResolve): If this is a static
19010 method and we don't have an InstanceExpression, we must report
19013 2002-08-25 Martin Baulig <martin@gnome.org>
19015 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
19016 `==' between a valuetype and an object.
19018 2002-08-25 Miguel de Icaza <miguel@ximian.com>
19020 * ecore.cs (TypeExpr): Provide a ToString method.
19022 2002-08-24 Martin Baulig <martin@gnome.org>
19024 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
19025 now called proggie.dbg and it's a binary file.
19027 2002-08-23 Martin Baulig <martin@gnome.org>
19029 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
19031 2002-08-23 Martin Baulig <martin@gnome.org>
19033 * struct.cs (MyStructInfo.ctor): Make this work with empty
19034 structs; it's not allowed to use foreach() on null.
19036 2002-08-23 Martin Baulig <martin@gnome.org>
19038 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
19039 writer the full pathname of the generated assembly.
19041 2002-08-23 Martin Baulig <martin@gnome.org>
19043 * statements.cs (FlowBranching.UsageVector.MergeChildren):
19044 A `finally' block never returns or breaks; improved handling of
19047 2002-08-23 Martin Baulig <martin@gnome.org>
19049 * statement.cs (Throw.Resolve): Allow `throw null'.
19051 2002-08-23 Martin Baulig <martin@gnome.org>
19053 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
19054 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
19055 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
19056 MemberLookup would return a wrong event if this is an explicit
19057 interface implementation and the class has an event with the same
19060 2002-08-23 Martin Baulig <martin@gnome.org>
19062 * statement.cs (Block.AddChildVariableNames): New public method.
19063 (Block.AddChildVariableName): Likewise.
19064 (Block.IsVariableNameUsedInChildBlock): Likewise.
19065 (Block.AddVariable): Check whether a variable name has already
19066 been used in a child block.
19068 * cs-parser.jay (declare_local_variables): Mark all variable names
19069 from the current block as being used in a child block in the
19072 2002-08-23 Martin Baulig <martin@gnome.org>
19074 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
19075 find the symbol writer.
19077 * driver.cs: csc also allows the arguments to /define being
19078 separated by commas, not only by semicolons.
19080 2002-08-23 Martin Baulig <martin@gnome.org>
19082 * interface.cs (Interface.GetMembers): Added static check for events.
19084 2002-08-15 Martin Baulig <martin@gnome.org>
19086 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
19087 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
19089 * ecore.cs (Expression.MemberLookup): Added documentation and explained
19090 why the MethodData.EmitDestructor() change was necessary.
19092 2002-08-20 Martin Baulig <martin@gnome.org>
19094 * class.cs (TypeContainer.FindMembers): Added static check for events.
19096 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
19098 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
19099 use Type.GetEvents(), not Type.FindMembers().
19101 2002-08-20 Martin Baulig <martin@gnome.org>
19103 * decl.cs (MemberCache): Added a special method cache which will
19104 be used for method-only searched. This ensures that a method
19105 search will return a MethodInfo with the correct ReflectedType for
19108 2002-08-20 Martin Baulig <martin@gnome.org>
19110 * decl.cs (DeclSpace.FindMembers): Made this public.
19112 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19114 * delegate.cs: fixed build on windows.
19115 [FIXME: Filed as bug #29150: MCS must report these errors.]
19117 2002-08-19 Ravi Pratap <ravi@ximian.com>
19119 * ecore.cs (StandardConversionExists): Return a false
19120 if we are trying to convert the void type to anything else
19121 since that is not allowed.
19123 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
19124 we flag error 70 in the event an event is trying to be accessed
19125 directly from outside the declaring type.
19127 2002-08-20 Martin Baulig <martin@gnome.org>
19129 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
19130 MemberCache from typemanager.cs to decl.cs.
19132 2002-08-19 Martin Baulig <martin@gnome.org>
19134 * class.cs (TypeContainer): Implement IMemberContainer.
19135 (TypeContainer.DefineMembers): Create the MemberCache.
19136 (TypeContainer.FindMembers): Do better BindingFlags checking; only
19137 return public members if BindingFlags.Public was given, check
19138 whether members are static.
19140 2002-08-16 Martin Baulig <martin@gnome.org>
19142 * decl.cs (DeclSpace.Define): Splitted this in Define and
19143 DefineMembers. DefineMembers is called first and initializes the
19146 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
19147 DefineMembers() on all our DeclSpaces.
19149 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
19150 but call DefineMembers() on all nested interfaces. We call their
19151 Define() in our new Define() function.
19153 * interface.cs (Interface): Implement IMemberContainer.
19154 (Interface.Define): Moved all code except the attribute stuf to
19156 (Interface.DefineMembers): Initialize the member cache.
19158 * typemanager.cs (IMemberFinder): Removed this interface, we don't
19159 need this anymore since we can use MemberCache.FindMembers directly.
19161 2002-08-19 Martin Baulig <martin@gnome.org>
19163 * typemanager.cs (MemberCache): When creating the cache for an
19164 interface type, add all inherited members.
19165 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
19166 to `out bool used_cache' and documented it.
19167 (TypeManager.MemberLookup): If we already used the cache in the first
19168 iteration, we don't need to do the interfaces check.
19170 2002-08-19 Martin Baulig <martin@gnome.org>
19172 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
19173 here from IMemberFinder and don't implement this interface anymore.
19174 (DeclSpace.MemberCache): Moved here from IMemberFinder.
19176 * typemanager.cs (IMemberFinder): This interface is now only used by
19177 classes which actually support the member cache.
19178 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
19179 since we only put DeclSpaces into this Hashtable.
19180 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
19181 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
19183 2002-08-16 Martin Baulig <martin@gnome.org>
19185 * typemanager.cs (ICachingMemberFinder): Removed.
19186 (IMemberFinder.MemberCache): New property.
19187 (TypeManager.FindMembers): Merged this with RealFindMembers().
19188 This function will never be called from TypeManager.MemberLookup()
19189 so we can't use the cache here, just the IMemberFinder.
19190 (TypeManager.MemberLookup_FindMembers): Check whether the
19191 IMemberFinder has a MemberCache and call the cache's FindMembers
19193 (MemberCache): Rewrote larger parts of this yet another time and
19194 cleaned it up a bit.
19196 2002-08-15 Miguel de Icaza <miguel@ximian.com>
19198 * driver.cs (LoadArgs): Support quoting.
19200 (Usage): Show the CSC-like command line arguments.
19202 Improved a few error messages.
19204 2002-08-15 Martin Baulig <martin@gnome.org>
19206 * typemanager.cs (IMemberContainer.Type): New property.
19207 (IMemberContainer.IsInterface): New property.
19209 The following changes are conditional to BROKEN_RUNTIME, which is
19210 defined at the top of the file.
19212 * typemanager.cs (MemberCache.MemberCache): Don't add the base
19213 class'es members, but add all members from TypeHandle.ObjectType
19214 if we're an interface.
19215 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
19216 is the current type.
19217 (MemberCache.CacheEntry.Container): Removed this field.
19218 (TypeHandle.GetMembers): Include inherited members.
19220 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19222 * typemanager.cs: fixed compilation and added a comment on a field that
19225 2002-08-15 Martin Baulig <martin@gnome.org>
19227 * class.cs (ConstructorInitializer.Resolve): In the
19228 Expression.MemberLookup call, use the queried_type as
19231 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
19232 declared' attribute, it's always true.
19233 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
19234 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
19235 temporary wrapper for FindMembers which tells MemberLookup whether
19236 members from the base classes are included in the return value.
19237 This will go away soon.
19238 (TypeManager.MemberLookup): Use this temporary hack here; once the
19239 new MemberCache is completed, we don't need to do the DeclaredOnly
19240 looping here anymore since the MemberCache will take care of this.
19241 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
19242 (MemberCache): When creating the MemberCache for a class, get
19243 members from the current class and all its base classes.
19244 (MemberCache.CacheEntry.Container): New field. This is a
19245 temporary hack until the Mono runtime is fixed to distinguish
19246 between ReflectedType and DeclaringType. It allows us to use MCS
19247 with both the MS runtime and the unfixed Mono runtime without
19248 problems and without accecting performance.
19249 (MemberCache.SearchMembers): The DeclaredOnly looping from
19250 TypeManager.MemberLookup is now done here.
19252 2002-08-14 Martin Baulig <martin@gnome.org>
19254 * statement.cs (MyStructInfo.MyStructInfo): Don't call
19255 Type.GetFields on dynamic types but get the fields from the
19256 corresponding TypeContainer.
19257 (MyStructInfo.GetStructInfo): Added check for enum types.
19259 * typemanager.cs (MemberList.IsSynchronized): Implemented.
19260 (MemberList.SyncRoot): Implemented.
19261 (TypeManager.FilterWithClosure): No need to check permissions if
19262 closure_start_type == closure_invocation_type, don't crash if
19263 closure_invocation_type is null.
19265 2002-08-13 Martin Baulig <martin@gnome.org>
19267 Rewrote TypeContainer.FindMembers to use a member cache. This
19268 gives us a speed increase of about 35% for the self-hosting MCS
19269 build and of about 15-20% for the class libs (both on GNU/Linux).
19271 * report.cs (Timer): New class to get enhanced profiling. This
19272 whole class is "TIMER" conditional since it remarkably slows down
19275 * class.cs (MemberList): New class. This is an IList wrapper
19276 which we're now using instead of passing MemberInfo[]'s around to
19277 avoid copying this array unnecessarily.
19278 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
19279 (ICachingMemberFinder, IMemberContainer): New interface.
19280 (TypeManager.FilterWithClosure): If `criteria' is null, the name
19281 has already been checked, otherwise use it for the name comparision.
19282 (TypeManager.FindMembers): Renamed to RealMemberFinder and
19283 provided wrapper which tries to use ICachingMemberFinder.FindMembers
19284 if possible. Returns a MemberList, not a MemberInfo [].
19285 (TypeHandle): New class, implements IMemberContainer. We create
19286 one instance of this class per type, it contains a MemberCache
19287 which is used to do the member lookups.
19288 (MemberCache): New class. Each instance of this class contains
19289 all members of a type and a name-based hash table.
19290 (MemberCache.FindMembers): This is our new member lookup
19291 function. First, it looks up all members of the requested name in
19292 the hash table. Then, it walks this list and sorts out all
19293 applicable members and returns them.
19295 2002-08-13 Martin Baulig <martin@gnome.org>
19297 In addition to a nice code cleanup, this gives us a performance
19298 increase of about 1.4% on GNU/Linux - not much, but it's already
19299 half a second for the self-hosting MCS compilation.
19301 * typemanager.cs (IMemberFinder): New interface. It is used by
19302 TypeManager.FindMembers to call FindMembers on a TypeContainer,
19303 Enum, Delegate or Interface.
19304 (TypeManager.finder_to_member_finder): New PtrHashtable.
19305 (TypeManager.finder_to_container): Removed.
19306 (TypeManager.finder_to_delegate): Removed.
19307 (TypeManager.finder_to_interface): Removed.
19308 (TypeManager.finder_to_enum): Removed.
19310 * interface.cs (Interface): Implement IMemberFinder.
19312 * delegate.cs (Delegate): Implement IMemberFinder.
19314 * enum.cs (Enum): Implement IMemberFinder.
19316 * class.cs (TypeContainer): Implement IMemberFinder.
19318 2002-08-12 Martin Baulig <martin@gnome.org>
19320 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
19322 2002-08-12 Martin Baulig <martin@gnome.org>
19324 * ecore.cs (ITypeExpression): New interface for expressions which
19326 (TypeExpression): Renamed to TypeLookupExpression.
19327 (Expression.DoResolve): If we're doing a types-only lookup, the
19328 expression must implement the ITypeExpression interface and we
19329 call DoResolveType() on it.
19330 (SimpleName): Implement the new ITypeExpression interface.
19331 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
19332 hack, the situation that we're only looking up types can't happen
19333 anymore when this method is called. Moved the type lookup code to
19334 DoResolveType() and call it.
19335 (SimpleName.DoResolveType): This ITypeExpression interface method
19336 is now doing the types-only lookup.
19337 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
19338 (ResolveFlags): Added MaskExprClass.
19340 * expression.cs (MemberAccess): Implement the ITypeExpression
19342 (MemberAccess.DoResolve): Added support for a types-only lookup
19343 when we're called via ITypeExpression.DoResolveType().
19344 (ComposedCast): Implement the ITypeExpression interface.
19346 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
19347 Expression.Resolve() with ResolveFlags.Type instead.
19349 2002-08-12 Martin Baulig <martin@gnome.org>
19351 * interface.cs (Interface.Define): Apply attributes.
19353 * attribute.cs (Attribute.ApplyAttributes): Added support for
19354 interface attributes.
19356 2002-08-11 Martin Baulig <martin@gnome.org>
19358 * statement.cs (Block.Emit): Only check the "this" variable if we
19359 do not always throw an exception.
19361 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
19362 whether the property has a set accessor.
19364 2002-08-11 Martin Baulig <martin@gnome.org>
19366 Added control flow analysis support for structs.
19368 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
19369 with control flow analysis turned off.
19370 (IVariable): New interface.
19371 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
19372 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
19373 (FieldExpr.DoResolve): Resolve the instance expression with flow
19374 analysis turned off and do the definite assignment check after the
19375 resolving when we know what the expression will resolve to.
19377 * expression.cs (LocalVariableReference, ParameterReference):
19378 Implement the new IVariable interface, only call the flow analysis
19379 code if ec.DoFlowAnalysis is true.
19380 (This): Added constructor which takes a Block argument. Implement
19381 the new IVariable interface.
19382 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
19383 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
19384 This does the definite assignment checks for struct members.
19386 * class.cs (Constructor.Emit): If this is a non-static `struct'
19387 constructor which doesn't have any initializer, call
19388 Block.AddThisVariable() to tell the flow analysis code that all
19389 struct elements must be initialized before control returns from
19392 * statement.cs (MyStructInfo): New public class.
19393 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
19394 argument to this indexer. If non-zero, check an individual struct
19395 member, not the whole struct.
19396 (FlowBranching.CheckOutParameters): Check struct members.
19397 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
19398 overloaded versions of these methods which take an additional
19399 `int field_idx' argument to check struct members.
19400 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
19401 overloaded versions of these methods which take an additional
19402 `string field_name' argument to check struct member.s
19403 (VariableInfo): Implement the IVariable interface.
19404 (VariableInfo.StructInfo): New public property. Returns the
19405 MyStructInfo instance of the variable if it's a struct or null.
19406 (Block.AddThisVariable): New public method. This is called from
19407 Constructor.Emit() for non-static `struct' constructor which do
19408 not have any initializer. It creates a special variable for the
19409 "this" instance variable which will be checked by the flow
19410 analysis code to ensure that all of the struct's fields are
19411 initialized before control returns from the constructor.
19412 (UsageVector): Added support for struct members. If a
19413 variable/parameter is a struct with N members, we reserve a slot
19414 in the usage vector for each member. A struct is considered fully
19415 initialized if either the struct itself (slot 0) or all its
19416 members are initialized.
19418 2002-08-08 Martin Baulig <martin@gnome.org>
19420 * driver.cs (Driver.MainDriver): Only report an error CS5001
19421 if there were no compilation errors.
19423 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
19424 `UnsafeContext' property to determine whether the parent is in
19425 unsafe context rather than checking the parent's ModFlags:
19426 classes nested in an unsafe class are unsafe as well.
19428 2002-08-08 Martin Baulig <martin@gnome.org>
19430 * statement.cs (UsageVector.MergeChildren): Distinguish between
19431 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
19432 we return. Added test17() and test18() to test-154.cs.
19434 2002-08-08 Martin Baulig <martin@gnome.org>
19436 * typemanager.cs (TypeManager.FilterWithClosure): If we have
19437 Family access, make sure the invoking type isn't a subclass of the
19438 queried type (that'd be a CS1540).
19440 * ecore.cs (Expression.MemberLookup): Added overloaded version of
19441 this method which takes an additional `Type invocation_type'.
19443 * expression.cs (BaseAccess.DoResolve): Use the base type as
19444 invocation and query type.
19445 (MemberAccess.DoResolve): If the lookup failed and we're about to
19446 report a CS0122, try a lookup with the ec.ContainerType - if this
19447 succeeds, we must report a CS1540.
19449 2002-08-08 Martin Baulig <martin@gnome.org>
19451 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
19452 (MethodGroupExpr): Implement the IMemberExpr interface.
19454 * expression (MemberAccess.ResolveMemberAccess): No need to have
19455 any special code for MethodGroupExprs anymore, they're now
19458 2002-08-08 Martin Baulig <martin@gnome.org>
19460 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
19461 Family, FamANDAssem and FamORAssem permissions.
19462 (TypeManager.IsSubclassOrNestedChildOf): New public method.
19464 2002-08-08 Martin Baulig <martin@gnome.org>
19466 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
19467 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
19470 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
19472 * driver.cs: implemented /resource option to embed managed resources.
19474 2002-08-07 Martin Baulig <martin@gnome.org>
19476 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
19477 (FieldBase.HasFieldInitializer): New public property.
19478 (FieldBase.GetInitializerExpression): New public method. Resolves and
19479 returns the field initializer and makes sure it is only resolved once.
19480 (TypeContainer.EmitFieldInitializers): Call
19481 FieldBase.GetInitializerExpression to get the initializer, this ensures
19482 that it isn't resolved multiple times.
19484 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
19485 the resolving process (SimpleName/MemberLookup) that we're currently
19486 emitting a field initializer (which must not access any instance members,
19487 this is an error CS0236).
19489 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
19490 argument, if the `IsFieldInitializer' flag is set, we must report and
19491 error CS0236 and not an error CS0120.
19493 2002-08-07 Martin Baulig <martin@gnome.org>
19495 * ecore.cs (IMemberExpr): New public interface.
19496 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
19497 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
19498 if the expression is an IMemberExpr.
19500 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
19501 to be null, implicitly default to `this' if we're non-static in
19502 this case. Simplified the code a lot by using the new IMemberExpr
19503 interface. Also fixed bug #28176 here.
19505 2002-08-06 Martin Baulig <martin@gnome.org>
19507 * cs-parser.jay (SimpleLookup): Removed. We need to create
19508 ParameterReferences during semantic analysis so that we can do a
19509 type-only search when resolving Cast, TypeOf and SizeOf.
19510 (block): Pass the `current_local_parameters' to the Block's
19513 * class.cs (ConstructorInitializer): Added `Parameters parameters'
19514 argument to the constructor.
19515 (ConstructorInitializer.Resolve): Create a temporary implicit
19516 block with the parameters.
19518 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
19519 references here if we aren't doing a type-only search.
19521 * statement.cs (Block): Added constructor which takes a
19522 `Parameters parameters' argument.
19523 (Block.Parameters): New public property.
19525 * support.cs (InternalParameters.Parameters): Renamed `parameters'
19526 to `Parameters' and made it public readonly.
19528 2002-08-06 Martin Baulig <martin@gnome.org>
19530 * ecore.cs (Expression.Warning): Made this public as well.
19532 * report.cs (Report.Debug): Print the contents of collections.
19534 2002-08-06 Martin Baulig <martin@gnome.org>
19536 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
19537 used to tell Resolve() which kinds of expressions it may return.
19538 (Expression.Resolve): Added overloaded version of this method which
19539 takes a `ResolveFlags flags' argument. This can be used to tell
19540 Resolve() which kinds of expressions it may return. Reports a
19542 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
19543 ResolveFlags.SimpleName.
19544 (Expression.Error118): Added overloaded version of this method which
19545 takes a `ResolveFlags flags' argument. It uses the flags to determine
19546 which kinds of expressions are allowed.
19548 * expression.cs (Argument.ResolveMethodGroup): New public method.
19549 Resolves an argument, but allows a MethodGroup to be returned.
19550 This is used when invoking a delegate.
19552 * TODO: Updated a bit.
19554 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19556 Fixed compilation with csc.
19558 * ecore.cs: Expression.Error made public. Is this correct? Should
19559 Warning be made public too?
19561 * expression.cs: use ea.Location instead of ea.loc.
19562 [FIXME: Filed as bug #28607: MCS must report these errors.]
19564 2002-08-06 Martin Baulig <martin@gnome.org>
19566 * ecore.cs (Expression.loc): Moved the location here instead of
19567 duplicating it in all derived classes.
19568 (Expression.Location): New public property.
19569 (Expression.Error, Expression.Warning): Made them non-static and
19570 removed the location argument.
19571 (Expression.Warning): Added overloaded version which takes an
19572 `int level' argument.
19573 (Expression.Error118): Make this non-static and removed the
19574 expression and location arguments.
19575 (TypeExpr): Added location argument to the constructor.
19577 * expression.cs (StaticCallExpr): Added location argument to
19579 (Indirection, PointerArithmetic): Likewise.
19580 (CheckedExpr, UnCheckedExpr): Likewise.
19581 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
19582 (StringPtr): Likewise.
19585 2002-08-05 Martin Baulig <martin@gnome.org>
19587 * expression.cs (BaseAccess.DoResolve): Actually report errors.
19589 * assign.cs (Assign.DoResolve): Check whether the source
19590 expression is a value or variable.
19592 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
19593 while resolving the corresponding blocks.
19595 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
19596 an error, don't silently return null.
19598 * statement.cs (Block.AddVariable): Do the error reporting here
19599 and distinguish between CS0128 and CS0136.
19600 (Block.DoResolve): Report all unused labels (warning CS0164).
19601 (LabeledStatement): Pass the location to the constructor.
19602 (LabeledStatement.HasBeenReferenced): New property.
19603 (LabeledStatement.Resolve): Set it to true here.
19605 * statement.cs (Return.Emit): Return success even after reporting
19606 a type mismatch error (CS0126 or CS0127), this is what csc does and
19607 it avoids confusing the users with any consecutive errors.
19609 2002-08-05 Martin Baulig <martin@gnome.org>
19611 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
19613 * const.cs (Const.LookupConstantValue): Catch circular definitions.
19615 * expression.cs (MemberAccess.DoResolve): Silently return if an
19616 error has already been reported.
19618 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
19619 error has already been reported.
19621 2002-08-05 Martin Baulig <martin@gnome.org>
19623 * statement.cs (UsageVector): Only initialize the `parameters'
19624 vector if we actually have any "out" parameters.
19626 2002-08-05 Martin Baulig <martin@gnome.org>
19628 * expression.cs (Binary.ResolveOperator): When combining delegates,
19629 they must have the same type.
19631 2002-08-05 Martin Baulig <martin@gnome.org>
19633 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
19634 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
19635 work with the ms runtime and we also don't need it: if we're a
19636 PropertyBuilder and not in the `indexer_arguments' hash, then we
19637 are a property and not an indexer.
19639 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
19640 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
19641 since the latter one doesn't work with the ms runtime.
19643 2002-08-03 Martin Baulig <martin@gnome.org>
19645 Fixed bugs #27998 and #22735.
19647 * class.cs (Method.IsOperator): New public field.
19648 (Method.CheckBase): Report CS0111 if there's already a method
19649 with the same parameters in the current class. Report CS0508 when
19650 attempting to change the return type of an inherited method.
19651 (MethodData.Emit): Report CS0179 if a method doesn't have a body
19652 and it's not marked abstract or extern.
19653 (PropertyBase): New abstract base class for Property and Indexer.
19654 (PropertyBase.CheckBase): Moved here from Property and made it work
19656 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
19657 the same so we can reuse it there.
19658 (Property, Indexer): Derive from PropertyBase.
19659 (MethodSignature.inheritable_property_signature_filter): New delegate
19660 to find properties and indexers.
19662 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
19663 argument and improved error reporting.
19665 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
19666 EmptyReadOnlyParameters and made it a property.
19668 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
19669 version of this method which takes a `PropertyInfo indexer'.
19670 (TypeManager.RegisterIndexer): New method.
19672 * class.cs: Added myself as author of this file :-)
19674 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19676 * class.cs: fixed compilation on windoze.
19678 2002-08-03 Martin Baulig <martin@gnome.org>
19680 * interface.cs (Interface.GetInterfaceBases): Check whether all
19681 base interfaces are at least as accessible than the current one.
19683 * class.cs (TypeContainer.GetClassBases): Check whether base types
19684 are at least as accessible than the current type.
19685 (TypeContainer.AsAccessible): Implemented and made non-static.
19686 (MemberBase.CheckParameters): Report errors if the accessibility
19689 * delegate.cs (Delegate.Delegate): The default visibility is
19690 internal for top-level types and private for nested types.
19691 (Delegate.Define): Report errors if the accessibility checks fail.
19693 * enum.cs (Enum.Enum): The default visibility is internal for
19694 top-level types and private for nested types.
19695 (Enum.DefineType): Compute the correct visibility.
19697 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
19698 function which takes a `bool is_toplevel' instead of a TypeContainer.
19700 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
19703 2002-08-02 Martin Baulig <martin@gnome.org>
19705 * expression.cs (LocalVariableReferenc): Added constructor which
19706 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
19707 (LocalVariableReference.IsReadOnly): New property.
19708 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
19709 variable is readonly, use our own readonly flag to do this; you can
19710 use the new constructor to get a writable reference to a read-only
19713 * cs-parser.jay (foreach_statement, using_statement): Get a writable
19714 reference to the local variable.
19716 2002-08-01 Miguel de Icaza <miguel@ximian.com>
19718 * rootcontext.cs (ResolveCore): Also include System.Exception
19720 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
19721 we reach an EmptyStatement.
19723 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
19726 * expression.cs (Binary.ResolveOperator): Check error result in
19729 use brtrue/brfalse directly and avoid compares to null.
19731 2002-08-02 Martin Baulig <martin@gnome.org>
19733 * class.cs (TypeContainer.Define): Define all nested interfaces here.
19734 Fixes bug #28407, added test-155.cs.
19736 2002-08-01 Martin Baulig <martin@gnome.org>
19738 * class.cs (Event.EmitDefaultMethod): Make this work with static
19739 events. Fixes #28311, added verify-3.cs.
19741 2002-08-01 Martin Baulig <martin@gnome.org>
19743 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
19744 `is_disposable' fields.
19745 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
19746 `hm.is_disposable' if we're using the collection pattern.
19747 (Foreach.EmitCollectionForeach): Use the correct type for the
19748 enumerator's local variable, only emit the try/finally block if
19749 necessary (fixes #27713).
19751 2002-08-01 Martin Baulig <martin@gnome.org>
19753 * ecore.cs (Expression.report118): Renamed to Error118 and made
19756 * statement.cs (Throw.Resolve): Check whether the expression is of
19757 the correct type (CS0118) and whether the type derives from
19758 System.Exception (CS0155).
19759 (Catch.Resolve): New method. Do the type lookup here and check
19760 whether it derives from System.Exception (CS0155).
19761 (Catch.CatchType, Catch.IsGeneral): New public properties.
19763 * typemanager.cs (TypeManager.exception_type): Added.
19765 2002-07-31 Miguel de Icaza <miguel@ximian.com>
19767 * driver.cs: Updated About function.
19769 2002-07-31 Martin Baulig <martin@gnome.org>
19771 Implemented Control Flow Analysis.
19773 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
19774 (EmitContext.CurrentBranching): Added.
19775 (EmitContext.StartFlowBranching): Added.
19776 (EmitContext.EndFlowBranching): Added.
19777 (EmitContext.KillFlowBranching): Added.
19778 (EmitContext.IsVariableAssigned): Added.
19779 (EmitContext.SetVariableAssigned): Added.
19780 (EmitContext.IsParameterAssigned): Added.
19781 (EmitContext.SetParameterAssigned): Added.
19782 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
19783 Added control flow analysis stuff here.
19785 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
19786 resolve the expression as lvalue.
19787 (LocalVariableReference.DoResolve): Check whether the variable has
19788 already been assigned.
19789 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
19790 the parameter as assigned here.
19791 (ParameterReference.DoResolve): Check whether the parameter has already
19793 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
19794 expression as lvalue.
19796 * statement.cs (FlowBranching): New class for the flow analysis code.
19797 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
19798 (LabeledStatement.IsDefined): New public property.
19799 (LabeledStatement.AddUsageVector): New public method to tell flow
19800 analyis that the label may be reached via a forward jump.
19801 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
19803 (VariableInfo.Number): New public field. This is used by flow analysis
19804 to number all locals of a block.
19805 (Block.CountVariables): New public property. This is the number of
19806 local variables in this block (including the locals from all parent
19808 (Block.EmitMeta): Number all the variables.
19810 * statement.cs: Added flow analysis support to all classes.
19812 2002-07-31 Martin Baulig <martin@gnome.org>
19814 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
19815 To get debugging messages, compile mcs with /define:MCS_DEBUG and
19816 then use this argument.
19818 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
19820 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
19821 use this to specify /define options.
19823 2002-07-29 Martin Baulig <martin@gnome.org>
19825 * statement.cs (Fixed): Moved all code that does variable lookups
19826 and resolvings from Emit to Resolve.
19828 * statement.cs (For): Moved all code that does variable lookups
19829 and resolvings from Emit to Resolve.
19831 * statement.cs (Using): Moved all code that does variable lookups
19832 and resolvings from Emit to Resolve.
19834 2002-07-29 Martin Baulig <martin@gnome.org>
19836 * attribute.cs (Attribute.Resolve): Explicitly catch a
19837 System.NullReferenceException when creating the
19838 CustromAttributeBuilder and report a different warning message.
19840 2002-07-29 Martin Baulig <martin@gnome.org>
19842 * support.cs (ParameterData.ParameterName): Added method to
19843 get the name of a parameter.
19845 * typemanager.cs (TypeManager.IsValueType): New public method.
19847 2002-07-29 Martin Baulig <martin@gnome.org>
19849 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
19850 is a flag which specifies that it's either ref or out.
19851 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
19852 the out parameter to `out Parameter.Modifier mod', also set the
19853 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
19855 * support.cs (InternalParameters.ParameterModifier): Distinguish
19856 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
19857 Parameter.Modifier.ISBYREF flag if it's either ref or out.
19859 * expression.cs (Argument.GetParameterModifier): Distinguish
19860 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
19861 Parameter.Modifier.ISBYREF flag if it's either ref or out.
19863 2002-07-29 Martin Baulig <martin@gnome.org>
19865 * expression.cs (ParameterReference.ParameterReference): Added
19866 `Location loc' argument to the constructor.
19868 * cs-parser.jay: Pass location to ParameterReference.
19870 2002-07-28 Miguel de Icaza <miguel@ximian.com>
19872 * statement.cs (Try): Initialize the location.
19874 * cs-parser.jay: pass location to Try.
19876 * expression.cs (Unary.Reduce): Change the prototype to return
19877 whether a constant fold could be performed or not. The result is
19878 returned in an out parameters. In the case of Indirection and
19879 AddressOf, we want to perform the full tests.
19881 2002-07-26 Miguel de Icaza <miguel@ximian.com>
19883 * statement.cs (Statement.Emit): Flag dead code.
19885 2002-07-27 Andrew Birkett <andy@nobugs.org>
19887 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
19889 2002-07-27 Martin Baulig <martin@gnome.org>
19891 * class.cs (MethodData.Define): Put back call to
19892 TypeManager.AddMethod(), accidentally commented this out.
19894 * report.cs (Debug): New public method to print debugging information,
19895 this is `[Conditional ("DEBUG")]'.
19897 2002-07-26 Martin Baulig <martin@gnome.org>
19899 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
19900 (switch_statement): Push the current_block to the switch_stack and
19901 pop it again when we're done with the switch.
19902 (switch_section): The new block is a child of the current_block.
19903 Fixes bug #24007, added test-152.cs.
19905 2002-07-27 Martin Baulig <martin@gnome.org>
19907 * expression.cs (Invocation.EmitArguments): When calling a varargs
19908 function with only its fixed arguments, we need to pass an empty
19911 2002-07-27 Martin Baulig <martin@gnome.org>
19913 Mono 0.13 has been released.
19915 2002-07-25 Miguel de Icaza <miguel@ximian.com>
19917 * driver.cs: Rename --resource to --linkres, because that is what
19918 we do currently, we dont support --resource yet.
19920 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
19922 2002-07-25 Martin Baulig <martin@gnome.org>
19924 * class.cs (MethodData): New public class. This is a `method builder'
19925 class for a method or one accessor of a Property/Indexer/Event.
19926 (MethodData.GetMethodFlags): Moved here from MemberBase.
19927 (MethodData.ApplyAttributes): Likewise.
19928 (MethodData.ApplyObsoleteAttribute): Likewise.
19929 (MethodData.ApplyConditionalAttribute): Likewise.
19930 (MethodData.ApplyDllImportAttribute): Likewise.
19931 (MethodData.CheckAbstractAndExternal): Likewise.
19932 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
19933 (MethodData.Emit): Formerly known as Method.Emit().
19934 (MemberBase): Moved everything which was specific to a single
19935 accessor/method to MethodData.
19936 (Method): Create a new MethodData and call Define() and Emit() on it.
19937 (Property, Indexer, Event): Create a new MethodData objects for each
19938 accessor and call Define() and Emit() on them.
19940 2002-07-25 Martin Baulig <martin@gnome.org>
19942 Made MethodCore derive from MemberBase to reuse the code from there.
19943 MemberBase now also checks for attributes.
19945 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
19946 (MemberBase.GetMethodFlags): Moved here from class Method and marked
19948 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
19949 `CallingConventions cc' and `Attributes opt_attrs' arguments.
19950 (MemberBase.ApplyAttributes): New virtual method; applies the
19951 attributes to a method or accessor.
19952 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
19953 (MemberBase.ApplyConditionalAttribute): Likewise.
19954 (MemberBase.ApplyDllImportAttribute): Likewise.
19955 (MemberBase.CheckAbstractAndExternal): Likewise.
19956 (MethodCore.ParameterTypes): This is now a property instead of a
19957 method, it's initialized from DoDefineParameters().
19958 (MethodCore.ParameterInfo): Removed the set accessor.
19959 (MethodCore.DoDefineParameters): New protected virtual method to
19960 initialize ParameterTypes and ParameterInfo.
19961 (Method.GetReturnType): We can now simply return the MemberType.
19962 (Method.GetMethodFlags): Override the MemberBase version and add
19963 the conditional flags.
19964 (Method.CheckBase): Moved some code from Define() here, call
19965 DoDefineParameters() here.
19966 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
19967 here to avoid some larger code duplication.
19968 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
19969 ensure that abstract and external accessors don't declare a body.
19971 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
19972 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
19973 lookup in the attribute's parent classes, so we need to abort as soon
19974 as we found the first match.
19975 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
19976 the attribute has no arguments.
19978 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
19981 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19983 * cs-parser.jay: reverted previous patch.
19985 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19987 * cs-parser.jay: fixed bug #22119.
19989 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19991 * attribute.cs: fixed compilation. The error was:
19992 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
19993 be assigned to before control leaves the current method."
19994 [FIXME: Filed as bug #28186: MCS must report this error.]
19996 2002-07-25 Martin Baulig <martin@gnome.org>
19998 * attribute.cs (Attribute.Conditional_GetConditionName): New static
19999 method to pull the condition name ouf of a Conditional attribute.
20000 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
20001 the obsolete message and error flag out of an Obsolete attribute.
20003 * class.cs (Method.GetMethodFlags): New public method to get the
20004 TypeManager.MethodFlags for this method.
20005 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
20007 (Method.Define): Get and apply the Obsolete and Conditional attributes;
20008 if we're overriding a virtual function, set the new private variable
20009 `parent_method'; call the new TypeManager.AddMethod().
20011 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
20012 the MethodBuilder and the Method in a PtrHashtable.
20013 (TypeManager.builder_to_method): Added for this purpose.
20014 (TypeManager.MethodFlags): Added IsObsoleteError.
20015 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
20016 Obsolete and Conditional arguments in MethodBuilders. If we discover
20017 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
20018 the message from the attribute.
20020 2002-07-24 Martin Baulig <martin@gnome.org>
20022 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
20023 preprocessor directives, ensure that the argument to #define/#undef is
20024 exactly one identifier and that it's actually an identifier.
20026 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
20029 2002-07-24 Martin Baulig <martin@gnome.org>
20031 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
20032 initialize it to TypeManager.object_type in the constructor.
20033 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
20034 of the `hm.get_current' method if we're using the collection pattern.
20035 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
20036 for the explicit conversion to make it work when we're using the collection
20037 pattern and the `Current' property has a different return type than `object'.
20040 2002-07-24 Martin Baulig <martin@gnome.org>
20042 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
20043 does not match, but don't report any errors. This method is called in
20044 order for all methods in a MethodGroupExpr until a matching method is
20045 found, so we don't want to bail out if the first method doesn't match.
20046 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
20047 matches, report the 123. Fixes #28070.
20049 2002-07-24 Martin Baulig <martin@gnome.org>
20051 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
20052 TypeManager.TypeToCoreType() to the top of the method so the
20053 following equality checks will work. Fixes #28107.
20055 2002-07-24 Martin Baulig <martin@gnome.org>
20057 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
20058 operand is of type uint, and the other operand is of type sbyte,
20059 short or int, the operands are converted to type long." -
20060 Actually do what this comment already told us. Fixes bug #28106,
20063 2002-07-24 Martin Baulig <martin@gnome.org>
20065 * class.cs (MethodBase): New abstract class. This is now a base
20066 class for Property, Indexer and Event to avoid some code duplication
20067 in their Define() and DefineMethods() methods.
20068 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
20069 generic methods for Define() and DefineMethods().
20070 (FieldBase): Derive from MemberBase, not MemberCore.
20071 (Property): Derive from MemberBase, not MemberCore.
20072 (Property.DefineMethod): Moved all the code from this method to the
20073 new MethodBase.DefineAccessor(), just call it with appropriate
20075 (Property.Define): Call the new Property.DoDefine(), this does some
20076 sanity checks and we don't need to duplicate the code everywhere.
20077 (Event): Derive from MemberBase, not MemberCore.
20078 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
20079 accessors, this will also make them work with interface events.
20080 (Indexer): Derive from MemberBase, not MemberCore.
20081 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
20082 (Indexer.Define): Use the new MethodBase functions.
20084 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
20085 argument to the constructor.
20086 (Interface.FindMembers): Added support for interface events.
20087 (Interface.PopluateEvent): Implemented.
20089 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
20091 2002-07-22 Miguel de Icaza <miguel@ximian.com>
20093 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
20094 but this is required to check for a method name being the same as
20095 the containing class.
20099 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20101 * interface.cs: initialize variable.
20103 2002-07-23 Martin Baulig <martin@gnome.org>
20105 Implemented the IndexerName attribute in interfaces.
20107 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
20108 name if this is an explicit interface implementation.
20109 (Indexer.InterfaceIndexerName): New public variable. If we're
20110 implementing an interface indexer, this is the IndexerName in that
20111 interface. Otherwise, it's the IndexerName.
20112 (Indexer.DefineMethod): If we're implementing interface indexer,
20113 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
20114 and Pending.ImplementIndexer methods.
20115 (Indexer.Define): Also define the PropertyBuilder if we're
20116 implementing an interface indexer and this is neither an explicit
20117 interface implementation nor do the IndexerName match the one in
20120 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
20121 If a method is defined here, then we always need to create a proxy
20122 for it. This is used when implementing interface indexers.
20123 (Pending.IsInterfaceIndexer): New public method.
20124 (Pending.ImplementIndexer): New public method.
20125 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
20126 This is used when implementing interface indexers to define a proxy
20128 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
20129 define a proxy if necessary.
20131 * interface.cs (Interface.IndexerName): New public variable.
20132 (Interface.PopulateIndexer): Set the IndexerName.
20133 (Interface.DefineIndexers): New private method. Populate all the
20134 indexers and make sure their IndexerNames match.
20136 * typemanager.cs (IndexerPropertyName): Added support for interface
20139 2002-07-22 Martin Baulig <martin@gnome.org>
20141 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
20142 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
20143 ret if HasReturnLabel.
20144 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
20147 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
20148 and set the ec.LoopBeginTryCatchLevel.
20149 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
20150 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
20151 the current ec.TryCatchLevel, the branch goes out of an exception
20152 block. In this case, we need to use Leave and not Br.
20154 2002-07-22 Martin Baulig <martin@gnome.org>
20156 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
20157 block unless the block does not always return or it is contained in
20158 another try { ... } catch { ... } block. Fixes bug #26506.
20159 Added verify-1.cs to the test suite.
20161 2002-07-22 Martin Baulig <martin@gnome.org>
20163 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
20164 then we do not always return. Fixes bug #24985.
20166 2002-07-22 Martin Baulig <martin@gnome.org>
20168 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
20169 lookup on a per-class level; ie. walk up the class hierarchy until we
20170 found at least one applicable method, then choose the best among them.
20171 Fixes bug #24463 and test-29.cs.
20173 2002-07-22 Martin Baulig <martin@gnome.org>
20175 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
20176 return types of the methods. The return type is not part of the
20177 signature and we must not check it to make the `new' modifier work.
20178 Fixes bug #27999, also added test-147.cs.
20179 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
20181 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
20182 on the method's return type.
20184 2002-07-21 Martin Baulig <martin@gnome.org>
20186 * assign.cs: Make this work if the rightmost source is a constant and
20187 we need to do an implicit type conversion. Also adding a few more tests
20188 to test-38.cs which should have caught this.
20190 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
20191 target in the makefile for this. The makefile.gnu is primarily intended
20192 for end-users who don't want to debug the compiler.
20194 2002-07-21 Martin Baulig <martin@gnome.org>
20196 * assign.cs: Improved the Assign class so it can now handle embedded
20197 assignments (X = Y = Z = something). As a side-effect this'll now also
20198 consume less local variables. test-38.cs now passes with MCS, added
20199 a few new test cases to that test.
20201 2002-07-20 Martin Baulig <martin@gnome.org>
20203 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
20204 instructions. Fixes bug #27977, also added test-146.cs.
20206 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20208 * cs-tokenizer.cs: fixed getHex ().
20210 2002-07-19 Martin Baulig <martin@gnome.org>
20212 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
20213 not Type.GetType() to lookup the array type. This is needed when
20214 we're constructing an array of a user-defined type.
20215 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
20216 single-dimensional arrays, but also for single-dimensial arrays of
20219 2002-07-19 Martin Baulig <martin@gnome.org>
20221 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
20222 this function is called, it's not allowed to share LocalBuilders
20223 among ILGenerators.
20225 2002-07-19 Martin Baulig <martin@gnome.org>
20227 * expression.cs (Argument.Resolve): Report an error 118 when trying
20228 to pass a type as argument.
20230 2002-07-18 Martin Baulig <martin@gnome.org>
20232 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
20233 Conv_R_Un for the signed `long' type.
20235 2002-07-15 Miguel de Icaza <miguel@ximian.com>
20237 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
20238 `expr' for the temporary result, as that will fail if we do
20239 multiple resolves on the same expression.
20241 2002-07-05 Miguel de Icaza <miguel@ximian.com>
20243 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
20244 ec.TypeContainer for looking up aliases.
20246 * class.cs (TypeContainer): Remove LookupAlias from here.
20248 * decl.cs (DeclSpace); Move here.
20250 2002-07-01 Miguel de Icaza <miguel@ximian.com>
20252 * class.cs (FindMembers): Only call filter if the constructor
20253 bulider is not null.
20255 Also handle delegates in `NestedTypes' now. Now we will perform
20256 type lookups using the standard resolution process. This also
20259 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
20260 This uses Expressions (the limited kind that can be parsed by the
20261 tree) instead of strings.
20263 * expression.cs (ComposedCast.ToString): Implement, used to flag
20264 errors since now we have to render expressions.
20266 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
20269 * ecore.cs (SimpleName.ToString): ditto.
20271 * cs-parser.jay: Instead of using strings to assemble types, use
20272 Expressions to assemble the type (using SimpleName, ComposedCast,
20273 MemberAccess). This should fix the type lookups in declarations,
20274 because we were using a different code path for this.
20276 * statement.cs (Block.Resolve): Continue processing statements
20277 even when there is an error.
20279 2002-07-17 Miguel de Icaza <miguel@ximian.com>
20281 * class.cs (Event.Define): Also remove the `remove' method from
20282 the list of pending items.
20284 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
20285 generate more compact code.
20287 2002-07-17 Martin Baulig <martin@gnome.org>
20289 * const.cs (Const.LookupConstantValue): Add support for constant
20290 `unchecked' and `checked' expressions.
20291 Also adding test case test-140.cs for this.
20293 2002-07-17 Martin Baulig <martin@gnome.org>
20295 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
20296 check whether mi.ReturnType implements the IEnumerator interface; the
20297 `==' and the IsAssignableFrom() will fail in this situation.
20299 2002-07-16 Ravi Pratap <ravi@ximian.com>
20301 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
20304 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20306 * expression.cs: fixed bug #27811.
20308 2002-07-14 Miguel de Icaza <miguel@ximian.com>
20310 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
20311 Molaro: when we are a ref, the value already contains a pointer
20312 value, do not take the address of it.
20314 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
20315 * removed mb-parser.jay and mb-tokenizer.cs
20317 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20319 * expression.cs: check against the building corlib void type.
20321 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
20323 * ecore.cs: fix for valuetype static readonly fields: when
20324 initializing them, we need their address, not the address of a copy.
20326 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
20328 * typemanager.cs: register also enum_type in corlib.
20330 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20332 * class.cs: allow calling this (but not base) initializers in structs.
20334 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
20336 * ecore.cs: make sure we compare against the building base types
20339 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
20341 * typemanager.cs: fix TypeToCoreType() to handle void and object
20342 (corlib gets no more typerefs after this change).
20344 2002-07-12 Miguel de Icaza <miguel@ximian.com>
20346 * expression.cs (ArrayCreation.EmitArrayArguments): use
20347 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
20349 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
20350 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
20351 array indexes, the runtime actually forbids them.
20353 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
20354 for array arguments here.
20356 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
20357 instead of the default for ValueTypes.
20359 (New.DoEmit): Use IsValueType instead of
20360 IsSubclassOf (value_type)
20361 (New.DoResolve): ditto.
20362 (Invocation.EmitCall): ditto.
20364 * assign.cs (Assign): ditto.
20366 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
20367 Statements *are* currently doing part of their resolution during
20370 Expressions do always resolve during resolve, but statements are
20371 only required to propagate resolution to their children.
20373 2002-07-11 Miguel de Icaza <miguel@ximian.com>
20375 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
20377 (LoadAssembly): Do not add the dll if it is already specified
20379 (MainDriver): Add the System directory to the link path at the end,
20380 after all the other -L arguments.
20382 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
20383 wrong opcode for loading bytes and bools (ldelem.i1 instead of
20384 ldelem.u1) and using the opposite for sbytes.
20386 This fixes Digger, and we can finally run it.
20388 * driver.cs (UnixParseOption): Move the option parsing here.
20389 (CSCParseOption): Implement CSC-like parsing of options.
20391 We now support both modes of operation, the old Unix way, and the
20392 new CSC-like way. This should help those who wanted to make cross
20393 platform makefiles.
20395 The only thing broken is that /r:, /reference: and /lib: are not
20396 implemented, because I want to make those have the same semantics
20397 as the CSC compiler has, and kill once and for all the confussion
20398 around this. Will be doing this tomorrow.
20400 * statement.cs (Unsafe.Resolve): The state is checked during
20401 resolve, not emit, so we have to set the flags for IsUnsfe here.
20403 2002-07-10 Miguel de Icaza <miguel@ximian.com>
20405 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
20406 not catch the Error_ObjectRefRequired in SimpleName (as it is
20407 possible to have a class/instance variable name that later gets
20408 deambiguated), we have to check this here.
20410 2002-07-10 Ravi Pratap <ravi@ximian.com>
20412 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
20413 make static and put into Expression.
20415 (Event.Define): Register the private field of the event with the
20416 TypeManager so that GetFieldFromEvent can get at it.
20418 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
20419 keep track of the private field associated with an event which
20422 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
20425 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
20427 2002-07-10 Miguel de Icaza <miguel@ximian.com>
20429 * expression.cs (Binary.EmitBranchable): this routine emits the
20430 Binary expression in a branchable context. This basically means:
20431 we need to branch somewhere, not just get the value on the stack.
20433 This works together with Statement.EmitBoolExpression.
20435 * statement.cs (Statement.EmitBoolExpression): Use
20438 2002-07-09 Miguel de Icaza <miguel@ximian.com>
20440 * statement.cs (For): Reduce the number of jumps in loops.
20442 (For): Implement loop inversion for the For statement.
20444 (Break): We can be breaking out of a Try/Catch controlled section
20445 (foreach might have an implicit try/catch clause), so we need to
20446 use Leave instead of Br.
20448 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
20449 now). If the instace expression supports IMemoryLocation, we use
20450 the AddressOf method from the IMemoryLocation to extract the
20451 address instead of emitting the instance.
20453 This showed up with `This', as we were emitting the instance
20454 always (Emit) instead of the Address of This. Particularly
20455 interesting when This is a value type, as we dont want the Emit
20456 effect (which was to load the object).
20458 2002-07-08 Miguel de Icaza <miguel@ximian.com>
20460 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
20462 * statement.cs (Checked): Set the CheckedState during the resolve
20463 process too, as the ConvCast operations track the checked state on
20464 the resolve process, and not emit.
20466 * cs-parser.jay (namespace_member_declaration): Flag that we have
20467 found a declaration when we do. This is used to flag error 1529
20469 * driver.cs: Report ok when we display the help only.
20471 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
20473 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
20475 2002-07-04 Miguel de Icaza <miguel@ximian.com>
20477 * cs-tokenizer.cs (define): We also have to track locally the
20478 defines. AllDefines is just used for the Conditional Attribute,
20479 but we also need the local defines for the current source code.
20481 2002-07-03 Miguel de Icaza <miguel@ximian.com>
20483 * statement.cs (While, For, Do): These loops can exit through a
20484 Break statement, use this information to tell whether the
20485 statement is the last piece of code.
20487 (Break): Flag that we break.
20489 * codegen.cs (EmitContexts): New `Breaks' state variable.
20491 2002-07-03 Martin Baulig <martin@gnome.org>
20493 * class.cs (TypeContainer.MethodModifiersValid): Allow override
20494 modifiers in method declarations in structs. Otherwise, you won't
20495 be able to override things like Object.Equals().
20497 2002-07-02 Miguel de Icaza <miguel@ximian.com>
20499 * class.cs (Method, Property, Indexer): Do not allow the public
20500 modifier to be used in explicit interface implementations.
20502 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
20503 override modifiers in method declarations in structs
20505 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
20507 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
20508 integer or real overflow, report an error
20510 2002-07-02 Martin Baulig <martin@gnome.org>
20512 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
20513 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
20514 to tell the runtime about our newly created System.Object and
20515 System.ValueType types.
20517 2002-07-02 Miguel de Icaza <miguel@ximian.com>
20519 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
20520 struct instead of Ldarg/Starg.
20522 2002-07-02 Martin Baulig <martin@gnome.org>
20524 * expression.cs (Indirection.Indirection): Call
20525 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
20527 2002-07-02 Martin Baulig <martin@gnome.org>
20529 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
20530 ValueType, call TypeManager.TypeToCoreType() on it.
20531 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
20532 the OpCodes.Newarr argument.
20534 2002-07-02 Martin Baulig <martin@gnome.org>
20536 * expression.cs (Invocation.EmitCall): When compiling corlib,
20537 replace all calls to the system's System.Array type to calls to
20538 the newly created one.
20540 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
20541 System.Array methods.
20542 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
20543 from the system's System.Array type which must be replaced.
20545 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
20547 * typemanager.cs: load unverifiable_code_ctor so we can build
20548 corlib using the correct type. Avoid using GetTypeCode() with
20550 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
20551 TypeManager.object_type to allow building corlib.
20553 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
20555 * ecore.cs: handle System.Enum separately in LoadFromPtr().
20557 2002-07-01 Martin Baulig <martin@gnome.org>
20559 * class.cs: Make the last change actually work, we need to check
20560 whether `ifaces != null' to avoid a crash.
20562 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20564 * class.cs: when we build structs without fields that implement
20565 interfaces, we need to add the interfaces separately, since there is
20566 no API to both set the size and add the interfaces at type creation
20569 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20571 * expression.cs: the dimension arguments to the array constructors
20572 need to be converted if they are a long.
20574 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
20576 * class.cs: don't emit ldarg.0 if there is no parent constructor
20577 (fixes showstopper for corlib).
20579 2002-06-29 Martin Baulig <martin@gnome.org>
20581 MCS now compiles corlib on GNU/Linux :-)
20583 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
20584 ie. check for MethodImplOptions.InternalCall.
20586 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
20587 and TypeManager.attribute_type are null, so we must explicitly check
20588 whether parent is not null to find out whether it's an attribute type.
20589 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
20590 and SetBuilder, not only if the property is neither abstract nor external.
20591 This is necessary to set the MethodImplOptions on the accessor methods.
20592 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
20593 SetBuilder, see Property.Emit().
20595 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
20596 populate "System.Object", "System.ValueType" and "System.Attribute" since
20597 they've already been populated from BootCorlib_PopulateCoreTypes().
20599 2002-06-29 Martin Baulig <martin@gnome.org>
20601 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
20602 is the NullLiteral, we also need to make sure that target_type is not
20605 2002-06-29 Martin Baulig <martin@gnome.org>
20607 * rootcontext.cs (RootContext.ResolveCore): We must initialize
20608 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
20609 before calling BootstrapCorlib_ResolveDelegate ().
20611 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20613 * statement.cs: fixed build-breaker. All tests passed ok.
20615 2002-06-27 Martin Baulig <martin@gnome.org>
20617 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
20618 for System.Decimal when compiling corlib.
20620 2002-06-27 Martin Baulig <martin@gnome.org>
20622 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
20623 switch blocks which contain nothing but a default clause.
20625 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
20627 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
20629 2002-06-27 Martin Baulig <martin@gnome.org>
20631 * ecore.cs (PropertyExpr.PropertyExpr): Call
20632 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
20634 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
20635 is already a TypeBuilder.
20637 2002-06-27 Martin Baulig <martin@gnome.org>
20639 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
20640 `target_type == TypeManager.array_type', not IsAssignableFrom() in
20641 the "from an array-type to System.Array" case. This makes it work
20642 when compiling corlib.
20644 2002-06-27 Martin Baulig <martin@gnome.org>
20646 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
20647 non-static PropertyExpr, set its InstanceExpression. This makes
20648 the `ICollection.Count' property work in System/Array.cs.
20650 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
20652 * driver.cs: Made error handling more consistent. Errors now
20653 tracked by Report class, so many methods which used to return int
20654 now return void. Main() now prints success/failure and
20655 errors/warnings message.
20657 Renamed '--probe' compiler argument to '--expect-error'. Removed
20658 the magic number return values (123 and 124). Now, if the
20659 expected error occurs, the compiler exits with success (exit value
20660 0). If the compilation completes without seeing that particular
20661 error, the compiler exits with failure (exit value 1). The
20662 makefile in mcs/errors has been changed to handle the new behaviour.
20664 * report.cs: Made 'expected error' number a property and renamed
20665 it from 'Probe' to 'ExpectedError'.
20667 * genericparser.cs: Removed error handling support, since it is
20668 now all done by Report class.
20670 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
20671 class, so parse() no longer returns an int.
20673 * namespace.cs: Use Report.Error instead of GenericParser.error
20675 2002-06-22 Miguel de Icaza <miguel@ximian.com>
20677 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
20678 TypeContainer.AddOperator): At the front of the list put the
20679 explicit implementations, so they get resolved/defined first.
20681 2002-06-21 Miguel de Icaza <miguel@ximian.com>
20683 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
20684 interface type is implemented by this TypeContainer. Used during
20685 explicit interface implementation.
20687 (Property.Define, Indexer.Define, Method.Define): Validate that
20688 the given interface in the explicit implementation is one of the
20689 base classes for the containing type.
20691 Also if we are explicitly implementing an interface, but there is
20692 no match in the pending implementation table, report an error.
20694 (Property.Define): Only define the property if we are
20695 not explicitly implementing a property from an interface. Use the
20696 correct name also for those properties (the same CSC uses,
20697 although that is really not needed).
20699 (Property.Emit): Do not emit attributes for explicitly implemented
20700 properties, as there is no TypeBuilder.
20702 (Indexer.Emit): ditto.
20704 Hiding then means that we do not really *implement* a pending
20705 implementation, which makes code fail.
20707 2002-06-22 Martin Baulig <martin@gnome.org>
20709 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
20710 the return value of Object.GetType(). [FIXME: we need to do this whenever
20711 we get a type back from the reflection library].
20713 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
20715 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
20717 2002-06-20 Miguel de Icaza <miguel@ximian.com>
20719 * attribute.cs: Return null if we can not look up the type.
20721 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
20722 the interface types found.
20724 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
20725 interface types found.
20727 * typemanager.cs (GetInterfaces): Make this routine returns alll
20728 the interfaces and work around the lame differences between
20729 System.Type and System.Reflection.Emit.TypeBuilder in the results
20730 result for GetInterfaces.
20732 (ExpandInterfaces): Given an array of interface types, expand and
20733 eliminate repeated ocurrences of an interface. This expands in
20734 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
20737 2002-06-21 Martin Baulig <martin@gnome.org>
20739 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
20742 2002-06-21 Martin Baulig <martin@gnome.org>
20744 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
20745 and called with one of the core types, return the corresponding typebuilder for
20748 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
20751 2002-06-21 Martin Baulig <martin@gnome.org>
20753 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
20754 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
20755 (Expression.ConvertReferenceExplicit): Likewise.
20757 * expression.cs (ElementAccess.DoResolve): Likewise.
20758 (ElementAccess.DoResolveLValue): Likewise.
20760 2002-06-10 Martin Baulig <martin@gnome.org>
20762 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
20763 add the "value" parameter to the parameter list.
20765 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
20768 2002-06-19 Miguel de Icaza <miguel@ximian.com>
20770 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
20771 the argument to an int, uint, long or ulong, per the spec. Also
20772 catch negative constants in array creation.
20774 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
20776 * class.cs: do not allow the same interface to appear twice in
20777 the definition list.
20779 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
20781 * ecore.cs: don't use ldlen with System.Array.
20783 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
20785 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
20787 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
20789 * modifiers.cs: produce correct field attributes for protected
20790 internal. Easy fix so miguel can work on ther harder stuff:-)
20792 2002-06-18 Miguel de Icaza <miguel@ximian.com>
20794 * pending.cs: New file. Move the code from class.cs here.
20795 Support clearning the pending flag for all methods (when not doing
20796 explicit interface implementation).
20798 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
20800 * rootcontext.cs: added a couple more types needed to bootstrap.
20802 2002-06-17 Miguel de Icaza <miguel@ximian.com>
20804 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
20805 constructor in the type, instead of any constructor in the type
20806 hierarchy. Thanks to Paolo for finding this bug (it showed up as
20807 a bug in the Mono runtime when applying the params attribute).
20809 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
20810 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
20812 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
20814 * expression.cs (Unary.ResolveOperator): Use TypeManager
20815 to resolve the type.
20817 2002-06-13 Ravi Pratap <ravi@ximian.com>
20819 * cs-parser.jay (enum_member_declaration): Pass in the attributes
20822 * enum.cs (AddEnumMember): Add support to store the attributes associated
20823 with each member too.
20825 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
20826 field builders too - this takes care of the enum member case.
20828 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
20830 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
20831 address-of operator on both value types and pointers.
20833 2002-06-10 Martin Baulig <martin@gnome.org>
20835 * interface.cs (Interface.PopulateIndexer): Add the indexer's
20836 PropertyBuilder to the `property_builders' list.
20838 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
20839 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
20840 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
20841 find any indexers which are inherited from an interface.
20843 2002-06-09 Martin Baulig <martin@gnome.org>
20845 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
20846 the same type as the constant if necessary. There's also a test-130.cs
20849 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
20851 * typemanager.cs (TypeManager.ChangeType): Previously known as
20852 Enum.ChangeEnumType().
20854 2002-06-09 Martin Baulig <martin@gnome.org>
20856 * expression.cs (Cast.TryReduce): Added support for consts.
20858 2002-06-08 Ravi Pratap <ravi@ximian.com>
20860 * class.cs (Accessor): Hold attributes information so we can pass
20863 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
20864 Modify to pass in attributes attached to the methods.
20866 (add_accessor_declaration, remove_accessor_declaration): Ditto.
20868 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
20869 to handle the Accessor kind :-)
20871 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
20873 2002-06-08 Martin Baulig <martin@gnome.org>
20875 * expression.cs (Unary.TryReduceNegative): Added support for
20878 2002-06-08 Martin Baulig <martin@gnome.org>
20880 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
20881 name can't be found in the `defined_names' - the caller will do a
20882 MemberLookup in this case and thus find methods in System.Enum
20883 such as Enum.IsDefined().
20885 2002-06-08 Martin Baulig <martin@gnome.org>
20887 * enum.cs (Enum.ChangeEnumType): This is a custom version of
20888 Convert.ChangeType() which works with TypeBuilder created types.
20889 (Enum.LookupEnumValue, Enum.Define): Use it here.
20891 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
20892 `TypeBuilder.BaseType != null' check.
20893 (TypeContainer.FindMembers): Only lookup parent members if we
20894 actually have a parent.
20895 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
20896 (ConstructorInitializer.Resolve): Likewise.
20898 * interface.cs (Interface.FindMembers): Added
20899 `TypeBuilder.BaseType != null' check.
20901 * rootcontext.cs (RootContext.ResolveCore): Added
20902 "System.Runtime.CompilerServices.IndexerNameAttribute" to
20903 classes_second_stage.
20905 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
20906 debug_type and trace_type when compiling with --nostdlib.
20908 2002-06-07 Martin Baulig <martin@gnome.org>
20910 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
20911 (AddField): Set it to true when adding a non-static field.
20912 (DefineType): Use `have_nonstatic_fields' to find out whether we
20913 have non-static fields, not `Fields != null'.
20915 2002-06-02 Miguel de Icaza <miguel@ximian.com>
20917 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
20918 dereferencing a null on the static-field code path)
20920 2002-05-30 Martin Baulig <martin@gnome.org>
20922 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
20923 to take command line arguments. Use reflection to call the new
20924 custom `Initialize' function on the symbol writer and pass it the
20925 command line arguments.
20927 * driver.cs (--debug-args): New command line argument to pass command
20928 line arguments to the symbol writer.
20930 2002-05-28 Miguel de Icaza <miguel@ximian.com>
20932 * assign.cs (DoResolve): Forgot to do the implicit conversion to
20933 the target type for indexers and properties. Thanks to Joe for
20936 2002-05-27 Miguel de Icaza <miguel@ximian.com>
20938 * typemanager.cs (MethodFlags): returns the method flags
20939 (Obsolete/ShouldIgnore) that control warning emission and whether
20940 the invocation should be made, or ignored.
20942 * expression.cs (Invocation.Emit): Remove previous hack, we should
20943 not do this on matching a base type, we should do this based on an attribute
20945 Only emit calls to System.Diagnostics.Debug and
20946 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
20947 on the command line.
20949 * rootcontext.cs: Global settings for tracing and debugging.
20951 * cs-tokenizer.cs (define): New utility function to track
20952 defines. Set the global settings for TRACE and DEBUG if found.
20954 2002-05-25 Ravi Pratap <ravi@ximian.com>
20956 * interface.cs (Populate*): Pass in the TypeContainer as well as
20957 the DeclSpace as parameters so that we can create EmitContexts and
20958 then use that to apply attributes etc.
20960 (PopulateMethod, PopulateEvent, PopulateProperty)
20961 (PopulateIndexer): Apply attributes everywhere.
20963 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
20966 (ApplyAttributes): Update accordingly.
20968 We now apply interface attributes for all members too.
20970 2002-05-26 Miguel de Icaza <miguel@ximian.com>
20972 * class.cs (Indexer.Define); Correctly check if we are explicit
20973 implementation (instead of checking the Name for a ".", we
20974 directly look up if the InterfaceType was specified).
20976 Delay the creation of the PropertyBuilder.
20978 Only create the PropertyBuilder if we are not an explicit
20979 interface implementation. This means that explicit interface
20980 implementation members do not participate in regular function
20981 lookups, and hence fixes another major ambiguity problem in
20982 overload resolution (that was the visible effect).
20984 (DefineMethod): Return whether we are doing an interface
20987 * typemanager.cs: Temporary hack until we get attributes in
20988 interfaces (Ravi is working on that) and we get IndexerName
20989 support in interfaces.
20991 * interface.cs: Register the indexers as properties.
20993 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
20994 warning, I have verified that this is a bug in the .NET runtime
20995 (JavaScript suffers of the same problem).
20997 * typemanager.cs (MemberLookup): When looking up members for
20998 interfaces, the parent of an interface is the implicit
20999 System.Object (so we succeed in searches of Object methods in an
21000 interface method invocation. Example: IEnumerable x; x.ToString
21003 2002-05-25 Miguel de Icaza <miguel@ximian.com>
21005 * class.cs (Event): Events should also register if they do
21006 implement the methods that an interface requires.
21008 * typemanager.cs (MemberLookup); use the new GetInterfaces
21011 (GetInterfaces): The code used to lookup interfaces for a type is
21012 used in more than one place, factor it here.
21014 * driver.cs: Track the errors at the bottom of the file, we kept
21017 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
21018 instance if the method we are calling is static!
21020 2002-05-24 Miguel de Icaza <miguel@ximian.com>
21022 * attribute.cs (ApplyAttributes): Make this function filter out
21023 the IndexerName attribute (as that attribute in reality is never
21024 applied) and return the string constant for the IndexerName
21027 * class.cs (TypeContainer.Emit): Validate that all the indexers
21028 have the same IndexerName attribute, and if so, set the
21029 DefaultName attribute on the class.
21031 * typemanager.cs: The return value might contain other stuff (not
21032 only methods). For instance, consider a method with an "Item"
21033 property and an Item method.
21035 * class.cs: If there is a problem with the parameter types,
21038 2002-05-24 Ravi Pratap <ravi@ximian.com>
21040 * ecore.cs (ImplicitConversionExists): Wrapper function which also
21041 looks at user defined conversion after making a call to
21042 StandardConversionExists - we need this for overload resolution.
21044 * expression.cs : Update accordingly the various method calls.
21046 This fixes 2 bugs filed against implicit user defined conversions
21048 2002-05-22 Miguel de Icaza <miguel@ximian.com>
21050 * statement.cs: Track the result of the assignment.
21052 2002-05-21 Miguel de Icaza <miguel@ximian.com>
21054 * expression.cs (MemberAccess): Improved error reporting for
21055 inaccessible members.
21057 2002-05-22 Martin Baulig <martin@gnome.org>
21059 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
21060 itself with debugging support.
21062 2002-05-22 Martin Baulig <martin@gnome.org>
21064 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
21065 Removed, this isn't needed anymore.
21067 2002-05-20 Martin Baulig <martin@gnome.org>
21069 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
21070 be underlying type for an enum.
21072 2002-05-20 Miguel de Icaza <miguel@ximian.com>
21074 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
21075 that splits out the loading of just the core types.
21077 * rootcontext.cs (ResolveCore): Split the struct resolution in
21078 two, so we can load the enumeration underlying types before any
21081 * expression.cs (Is): Bandaid until we fix properly Switch (see
21082 bug #24985 for details).
21084 * typemanager.cs (ImplementsInterface): The hashtable will contain
21085 a null if there are no interfaces implemented.
21087 2002-05-18 Miguel de Icaza <miguel@ximian.com>
21089 * cs-parser.jay (indexer_declarator): It is fine to have array
21092 2002-05-17 Miguel de Icaza <miguel@ximian.com>
21094 * typemanager.cs: (RegisterBuilder): New function used to register
21095 TypeBuilders that implement interfaces. Since
21096 TypeBuilder.GetInterfaces (as usual) does not work with lame
21098 (AddUserType): register interfaces.
21100 (ImplementsInterface): Use the builder_to_ifaces hash if we are
21101 dealing with TypeBuilder. Also, arrays are showing up as
21102 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
21103 methods can not be invoked on them!
21105 * ecore.cs (ExplicitReferenceConversionExists): Made public.
21106 (ImplicitReferenceConversionExists): Split out from
21107 StandardConversionExists.
21109 * expression.cs (As): We were only implementing one of the three
21110 cases for the as operator. We now implement them all.
21111 (Is): Implement the various other cases for Is as well.
21113 * typemanager.cs (CACHE): New define used to control if we want or
21114 not the FindMembers cache. Seems to have a negative impact on
21115 performance currently
21117 (MemberLookup): Nested types have full acess to
21118 enclosing type members
21120 Remove code that coped with instance/static returns for events, we
21121 now catch this in RealFindMembers.
21123 (RealFindMembers): only perform static lookup if the instance
21124 lookup did not return a type or an event.
21126 2002-05-17 Miguel de Icaza <miguel@ximian.com>
21128 * assign.cs (CompoundAssign): We pass more semantic information
21129 now to Compound Assignments than we did before: now we have all
21130 the information at hand, and now we resolve the target *before* we
21131 do the expression expansion, which allows the "CacheValue" method
21132 to have the effect we intended (before, a [x] += 1 would generate
21133 two differen ArrayAccess expressions from the ElementAccess,
21134 during the resolution process).
21136 (CompoundAssign.DoResolve): Resolve target and original_source here.
21138 2002-05-16 Miguel de Icaza <miguel@ximian.com>
21140 * expression.cs (ArrayAccess): dropped debugging information.
21142 * typemanager.cs: Small bug fix: I was always returning i_members,
21143 instead of one of i_members or s_members (depending on which had
21146 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
21147 method is invoked before any code generation takes place, and it
21148 is a mechanism to inform that the expression will be invoked more
21149 than once, and that the method should use temporary values to
21150 avoid having side effects
21152 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
21154 * ecore.cs (Expression.CacheTemporaries): Provide empty default
21157 * expression.cs (Indirection, ArrayAccess): Add support for
21158 CacheTemporaries in these two bad boys.
21160 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
21161 ldobj or ldind_ref.
21162 (StoreFromPtr): Handle stobj as well.
21164 * expression.cs (UnaryMutator): Share more code.
21166 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
21167 down: I was not tracking the Filter function as well, which
21168 was affecting the results of the cache.
21170 2002-05-15 Miguel de Icaza <miguel@ximian.com>
21172 * attribute.cs: Remove the hack to handle the CharSet property on
21175 2002-05-14 Miguel de Icaza <miguel@ximian.com>
21177 * attribute.cs (DoResolve): More uglyness, we now only try to
21178 resolve the attribute partially, to extract the CharSet
21179 information (only if we are a StructLayout attribute). Otherwise
21181 (GetExtraTypeInfo): Add some code to conditionally kill in the
21182 future this. I am more and more convinced that the .NET
21183 framework has special code to handle the attribute setting on
21186 * expression.cs (IsParamsMethodApplicable): Revert my previous
21187 foreach change here, it was wrong.
21189 2002-05-13 Miguel de Icaza <miguel@ximian.com>
21191 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
21192 (pp_expr): do not abort on unknown input, just return.
21193 (eval): abort if there are pending chars.
21195 * attribute.cs (Attribute.Resolve): Positional parameters are
21196 optional. Deal with that case.
21198 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
21199 the Ansi/Unicode/Auto information for the type.
21201 (TypeContainer.DefineType): instantiate the EmitContext here, as
21202 we will be using it during the type definition (to resolve
21203 attributes) and during the emit phase.
21205 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
21206 to pull type information out of the attributes
21208 (Attribute.Resolve): track the constructor builder, and allow for
21209 multiple invocations (structs and classes will use this).
21211 * ecore.cs (MemberLookupFinal): new version with all the
21212 parameters customizable.
21214 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
21215 constructors. Return if the result value is null (as the error
21216 would have been flagged already by MemberLookupFinal)
21218 Do not allow instances of abstract classes or interfaces to be
21221 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
21222 We have to compare the assembly property here when dealing with
21223 FamANDAssem and Assembly access modifiers, because we might be
21224 creating an assembly from *modules* (that means that we are not
21225 getting TypeBuilders for types defined in other modules that are
21226 part of this assembly).
21228 (Method.Emit): If the method is marked abstract and has a body,
21231 (TypeContainer.DefineMembers): If both the defined member and the
21232 parent name match are methods, then do not emit any warnings: let
21233 the Method.Define routine take care of flagging warnings. But if
21234 there is a mismatch (method overrides something else, or method is
21235 overriwritten by something, then emit warning).
21237 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
21238 set to null, this means `do not check for the return type on the
21241 (Method.Define): set the return type for the method signature to
21242 null, so that we get methods with the same name and parameters and
21243 different return types. This is used to flag warning 114 (you are
21244 hiding a method, and you probably want to use the new/override
21247 * typemanager.cs (MemberLookup): Implemented proper access
21248 control, closing a long standing set of bug reports. The problem
21249 was that the Framework only has two bits: Public and NonPublic,
21250 and NonPublic includes private and protected methods, but we need
21251 to enforce the FamANDAssem, FamOrAssem and Family.
21253 2002-05-11 Miguel de Icaza <miguel@ximian.com>
21255 * statement.cs (GotoCase): Return true: Ammounts to giving up
21256 knowledge on whether we return or not, and letting the other case
21257 be responsible for it.
21259 2002-05-10 Miguel de Icaza <miguel@ximian.com>
21261 * driver.cs: Do not load directories for each file processed, only
21262 do it if there is a pattern.
21264 * ecore.cs: Report readonly assigns here as well, as we might have
21265 been resolved only by MemberAccess.
21267 (SimpleName.SimpleNameResolve): Also be useful for LValue
21268 resolution. We need this to propagate assign to local readonly variables
21270 * typemanager.cs: Use a ptrhashtable for the criteria, because we
21271 do not want to reuse potential criteria memory.
21273 * class.cs (MyEventBuilder): Set reflected_type;
21275 * ecore.cs (Constantify): Added support for constifying bools.
21277 (RootContext.LookupType): Added a cache for values looked up in
21278 the declaration space.
21280 * typemanager.cs (FindMembers): Now is a front-end to
21281 RealFindMembers, and provides a two-level hashtable-based cache to
21284 15% performance improvement: from 22.5 to 19.2 seconds.
21286 * expression.cs (IsParamsMethodApplicable): use foreach.
21287 (Invocation.DoResolve): ditto.
21288 (New.DoResolve): ditto.
21289 (ArrayCreation.DoResolve): ditto.
21291 * ecore.cs (FindMostEncompassingType): use foreach.
21293 * delegate.cs (NewDelegate.DoResolve): Use foreach
21295 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
21296 (RemoveMethods): use foreach.
21298 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
21299 nested foreach statements instead of for, and also break out of
21300 the inner loop once a match is found.
21302 (Invocation.OverloadResolve): Use foreach, simplify the code.
21304 2002-05-08 Miguel de Icaza <miguel@ximian.com>
21306 * cfold.cs (BinaryFold): During an enumeration evaluation context,
21307 we actually unwrap the expression to allow for extra information
21310 * expression.cs: Use Shr_Un on unsigned operations.
21312 2002-05-08 Ravi Pratap <ravi@ximian.com>
21314 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
21315 applicable operators was not being considered correctly. This closes
21316 the bug Miguel reported.
21318 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
21320 * attribute.cs: check that the type derives from System.Attribute
21321 and report the correct error in that case (moved the duplicate code to
21322 its own method, too).
21324 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
21326 * attribute.cs: lookup attribute type name as the spec says: first the
21327 bare attribute name and then name + "Attribute" (nant compiles with
21328 mcs after this fix).
21330 2002-05-07 Miguel de Icaza <miguel@ximian.com>
21332 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
21333 Because of the way we parse things, we should try to see if a
21334 UIntConstant can fit in an integer.
21336 2002-05-07 Ravi Pratap <ravi@ximian.com>
21338 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
21339 when we are in an explicit context.
21341 (ConvertReferenceExplicit): When converting from Iface type S to Class
21342 T make sure the rules are implemented as an OR.
21344 * parameter.cs (ParameterType): Make it a property for now although the
21345 purpose really isn't anything immediate.
21347 * expression.cs (Is*Applicable): Do better checking on the parameter type
21348 of a ref/out parameter. The ones from the system assemblies are already
21349 marked with the correct type so we don't need to do any correction.
21351 * ecore.cs (StandardConversionExists): Conversion from Interface types to
21352 the object type is standard too so include that.
21354 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21356 * ecore.cs (StandardConversionExists): Augment with missing code:
21357 deal with IntConstant, LongConstants and Enumerations.
21359 * assign.cs: Report the error, instead of failing silently
21361 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
21362 typecontainer that they are declared, because the
21363 typecontainer/namespace will have the list of using clauses that
21364 need to be applied.
21366 Assembly Attributes were escaping the normal registration
21369 (EmitCode): Apply attributes within an EmitContext that represents
21370 the container they were declared on.
21372 * cs-parser.jay: Track bases for structs. How did I get this wrong?
21374 2002-05-06 Ravi Pratap <ravi@ximian.com>
21376 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
21377 Revamp completely - make much cleaner as we now operate only
21380 (FindMostSpecificSource, FindMostSpecificTarget): New methods
21381 to implement the logic detailed in the spec more correctly.
21383 (UserDefinedConversion): Update accordingly.
21385 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21387 * statement.cs: Return flow analysis information up.
21389 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
21392 (token): Do not consume an extra character before calling
21395 2002-05-06 Piers Haken <piersh@friskit.com>
21397 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
21399 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21401 * class.cs (Constructor.Emit): Set the IsStatic flag in the
21402 EmitContext during the instance constructor initializer
21403 resolution, to stop access to instance variables.
21405 This is mandated by the spec, last paragraph of the `constructor
21406 initializers' section.
21408 2002-05-05 Miguel de Icaza <miguel@ximian.com>
21410 * cs-parser.jay, class.cs (Accessor): new class used to represent
21411 an accessor (get or set). In the past we used `null' to represent
21412 a missing accessor. But this is ambiguous because there was no
21413 way to tell in abstract indexers/properties if one of them was
21416 Now there is a way of addressing that.
21418 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
21419 instead of FindMembers.
21421 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
21422 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
21424 * attribute.cs: Treat indexers and properties as the same in terms
21425 of applying attributes
21427 * ecore.cs (FindMostEncompassedType): Use statically initialized
21428 EmptyExpressions()s like we do elsewhere to avoid creating useless
21429 objects (and we take this out of the tight loop).
21431 (GetConversionOperators): Move the code to extract the actual
21432 operators to a separate routine to clean things up.
21434 2002-05-04 Miguel de Icaza <miguel@ximian.com>
21436 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
21437 events are always registered FieldBuilders.
21439 * class.cs (FieldBase): New class shared by Fields
21441 * delegate.cs: If we are a toplevel delegate, use our full name.
21442 If we are a nested delegate, then only use our tail name.
21444 2002-05-02 Ravi Pratap <ravi@ximian.com>
21446 * expression.cs (IsApplicable): Ensure that we add the "&" to
21447 ref/out types before comparing it with the type of the argument.
21449 (IsParamsMethodApplicable): Ditto.
21451 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
21454 * delegate.cs : Handle the case when we have more than one applicable
21455 method. Flag an error only when we finish checking all.
21457 2002-05-02 Miguel de Icaza <miguel@ximian.com>
21459 * expression.cs: Add support for boolean static initializers.
21461 2002-05-01 Miguel de Icaza <miguel@ximian.com>
21463 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
21465 * parameter.cs (ComputeParameterTypes,
21466 ComputeAndDefineParameterTypes): Better error handling: now we
21467 clear the `types' cache if we fail during any of the type lookups.
21468 We also return the status code correctly to our caller
21470 * delegate.cs: If we fail to define a delegate, abort the extra
21473 * expression.cs (Binary.ResolveOperator): for
21474 operator==(object,object) and operator !=(object, object) we also
21475 have to verify that there is an implicit conversion from one to
21478 (ArrayAccess.DoResolve): Array Access can operate on
21481 2002-04-30 Miguel de Icaza <miguel@ximian.com>
21483 * assign.cs (CompoundAssign): A new class used as a "flag" that
21484 the assignment actually is happening as part of a compound
21485 assignment operator.
21487 During compound assignment, a few new rules exist to enable things
21494 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
21495 to the type of x) if y is implicitly convertible to the type of x,
21496 and the operator is a builtin operator and the return type of the
21497 operator is explicitly convertible to the type of x.
21499 * rootcontext.cs: Reset warning level to 2. 4 catches various
21500 "interesting" features in mcs, we must clean this up at some
21501 point, but currently am trying to kill other bugs ;-)
21503 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
21504 in container classes as well.
21506 * expression.cs (Binary.ResolveOperator): Handle string case
21507 before anything else (as operator overloading does emit an error
21508 before doing anything else).
21510 This code could go away when we move to a table driven model, but
21511 i could not come up with a good plan last night.
21513 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
21515 * typemanager.cs (CSharpName): reimplementation using regex.
21516 * class.cs: added null check for fields in Emit
21517 * rootcontext.cs: set warninglevel to 4
21519 2002-04-29 Miguel de Icaza <miguel@ximian.com>
21521 * typemanager.cs (CSharpName): reimplemented with Lupus
21524 2002-04-28 Miguel de Icaza <miguel@ximian.com>
21526 * statement.cs (If): correclty implement Resolve, because we were
21527 not catching sem errors in there. The same process is needed
21529 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
21532 (Statement.Warning_DeadCodeFound): Factorize code.
21533 (While): Report dead code here too.
21535 (Statement): Added Resolve virtual method to allow
21536 for resolution split from the emit code.
21538 2002-04-26 Miguel de Icaza <miguel@ximian.com>
21540 * statement.cs (EmitBoolExpression): No longer try to resolve the
21542 (MakeBoolean): New utility function that resolve, implicitly
21543 converts to boolean and tags the expression.
21546 (If, Do): Implement dead code elimination.
21547 (While): Implement loop inversion
21549 (Do, While, For, If): Resolve the expression prior to calling our
21552 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
21555 - added method Report28 (warning: program has more than one entry point)
21556 - added method IsEntryPoint, implements paragraph 10.1 of the spec
21557 - modified method Method.Define, the part at the end of the method
21559 * rootcontext.cs: added static public Location EntryPointLocation;
21561 * ../errors/cs0028.cs : Add test case for the above warning.
21564 - modified method CSharpName to allow arrays of primitive type to
21565 be printed nicely (e.g. instead of System.Int32[][] it now prints
21567 - added method CSharpSignature: returns the signature of a method
21568 in string format to be used in reporting errors, warnings, etc.
21570 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
21573 2002-04-26 Ravi Pratap <ravi@ximian.com>
21575 * delegate.cs (Define): Fix extremely silly bug where I was
21576 setting the type of the 'object' parameter of the BeginInvoke
21577 method to System.IAsyncResult instead of System.Object ;-)
21579 2002-04-26 Miguel de Icaza <miguel@ximian.com>
21581 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
21584 (Constructor.Emit): return if we fail to initialize the
21585 constructor. Another door closed!
21587 * expression.cs (New.DoResolve): Improve error message (from -6 to
21588 1501). Use DeclaredOnly lookup to find the exact constructor.
21590 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
21591 loop. This is useful.
21593 * cs-parser.jay: Adjust the default parameters so that destructors
21594 have the proper signature.
21596 2002-04-26 Martin Baulig <martin@gnome.org>
21598 * driver.cs (LoadAssembly): If `assembly' contains any characters
21599 which are only valid in path names and not in assembly names
21600 (currently slash, backslash and point), use Assembly.LoadFrom ()
21601 instead of Assembly.Load () on the `assembly' (before iteration
21602 over the link_paths).
21604 2002-04-26 Martin Baulig <martin@gnome.org>
21606 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
21608 2002-04-25 Miguel de Icaza <miguel@ximian.com>
21610 * class.cs (Property): use the new typemanager.MemberLookup
21612 (TypeContainer.MemberLookup): Implement using the
21613 TypeManager.MemberLookup now.
21615 * typemanager.cs: Make MemberLookup a function of the TypeManager,
21616 and return MemberInfos, so that these can be used without an
21617 EmitContext (what we had before).
21619 2002-04-24 Miguel de Icaza <miguel@ximian.com>
21621 * expression.cs: Fix the case where the argument to params if the
21622 type of the params. I omitted handling this before. Fixed
21624 2002-04-22 Miguel de Icaza <miguel@ximian.com>
21626 * driver.cs: Call BootCorlib_PopulateCoreType
21628 * class.cs (Property.CheckBase): Check for properties only, not
21631 * interface.cs: Temporary hack: try/catch around the
21632 CustomAttributeBuilder, because I am getting an exception that I
21635 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
21636 types whose definitions are required to be there (attributes are
21637 defined before standard types).
21639 Compute definitions as we boot the various types, as they are used
21640 immediately (value_type class will need object_type, but if we do
21641 not initialize object_type, we will pass a null, which will let
21642 the runtime pick the System.Object from the existing corlib, which
21643 is not what we want).
21645 2002-04-22 Patrik Torstensson <totte@labs2.com>
21647 * cs-tokenizer.cs: fixed a number of trim() issues.
21649 2002-04-22 Ravi Pratap <ravi@ximian.com>
21651 * expression.cs (Argument.Type): Ensure that we return the correct
21652 type when we have out or ref parameters [in which case we
21655 2002-04-22 Miguel de Icaza <miguel@ximian.com>
21657 * class.cs (Property, Indexer): Allow extern modifier in there.
21659 * typemanager.cs (InitBaseTypes): Initializes object_type and
21660 value_type, since those will be used early on during the bootstrap
21661 process to compile corlib.
21663 (InitCoreTypes): Move code from here to InitBaseTypes.
21665 2002-04-21 Miguel de Icaza <miguel@ximian.com>
21667 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
21668 single-dimension arrays as using the ldlen opcode.
21670 Daniel Lewis discovered this optimization.
21672 * typemanager.cs: Add signature for System.Array::get_Length
21674 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21676 * statement.cs: report the error when the foreach does not apply to an
21677 array nor a collection.
21679 2002-04-19 Miguel de Icaza <miguel@ximian.com>
21681 * expression.cs: Add implicit conversions to the operator ~.
21683 * constant.cs (DecimalConstant.Emit): Emit decimal value.
21685 * typemanager.cs: Locate the decimal constructor.
21687 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21689 * attribute.cs: use the new property of TypeOf.
21690 * expression.cs: added 'get' property around typearg.
21692 These changes fix a build breaker reported by NickD. Is this the
21693 correct way to fix? If not, please, revert my changes and make it
21696 2002-04-17 Miguel de Icaza <miguel@ximian.com>
21698 * attribute.cs: Add support for typeof in attribute invocations.
21699 I am not sure that this is right though.
21701 2002-04-14 Duncan Mak <duncan@ximian.com>
21703 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
21704 Binary.Operator.Division case.
21706 2002-04-13 Ravi Pratap <ravi@ximian.com>
21708 * class.cs (DefineType): Ensure that we do a proper check on
21709 attribute types and also register it with the TypeManager.
21711 (TypeContainer.Targets): The default for attribute types is
21712 AttributeTargets.All.
21714 * attribute.cs (ApplyAttributes): Registering the attribute type
21715 is done elsewhere, not when we discover we have a Usage attribute.
21717 2002-04-12 Ravi Pratap <ravi@ximian.com>
21719 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
21720 and get rid of is_delegate parameter.
21722 * everywhere : update.
21724 2002-04-12 Ravi Pratap <ravi@ximian.com>
21726 * cs-parser.jay (compilation_unit): Revamp completely to use
21727 some new ideas that I got from Rhys' grammar to solve the problems
21728 with assembly level attributes.
21730 (outer_declaration): New grammar production.
21732 (attribute_sections): Add.
21734 (opt_attributes): Base on attribute_sections
21736 (namespace_declaration): Allow opt_attributes to tackle the case
21737 when we have assembly level attributes - we are clever in this
21740 * attribute.cs (ApplyAttributes): Do not worry about assembly
21741 attributes in the non-global context.
21743 * rootcontext.cs (AddGlobalAttributes): Go back to using this
21744 instead of SetGlobalAttributes.
21746 * class.cs, rootcontext.cs : Ensure we define and generate
21747 attribute types before anything else.
21749 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
21750 and flag the new error -20 for the case when the attribute type
21751 does not have valid targets specified. csc does not catch this.
21753 * ../errors/errors.txt : update for error # -20
21755 2002-04-11 Ravi Pratap <ravi@ximian.com>
21757 * support.cs (InternalParameters.ParameterModifier): Do some null
21758 checking and return sane values.
21760 * class.cs (Method.Define): If we are a PInvoke method, ensure
21761 that we are static and extern. Report error # 601
21763 * ../errors/cs0601.cs : Add test case for the above error.
21765 2002-04-07 Ravi Pratap <ravi@ximian.com>
21767 * rootcontext.cs (attribute_types): We need to keep type of
21768 all attribute types separately and emit code for them first.
21770 (RegisterAttribute) : Implement.
21772 * class.cs (DefineType): Check if the current Type is a custom
21773 attribute type and register it accordingly.
21775 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
21776 adding the first attribute twice and rename to
21778 (SetGlobalAttributes): this.
21780 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
21783 * attribute.cs (ApplyAttributes): Take an additional argument telling us
21784 if we are processing global arguments. Hmm, I am unsure of this.
21786 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21788 * expression.cs: added static array of strings to avoid calling
21789 Enum.ToString () for Operator in Binary. Significant recover of
21792 2002-04-10 Miguel de Icaza <miguel@ximian.com>
21794 * class.cs (FindMembers): Allow the Builders of the various
21795 members to be null. If they are skip them. This only happens
21796 during the PInvoke declaration.
21798 2002-04-09 Miguel de Icaza <miguel@ximian.com>
21800 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
21801 failure, so we do not keep going afterwards.
21803 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
21804 wanted to pass `false' as the `is_delegate' argument. If this is
21805 the case, why not use delegate_type == null to mean `is_delegate =
21806 false' and anything else as is_delegate = true.
21808 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
21810 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
21811 code for the section, not the beginning of the tests.
21813 2002-04-08 Miguel de Icaza <miguel@ximian.com>
21815 * cfold.cs: Handle operator + (Enum x, Underlying x)
21817 * expression.cs (Binary): same. Warn about errors where we have
21818 Enum/Enum in operator + as well.
21820 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
21823 - added support for switch(bool)
21824 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
21825 - add TableSwitchEmit() to handle table-based switch statements
21827 2002-04-05 Ravi Pratap <ravi@ximian.com>
21829 * expression.cs (Invocation.OverloadResolve): Factor out code which
21830 does parameter compatibility checking with arguments so that we can
21831 re-use the code even from Delegate.VerifyApplicability
21833 (VerifyArgumentsCompat): Move above code here.
21835 * delegate.cs (VerifyApplicability): Get rid of duplicate code
21836 and instead make a call to the above method.
21838 2002-03-31 Ravi Pratap <ravi@ximian.com>
21840 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
21841 We use it to keep track of classes which are attribute types.
21843 2002-04-02 Miguel de Icaza <miguel@ximian.com>
21845 * delegate.cs (Delegate.Define): Correctly define the types in the
21846 presence of fixed and array parameters.
21848 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
21851 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
21852 include NonPublic after the first iteration.
21854 * class.cs (Indexer.CheckBase): Only check if both parents are
21857 * cs-parser.jay (accessor_body): If empty, set to null.
21859 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
21860 same code path here to resolve constants names that we did have in
21861 MemberAccess.DoResolve. There is too much code duplicated here.
21863 2002-04-01 Miguel de Icaza <miguel@ximian.com>
21865 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
21867 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
21870 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
21871 tokens, numbers and strings.
21873 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
21876 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
21877 asyncronous parameters and the regular parameters.
21879 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
21880 specify the target directory.
21882 * expression.cs: (This.DoResolve): Simplify
21883 (As.Emit): Optimize, do not generate IsInst if the expression is
21884 always of the given type.
21886 (Is.DoResolve): Bug fix, we were reporting both always/never for
21889 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
21890 creating too many unnecessary arrays.
21892 2002-03-31 Miguel de Icaza <miguel@ximian.com>
21894 * class.cs (EmitFieldInitializer): Use Assign expression to assign
21895 fields instead of rolling our own initializer. Takes care of all
21896 implicit conversions, and drops unnecessary static checks/argument.
21898 2002-03-31 Dick Porter <dick@ximian.com>
21900 * driver.cs: use the GetDirectories() return values properly, and
21901 use "/" as path separator.
21903 2002-03-30 Miguel de Icaza <miguel@ximian.com>
21905 * expression.cs (Unary): Optimize - - expr into expr.
21906 (Binary): Optimize a + (-b) into a -b.
21908 * codegen.cs (CodeGen): Made all methods static.
21910 2002-03-29 Miguel de Icaza <miguel@ximian.com>
21914 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
21915 TypeBuilder property.
21917 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
21920 * tree.cs: Removed the various RecordXXXX, and replaced with a
21921 single RecordDecl. Removed all the accessor methods, and just
21922 left a single access point Type
21924 * enum.cs: Rename DefineEnum to DefineType.
21926 * decl.cs: New abstract method `DefineType' used to unify the
21927 Defines for Enumerations, Interfaces, TypeContainers and
21930 (FindType): Moved LookupInterfaceOrClass here. Moved the
21931 LookupBaseClasses method that used to live in class.cs and
21932 interface.cs here, and renamed to FindType.
21934 * delegate.cs: Implement DefineType. Take advantage of the
21935 refactored pattern for locating the parent builder without taking
21936 the parent_builder argument (which we know does not work if we are
21937 nested, and triggering a toplevel definition).
21939 2002-03-28 Miguel de Icaza <miguel@ximian.com>
21941 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
21942 accessibility of a member has changed during override and report
21945 * class.cs (Method.Define, Property.Define): Only complain on
21946 overrides if the method is private, any other accessibility is
21947 fine (and since we just checked the permission is the same, we are
21950 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
21951 and elif are processed always. The other pre-processing
21952 directives are only processed if we are "taking" the path
21954 2002-03-29 Martin Baulig <martin@gnome.org>
21956 * class.cs (Method.Emit): Only emit symbolic debugging info if the
21957 current location is not Null.
21959 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
21960 a separate method so we can profile it.
21962 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
21963 `span.Seconds' are just seconds, but no minutes or hours.
21964 (MainDriver): Profile the CodeGen.SaveSymbols calls.
21966 2002-03-28 Miguel de Icaza <miguel@ximian.com>
21968 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
21969 Remove the gratuitous set of Final:
21971 // If an interface implementation, then we can set Final.
21972 if (((flags & MethodAttributes.Abstract) == 0) &&
21973 implementing.DeclaringType.IsInterface)
21974 flags |= MethodAttributes.Final;
21976 I do not know what I was smoking when I used that.
21979 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
21980 step into fixing the name resolution issues for delegates and
21981 unifying the toplevel name resolution.
21983 2002-03-28 Martin Baulig <martin@gnome.org>
21985 * class.cs (Method.Emit): If we have a symbol writer, call its
21986 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
21987 tell it about the current method.
21989 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
21990 writer that we're going to emit the first byte of IL code for a new
21991 statement (a new source line).
21992 (EmitContext.EmitTopBlock): If we have a symbol writer, call
21993 EmitContext.Mark() before emitting any code.
21995 * location.cs (SymbolDocument): Return null when we're Null.
21997 * statement.cs (Statement): Moved the `Location loc' variable here.
21998 (Statement.EmitBoolExpression): If we have a symbol writer, call
21999 ec.Mark() before emitting any code to tell it that we're at the
22000 beginning of a new statement.
22001 (StatementExpression): Added `Location' argument to the constructor.
22002 (Block): Added public readonly variable `StartLocation' and public
22003 variable `EndLocation'. The latter is to be set using SetEndLocation().
22004 (Block): Added constructor which takes a start and end location.
22005 (Block.SetEndLocation): New method. This sets the end location.
22006 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
22007 local variables we create.
22008 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
22009 each statement and do also mark the begin and end of the block.
22011 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
22012 tell it the current lexer.Location, use Location.Null for the end of the
22014 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
22015 current block, set its end location using SetEndLocation().
22016 (statement_expression): StatementExpression constructor now takes the
22017 lexer.Location as additional argument.
22018 (for_statement, declare_local_variables): Likewise.
22019 (declare_local_variables): When creating a new implicit block, use the
22020 new Block constructor and pass it the lexer.Location.
22022 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22024 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
22025 members also on the parent interfaces recursively.
22027 2002-03-27 Miguel de Icaza <miguel@ximian.com>
22029 * report.cs: Use new formats, since Gonzalo finished the missing
22032 * expression.cs (Binary.ResolveOperator): added missing operator|
22033 operator& and operator^ for bool/bool.
22035 * cs-parser.jay: CheckDef now takes a Location argument that is
22036 used to report errors more precisly (instead of reporting the end
22037 of a definition, we try to track something which is a lot closer
22038 to the source of the problem).
22040 * cs-tokenizer.cs: Track global token use, so we can properly flag
22041 the use of #define/#undef after the first token has been seen.
22043 Also, rename the reportXXXX to Error_DescriptiveName
22045 * decl.cs (DeclSpace.IsTopLevel): Move property here from
22046 TypeContainer, so that Enum and Interface can use this too.
22048 * class.cs (TypeContainer.LookupInterfaceOrClass,
22049 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
22050 `builder' argument. Typically this was used to pass the parent
22051 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
22054 The problem is that a nested class could trigger the definition of
22055 a toplevel class, and the builder would be obviously wrong in that
22058 So we drop this argument, and we compute dynamically the
22059 TypeBuilder/ModuleBuilder (the correct information was available
22060 to us anyways from DeclSpace.Parent)
22062 * interface.cs (Interface.DefineInterface): Drop builder
22063 parameter cleanup like class.cs
22065 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
22068 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
22071 (Try.Emit): Propagate the returns value from the statement.
22073 (Return.Emit): Even if we are leavning
22075 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
22077 * modifiers.cs: Fix the computation of MethodAttributes flags.
22079 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
22081 * driver.cs: allow compilation of files that start with '/'.
22082 Add a default case when checking the argument of --target.
22084 2002-03-25 Miguel de Icaza <miguel@ximian.com>
22086 * interface.cs: Implement the same search algorithm for types in
22087 the interface code.
22089 * delegate.cs: Do not allow multiple definition.
22091 * Recovered ChangeLog that got accidentally amputated
22093 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
22095 * rootcontext.cs: Load manually enum to allow core classes to
22096 contain enumerations.
22098 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
22099 Update to new static methods in TypeManager.
22101 * typemanager.cs (GetMethod, GetConstructor): Use our
22102 implementation of FindMembers to find the members, since during
22103 corlib compilation, the types are TypeBuilders and GetMethod and
22104 GetConstructor do not work.
22106 Make all methods in TypeManager static.
22108 (InitCodeHelpers): Split the functionality from
22109 the InitCodeTypes function.
22111 * driver.cs: Call InitCodeHelpers after we have populated the
22114 * cs-parser.jay (delegate_declaration): we did not used to compute
22115 the delegate name correctly for void delegates.
22117 2002-03-24 Miguel de Icaza <miguel@ximian.com>
22119 * rootcontext.cs (RootContext): Init the interface_resolve_order
22120 and type_container_resolve_order always.
22122 (ResolveCore, BootstrapCorlib_ResolveClass,
22123 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
22124 compiler when compiling with --nostdlib
22126 * class.cs (TypeContainer.DefineType): Check that our parent is
22127 not null. This test is most important when we are bootstraping
22130 * codegen.cs: Split out the symbol writing code.
22132 2002-03-25 Martin Baulig <martin@gnome.org>
22134 * driver.cs (-g): Made -g an alias for --debug.
22136 2002-03-24 Martin Baulig <martin@gnome.org>
22138 * codegen.cs (SymbolWriter): New public variable. Returns the
22139 current symbol writer.
22140 (CodeGen): Added `bool want_debugging_support' argument to the
22141 constructor. If true, tell the ModuleBuild that we want debugging
22142 support and ask it for the ISymbolWriter.
22143 (Save): If we have a symbol writer, call it's Close() method after
22144 saving the assembly.
22146 * driver.c (--debug): New command line argument to create a
22147 debugger information file.
22149 * location.cs (SymbolDocument): New public property. Returns an
22150 ISymbolDocumentWriter object for the current source file or null
22151 if we don't have a symbol writer.
22153 2002-03-21 Miguel de Icaza <miguel@ximian.com>
22155 * driver.cs (LoadAssembly): Correctly return when all the paths
22156 have been tried and not before.
22158 * statement.cs (Switch.Emit): return the actual coverage for this
22159 statement (returns/not-returns)
22161 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
22162 switch of the statement if we are the last switch section. That
22163 kills two problems: try/catch problems (we used to emit an empty
22164 nop at the end) and switch statements where all branches would
22167 2002-03-19 Miguel de Icaza <miguel@ximian.com>
22169 * driver.cs: Add default assemblies (the equivalent to the
22170 Microsoft CSC.RSP file)
22172 * cs-tokenizer.cs: When updating `cols and setting it to zero,
22173 also update tokens_seen and set it to false.
22175 * driver.cs: Implement --recurse for Mike.
22177 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
22178 correctly splitting out the paths.
22180 2002-03-18 Miguel de Icaza <miguel@ximian.com>
22182 * interface.cs (Interface.PopulateProperty): Instead of using
22183 `parent' as the declaration space for the set parameters, use
22186 * support.cs (InternalParameters): InternalParameters constructor
22187 takes a DeclSpace instead of a TypeContainer.
22189 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
22190 types are being initialized, load the address of it before calling
22193 (New): Provide a mechanism to disable the generation of local
22194 value type temporaries when the caller will be providing us with
22195 an address to store it.
22197 (ArrayCreation.EmitDynamicInitializers): Use it.
22199 2002-03-17 Miguel de Icaza <miguel@ximian.com>
22201 * expression.cs (Invocation.EmitArguments): Only probe for array
22202 property if there is more than one argument. Sorry about that.
22204 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
22205 empty param arrays.
22207 * class.cs (Method.LabelParameters): Fix incorrect code path that
22208 prevented the `ParamArrayAttribute' from being applied to the
22211 2002-03-16 Miguel de Icaza <miguel@ximian.com>
22213 * support.cs (ReflectionParameters): Correctly compute whether the
22214 last argument is a params array. Fixes the problem with
22217 * typemanager.cs: Make the assemblies array always be non-null
22218 (empty, but non-null)
22220 * tree.cs (RecordDecl): New function that abstracts the recording
22221 of names. This reports error 101, and provides a pointer to the
22222 previous declaration. Fixes a crash in the compiler.
22224 * cs-parser.jay (constructor_declaration): Update to new grammar,
22225 and provide a constructor_body that can be empty.
22227 2002-03-15 Miguel de Icaza <miguel@ximian.com>
22229 * driver.cs: Add support for --resources.
22231 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
22232 Make all types for the various array helper methods be integer.
22234 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
22235 CheckState to ConvCast.
22237 (ConvCast): Now it takes a `checked' state argument, to avoid
22238 depending on the emit context for the conversion, and just using
22239 the resolve time setting.
22241 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
22242 instead of Invocation.EmitArguments. We do not emit the original
22243 arguments, instead we emit those which have been converted to
22244 unsigned int expressions.
22246 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
22248 * codegen.cs: ditto.
22250 * expression.cs (LocalVariableReference): Drop the use of the
22251 Store function that depended on the variable index.
22253 * statement.cs (VariableInfo): Drop the `Idx' property from this
22254 class, as this is not taking into account the indexes for
22255 temporaries tat we generate during the execution, getting the
22258 * class.cs: First emit class initializers, then call the parent
22261 * expression.cs (Binary): Fix opcode emision.
22262 (UnaryMutator.EmitCode): Support checked code generation
22264 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
22265 matches for events for both the Static and Instance scans,
22266 pointing to the same element. Fix that.
22268 2002-03-14 Miguel de Icaza <miguel@ximian.com>
22270 * rootcontext.cs (ResolveTree): Always set the
22271 interface_resolve_order, because nested interfaces will be calling
22274 * class.cs (GetInterfaceOrClass): Track the same resolution
22275 process used by TypeManager.LookupType. This fixes the nested
22276 type lookups in class declarations (separate path from
22279 (TypeContainer.DefineType): Also define nested interfaces.
22280 (TypeContainer.RegisterOrder): New public function used to
22281 register the order in which child interfaces need to be closed.
22283 Nested interfaces need to be closed after their parents have been
22286 * interface.cs (InterfaceAttr): Put all the logic for computing
22287 the interface attribute here.
22289 (DefineInterface): Register our interface order with the
22290 RootContext or with the TypeContainer depending on the case.
22292 2002-03-12 Miguel de Icaza <miguel@ximian.com>
22294 * cs-parser.jay: rework foreach statement to work with the new
22295 changes to the policy on SimpleNames.
22297 * report.cs: support Stacktrace on warnings as well.
22299 * makefile: drop --unsafe and /unsafe from the compile.
22301 2002-03-13 Ravi Pratap <ravi@ximian.com>
22303 * ecore.cs (StandardConversionExists): Modify to take an Expression
22304 as the first parameter. Ensure we do null -> reference type conversion
22307 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
22308 temporary Expression objects.
22310 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
22312 * interface.cs: workaround bug in method overloading resolution
22313 (there is already a bugzilla bug for it).
22315 2002-03-12 Miguel de Icaza <miguel@ximian.com>
22317 We could also solve this problem by having a separate path for
22318 performing type lookups, instead of DoResolve, we could have a
22319 ResolveType entry point, and only participating pieces of the
22320 production (simplename, deref, array) would implement this.
22322 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
22323 signal SimpleName to only resolve type names and not attempt to
22324 resolve anything else.
22326 * expression.cs (Cast): Set the flag.
22328 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
22330 * class.cs: Only report 108 if there is no `new' modifier.
22332 * cs-parser.jay: rework foreach statement to work with the new
22333 changes to the policy on SimpleNames.
22335 * report.cs: support Stacktrace on warnings as well.
22337 * makefile: drop --unsafe and /unsafe from the compile.
22339 2002-03-11 Miguel de Icaza <miguel@ximian.com>
22341 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22342 lookups here, instead of doing that at parse time. This means
22343 that our grammar will not introduce `LocalVariableReferences' as
22344 expressions at this point. That solves the problem of code like
22348 static void Main ()
22352 This is only half the fix. The full fix requires parameters to
22353 also be handled in this way.
22355 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
22356 makes the use more obvious of the DeclSpace. The
22357 ec.TypeContainer.TypeBuilder is now only used to pull the
22358 TypeBuilder for it.
22360 My theory is that I can get rid of the TypeBuilder completely from
22361 the EmitContext, and have typecasts where it is used (from
22362 DeclSpace to where it matters).
22364 The only pending problem is that the code that implements Aliases
22365 is on TypeContainer, and probably should go in DeclSpace.
22367 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22368 lookups here, instead of doing that at parse time. This means
22369 that our grammar will not introduce `LocalVariableReferences' as
22370 expressions at this point. That solves the problem of code like
22374 static void Main ()
22378 This is only half the fix. The full fix requires parameters to
22379 also be handled in this way.
22381 * class.cs (Property.DefineMethod): When implementing an interface
22382 method, set newslot, when implementing an abstract method, do not
22383 set the flag (before we tried never setting it, or always setting
22384 it, which is the difference).
22385 (Indexer.DefineMethod): same.
22386 (Method.DefineMethod): same.
22388 * ecore.cs: Only set the status used flag if we get back a Field.
22390 * attribute.cs: Temporary hack, so Paolo can keep working.
22392 2002-03-08 Ravi Pratap <ravi@ximian.com>
22394 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
22395 the unmanaged type in the case we have a MarshalAs attribute.
22397 (Resolve): Handle the case when we are parsing the special MarshalAs
22398 attribute [we need to store the unmanaged type to use later]
22400 * typemanager.cs (marshal_as_attr_type): Built in type for the
22401 MarshalAs Attribute.
22403 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
22404 on parameters and accordingly set the marshalling info.
22406 2002-03-09 Miguel de Icaza <miguel@ximian.com>
22408 * class.cs: Optimizing slightly by removing redundant code after
22409 we switched to the `NoTypes' return value.
22410 (Property.DefineMethod): use NoTypes here too.
22412 This fixes the bug I introduced in my last batch of changes.
22414 2002-03-05 Ravi Pratap <ravi@ximian.com>
22416 * tree.cs (RecordEnum): Add. We now keep track of enums too.
22418 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
22419 Enums since those are types too.
22421 * cs-parser.jay (enum_declaration): Record enums as we parse them.
22423 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
22424 thanks to a call during the lookup process.
22426 2002-03-07 Miguel de Icaza <miguel@ximian.com>
22428 * statement.cs (Foreach): Lots of work to accomodate a particular
22429 kind of foreach statement that I had not kept in mind. It is
22430 possible to have foreachs on classes that provide a GetEnumerator
22431 method that return objects that implement the "pattern" for using
22432 a foreach, there is no need to support GetEnumerator
22435 This is needed to compile nant.
22437 * decl.cs: Only report 114 if the member is not `Finalize' and if
22438 the warning level is at least 2.
22440 * class.cs: Moved the compare function from Method to
22443 (MethodSignature.InheritableMemberSignatureCompare): Add new
22444 filter function that is used to extract inheritable methods from a
22447 (Method.Define): Use the new `inheritable_method_signature_filter'
22450 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
22453 2002-03-06 Miguel de Icaza <miguel@ximian.com>
22455 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
22457 * cs-parser.jay: Add opt_semicolon to the interface declaration.
22459 * expression.cs: Pass location information to
22460 ConvertImplicitStandard.
22462 * class.cs: Added debugging code to track return values from
22465 2002-03-05 Miguel de Icaza <miguel@ximian.com>
22467 * expression.cs (Is.DoResolve): If either side of the `is' is an
22468 interface, do not flag the warning.
22470 * ecore.cs (ImplicitReferenceConversion): We need a separate test
22473 * report.cs: Allow for --fatal to be used with --probe.
22475 * typemanager.cs (NoTypes): Move the definition for the empty Type
22478 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
22480 (TypeContainer.DefineProxy): New function used to proxy to parent
22481 implementations when implementing interfaces.
22482 (TypeContainer.ParentImplements): used to lookup if our parent
22483 implements a public function that is required by an interface.
22484 (TypeContainer.VerifyPendingMethods): Hook this up.
22486 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
22487 `modules' and `assemblies' arraylists into arrays. We only grow
22488 these are the very early start up of the program, so this improves
22489 the speedof LookupType (nicely measured).
22491 * expression.cs (MakeByteBlob): Replaced unsafe code with
22492 BitConverter, as suggested by Paolo.
22494 * cfold.cs (ConstantFold.Binary): Special case: perform constant
22495 folding of string concatenation, but if either side is a string,
22496 and the other is not, then return null, and let the runtime use
22497 the concatenation on the string plus the object (using
22498 `Object.ToString').
22500 2002-03-04 Miguel de Icaza <miguel@ximian.com>
22502 Constant Folding has been implemented now.
22504 * expression.cs (Unary.Reduce): Do not throw an exception, catch
22505 the error instead on types that are not supported in one's
22508 * constant.cs (Constant and all children): New set of functions to
22509 perform implict and explicit conversions.
22511 * ecore.cs (EnumConstant): Implement the new functions to perform
22512 conversion by proxying to the child expression.
22514 * codegen.cs: (ConstantCheckState): Constant evaluation has its
22515 own separate setting that can not be turned off from the command
22516 line using --unchecked or --checked and is only controlled using
22517 the checked/unchecked statements and expressions. This setting is
22518 used by the constant folder to flag errors.
22520 * expression.cs (CheckedExpr, UncheckedExpr): Set the
22521 ConstantCheckState as well.
22523 During Resolve, they also have to flag the state, because the
22524 constant folder runs completely in the Resolve phase.
22526 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
22529 2002-03-01 Miguel de Icaza <miguel@ximian.com>
22531 * cfold.cs: New file, this file contains the constant folder.
22533 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
22534 argument to track whether we are using the resulting address to
22535 load or store a value and provide better error messages.
22537 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
22538 new AddressOf arguments.
22540 * statement.cs (Foreach.EmitCollectionForeach): Update
22542 * expression.cs (Argument.Emit): Call AddressOf with proper
22543 arguments to track usage.
22545 (New.DoEmit): Call AddressOf with new arguments.
22547 (Unary.Emit): Adjust AddressOf call.
22549 2002-03-01 Ravi Pratap <ravi@ximian.com>
22551 * cs-parser.jay (member_access): Change the case for pre-defined types
22552 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
22555 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
22558 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
22559 essentially like methods and apply attributes like MethodImplOptions to them too.
22561 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
22564 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
22565 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
22568 * Update code everywhere accordingly.
22570 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
22572 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
22574 2002-02-28 Ravi Pratap <ravi@ximian.com>
22576 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
22577 try performing lookups against those instead of jumping straight into using
22578 the 'using' clauses.
22580 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
22582 (LookupType): Perform lookups in implicit parents too.
22584 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
22585 sequence as RootContext.LookupType.
22587 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
22588 the various cases of namespace lookups into this method.
22590 2002-03-01 Miguel de Icaza <miguel@ximian.com>
22592 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
22593 in positional arguments)
22595 * class.cs (Operator): Update the AllowedModifiers to contain
22598 * cs-parser.jay: Update operator declaration to allow for the
22599 operator body to be empty.
22601 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
22604 2002-02-27 Miguel de Icaza <miguel@ximian.com>
22606 * class.cs (Method.Emit): Label parameters.
22608 * driver.cs: Return 1 or 0 as the program exit code.
22610 2002-02-26 Miguel de Icaza <miguel@ximian.com>
22612 * expression.cs: Special case the `null' object when trying to
22613 auto-compute the type, as anything can be explicitly converted to
22616 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
22617 spotting this Paolo.
22619 (Expression.ImplicitNumericConversion): Perform comparissions of
22620 the type using the underlying type in the case of an enumeration
22621 rather than using the enumeration type for the compare.
22623 Cope with the underlying == type case, which is not possible to
22626 (Expression.ConvertNumericExplicit): Perform comparissions of
22627 the type using the underlying type in the case of an enumeration
22628 rather than using the enumeration type for the compare.
22630 * driver.cs: If the user does not supply an extension, assume .exe
22632 * cs-parser.jay (if_statement): Rewrote so that we can track the
22633 location for the if statement.
22635 * expression.cs (Binary.ConstantFold): Only concat strings when
22636 the operation is "+", not everything ;-)
22638 * statement.cs (Statement.EmitBoolExpression): Take a location
22640 (If, While, Do): Track location.
22642 * expression.cs (Binary.ResolveOperator): In the object + string
22643 case, I was missing a call to ConvertImplicit
22645 2002-02-25 Ravi Pratap <ravi@ximian.com>
22647 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
22648 Location arguments. Ensure we use RootContext.LookupType to do our work
22649 and not try to do a direct Type.GetType and ModuleBuilder.GetType
22651 * interface.cs (PopulateMethod): Handle the type of the parameter being
22654 * expression.cs (Invocation.BetterFunction): Handle the case when we
22655 have a params method with no fixed arguments and a call is made with no
22658 2002-02-25 Miguel de Icaza <miguel@ximian.com>
22660 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
22661 the verbatim-string-literal
22663 * support.cs (InternalParameters.ParameterModifier): handle null
22665 (InternalParameters.ParameterType): ditto.
22667 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
22668 duplicating the name of the variable parameter.
22669 (GetParameterByName): Fix bug where we were not looking up array
22670 paramters if they were the only present (thanks Paolo!).
22671 (GetParameterInfo): We only have an empty set of types if both
22672 fixed and array are set to null.
22673 (GetParameterInfo-idx): Handle FixedParameter == null
22675 * cs-parser.jay: Handle the case where there is no catch
22676 statements (missing null test).
22678 2002-02-22 Miguel de Icaza <miguel@ximian.com>
22680 * driver.cs (MainDriver): Be conservative on our command line
22683 Catch DirectoryNotFoundException when calling GetFiles.
22685 (SplitPathAndPattern): Used to split the input specification into
22686 a path and a pattern that we can feed to Directory.GetFiles.
22688 2002-02-21 Miguel de Icaza <miguel@ximian.com>
22690 * statement.cs (Fixed): Implement the last case of the Fixed
22691 statement (string handling).
22693 * expression.cs (StringPtr): New class used to return a char * to
22694 a string; Used by the Fixed statement.
22696 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
22698 * expression.cs (Binary.ResolveOperator): Remove redundant
22699 MemberLookup pn parent type.
22700 Optimize union call, we do not need a union if the types are the same.
22701 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
22704 Specialize the use of MemberLookup everywhere, instead of using
22705 the default settings.
22707 (StackAlloc): Implement stackalloc keyword.
22709 * cs-parser.jay: Add rule to parse stackalloc.
22711 * driver.cs: Handle /h, /help, /?
22713 * expression.cs (MakeByteBlob): Removed the hacks we had in place
22714 before we supported unsafe code.
22716 * makefile: add --unsafe to the self compilation of mcs.
22718 2002-02-20 Miguel de Icaza <miguel@ximian.com>
22720 * expression.cs (PointerArithmetic): New class that is used to
22721 perform pointer arithmetic.
22722 (Binary.Resolve): Handle pointer arithmetic
22723 Handle pointer comparission.
22724 (ArrayPtr): Utility expression class that is used to take the
22725 address of an array.
22727 (ElementAccess): Implement array access for pointers
22729 * statement.cs (Fixed): Implement fixed statement for arrays, we
22730 are missing one more case before we are done.
22732 * expression.cs (Indirection): Implement EmitAssign and set the
22733 ExprClass to Variable. This allows pointer dereferences to be
22734 treated as variables, and to have values assigned to them.
22736 * ecore.cs (Expression.StoreFromPtr): New utility function to
22737 store values dereferencing.
22739 2002-02-20 Ravi Pratap <ravi@ximian.com>
22741 * expression.cs (Binary.ResolveOperator): Ensure that we are
22742 not trying to operate on a void type - this fixes the reported
22745 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
22746 the parent implementation is sealed.
22748 * ../errors/cs0239.cs : Add.
22750 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
22752 * typemanager.cs (unverifiable_code_type): Corresponds to
22753 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
22754 which have unsafe code in them.
22756 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
22759 2002-02-19 Miguel de Icaza <miguel@ximian.com>
22761 * cs-tokenizer.cs: Add support for @"litreal strings"
22763 Make tokenizer accept pre-processor directives
22764 on any column (remove the old C-like limitation).
22766 * rootcontext.cs (EmitCode): Emit any global attributes.
22767 (AddGlobalAttributes): Used to keep track of assembly attributes.
22769 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
22771 * cs-parser.jay: Add support for global attributes.
22773 2002-02-17 Miguel de Icaza <miguel@ximian.com>
22775 * expression.cs (Indirection): New helper class. Unary will
22776 create Indirection classes to be able to implement the
22777 IMemoryLocation interface on it.
22779 2002-02-16 Miguel de Icaza <miguel@ximian.com>
22781 * cs-parser.jay (fixed_statement): reference the right statement.
22783 * statement.cs (Fixed.Emit): Finish implementing the fixed
22784 statement for the &x case.
22786 2002-02-14 Miguel de Icaza <miguel@ximian.com>
22788 * class.cs (Property.Define, Method.Define): Remove newslot when
22791 * modifiers.cs: My use of NewSlot when `Abstract' was set was
22792 wrong. NewSlot should only be used if the `new' keyword is present.
22794 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
22795 locating our system dir. Sorry about this.
22797 2002-02-13 Miguel de Icaza <miguel@ximian.com>
22799 * driver.cs (GetSystemDir): Compute correctly the location of our
22800 system assemblies. I was using the compiler directory instead of
22801 the library directory.
22803 2002-02-13 Ravi Pratap <ravi@ximian.com>
22805 * expression.cs (BetterFunction): Put back in what Miguel commented out
22806 since it is the correct fix. The problem is elsewhere ;-)
22808 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
22809 parameters of the parms method are themselves compatible or not !
22811 (StandardConversionExists): Fix very dangerous bug where we were forgetting
22812 to check that a class implements an interface before saying that an implicit
22813 conversion was allowed. Use ImplementsInterface to do the checking.
22815 2002-02-13 Miguel de Icaza <miguel@ximian.com>
22817 * class.cs (Method.Define): Track whether we are an explicit
22818 implementation or not. And only call DefineMethodOverride if we
22819 are an explicit implementation.
22821 (Property.DefineMethod): Ditto.
22823 2002-02-11 Ravi Pratap <ravi@ximian.com>
22825 * expression.cs (BetterFunction): Catch hideous bug which was
22826 preventing us from detecting ambiguous calls due to implicit casts i.e
22829 2002-01-29 Miguel de Icaza <miguel@ximian.com>
22831 * support.cs (Pair): Remove un-needed method. I figured why I was
22832 getting the error in cs-parser.jay, the variable in a foreach loop
22833 is readonly, and the compiler does not really treat this as a variable.
22835 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
22836 instead of EQUALS in grammar.
22838 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
22840 * expression.cs (Unary.DoResolve): Check whether the argument is
22843 2002-01-28 Miguel de Icaza <miguel@ximian.com>
22845 * support.cs: Api for Pair to set a value. Despite the fact that
22846 the variables are public the MS C# compiler refuses to compile
22847 code that accesses the field if the variable is part of a foreach
22850 * statement.cs (Fixed): Begin implementation of the fixed
22853 (Block.AddVariable): Return the VariableInfo on success and null
22854 on failure instead of true/false.
22856 * cs-parser.jay (foreach): Catch errors on variables already
22857 defined (we were ignoring this value before) and properly unwind
22858 the block hierarchy
22860 (fixed_statement): grammar for the fixed statement.
22862 2002-01-25 Miguel de Icaza <miguel@ximian.com>
22864 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
22865 pointer types to be incretemented.
22867 (SizeOf): Implement.
22869 * cs-parser.jay (pointer_member_access): Implement
22870 expr->IDENTIFIER production.
22872 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
22873 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
22876 (Unary): Implement indirection.
22878 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
22879 use in non-unsafe context).
22881 (SimpleName.DoResolve): Check for pointers in field access on safe
22884 (Expression.LoadFromPtr): Factor the load-indirect code in this
22885 function. This was duplicated in UnboxCast and ParameterReference
22887 2002-01-24 Miguel de Icaza <miguel@ximian.com>
22889 * expression.cs (ComposedCast): report an error if a pointer cast
22890 is used in a safe region.
22892 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
22893 pointer type casts in unsafe context.
22895 * codegen.cs (EmitContext): Set up IsUnsafe.
22897 * cs-parser.jay (non_expression_type): Add productions for pointer
22900 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
22901 code. We should not use force into static mode if the method is
22902 not virtual. Fixes bug in MIS
22904 * statement.cs (Do.Emit, While.Emit, For.Emit,
22905 Statement.EmitBoolExpression): Add support to Do and While to
22906 propagate infinite loop as `I do return' semantics.
22908 Improve the For case to also test for boolean constants.
22910 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
22911 to the list of attributes we can add.
22913 Remove `EmitContext' argument.
22915 * class.cs (Method.Define): Apply parameter attributes.
22916 (Constructor.Define): Apply parameter attributes.
22917 (MethodCore.LabelParameters): Move here the core of labeling
22920 * support.cs (ReflectionParameters.ParameterModifier,
22921 InternalParameters.ParameterModifier): Use IsByRef on the type and
22922 only return the OUT bit for these parameters instead of in/out/ref
22925 This is because I miss-understood things. The ParameterInfo.IsIn
22926 and IsOut represent whether the parameter has the [In] and [Out]
22929 2002-01-22 Miguel de Icaza <miguel@ximian.com>
22931 * ecore.cs (FieldExpr.Emit): Release temporaries.
22933 * assign.cs (LocalTemporary.Release): new function.
22935 * codegen.cs (EmitContext.GetTemporaryStorage,
22936 EmitContext.FreeTemporaryStorage): Rework the way we deal with
22937 temporary storage. Now we can "put back" localbuilders when we
22940 2002-01-21 Miguel de Icaza <miguel@ximian.com>
22942 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
22943 need to make a copy of the variable to generate verifiable code.
22945 2002-01-19 Miguel de Icaza <miguel@ximian.com>
22947 * driver.cs: Compute dynamically the system directory.
22949 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
22950 Slower, but more generally useful. Used by the abstract
22951 registering implementation.
22953 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
22954 the rules for the special rule on Type/instances. First check if
22955 we have the same name, and if so, try that special static path
22956 rather than the instance path.
22958 2002-01-18 Miguel de Icaza <miguel@ximian.com>
22960 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
22963 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
22964 Enum, ValueType, Delegate or Array for non-corlib compiles.
22966 * cs-tokenizer.cs: Catch long identifiers (645)
22968 * typemanager.cs (IndexerPropetyName): Ravi never tested this
22971 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
22972 fix, we were returning too early, so we were not registering
22973 pending methods from abstract classes.
22975 Do not register pending methods if the class is abstract.
22977 * expression.cs (Conditional.DoResolve): Report circular implicit
22978 conversions when we neecd to compute it for conditional
22981 (Is.DoResolve): If the expression is always of the provided type,
22982 flag warning 183. If the expression can not ever be of the
22983 provided type flag warning 184.
22985 * class.cs: Catch 169 as well.
22987 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
22990 2002-01-18 Nick Drochak <ndrochak@gol.com>
22992 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
22994 2002-01-17 Miguel de Icaza <miguel@ximian.com>
22996 * interface.cs: (PopulateMethod): Check for pointers being defined
22997 only if the unsafe context is active.
22998 (PopulateProperty): ditto.
22999 (PopulateIndexer): ditto.
23001 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
23002 specified. If pointers are present, make sure that they are
23003 present in an unsafe context.
23004 (Constructor, Constructor.Define): ditto.
23005 (Field, Field.Define): ditto.
23006 (Property, Property.Define): ditto.
23007 (Event, Event.Define): ditto.
23009 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
23010 hashtable if there are classes or structs defined.
23012 * expression.cs (LocalVariableReference.DoResolve): Simplify this
23013 code, as the constant resolution moved.
23015 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
23016 the metadata, so we can flag error 133.
23018 * decl.cs (MemberCore.UnsafeOK): New function to test that a
23019 pointer is being declared in an unsafe context.
23021 2002-01-16 Miguel de Icaza <miguel@ximian.com>
23023 * modifiers.cs (Modifiers.Check): Require a Location argument.
23024 Report error 227 for Unsafe use.
23026 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
23028 * statement.cs (For.Emit): If the test is null, then report that
23029 we do `return', as we wont reach anything afterwards.
23031 (Switch.SwitchGoverningType): Track the expression that matched
23034 * driver.cs: Allow negative numbers as an error code to flag.
23036 * cs-parser.jay: Handle 1551.
23038 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
23040 2002-01-15 Miguel de Icaza <miguel@ximian.com>
23042 * cs-parser.jay: Report 1518 (type declaration can only contain
23043 class, struct, interface, enum or delegate)
23045 (switch_label): Report 1523 (keywords `case' or `default' must
23048 (opt_switch_sections): Report 1522 (empty switch)
23050 * driver.cs: Report 1515 (response file specified multiple times)
23051 Report 1516 (Source file specified multiple times).
23053 * expression.cs (Argument.Resolve): Signal 1510
23055 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
23056 access not allowed in static code)
23058 2002-01-11 Ravi Pratap <ravi@ximian.com>
23060 * typemanager.cs (IsPointerType): Utility method which we are going
23063 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
23064 the object type, so we take care of that.
23066 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
23068 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
23069 added to non-params parameters :-)
23071 * typemanager.cs (CSharpName): Include 'void' type too.
23073 (void_ptr_type): Include in the set of core types.
23075 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
23078 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
23081 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
23082 completely forgotten about it.
23084 2002-01-10 Ravi Pratap <ravi@ximian.com>
23086 * cs-parser.jay (pointer_type): Add. This begins our implementation
23087 of parsing rules for unsafe code.
23089 (unsafe_statement): Implement.
23091 (embedded_statement): Modify to include the above.
23093 * statement.cs (Unsafe): Implement new class for unsafe blocks.
23095 * codegen.cs (EmitContext.InUnsafe): Add. This determines
23096 if the current context is an unsafe one.
23098 * cs-parser.jay (local_variable_pointer_type): Since local variable types
23099 are handled differently, we need separate rules for them.
23101 (local_variable_declaration): Update to use local_variable_pointer_type
23102 to allow variable declarations of unmanaged pointer types.
23104 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
23105 in unsafe contexts.
23107 * ../errors/cs0214.cs : Add.
23109 2002-01-16 Nick Drochak <ndrochak@gol.com>
23111 * makefile: remove 'response' file when cleaning.
23113 2002-01-15 Miguel de Icaza <miguel@ximian.com>
23115 * cs-parser.jay: Report 1524.
23117 2002-01-14 Miguel de Icaza <miguel@ximian.com>
23119 * typemanager.cs (RegisterMethod): drop checking if we have
23120 registered this from here
23122 2002-01-12 Miguel de Icaza <miguel@ximian.com>
23124 * class.cs (Method.EmitDestructor): Implement calling our base
23127 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
23128 value of InFinally.
23130 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
23131 this routine and will wrap the call in a try/catch block. Deal
23134 2002-01-11 Miguel de Icaza <miguel@ximian.com>
23136 * ecore.cs (Expression.MemberLookup): instead of taking a
23137 parameter `same_type' that was used to tell whether we could
23138 access private members we compute our containing type from the
23141 (FieldExpr): Added partial support for volatile fields. This does
23142 not work for volatile fields exposed from assemblies, as I can not
23143 figure out how to extract the modreq from it.
23145 Updated all the source files to use this.
23147 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
23148 because it is referenced by MemberLookup very often.
23150 2002-01-09 Ravi Pratap <ravi@ximian.com>
23152 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
23153 TypeBuilder.GetCustomAttributes to retrieve what we need.
23155 Get rid of redundant default_member_attr_type as this is the same as
23156 default_member_type which already exists.
23158 * interface.cs, attribute.cs : Update accordingly.
23160 2002-01-08 Miguel de Icaza <miguel@ximian.com>
23162 * typemanager.cs: Enable IndexerPropertyName again. It does not
23163 work for TYpeBuilders though. Ravi, can you please fix this?
23165 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
23167 * expression.cs (Argument.Emit): Handle the case of ref objects
23168 being passed to ref functions;
23170 (ParameterReference.EmitLoad): Loads the content of the pointer
23171 without dereferencing.
23173 2002-01-07 Miguel de Icaza <miguel@ximian.com>
23175 * cs-tokenizer.cs: Implemented the pre-processing expressions.
23177 2002-01-08 Ravi Pratap <ravi@ximian.com>
23179 * class.cs (Indexer.DefineMethod): Incorporate the interface
23180 type in the name of the method if we are doing explicit interface
23183 * expression.cs (ConversionExists): Remove as it is completely obsolete.
23185 (BetterConversion): Fix extremely trivial bug where we were referring to
23186 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
23189 * ../errors/bug16.cs : Add although we have fixed it.
23191 2002-01-07 Miguel de Icaza <miguel@ximian.com>
23193 * expression.cs (BaseIndexer): Begin implementation.
23195 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
23197 * cs-parser.jay (indexer_declarator): Use qualified_identifier
23198 production directly to remove a shift/reduce, and implement
23199 explicit interface implementation.
23201 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
23202 after a floating point suffix.
23204 * expression.cs (DoNumericPromotions): Improved the conversion for
23205 uint/uint. If we have a constant, we avoid doing a typecast to a
23208 * class.cs (Indexer): Implement explicit interface implementation
23211 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
23213 * class.cs: make the default instance constructor public and hidebysig.
23215 2001-01-03 Ravi Pratap <ravi@ximian.com>
23217 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
23218 so we can call it from elsewhere.
23220 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
23221 we emit it internally if the class has a defined indexer; otherwise the user
23222 emits it by decorating the class definition with the DefaultMemberAttribute.
23224 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
23225 attribute is not used on a type which defines an indexer.
23227 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
23228 character when we skip whitespace.
23230 * ../errors/cs0646.cs : Add.
23232 2002-01-03 Miguel de Icaza <miguel@ximian.com>
23234 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
23237 * makefile: Add practical target `mcs3.exe' which builds the third
23238 generation compiler.
23240 * expression.cs (New): Fix structures constructor calling.
23242 * class.cs (Property, Method, Indexer): Emit Final flag on the
23243 method if we are an interface implementation and we are not
23246 * ecore.cs (PropertyExpr): New public field `IsBase', tells
23247 whether this property is referencing a `base' method.
23249 * expression.cs (Invocation.EmitCall): take an extra argument:
23250 is_base, this is used to determine whether the `call' or
23251 `callvirt' opcode should be used.
23254 * delegate.cs: update EmitCall.
23256 * class.cs (Method.Define): Set NewSlot for the cases where we are
23257 not implementing an interface method.
23259 (Property.Define): ditto.
23261 2002-01-02 Miguel de Icaza <miguel@ximian.com>
23263 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
23264 'r'. Allows mcs to parse itself fully.
23266 2002-01-02 Ravi Pratap <ravi@ximian.com>
23268 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
23269 of the number of initializers that require the InitializeArray method.
23271 (CheckIndices): Store the Expression in all cases - not the plain value. Also
23272 update the above field where necessary.
23274 (MakeByteBlob): Update accordingly.
23276 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
23279 (EmitDynamicInitializers): Update in accordance with the new optimization.
23281 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
23282 same OpCode applies.
23284 * cs-parser.jay : Fix some glaring errors I introduced.
23286 2002-01-01 Ravi Pratap <ravi@ximian.com>
23288 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
23289 so that we can check for name clashes there too.
23291 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
23292 for interface indexers.
23294 * interfaces.cs (Define): Emit the default member attribute.
23296 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
23297 variable was being referred to while setting the value ;-)
23299 2002-01-01 Miguel de Icaza <miguel@ximian.com>
23301 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
23302 byte-by-byte information when we know the data is zero.
23304 Make the block always a multiple of 4, because
23305 DefineInitializedData has a bug.
23307 * assign.cs: Fix, we should assign from the temporary, not from
23310 * expression.cs (MakeByteBlob): Fix my incorrect code.
23312 2001-12-31 Miguel de Icaza <miguel@ximian.com>
23314 * typemanager.cs (EnumToUnderlying): This function is used to get
23315 the underlying type from an enumeration, because it does not
23318 * constant.cs: Use the I4_S form for values between -128 and 127.
23320 * statement.cs (Block.LookupLabel): Looks up a label.
23321 (Block): Drop support for labeled blocks.
23323 (LabeledStatement): New kind of statement that represents a label
23326 (Goto): Finally implement this bad boy.
23328 * cs-parser.jay: Update to reflect new mechanism to implement
23331 2001-12-30 Miguel de Icaza <miguel@ximian.com>
23333 * codegen.cs (EmitContext.This): a codegen property that keeps the
23334 a single instance of this instead of creating many different this
23337 * delegate.cs (Delegate.DoResolve): Update to use the property;
23339 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
23341 * expression.cs (BaseAccess.DoResolve): Ditto.
23343 2001-12-29 Ravi Pratap <ravi@ximian.com>
23345 * typemanager.cs (methodimpl_attr_type): Add to hold the type
23346 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
23348 (InitCoreTypes): Update accordingly.
23350 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
23351 so we can quickly store the state.
23353 (ApplyAttributes): Set the correct implementation flags
23354 for InternalCall methods.
23356 2001-12-29 Miguel de Icaza <miguel@ximian.com>
23358 * expression.cs (EmitCall): if a method is not virtual, then do
23359 not use callvirt on it.
23361 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
23362 user defined stuff) requires the use of stobj, which takes an
23363 address on the stack instead of an array and an index. So emit
23364 the Ldelema operation for it.
23366 (EmitStoreOpcode): Use stobj for valuetypes.
23368 (UnaryMutator.EmitCode): Use the right 1 value depending on
23369 whether we are dealing with int64/uint64, float or doubles.
23371 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
23372 constructors that I implemented last night.
23374 (Constructor.IsDefault): Fix to work properly for static
23377 * cs-parser.jay (CheckDef): report method signature errors.
23378 Update error number 103 to be 132.
23380 * decl.cs: New AdditionResult enumeration value: MethodExists.
23381 Although we do this check for methods later on in the semantic
23382 analysis, catching repeated default constructors is so easy that
23383 we catch these here.
23385 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
23388 (ParameterReference.EmitAssign, Emit): handle
23391 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
23392 (ArrayAccess.EmitStoreOpcode): ditto.
23394 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
23396 * expression.cs (MakeByteBlob): Complete all the missing types
23397 (uint, short, ushort, byte, sbyte)
23399 * class.cs: Only init instance field initializers on instance
23402 Rename `constructors' to instance_constructors.
23404 (TypeContainer.AddConstructor): Only add constructors to the list
23405 if it is not static.
23407 Make sure that we handle default_static_constructor independently
23408 everywhere where we handle instance_constructors
23410 2001-12-28 Miguel de Icaza <miguel@ximian.com>
23412 * class.cs: Do not lookup or create a base initializer for a
23413 static constructor.
23415 (ConstructorInitializer.Resolve): use the proper type to lookup
23418 * cs-parser.jay: Report error 1585 (modifiers between type and name).
23420 * enum.cs, interface.cs: Remove CloseType, this is taken care by
23423 * decl.cs: CloseType is now an virtual method, the default
23424 implementation just closes this type.
23426 2001-12-28 Ravi Pratap <ravi@ximian.com>
23428 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
23429 to PreserveSig by default. Also emit HideBySig on such methods.
23431 Basically, set the defaults to standard values.
23433 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
23434 argument, if candidate is better, it can't be worse than the best !
23436 (Invocation): Re-write bits to differentiate between methods being
23437 applicable in their expanded form and their normal form - for params
23440 Get rid of use_standard everywhere as only standard conversions are allowed
23441 in overload resolution.
23443 More spec conformance.
23445 2001-12-27 Miguel de Icaza <miguel@ximian.com>
23447 * driver.cs: Add --timestamp, to see where the compiler spends
23450 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
23451 `this' in static code.
23453 (SimpleName.DoResolve): Implement in terms of a helper function
23454 that allows static-references to be passed upstream to
23457 (Expression.ResolveWithSimpleName): Resolve specially simple
23458 names when called by MemberAccess to implement the special
23461 (Expression.ImplicitReferenceConversion): Handle conversions from
23462 Null to reference types before others, as Null's type is
23465 * expression.cs (Invocation.EmitCall): Handle the special case of
23466 calling methods declared on a reference type from a ValueType
23467 (Base classes System.Object and System.Enum)
23469 (MemberAccess.Resolve): Only perform lookups on Enumerations if
23470 the left hand side is a TypeExpr, not on every enumeration.
23472 (Binary.Resolve): If types are reference types, then do a cast to
23473 object on operators != and == of both arguments.
23475 * typemanager.cs (FindMembers): Extract instance and static
23476 members if requested.
23478 * interface.cs (PopulateProperty): Use void_type instead of null
23479 as the return type for the setter method.
23481 (PopulateIndexer): ditto.
23483 2001-12-27 Ravi Pratap <ravi@ximian.com>
23485 * support.cs (ReflectionParameters): Fix minor bug where we
23486 were examining the wrong parameter for the ParamArray attribute.
23488 Cope with requests for the type of the parameter at position
23489 greater than the params parameter's. We now return the element
23490 type of the params array as that makes more sense.
23492 * expression.cs (Invocation.IsParamsMethodApplicable): Update
23493 accordingly as we no longer have to extract the element type
23496 (Invocation.OverloadResolve): Update.
23498 2001-12-27 Miguel de Icaza <miguel@ximian.com>
23500 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
23501 against IEnumerator, test whether the return value is a descendant
23502 of the IEnumerator interface.
23504 * class.cs (Indexer.Define): Use an auxiliary method to implement
23505 the other bits of the method definition. Begin support for
23506 explicit interface implementation.
23508 (Property.DefineMethod): Use TypeManager.void_type instead of null
23509 for an empty return value.
23511 2001-12-26 Miguel de Icaza <miguel@ximian.com>
23513 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
23514 dealing with a FieldExpr which is composed of a FieldBuilder, in
23515 the code path we did extract the constant, but we should have
23516 obtained the underlying value to be able to cast it (otherwise we
23517 end up in an infinite loop, this is what Ravi was running into).
23519 (ArrayCreation.UpdateIndices): Arrays might be empty.
23521 (MemberAccess.ResolveMemberAccess): Add support for section
23522 14.5.4.1 that deals with the special case of E.I when E is a type
23523 and something else, that I can be a reference to a static member.
23525 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
23526 handle a particular array type to create byte blobs, it is just
23527 something we dont generate byteblobs for.
23529 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
23532 * location.cs (Push): remove the key from the hashtable that we
23533 are about to add. This happens for empty files.
23535 * driver.cs: Dispose files after we have parsed them.
23537 (tokenize): new function that only runs the tokenizer on its
23538 input, for speed testing.
23540 2001-12-26 Ravi Pratap <ravi@ximian.com>
23542 * class.cs (Event.Define): Define the private field only if there
23543 are no accessors defined.
23545 * expression.cs (ResolveMemberAccess): If there is no associated
23546 field with the event, that means we have an event defined with its
23547 own accessors and we should flag error cs0070 since transforming
23548 ourselves into a field is not valid in that case.
23550 * ecore.cs (SimpleName.DoResolve): Same as above.
23552 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
23553 and charset to sane values.
23555 2001-12-25 Ravi Pratap <ravi@ximian.com>
23557 * assign.cs (DoResolve): Perform check on events only if they
23558 are being accessed outside the declaring type.
23560 * cs-parser.jay (event_declarations): Update rules to correctly
23561 set the type of the implicit parameter etc.
23563 (add_accessor, remove_accessor): Set current local parameters.
23565 * expression.cs (Binary): For delegate addition and subtraction,
23566 cast the return value from the method into the appropriate delegate
23569 2001-12-24 Ravi Pratap <ravi@ximian.com>
23571 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
23572 of these as the workaround is unnecessary.
23574 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
23575 delegate data - none of that is needed at all.
23577 Re-write bits to extract the instance expression and the delegate method
23580 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
23583 * attribute.cs (ApplyAttributes): New method to take care of common tasks
23584 of attaching attributes instead of duplicating code everywhere.
23586 * everywhere : Update code to do attribute emission using the above method.
23588 2001-12-23 Miguel de Icaza <miguel@ximian.com>
23590 * expression.cs (IsParamsMethodApplicable): if there are not
23591 parameters, return immediately.
23593 * ecore.cs: The 0 literal can be implicity converted to an enum
23596 (SimpleName.DoResolve): First lookup the type, then lookup the
23599 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
23600 want to get its address. If the InstanceExpression is not
23601 addressable, store the result in a temporary variable, then get
23604 * codegen.cs: Only display 219 errors on warning level or above.
23606 * expression.cs (ArrayAccess): Make it implement the
23607 IMemoryLocation interface.
23609 (Binary.DoResolve): handle the operator == (object a, object b)
23610 and operator != (object a, object b) without incurring into a
23611 BoxedCast (because 5 != o should never be performed).
23613 Handle binary enumerator operators.
23615 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
23616 value type, otherwise use Ldelem_ref.
23618 Use precomputed names;
23620 (AddressOf): Implement address of
23622 * cs-parser.jay (labeled_statement): Fix recursive block
23623 addition by reworking the production.
23625 * expression.cs (New.DoEmit): New has a special case:
23627 If we are dealing with a ValueType, we have a few
23628 situations to deal with:
23630 * The target of New is a ValueType variable, that is
23631 easy, we just pass this as the variable reference
23633 * The target of New is being passed as an argument,
23634 to a boxing operation or a function that takes a
23637 In this case, we need to create a temporary variable
23638 that is the argument of New.
23641 2001-12-23 Ravi Pratap <ravi@ximian.com>
23643 * rootcontext.cs (LookupType): Check that current_type is not null before
23644 going about looking at nested types.
23646 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
23647 not implement the IAssignMethod interface any more.
23649 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
23650 where we tranform them into FieldExprs if they are being resolved from within
23651 the declaring type.
23653 * ecore.cs (SimpleName.DoResolve): Do the same here.
23655 * assign.cs (DoResolve, Emit): Clean up code considerably.
23657 * ../errors/bug10.cs : Add.
23659 * ../errors/cs0070.cs : Add.
23661 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
23663 * assign.cs : Get rid of EventIsLocal everywhere.
23665 2001-12-23 Miguel de Icaza <miguel@ximian.com>
23667 * ecore.cs (ConvertIntLiteral): finished the implementation.
23669 * statement.cs (SwitchLabel): Convert the value we are using as a
23670 key before looking up the table.
23672 2001-12-22 Miguel de Icaza <miguel@ximian.com>
23674 * codegen.cs (EmitTopBlock): Require a Location argument now.
23676 * cs-parser.jay (constructor_declarator): We need to setup
23677 current_local_parameters before we parse the
23678 opt_constructor_initializer, to allow the variables to be bound
23679 to the constructor arguments.
23681 * rootcontext.cs (LookupType): First lookup nested classes in our
23682 class and our parents before we go looking outside our class.
23684 * expression.cs (ConstantFold): Extract/debox the values at the
23687 * rootcontext.cs (EmitCode): Resolve the constants first before we
23688 resolve the types. This is not really needed, but it helps debugging.
23690 * statement.cs: report location.
23692 * cs-parser.jay: pass location to throw statement.
23694 * driver.cs: Small bug fix.
23696 * report.cs: Updated format to be 4-zero filled digits.
23698 2001-12-22 Ravi Pratap <ravi@ximian.com>
23700 * expression.cs (CheckIndices): Fix minor bug where the wrong
23701 variable was being referred to ;-)
23703 (DoEmit): Do not call EmitStaticInitializers when the
23704 underlying type is System.Object.
23706 2001-12-21 Ravi Pratap <ravi@ximian.com>
23708 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
23709 and do the usual workaround for SRE.
23711 * class.cs (MyEventBuilder.EventType): New member to get at the type
23712 of the event, quickly.
23714 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
23716 * assign.cs (Assign.DoResolve): Handle the case when the target
23717 is an EventExpr and perform the necessary checks.
23719 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
23722 (SimpleName.MemberStaticCheck): Include check for EventExpr.
23724 (EventExpr): Set the type in the constructor itself since we
23725 are meant to be born fully resolved.
23727 (EventExpr.Define): Revert code I wrote earlier.
23729 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
23730 instance expression is null. The instance expression is a This in that case
23731 or a null, depending on whether it is a static method or not.
23733 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
23734 refers to more than one method.
23736 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
23737 and accordingly flag errors.
23739 2001-12-21 Miguel de Icaza <miguel@ximian.com>
23741 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
23743 2001-12-22 Miguel de Icaza <miguel@ximian.com>
23745 * location.cs (ToString): Provide useful rutine.
23747 2001-12-21 Miguel de Icaza <miguel@ximian.com>
23749 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
23750 objects, return the actual integral boxed.
23752 * statement.cs (SwitchLabel): define an ILLabel for each
23755 (Switch.CheckSwitch): If the value is a Literal, extract
23756 the underlying literal.
23758 Also in the unused hashtable we had, add the SwitchLabel so we can
23759 quickly look this value up.
23761 * constant.cs: Implement a bunch of new constants. Rewrite
23762 Literal based on this. Made changes everywhere to adapt to this.
23764 * expression.cs (Expression.MakeByteBlob): Optimize routine by
23765 dereferencing array only once, and also copes with enumrations.
23767 bytes are two bytes wide, not one.
23769 (Cast): Perform constant conversions.
23771 * ecore.cs (TryImplicitIntConversion): Return literals instead of
23772 wrappers to the literals here.
23774 * expression.cs (DoNumericPromotions): long literals can converted
23775 to ulong implicity (this is taken care of elsewhere, but I was
23776 missing this spot).
23778 * ecore.cs (Expression.Literalize): Make the return type Literal,
23779 to improve type checking.
23781 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
23783 2001-12-20 Miguel de Icaza <miguel@ximian.com>
23785 * literal.cs: Revert code from ravi that checked the bounds. The
23786 bounds are sane by the definition of the type itself.
23788 * typemanager.cs: Fix implementation of ImplementsInterface. We
23789 need to actually look up in our parent hierarchy for interfaces
23792 * const.cs: Use the underlying type for enumerations
23794 * delegate.cs: Compute the basename for the delegate creation,
23795 that should fix the delegate test case, and restore the correct
23796 Type Lookup semantics in rootcontext
23798 * rootcontext.cs: Revert Ravi's last patch. The correct way of
23799 referencing a nested type with the Reflection API is using the "+"
23802 * cs-parser.jay: Do not require EOF token at the end.
23804 2001-12-20 Ravi Pratap <ravi@ximian.com>
23806 * rootcontext.cs (LookupType): Concatenate type names with
23807 a '.' instead of a '+' The test suite passes again.
23809 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
23810 field of the enumeration.
23812 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
23813 the case when the member is an EventExpr.
23815 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
23816 static has an associated instance expression.
23818 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
23820 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
23822 * class.cs (Event.Define): Register event and perform appropriate checks
23825 We define the Add and Remove methods even if the use provides none because
23826 in that case, we provide default implementations ourselves.
23828 Define a private field of the type of the event. This is done by the CSC compiler
23829 and we should be doing it too ;-)
23831 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
23832 More methods we use in code we generate.
23834 (multicast_delegate_type, delegate_type): Two separate types since the distinction
23837 (InitCoreTypes): Update accordingly for the above.
23839 * class.cs (Event.Emit): Generate code for default accessors that we provide
23841 (EmitDefaultMethod): Do the job in the above.
23843 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
23846 2001-12-20 Miguel de Icaza <miguel@ximian.com>
23848 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
23849 builders even if we were missing one.
23851 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
23852 pass the Basename as our class name instead of the Name. The
23853 basename will be correctly composed for us.
23855 * parameter.cs (Paramters): Now takes a Location argument.
23857 * decl.cs (DeclSpace.LookupType): Removed convenience function and
23858 make all the code call directly LookupType in RootContext and take
23859 this chance to pass the Location information everywhere.
23861 * Everywhere: pass Location information.
23863 2001-12-19 Miguel de Icaza <miguel@ximian.com>
23865 * class.cs (Constructor.Define): Updated way of detecting the
23866 length of the parameters.
23868 (TypeContainer.DefineType): Use basename as the type name for
23871 (TypeContainer.Define): Do not recursively define types here, as
23872 definition is taken care in order by the RootContext.
23874 * tree.cs: Keep track of namespaces in a per-file basis.
23876 * parameter.cs (Parameter.ComputeSignature): Update to use
23879 (Parameters.GetSignature): ditto.
23881 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
23882 instead of a TypeContainer.
23884 (Interface.SemanticAnalysis): Use `this' instead of our parent to
23885 resolve names. Because we need to be resolve in our context, not
23888 * driver.cs: Implement response files.
23890 * class.cs (TypeContainer.DefineType): If we are defined, do not
23891 redefine ourselves.
23893 (Event.Emit): Emit the code for add/remove handlers.
23894 (Event.Define): Save the MethodBuilders for add/remove.
23896 * typemanager.cs: Use pair here too.
23898 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
23899 DictionaryEntry requires the first argument to be non-null.
23901 (enum_declaration): Compute full name for registering the
23904 (delegate_declaration): Instead of using
23905 formal_parameter_list, use opt_formal_parameter_list as the list
23908 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
23909 (EventParsing): New property that controls whether `add' and
23910 `remove' are returned as tokens or identifiers (for events);
23912 2001-12-19 Ravi Pratap <ravi@ximian.com>
23914 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
23915 use MyEventBuilder only and let it wrap the real builder for us.
23917 (MyEventBuilder): Revamp constructor etc.
23919 Implement all operations that we perform on EventBuilder in precisely the same
23922 (FindMembers): Update to use the EventBuilder member.
23924 (Event.Emit): Update accordingly.
23926 2001-12-18 Ravi Pratap <ravi@ximian.com>
23928 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
23929 by calling the appropriate methods.
23931 (GetCustomAttributes): Make stubs as they cannot possibly do anything
23934 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
23936 2001-12-17 Ravi Pratap <ravi@ximian.com>
23938 * delegate.cs (Delegate.Populate): Check that the return type
23939 and various parameters types are indeed accessible.
23941 * class.cs (Constructor.Define): Same here.
23943 (Field.Define): Ditto.
23945 (Event.Define): Ditto.
23947 (Operator.Define): Check that the underlying Method defined itself
23948 correctly - so it's MethodBuilder should not be null.
23950 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
23951 expression happens to be null.
23953 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
23954 members but as of now we don't seem to be able to do anything really useful with it.
23956 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
23957 not the EventBuilder.
23959 2001-12-18 Miguel de Icaza <miguel@ximian.com>
23961 * cs-tokenizer.cs: Add support for defines.
23962 Add support for #if, #elif, #else, #endif
23964 (eval_var): evaluates a variable.
23965 (eval): stubbed for evaluating functions.
23967 * cs-parser.jay: Pass the defines information
23969 * driver.cs: Add --define command line option.
23971 * decl.cs: Move MemberCore here.
23973 Make it the base class for DeclSpace. This allows us to catch and
23974 report 108 and 109 for everything now.
23976 * class.cs (TypeContainer.Define): Extract all the members
23977 before populating and emit the warning 108 (new keyword required
23978 to override) instead of having each member implement this.
23980 (MemberCore.Define): New abstract method, we will be using this in
23981 the warning reporting engine in Populate.
23983 (Operator.Define): Adjust to new MemberCore protocol.
23985 * const.cs (Const): This does not derive from Expression, it is a
23986 temporary object we use to create fields, it is a MemberCore.
23988 * class.cs (Method.Define): Allow the entry point to be in a
23991 * driver.cs: Rewrite the argument handler to clean it up a bit.
23993 * rootcontext.cs: Made it just an auxiliary namespace feature by
23994 making everything static.
23996 * driver.cs: Adapt code to use RootContext type name instead of
23999 * delegate.cs: Remove RootContext argument.
24001 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
24004 * class.cs (Event.Define): The lookup can fail.
24006 * cs-tokenizer.cs: Begin implementation of pre-procesor.
24008 * expression.cs: Resolve the this instance before invoking the code.
24010 2001-12-17 Miguel de Icaza <miguel@ximian.com>
24012 * cs-parser.jay: Add a production in element_access that allows
24013 the thing to become a "type" reference. This way we can parse
24014 things like "(string [])" as a type.
24016 Note that this still does not handle the more complex rules of
24020 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
24022 * ecore.cs: (CopyNewMethods): new utility function used to
24023 assemble the list of methods from running FindMembers.
24025 (MemberLookup): Rework FindMembers so that
24027 2001-12-16 Miguel de Icaza <miguel@ximian.com>
24029 * class.cs (TypeContainer): Remove Delegates who fail to be
24032 * delegate.cs (Populate): Verify that we dont get null return
24033 values. TODO: Check for AsAccessible.
24035 * cs-parser.jay: Use basename to emit error 574 (destructor should
24036 have the same name as container class), not the full name.
24038 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
24039 possible representation.
24041 Also implements integer type suffixes U and L.
24043 2001-12-15 Miguel de Icaza <miguel@ximian.com>
24045 * expression.cs (ArrayCreation.DoResolve): We need to do the
24046 argument resolution *always*.
24048 * decl.cs: Make this hold the namespace. Hold the root context as
24050 (LookupType): Move here.
24052 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
24054 * location.cs (Row, Name): Fixed the code, it was always returning
24055 references to the first file.
24057 * interface.cs: Register properties defined through interfaces.
24059 * driver.cs: Add support for globbing on the command line
24061 * class.cs (Field): Make it derive from MemberCore as well.
24064 2001-12-15 Ravi Pratap <ravi@ximian.com>
24066 * class.cs (Event::Define): Check that the type of the event is a delegate
24067 type else flag error #66.
24069 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
24072 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
24073 values of EntryPoint, CharSet etc etc.
24075 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
24077 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
24078 be null and we should ignore this. I am not sure if this is really clean. Apparently,
24079 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
24080 which needs this to do its work.
24082 * ../errors/cs0066.cs : Add.
24084 2001-12-14 Miguel de Icaza <miguel@ximian.com>
24086 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
24089 * class.cs: (MethodSignature.MethodSignature): Removed hack that
24090 clears out the parameters field.
24091 (MemberSignatureCompare): Cleanup
24093 (MemberCore): New base class used to share code between MethodCore
24096 (RegisterRequiredImplementations) BindingFlags.Public requires
24097 either BindingFlags.Instace or Static. Use instance here.
24099 (Property): Refactored code to cope better with the full spec.
24101 * parameter.cs (GetParameterInfo): Return an empty array instead
24104 * class.cs (Property): Abstract or extern properties have no bodies.
24106 * parameter.cs (GetParameterInfo): return a zero-sized array.
24108 * class.cs (TypeContainer.MethodModifiersValid): Move all the
24109 method modifier validation to the typecontainer so we can reuse
24110 this on properties.
24112 (MethodCore.ParameterTypes): return an empty sized array of types.
24114 (Property.Define): Test property modifier validity.
24116 Add tests for sealed/override too.
24118 (Method.Emit): abstract or extern methods have no bodies.
24120 2001-12-14 Ravi Pratap <ravi@ximian.com>
24122 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
24125 (Method::Define, ::Emit): Modify accordingly.
24127 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
24129 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
24131 * makefile: Pass in /unsafe.
24133 2001-12-13 Miguel de Icaza <miguel@ximian.com>
24135 * class.cs (MakeKey): Kill routine.
24137 * class.cs (TypeContainer.Define): Correctly define explicit
24138 method implementations (they require the full interface name plus
24141 * typemanager.cs: Deply the PtrHashtable here and stop using the
24142 lame keys. Things work so much better.
24144 This of course broke everyone who depended on `RegisterMethod' to
24145 do the `test for existance' test. This has to be done elsewhere.
24147 * support.cs (PtrHashtable): A hashtable that avoid comparing with
24148 the object stupid Equals method (because, that like fails all over
24149 the place). We still do not use it.
24151 * class.cs (TypeContainer.SetRequiredInterface,
24152 TypeContainer.RequireMethods): Killed these two routines and moved
24153 all the functionality to RegisterRequiredImplementations.
24155 (TypeContainer.RegisterRequiredImplementations): This routine now
24156 registers all the implementations required in an array for the
24157 interfaces and abstract methods. We use an array of structures
24158 which can be computed ahead of time to reduce memory usage and we
24159 also assume that lookups are cheap as most classes will not
24160 implement too many interfaces.
24162 We also avoid creating too many MethodSignatures.
24164 (TypeContainer.IsInterfaceMethod): Update and optionally does not
24165 clear the "pending" bit if we find that there are problems with
24168 (TypeContainer.VerifyPendingMethods): Update to report errors of
24169 methods that look like implementations but are not.
24171 (TypeContainer.Define): Add support for explicit interface method
24174 2001-12-12 Miguel de Icaza <miguel@ximian.com>
24176 * typemanager.cs: Keep track of the parameters here instead of
24177 being a feature of the TypeContainer.
24179 * class.cs: Drop the registration of parameters here, as
24180 InterfaceMethods are also interface declarations.
24182 * delegate.cs: Register methods with the TypeManager not only with
24183 the TypeContainer. This code was buggy.
24185 * interface.cs: Full registation here.
24187 2001-12-11 Miguel de Icaza <miguel@ximian.com>
24189 * expression.cs: Remove reducer for binary expressions, it can not
24192 * const.cs: Put here the code that used to go into constant.cs
24194 * constant.cs: Put here the code for constants, this is a new base
24195 class for Literals.
24197 * literal.cs: Make Literal derive from Constant.
24199 2001-12-09 Miguel de Icaza <miguel@ximian.com>
24201 * statement.cs (Return.Emit): Report error 157 if the user
24202 attempts to return from a finally block.
24204 (Return.Emit): Instead of emitting a return, jump to the end of
24207 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
24208 LocalBuilder to store the result of the function. ReturnLabel is
24209 the target where we jump.
24212 2001-12-09 Radek Doulik <rodo@ximian.com>
24214 * cs-parser.jay: remember alias in current namespace
24216 * ecore.cs (SimpleName::DoResolve): use aliases for types or
24219 * class.cs (LookupAlias): lookup alias in my_namespace
24221 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
24223 (LookupAlias): lookup alias in this and if needed in parent
24226 2001-12-08 Miguel de Icaza <miguel@ximian.com>
24230 * rootcontext.cs: (ModuleBuilder) Made static, first step into
24231 making things static. I need this to avoid passing the
24232 TypeContainer when calling ParameterType.
24234 * support.cs (InternalParameters.ParameterType): Remove ugly hack
24235 that did string manipulation to compute the type and then call
24236 GetType. Use Parameter.ParameterType instead.
24238 * cs-tokenizer.cs: Consume the suffix for floating values.
24240 * expression.cs (ParameterReference): figure out whether this is a
24241 reference parameter or not. Kill an extra variable by computing
24242 the arg_idx during emission.
24244 * parameter.cs (Parameters.GetParameterInfo): New overloaded
24245 function that returns whether a parameter is an out/ref value or not.
24247 (Parameter.ParameterType): The type of the parameter (base,
24248 without ref/out applied).
24250 (Parameter.Resolve): Perform resolution here.
24251 (Parameter.ExternalType): The full type (with ref/out applied).
24253 * statement.cs (Using.Emit, Using.EmitExpression): Implement
24254 support for expressions on the using statement.
24256 2001-12-07 Miguel de Icaza <miguel@ximian.com>
24258 * statement.cs (Using.EmitLocalVariableDecls): Split the
24259 localvariable handling of the using statement.
24261 (Block.EmitMeta): Keep track of variable count across blocks. We
24262 were reusing slots on separate branches of blocks.
24264 (Try.Emit): Emit the general code block, we were not emitting it.
24266 Check the type of the declaration to be an IDisposable or
24267 something that can be implicity converted to it.
24269 Emit conversions if required.
24271 * ecore.cs (EmptyExpression): New utility class.
24272 (Expression.ImplicitConversionExists): New utility function.
24274 2001-12-06 Miguel de Icaza <miguel@ximian.com>
24276 * statement.cs (Using): Implement.
24278 * expression.cs (LocalVariableReference): Support read only variables.
24280 * statement.cs: Remove the explicit emit for the Leave opcode.
24281 (VariableInfo): Add a readonly field.
24283 2001-12-05 Miguel de Icaza <miguel@ximian.com>
24285 * ecore.cs (ConvCast): new class used to encapsulate the various
24286 explicit integer conversions that works in both checked and
24287 unchecked contexts.
24289 (Expression.ConvertNumericExplicit): Use new ConvCast class to
24290 properly generate the overflow opcodes.
24292 2001-12-04 Miguel de Icaza <miguel@ximian.com>
24294 * statement.cs: The correct type for the EmptyExpression is the
24295 element_type, not the variable type. Ravi pointed this out.
24297 2001-12-04 Ravi Pratap <ravi@ximian.com>
24299 * class.cs (Method::Define): Handle PInvoke methods specially
24300 by using DefinePInvokeMethod instead of the usual one.
24302 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
24303 above to do the task of extracting information and defining the method.
24305 2001-12-04 Ravi Pratap <ravi@ximian.com>
24307 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
24308 of the condition for string type.
24310 (Emit): Move that here.
24312 (ArrayCreation::CheckIndices): Keep string literals in their expression
24315 (EmitDynamicInitializers): Handle strings appropriately.
24317 2001-12-04 Miguel de Icaza <miguel@ximian.com>
24319 * codegen.cs (EmitContext): Replace multiple variables with a
24320 single pointer to the current Switch statement.
24322 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
24325 2001-12-03 Miguel de Icaza <miguel@ximian.com>
24329 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
24332 (Foreach.Emit): Foreach on arrays was not setting
24333 up the loop variables (for break/continue).
24335 (GotoCase): Semi-implented.
24337 2001-12-03 Ravi Pratap <ravi@ximian.com>
24339 * attribute.cs (CheckAttribute): Handle system attributes by using
24340 Attribute.GetAttributes to examine information we need.
24342 (GetValidPlaces): Same here.
24344 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
24346 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
24348 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
24350 (Method::Define): Set appropriate flags if we have a DllImport attribute.
24352 (Method::Emit): Handle the case when we are a PInvoke method.
24354 2001-12-03 Miguel de Icaza <miguel@ximian.com>
24356 * expression.cs: Use ResolveWithSimpleName on compound names.
24358 2001-12-02 Ravi Pratap <ravi@ximian.com>
24360 * constant.cs (EmitConstant): Make sure we resolve the associated expression
24361 before trying to reduce it.
24363 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
24365 * constant.cs (LookupConstantValue): Implement.
24367 (EmitConstant): Use the above in emitting the constant.
24369 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
24370 that are user-defined by doing a LookupConstantValue on them.
24372 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
24375 2001-11-29 Miguel de Icaza <miguel@ximian.com>
24377 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
24379 (BaseAccess.DoResolve): Implement.
24381 (MemberAccess.DoResolve): Split this routine into a
24382 ResolveMemberAccess routine that can be used independently
24384 2001-11-28 Miguel de Icaza <miguel@ximian.com>
24386 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
24387 As that share bits of the implementation. Is returns a boolean,
24388 while As returns the Type that is being probed.
24390 2001-12-01 Ravi Pratap <ravi@ximian.com>
24392 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
24393 instead of a Literal - much easier.
24395 (EnumInTransit): Remove - utterly useless :-)
24397 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
24399 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
24401 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
24402 chain when we have no associated expression.
24404 2001-11-30 Ravi Pratap <ravi@ximian.com>
24406 * constant.cs (Define): Use Location while reporting the errror.
24408 Also emit a warning when 'new' is used and there is no inherited
24411 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
24414 (LookupEnumValue): Implement to lookup an enum member's value and define it
24417 (Populate): Re-write accordingly to use the above routine.
24419 2001-11-27 Miguel de Icaza <miguel@ximian.com>
24421 * expression.cs (This): Fix prototype for DoResolveLValue to
24422 override the base class DoResolveLValue.
24424 * cs-parser.cs: Report errors cs574 and cs575 (destructor
24427 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
24428 (we need to load the address of the field here). This fixes
24431 (FieldExpr.DoResolveLValue): Call the DoResolve
24432 function to initialize the Instance expression.
24434 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
24435 correctly the GetEnumerator operation on a value type.
24437 * cs-parser.jay: Add more simple parsing error catches.
24439 * statement.cs (Switch): Add support for string switches.
24440 Handle null specially.
24442 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
24444 2001-11-28 Ravi Pratap <ravi@ximian.com>
24446 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
24448 (declare_local_constant): New helper function.
24450 * statement.cs (AddConstant): Keep a separate record of constants
24452 (IsConstant): Implement to determine if a variable is a constant.
24454 (GetConstantExpression): Implement.
24456 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
24458 * statement.cs (IsVariableDefined): Re-write.
24460 2001-11-27 Ravi Pratap <ravi@ximian.com>
24462 * class.cs (TypeContainer::FindMembers): Look for constants
24463 in the case when we are looking for MemberTypes.Field
24465 * expression.cs (MemberAccess::DoResolve): Check that in the
24466 case we are a FieldExpr and a Literal, we are not being accessed
24467 by an instance reference.
24469 * cs-parser.jay (local_constant_declaration): Implement.
24471 (declaration_statement): Implement for constant declarations.
24473 2001-11-26 Miguel de Icaza <miguel@ximian.com>
24475 * statement.cs (Switch): Catch double defaults.
24477 (Switch): More work on the switch() statement
24478 implementation. It works for integral values now, need to finish
24482 2001-11-24 Miguel de Icaza <miguel@ximian.com>
24484 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
24485 integer literals into other integer literals. To be used by
24488 2001-11-24 Ravi Pratap <ravi@ximian.com>
24490 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
24493 (EmitDynamicInitializers): Cope with the above since we extract data
24494 directly from ArrayData now.
24496 (ExpectInitializers): Keep track of whether initializers are mandatory
24499 (Bounds): Make it a hashtable to prevent the same dimension being
24500 recorded for every element in that dimension.
24502 (EmitDynamicInitializers): Fix bug which prevented the Set array method
24505 Also fix bug which was causing the indices to be emitted in the reverse
24508 2001-11-24 Miguel de Icaza <miguel@ximian.com>
24510 * expression.cs (ArrayCreation): Implement the bits that Ravi left
24511 unfinished. They do not work, because the underlying code is
24514 2001-11-22 Miguel de Icaza <miguel@ximian.com>
24516 * cs-parser.jay: Remove bogus fixme.
24518 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
24519 on Switch statement.
24521 2001-11-23 Ravi Pratap <ravi@ximian.com>
24523 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
24526 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
24527 parameter. Apparently, any expression is allowed.
24529 (ValidateInitializers): Update accordingly.
24531 (CheckIndices): Fix some tricky bugs thanks to recursion.
24533 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
24534 I was being completely brain-dead.
24536 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
24537 and re-write acordingly.
24539 (DelegateInvocation): Re-write accordingly.
24541 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
24543 (MakeByteBlob): Handle types more correctly.
24545 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
24546 initialization from expressions but it is incomplete because I am a complete
24549 2001-11-22 Miguel de Icaza <miguel@ximian.com>
24551 * statement.cs (If.Emit): Fix a bug that generated incorrect code
24552 on If. Basically, we have to return `true' (ie, we do return to
24553 our caller) only if both branches of the if return.
24555 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
24556 short-circuit operators, handle them as short circuit operators.
24558 (Cast.DoResolve): Resolve type.
24559 (Cast.Cast): Take an expression as the target type.
24561 * cs-parser.jay (cast_expression): Remove old hack that only
24562 allowed a limited set of types to be handled. Now we take a
24563 unary_expression and we resolve to a type during semantic
24566 Use the grammar productions from Rhys to handle casts (this is
24567 not complete like Rhys syntax yet, we fail to handle that corner
24568 case that C# has regarding (-x), but we will get there.
24570 2001-11-22 Ravi Pratap <ravi@ximian.com>
24572 * class.cs (EmitFieldInitializer): Take care of the case when we have a
24573 field which is an array type.
24575 * cs-parser.jay (declare_local_variables): Support array initialization too.
24577 * typemanager.cs (MakeKey): Implement.
24579 (everywhere): Use the above appropriately.
24581 * cs-parser.jay (for_statement): Update for array initialization while
24582 declaring variables.
24584 * ecore.cs : The error message was correct, it's the variable's names that
24585 were misleading ;-) Make the code more readable.
24587 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
24588 the correct type etc.
24590 (ConvertExplicit): Handle Enum types by examining the underlying type.
24592 2001-11-21 Ravi Pratap <ravi@ximian.com>
24594 * parameter.cs (GetCallingConvention): Always return
24595 CallingConventions.Standard for now.
24597 2001-11-22 Miguel de Icaza <miguel@ximian.com>
24599 * expression.cs (Binary.ResolveOperator): Update the values of `l'
24600 and `r' after calling DoNumericPromotions.
24602 * ecore.cs: Fix error message (the types were in the wrong order).
24604 * statement.cs (Foreach.ProbeCollectionType): Need to pass
24605 BindingFlags.Instance as well
24607 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
24608 implicit int literal conversion in an empty cast so that we
24609 propagate the right type upstream.
24611 (UnboxCast): new class used to unbox value types.
24612 (Expression.ConvertExplicit): Add explicit type conversions done
24615 (Expression.ImplicitNumericConversion): Oops, forgot to test for
24616 the target type before applying the implicit LongLiterals to ULong
24619 2001-11-21 Miguel de Icaza <miguel@ximian.com>
24621 * cs-parser.jay (for_statement): Reworked the way For works: now
24622 we declare manually any variables that are introduced in
24623 for_initializer to solve the problem of having out-of-band code
24624 emition (that is what got for broken).
24626 (declaration_statement): Perform the actual variable declaration
24627 that used to be done in local_variable_declaration here.
24629 (local_variable_declaration): Do not declare anything, just pass
24630 the information on a DictionaryEntry
24632 2001-11-20 Ravi Pratap <ravi@ximian.com>
24634 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
24635 re-write of the logic to now make it recursive.
24637 (UpdateIndices): Re-write accordingly.
24639 Store element data in a separate ArrayData list in the above methods.
24641 (MakeByteBlob): Implement to dump the array data into a byte array.
24643 2001-11-19 Ravi Pratap <ravi@ximian.com>
24645 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
24648 * constant.cs (Define): Implement.
24650 (EmitConstant): Re-write fully.
24652 Pass in location info.
24654 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
24657 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
24658 DictionaryEntry since we need location info too.
24660 (constant_declaration): Update accordingly.
24662 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
24663 code into another method : UpdateIndices.
24665 2001-11-18 Ravi Pratap <ravi@ximian.com>
24667 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
24668 some type checking etc.
24670 2001-11-17 Ravi Pratap <ravi@ximian.com>
24672 * expression.cs (ArrayCreation::ValidateInitializers): Implement
24673 bits to provide dimension info if the user skips doing that.
24675 Update second constructor to store the rank correctly.
24677 2001-11-16 Ravi Pratap <ravi@ximian.com>
24679 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
24680 and try to implement.
24682 * ../errors/cs0150.cs : Add.
24684 * ../errors/cs0178.cs : Add.
24686 2001-11-16 Miguel de Icaza <miguel@ximian.com>
24688 * statement.cs: Implement foreach on multi-dimensional arrays.
24690 * parameter.cs (Parameters.GetParameterByName): Also lookup the
24691 name of the params argument.
24693 * expression.cs: Use EmitStoreOpcode to get the right opcode while
24694 initializing the array.
24696 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
24697 we can use this elsewhere.
24699 * statement.cs: Finish implementation of foreach for single
24702 * cs-parser.jay: Use an out-of-band stack to pass information
24703 around, I wonder why I need this.
24705 foreach_block: Make the new foreach_block the current_block.
24707 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
24708 function used to return a static Parameters structure. Used for
24709 empty parameters, as those are created very frequently.
24711 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
24713 2001-11-15 Ravi Pratap <ravi@ximian.com>
24715 * interface.cs : Default modifier is private, not public. The
24716 make verify test passes again.
24718 2001-11-15 Ravi Pratap <ravi@ximian.com>
24720 * support.cs (ReflectionParameters): Fix logic to determine
24721 whether the last parameter is a params one. Test 9 passes again.
24723 * delegate.cs (Populate): Register the builders we define with
24724 RegisterParameterForBuilder. Test 19 passes again.
24726 * cs-parser.jay (property_declaration): Reference $6 instead
24727 of $$ to get at the location.
24729 (indexer_declaration): Similar stuff.
24731 (attribute): Ditto.
24733 * class.cs (Property): Register parameters for the Get and Set methods
24734 if they exist. Test 23 passes again.
24736 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
24737 call to EmitArguments as we are sure there aren't any params arguments.
24738 Test 32 passes again.
24740 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
24741 IndexOutOfRangeException.
24743 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
24744 Test 33 now passes again.
24746 2001-11-15 Miguel de Icaza <miguel@ximian.com>
24748 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
24749 broke a bunch of things. Will have to come up with a better way
24750 of tracking locations.
24752 * statement.cs: Implemented foreach for single dimension arrays.
24754 2001-11-09 Miguel de Icaza <miguel@ximian.com>
24756 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
24757 an error. This removes the lookup from the critical path.
24759 * cs-parser.jay: Removed use of temporary_loc, which is completely
24762 2001-11-14 Miguel de Icaza <miguel@ximian.com>
24764 * support.cs (ReflectionParameters.ParameterModifier): Report
24765 whether the argument is a PARAMS argument or not.
24767 * class.cs: Set the attribute `ParamArrayAttribute' on the
24768 parameter argument.
24770 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
24771 and cons_param_array_attribute (ConstructorInfo for
24772 ParamArrayAttribute).,
24774 * codegen.cs: Emit the return using the `Return' statement, that
24775 way we can report the error correctly for missing return values.
24777 * class.cs (Method.Emit): Clean up.
24779 * expression.cs (Argument.Resolve): Take another argument: the
24780 location where this argument is used. Notice that this is not
24781 part of the "Argument" class as to reduce the size of the
24782 structure (we know the approximate location anyways).
24784 Test if the argument is a variable-reference, if not, then
24785 complain with a 206.
24787 (Argument.Emit): Emit addresses of variables.
24789 (Argument.FullDesc): Simplify.
24791 (Invocation.DoResolve): Update for Argument.Resolve.
24793 (ElementAccess.DoResolve): ditto.
24795 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
24796 method should be virtual, as this method is always virtual.
24798 (NewDelegate.DoResolve): Update for Argument.Resolve.
24800 * class.cs (ConstructorInitializer.DoResolve): ditto.
24802 * attribute.cs (Attribute.Resolve): ditto.
24804 2001-11-13 Miguel de Icaza <miguel@ximian.com>
24806 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
24808 * expression.cs (ParameterReference): Drop IStackStorage and implement
24809 IAssignMethod instead.
24811 (LocalVariableReference): ditto.
24813 * ecore.cs (FieldExpr): Drop IStackStorage and implement
24814 IAssignMethod instead.
24816 2001-11-13 Miguel de Icaza <miguel@ximian.com>
24818 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
24819 enumerations that are used in heavily used structures derive from
24820 byte in a laughable and pathetic attempt to reduce memory usage.
24821 This is the kind of pre-optimzations that you should not do at
24822 home without adult supervision.
24824 * expression.cs (UnaryMutator): New class, used to handle ++ and
24825 -- separatedly from the other unary operators. Cleans up the
24826 code, and kills the ExpressionStatement dependency in Unary.
24828 (Unary): Removed `method' and `Arguments' from this class, making
24829 it smaller, and moving it all to SimpleCall, so I can reuse this
24830 code in other locations and avoid creating a lot of transient data
24831 strucutres when not required.
24833 * cs-parser.jay: Adjust for new changes.
24835 2001-11-11 Miguel de Icaza <miguel@ximian.com>
24837 * enum.cs (Enum.Populate): If there is a failure during
24840 * cs-parser.jay (opt_enum_base): we used to catch type errors
24841 here, but this is really incorrect. The type error should be
24842 catched during semantic analysis.
24844 2001-12-11 Ravi Pratap <ravi@ximian.com>
24846 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
24847 current_local_parameters as expected since I, in my stupidity, had forgotten
24850 * attribute.cs (GetValidPlaces): Fix stupid bug.
24852 * class.cs (Method::Emit): Perform check on applicability of attributes.
24854 (Constructor::Emit): Ditto.
24856 (Field::Emit): Ditto.
24858 (Field.Location): Store location information.
24860 (Property, Event, Indexer, Operator): Ditto.
24862 * cs-parser.jay (field_declaration): Pass in location for each field.
24864 * ../errors/cs0592.cs : Add.
24866 2001-11-12 Ravi Pratap <ravi@ximian.com>
24868 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
24870 (InitCoreTypes): Update accordingly.
24872 (RegisterAttrType, LookupAttr): Implement.
24874 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
24875 info about the same.
24877 (Resolve): Update to populate the above as necessary.
24879 (Error592): Helper.
24881 (GetValidPlaces): Helper to the above.
24883 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
24885 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
24887 2001-11-12 Ravi Pratap <ravi@ximian.com>
24889 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
24891 * ../errors/cs0617.cs : Add.
24893 2001-11-11 Ravi Pratap <ravi@ximian.com>
24895 * enum.cs (Emit): Rename to Populate to be more consistent with what
24896 we expect it to do and when exactly it is called.
24898 * class.cs, rootcontext.cs : Update accordingly.
24900 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
24901 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
24903 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
24905 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
24906 of a fieldinfo using the above, when dealing with a FieldBuilder.
24908 2001-11-10 Ravi Pratap <ravi@ximian.com>
24910 * ../errors/cs0031.cs : Add.
24912 * ../errors/cs1008.cs : Add.
24914 * ../errrors/cs0543.cs : Add.
24916 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
24919 (FindMembers): Implement.
24921 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
24922 enums and delegates too.
24924 (enum_types): Rename to builder_to_enum.
24926 (delegate_types): Rename to builder_to_delegate.
24928 * delegate.cs (FindMembers): Implement.
24930 2001-11-09 Ravi Pratap <ravi@ximian.com>
24932 * typemanager.cs (IsEnumType): Implement.
24934 * enum.cs (Emit): Re-write parts to account for the underlying type
24935 better and perform checking etc.
24937 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
24938 of the underlying type.
24940 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
24943 * enum.cs (error31): Helper to report error #31.
24945 * cs-parser.jay (enum_declaration): Store location of each member too.
24947 * enum.cs (member_to_location): New hashtable.
24949 (AddEnumMember): Update location hashtable.
24951 (Emit): Use the location of each member while reporting errors.
24953 2001-11-09 Miguel de Icaza <miguel@ximian.com>
24955 * cs-parser.jay: A for_initializer if is a
24956 local_variable_declaration really ammount to have an implicit
24957 block with the variable declaration and no initializer for for.
24959 * statement.cs (For.Emit): Cope with null initializers.
24961 This fixes the infinite loop on for initializers.
24963 2001-11-08 Miguel de Icaza <miguel@ximian.com>
24965 * enum.cs: More cleanup.
24967 * ecore.cs: Remove dead code.
24969 * class.cs (Property.Emit): More simplification.
24970 (Event.Emit): ditto.
24972 Reworked to have less levels of indentation.
24974 2001-11-08 Ravi Pratap <ravi@ximian.com>
24976 * class.cs (Property): Emit attributes.
24986 * enum.cs (Emit): Ditto.
24988 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
24991 * class.cs (Field, Event, etc.): Move attribute generation into the
24992 Emit method everywhere.
24994 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
24995 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
24996 as we had no way of defining nested enums !
24998 * rootcontext.cs : Adjust code accordingly.
25000 * typemanager.cs (AddEnumType): To keep track of enum types separately.
25002 2001-11-07 Ravi Pratap <ravi@ximian.com>
25004 * expression.cs (EvalConstantExpression): Move into ecore.cs
25006 * enum.cs (Enum): Rename some members and make them public and readonly
25007 according to our convention.
25009 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
25012 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
25014 (Enum::Emit): Write a simple version for now which doesn't try to compute
25015 expressions. I shall modify this to be more robust in just a while.
25017 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
25019 (TypeContainer::CloseType): Create the Enum types too.
25021 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
25023 * expression.cs (EvalConstantExpression): Get rid of completely.
25025 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
25026 user-defined values and other cases.
25028 (IsValidEnumLiteral): Helper function.
25030 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
25031 out there in the case we had a literal FieldExpr.
25033 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
25035 (Literalize): Revamp a bit to take two arguments.
25037 (EnumLiteral): New class which derives from Literal to wrap enum literals.
25039 2001-11-06 Ravi Pratap <ravi@ximian.com>
25041 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
25043 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
25045 (Resolve): Use the above to ensure we have proper initializers.
25047 2001-11-05 Ravi Pratap <ravi@ximian.com>
25049 * expression.cs (Expression::EvalConstantExpression): New method to
25050 evaluate constant expressions.
25052 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
25054 2001-11-07 Miguel de Icaza <miguel@ximian.com>
25056 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
25059 (Binary.ResolveOperator): Handle operator != (object a, object b)
25060 and operator == (object a, object b);
25062 (Binary.DoNumericPromotions): Indicate whether the numeric
25063 promotion was possible.
25065 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
25068 Made the ArrayAccess implement interface IAssignMethod instead of
25069 IStackStore as the order in which arguments are passed reflects
25072 * assign.cs: Instead of using expr.ExprClass to select the way of
25073 assinging, probe for the IStackStore/IAssignMethod interfaces.
25075 * typemanager.cs: Load InitializeArray definition.
25077 * rootcontext.cs (RootContext.MakeStaticData): Used to define
25078 static data that can be used to initialize arrays.
25080 2001-11-05 Miguel de Icaza <miguel@ximian.com>
25082 * expression.cs: Handle operator== and operator!= for booleans.
25084 (Conditioal.Reduce): Implement reducer for the ?: operator.
25086 (Conditional.Resolve): Implement dead code elimination.
25088 (Binary.Resolve): Catch string literals and return a new
25089 concatenated string.
25091 (Unary.Reduce): Implement reduction of unary expressions.
25093 * ecore.cs: Split out the expression core handling here.
25095 (Expression.Reduce): New method used to perform constant folding
25096 and CSE. This is needed to support constant-expressions.
25098 * statement.cs (Statement.EmitBoolExpression): Pass true and false
25099 targets, and optimize for !x.
25101 2001-11-04 Ravi Pratap <ravi@ximian.com>
25103 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
25104 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
25105 set custom atttributes.
25107 * literal.cs (Literal::GetValue): New abstract method to return the actual
25108 value of the literal, cast as an object.
25110 (*Literal): Implement GetValue method.
25112 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
25113 expressions to the arraylist but objects of type Argument.
25115 * class.cs (TypeContainer::Emit): Emit our attributes too.
25117 (Method::Emit, Constructor::Emit): Ditto.
25119 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
25120 to be ignoring earlier.
25122 2001-11-03 Ravi Pratap <ravi@ximian.com>
25124 * attribute.cs (AttributeSection::Define): Implement to do the business
25125 of constructing a CustomAttributeBuilder.
25127 (Attribute): New trivial class. Increases readability of code.
25129 * cs-parser.jay : Update accordingly.
25131 (positional_argument_list, named_argument_list, named_argument): New rules
25133 (attribute_arguments): Use the above so that we are more correct.
25135 2001-11-02 Ravi Pratap <ravi@ximian.com>
25137 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
25138 to perform all checks for a method with a params parameter.
25140 (Invocation::OverloadResolve): Update to use the above method and therefore
25141 cope correctly with params method invocations.
25143 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
25146 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
25147 constructors in our parent too because we can't afford to miss out on
25150 * attribute.cs (AttributeSection): New name for the class Attribute
25152 Other trivial changes to improve readability.
25154 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
25155 use the new class names.
25157 2001-11-01 Ravi Pratap <ravi@ximian.com>
25159 * class.cs (Method::Define): Complete definition for params types too
25161 (Indexer::Define): Ditto.
25163 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
25164 Cope everywhere with a request for info about the array parameter.
25166 2001-11-01 Ravi Pratap <ravi@ximian.com>
25168 * tree.cs (RecordNamespace): Fix up to check for the correct key.
25170 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
25171 local_variable_type to extract the string corresponding to the type.
25173 (local_variable_type): Fixup the action to use the new helper method.
25175 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
25178 * expression.cs : Clean out code which uses the above.
25180 2001-10-31 Ravi Pratap <ravi@ximian.com>
25182 * typemanager.cs (RegisterMethod): Check if we already have an existing key
25183 and bale out if necessary by returning a false.
25185 (RegisterProperty): Ditto.
25187 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
25188 and print out appropriate error messages.
25190 * interface.cs (everywhere): Ditto.
25192 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
25193 location to constructor.
25195 * class.cs (Property, Event, Indexer): Update accordingly.
25197 * ../errors/cs111.cs : Added.
25199 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
25200 of a method, as laid down by the spec.
25202 (Invocation::OverloadResolve): Use the above method.
25204 2001-10-31 Ravi Pratap <ravi@ximian.com>
25206 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
25207 now take a TypeContainer and a Parameters object.
25209 (ParameterData): Modify return type of ParameterModifier method to be
25210 Parameter.Modifier and not a string.
25212 (ReflectionParameters, InternalParameters): Update accordingly.
25214 * expression.cs (Argument::GetParameterModifier): Same here.
25216 * support.cs (InternalParameters::ParameterType): Find a better way of determining
25217 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
25218 symbol in it at all so maybe this is only for now.
25220 2001-10-30 Ravi Pratap <ravi@ximian.com>
25222 * support.cs (InternalParameters): Constructor now takes an extra argument
25223 which is the actual Parameters class.
25225 (ParameterDesc): Update to provide info on ref/out modifiers.
25227 * class.cs (everywhere): Update call to InternalParameters to pass in
25228 the second argument too.
25230 * support.cs (ParameterData): Add ParameterModifier, which is a method
25231 to return the modifier info [ref/out etc]
25233 (InternalParameters, ReflectionParameters): Implement the above.
25235 * expression.cs (Argument::ParameterModifier): Similar function to return
25236 info about the argument's modifiers.
25238 (Invocation::OverloadResolve): Update to take into account matching modifiers
25241 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
25242 a new SetFormalParameters object which we pass to InternalParameters.
25244 2001-10-30 Ravi Pratap <ravi@ximian.com>
25246 * expression.cs (NewArray): Merge into the ArrayCreation class.
25248 2001-10-29 Ravi Pratap <ravi@ximian.com>
25250 * expression.cs (NewArray): Merge classes NewBuiltinArray and
25251 NewUserdefinedArray into one as there wasn't much of a use in having
25254 * expression.cs (Argument): Change field's name to ArgType from Type.
25256 (Type): New readonly property which returns the proper type, taking into
25257 account ref/out modifiers.
25259 (everywhere): Adjust code accordingly for the above.
25261 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
25262 whether we are emitting for a ref or out parameter.
25264 * expression.cs (Argument::Emit): Use the above field to set the state.
25266 (LocalVariableReference::Emit): Update to honour the flag and emit the
25269 * parameter.cs (Attributes): Set the correct flags for ref parameters.
25271 * expression.cs (Argument::FullDesc): New function to provide a full desc.
25273 * support.cs (ParameterData): Add method ParameterDesc to the interface.
25275 (ReflectionParameters, InternalParameters): Implement the above method.
25277 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
25280 (Invocation::FullMethodDesc): Ditto.
25282 2001-10-29 Miguel de Icaza <miguel@ximian.com>
25284 * cs-parser.jay: Add extra production for the second form of array
25287 * expression.cs (ArrayCreation): Update to reflect the above
25290 * Small changes to prepare for Array initialization.
25292 2001-10-28 Miguel de Icaza <miguel@ximian.com>
25294 * typemanager.cs (ImplementsInterface): interface might be null;
25295 Deal with this problem;
25297 Also, we do store negative hits on the cache (null values), so use
25298 this instead of calling t.GetInterfaces on the type everytime.
25300 2001-10-28 Ravi Pratap <ravi@ximian.com>
25302 * typemanager.cs (IsBuiltinType): New method to help determine the same.
25304 * expression.cs (New::DoResolve): Get rid of array creation code and instead
25305 split functionality out into different classes.
25307 (New::FormArrayType): Move into NewBuiltinArray.
25309 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
25312 (NewBuiltinArray): New class to handle creation of built-in arrays.
25314 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
25315 account creation of one-dimensional arrays.
25317 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
25319 (NewUserdefinedArray::DoResolve): Implement.
25321 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
25323 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
25324 we maintain inside the TypeManager. This is necessary to perform lookups on the
25327 (LookupType): Update to perform GetType on the module builders too.
25329 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
25331 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
25333 2001-10-23 Ravi Pratap <ravi@ximian.com>
25335 * expression.cs (New::DoResolve): Implement guts of array creation.
25337 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
25339 2001-10-27 Miguel de Icaza <miguel@ximian.com>
25341 * expression.cs: Fix bug I introduced lsat night that broke
25344 (Expression.Resolve): Report a 246 error (can not resolve name)
25345 if we find a SimpleName in the stream.
25347 (Expression.ResolveLValue): Ditto.
25349 (Expression.ResolveWithSimpleName): This function is a variant of
25350 ResolveName, this one allows SimpleNames to be returned without a
25351 warning. The only consumer of SimpleNames is MemberAccess
25353 2001-10-26 Miguel de Icaza <miguel@ximian.com>
25355 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
25356 might arrive here. I have my doubts that this is correct.
25358 * statement.cs (Lock): Implement lock statement.
25360 * cs-parser.jay: Small fixes to support `lock' and `using'
25362 * cs-tokenizer.cs: Remove extra space
25364 * driver.cs: New flag --checked, allows to turn on integer math
25367 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
25368 Threading.Monitor.Exit
25370 2001-10-23 Miguel de Icaza <miguel@ximian.com>
25372 * expression.cs (IndexerAccess::DoResolveLValue): Set the
25373 Expression Class to be IndexerAccess.
25375 Notice that Indexer::DoResolve sets the eclass to Value.
25377 2001-10-22 Miguel de Icaza <miguel@ximian.com>
25379 * class.cs (TypeContainer::Emit): Emit code for indexers.
25381 * assign.cs (IAssignMethod): New interface implemented by Indexers
25382 and Properties for handling assignment.
25384 (Assign::Emit): Simplify and reuse code.
25386 * expression.cs (IndexerAccess, PropertyExpr): Implement
25387 IAssignMethod, clean up old code.
25389 2001-10-22 Ravi Pratap <ravi@ximian.com>
25391 * typemanager.cs (ImplementsInterface): New method to determine if a type
25392 implements a given interface. Provides a nice cache too.
25394 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
25397 (ConvertReferenceExplicit): Ditto.
25399 * delegate.cs (Delegate::Populate): Update to define the parameters on the
25400 various methods, with correct names etc.
25402 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
25403 Operator.UnaryNegation.
25405 * cs-parser.jay (operator_declarator): Be a little clever in the case where
25406 we have a unary plus or minus operator.
25408 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
25411 * everywhere : update accordingly.
25413 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
25416 * class.cs (Method::Define): For the case where we are implementing a method
25417 inherited from an interface, we need to set the MethodAttributes.Final flag too.
25418 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
25420 2001-10-21 Ravi Pratap <ravi@ximian.com>
25422 * interface.cs (FindMembers): Implement to work around S.R.E
25425 * typemanager.cs (IsInterfaceType): Implement.
25427 (FindMembers): Update to handle interface types too.
25429 * expression.cs (ImplicitReferenceConversion): Re-write bits which
25430 use IsAssignableFrom as that is not correct - it doesn't work.
25432 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
25433 and accordingly override EmitStatement.
25435 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
25436 using the correct logic :-)
25438 2001-10-19 Ravi Pratap <ravi@ximian.com>
25440 * ../errors/cs-11.cs : Add to demonstrate error -11
25442 2001-10-17 Miguel de Icaza <miguel@ximian.com>
25444 * assign.cs (Assign::Resolve): Resolve right hand side first, and
25445 then pass this as a hint to ResolveLValue.
25447 * expression.cs (FieldExpr): Add Location information
25449 (FieldExpr::LValueResolve): Report assignment to readonly
25452 (Expression::ExprClassFromMemberInfo): Pass location information.
25454 (Expression::ResolveLValue): Add new method that resolves an
25457 (Expression::DoResolveLValue): Default invocation calls
25460 (Indexers): New class used to keep track of indexers in a given
25463 (IStackStore): Renamed from LValue, as it did not really describe
25464 what this did. Also ResolveLValue is gone from this interface and
25465 now is part of Expression.
25467 (ElementAccess): Depending on the element access type
25469 * typemanager.cs: Add `indexer_name_type' as a Core type
25470 (System.Runtime.CompilerServices.IndexerNameAttribute)
25472 * statement.cs (Goto): Take a location.
25474 2001-10-18 Ravi Pratap <ravi@ximian.com>
25476 * delegate.cs (Delegate::VerifyDelegate): New method to verify
25477 if two delegates are compatible.
25479 (NewDelegate::DoResolve): Update to take care of the case when
25480 we instantiate a delegate from another delegate.
25482 * typemanager.cs (FindMembers): Don't even try to look up members
25483 of Delegate types for now.
25485 2001-10-18 Ravi Pratap <ravi@ximian.com>
25487 * delegate.cs (NewDelegate): New class to take care of delegate
25490 * expression.cs (New): Split the delegate related code out into
25491 the NewDelegate class.
25493 * delegate.cs (DelegateInvocation): New class to handle delegate
25496 * expression.cs (Invocation): Split out delegate related code into
25497 the DelegateInvocation class.
25499 2001-10-17 Ravi Pratap <ravi@ximian.com>
25501 * expression.cs (New::DoResolve): Implement delegate creation fully
25502 and according to the spec.
25504 (New::DoEmit): Update to handle delegates differently.
25506 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
25507 because of which we were printing out arguments in reverse order !
25509 * delegate.cs (VerifyMethod): Implement to check if the given method
25510 matches the delegate.
25512 (FullDelegateDesc): Implement.
25514 (VerifyApplicability): Implement.
25516 * expression.cs (Invocation::DoResolve): Update to accordingly handle
25517 delegate invocations too.
25519 (Invocation::Emit): Ditto.
25521 * ../errors/cs1593.cs : Added.
25523 * ../errors/cs1594.cs : Added.
25525 * delegate.cs (InstanceExpression, TargetMethod): New properties.
25527 2001-10-16 Ravi Pratap <ravi@ximian.com>
25529 * typemanager.cs (intptr_type): Core type for System.IntPtr
25531 (InitCoreTypes): Update for the same.
25533 (iasyncresult_type, asynccallback_type): Ditto.
25535 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
25538 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
25541 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
25542 the builders for the 4 members of a delegate type :-)
25544 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
25547 * expression.cs (New::DoResolve): Implement guts for delegate creation.
25549 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
25551 2001-10-15 Miguel de Icaza <miguel@ximian.com>
25553 * statement.cs (Break::Emit): Implement.
25554 (Continue::Emit): Implement.
25556 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
25557 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
25558 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
25559 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
25562 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
25563 properties that track the label for the current loop (begin of the
25564 loop and end of the loop).
25566 2001-10-15 Ravi Pratap <ravi@ximian.com>
25568 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
25569 use of emitting anything at all.
25571 * class.cs, rootcontext.cs : Get rid of calls to the same.
25573 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
25575 (Populate): Define the constructor correctly and set the implementation
25578 * typemanager.cs (delegate_types): New hashtable to hold delegates that
25581 (AddDelegateType): Implement.
25583 (IsDelegateType): Implement helper method.
25585 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
25587 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
25588 and accordingly handle it.
25590 * delegate.cs (Populate): Take TypeContainer argument.
25591 Implement bits to define the Invoke method. However, I still haven't figured out
25592 how to take care of the native int bit :-(
25594 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
25595 Qualify the name of the delegate, not its return type !
25597 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
25600 (StandardConversionExists): Checking for array types turns out to be recursive.
25602 (ConvertReferenceExplicit): Implement array conversion.
25604 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
25606 2001-10-12 Ravi Pratap <ravi@ximian.com>
25608 * cs-parser.jay (delegate_declaration): Store the fully qualified
25609 name as it is a type declaration.
25611 * delegate.cs (ReturnType, Name): Rename members to these. Make them
25614 (DefineDelegate): Renamed from Define. Does the same thing essentially,
25615 as TypeContainer::DefineType.
25617 (Populate): Method in which all the definition of the various methods (Invoke)
25620 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
25623 (CloseDelegate): Finally creates the delegate.
25625 * class.cs (TypeContainer::DefineType): Update to define delegates.
25626 (Populate, Emit and CloseType): Do the same thing here too.
25628 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
25629 delegates in all these operations.
25631 2001-10-14 Miguel de Icaza <miguel@ximian.com>
25633 * expression.cs: LocalTemporary: a new expression used to
25634 reference a temporary that has been created.
25636 * assign.cs: Handle PropertyAccess back here, so that we can
25637 provide the proper semantic access to properties.
25639 * expression.cs (Expression::ConvertReferenceExplicit): Implement
25640 a few more explicit conversions.
25642 * modifiers.cs: `NEW' modifier maps to HideBySig.
25644 * expression.cs (PropertyExpr): Make this into an
25645 ExpressionStatement, and support the EmitStatement code path.
25647 Perform get/set error checking, clean up the interface.
25649 * assign.cs: recognize PropertyExprs as targets, and if so, turn
25650 them into toplevel access objects.
25652 2001-10-12 Miguel de Icaza <miguel@ximian.com>
25654 * expression.cs: PropertyExpr::PropertyExpr: use work around the
25657 * typemanager.cs: Keep track here of our PropertyBuilders again to
25658 work around lameness in SRE.
25660 2001-10-11 Miguel de Icaza <miguel@ximian.com>
25662 * expression.cs (LValue::LValueResolve): New method in the
25663 interface, used to perform a second resolution pass for LValues.
25665 (This::DoResolve): Catch the use of this in static methods.
25667 (This::LValueResolve): Implement.
25669 (This::Store): Remove warning, assigning to `this' in structures
25672 (Invocation::Emit): Deal with invocation of
25673 methods on value types. We need to pass the address to structure
25674 methods rather than the object itself. (The equivalent code to
25675 emit "this" for structures leaves the entire structure on the
25676 stack instead of a pointer to it).
25678 (ParameterReference::DoResolve): Compute the real index for the
25679 argument based on whether the method takes or not a `this' pointer
25680 (ie, the method is static).
25682 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
25683 value types returned from functions when we need to invoke a
25684 method on the sturcture.
25687 2001-10-11 Ravi Pratap <ravi@ximian.com>
25689 * class.cs (TypeContainer::DefineType): Method to actually do the business of
25690 defining the type in the Modulebuilder or Typebuilder. This is to take
25691 care of nested types which need to be defined on the TypeBuilder using
25692 DefineNestedMethod.
25694 (TypeContainer::GetClassBases): Implement. Essentially the code from the
25695 methods in RootContext, only ported to be part of TypeContainer.
25697 (TypeContainer::GetInterfaceOrClass): Ditto.
25699 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
25701 * interface.cs (Interface::DefineInterface): New method. Does exactly
25702 what RootContext.CreateInterface did earlier, only it takes care of nested types
25705 (Interface::GetInterfaces): Move from RootContext here and port.
25707 (Interface::GetInterfaceByName): Same here.
25709 * rootcontext.cs (ResolveTree): Re-write.
25711 (PopulateTypes): Re-write.
25713 * class.cs (TypeContainer::Populate): Populate nested types too.
25714 (TypeContainer::Emit): Emit nested members too.
25716 * typemanager.cs (AddUserType): Do not make use of the FullName property,
25717 instead just use the name argument passed in as it is already fully
25720 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
25721 to TypeContainer mapping to see if a type is user-defined.
25723 * class.cs (TypeContainer::CloseType): Implement.
25725 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
25726 the default constructor.
25728 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
25731 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
25733 * interface.cs (CloseType): Create the type here.
25735 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
25738 Remove all the methods which are now in TypeContainer.
25740 2001-10-10 Ravi Pratap <ravi@ximian.com>
25742 * delegate.cs (Define): Re-write bits to define the delegate
25745 2001-10-10 Miguel de Icaza <miguel@ximian.com>
25747 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
25749 * expression.cs (ImplicitReferenceConversion): handle null as well
25750 as a source to convert to any reference type.
25752 * statement.cs (Return): Perform any implicit conversions to
25753 expected return type.
25755 Validate use of return statement.
25757 * codegen.cs (EmitContext): Pass the expected return type here.
25759 * class.cs (Method, Constructor, Property): Pass expected return
25760 type to EmitContext.
25762 2001-10-09 Miguel de Icaza <miguel@ximian.com>
25764 * expression.cs: Make DoResolve take an EmitContext instead of a
25767 Replaced `l' and `location' for `loc', for consistency.
25769 (Error, Warning): Remove unneeded Tc argument.
25771 * assign.cs, literal.cs, constant.cs: Update to new calling
25774 * codegen.cs: EmitContext now contains a flag indicating whether
25775 code is being generated in a static method or not.
25777 * cs-parser.jay: DecomposeQI, new function that replaces the old
25778 QualifiedIdentifier. Now we always decompose the assembled
25779 strings from qualified_identifier productions into a group of
25782 2001-10-08 Miguel de Icaza <miguel@ximian.com>
25784 * rootcontext.cs: Deal with field-less struct types correctly now
25785 by passing the size option to Define Type.
25787 * class.cs: Removed hack that created one static field.
25789 2001-10-07 Miguel de Icaza <miguel@ximian.com>
25791 * statement.cs: Moved most of the code generation here.
25793 2001-10-09 Ravi Pratap <ravi@ximian.com>
25795 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
25798 (ElementAccess): Remove useless bits for now - keep checks as the spec
25801 2001-10-08 Ravi Pratap <ravi@ximian.com>
25803 * expression.cs (ElementAccess::DoResolve): Remove my crap code
25804 and start performing checks according to the spec.
25806 2001-10-07 Ravi Pratap <ravi@ximian.com>
25808 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
25809 rank_specifiers instead.
25811 (rank_specifiers): Change the order in which the rank specifiers are stored
25813 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
25815 * expression.cs (ElementAccess): Implement the LValue interface too.
25817 2001-10-06 Ravi Pratap <ravi@ximian.com>
25819 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
25820 except that user defined conversions are not included.
25822 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
25823 perform the conversion of the return type, if necessary.
25825 (New::DoResolve): Check whether we are creating an array or an object
25826 and accordingly do the needful.
25828 (New::Emit): Same here.
25830 (New::DoResolve): Implement guts of array creation.
25832 (New::FormLookupType): Helper function.
25834 2001-10-07 Miguel de Icaza <miguel@ximian.com>
25836 * codegen.cs: Removed most of the code generation here, and move the
25837 corresponding code generation bits to the statement classes.
25839 Added support for try/catch/finalize and throw.
25841 * cs-parser.jay: Added support for try/catch/finalize.
25843 * class.cs: Catch static methods having the flags override,
25844 virtual or abstract.
25846 * expression.cs (UserCast): This user cast was not really doing
25847 what it was supposed to do. Which is to be born in fully resolved
25848 state. Parts of the resolution were being performed at Emit time!
25852 2001-10-05 Miguel de Icaza <miguel@ximian.com>
25854 * expression.cs: Implicity convert the result from UserCast.
25856 2001-10-05 Ravi Pratap <ravi@ximian.com>
25858 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
25859 prevented it from working correctly.
25861 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
25862 merely ConvertImplicit.
25864 2001-10-05 Miguel de Icaza <miguel@ximian.com>
25866 * typemanager.cs: Make the LookupTypeContainer function static,
25867 and not per-instance.
25869 * class.cs: Make static FindMembers (the one that takes a Type
25872 * codegen.cs: Add EmitForeach here.
25874 * cs-parser.jay: Make foreach a toplevel object instead of the
25875 inline expansion, as we need to perform semantic analysis on it.
25877 2001-10-05 Ravi Pratap <ravi@ximian.com>
25879 * expression.cs (Expression::ImplicitUserConversion): Rename to
25880 UserDefinedConversion.
25882 (Expression::UserDefinedConversion): Take an extra argument specifying
25883 whether we look for explicit user conversions too.
25885 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
25887 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
25889 (ExplicitUserConversion): Make it a call to UserDefinedConversion
25890 with the appropriate arguments.
25892 * cs-parser.jay (cast_expression): Record location too.
25894 * expression.cs (Cast): Record location info.
25896 (Expression::ConvertExplicit): Take location argument.
25898 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
25899 to determine if we are doing explicit conversions.
25901 (UserCast::Emit): Update accordingly.
25903 (Expression::ConvertExplicit): Report an error if everything fails.
25905 * ../errors/cs0030.cs : Add.
25907 2001-10-04 Miguel de Icaza <miguel@ximian.com>
25909 * modifiers.cs: If the ABSTRACT keyword is present, also set the
25910 virtual and newslot bits.
25912 * class.cs (TypeContainer::RegisterRequiredImplementations):
25913 Record methods we need.
25915 (TypeContainer::MakeKey): Helper function to make keys for
25916 MethodBases, since the Methodbase key is useless.
25918 (TypeContainer::Populate): Call RegisterRequiredImplementations
25919 before defining the methods.
25921 Create a mapping for method_builders_to_methods ahead of time
25922 instead of inside a tight loop.
25924 (::RequireMethods): Accept an object as the data to set into the
25925 hashtable so we can report interface vs abstract method mismatch.
25927 2001-10-03 Miguel de Icaza <miguel@ximian.com>
25929 * report.cs: Make all of it static.
25931 * rootcontext.cs: Drop object_type and value_type computations, as
25932 we have those in the TypeManager anyways.
25934 Drop report instance variable too, now it is a global.
25936 * driver.cs: Use try/catch on command line handling.
25938 Add --probe option to debug the error reporting system with a test
25941 * report.cs: Add support for exiting program when a probe
25942 condition is reached.
25944 2001-10-03 Ravi Pratap <ravi@ximian.com>
25946 * expression.cs (Binary::DoNumericPromotions): Fix the case when
25947 we do a forcible conversion regardless of type, to check if
25948 ForceConversion returns a null.
25950 (Binary::error19): Use location to report error.
25952 (Unary::error23): Use location here too.
25954 * ../errors/cs0019.cs : Check in.
25956 * ../errors/cs0023.cs : Check in.
25958 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
25959 case of a non-null MethodInfo object with a length of 0 !
25961 (Binary::ResolveOperator): Flag error if overload resolution fails to find
25962 an applicable member - according to the spec :-)
25963 Also fix logic to find members in base types.
25965 (Unary::ResolveOperator): Same here.
25967 (Unary::report23): Change name to error23 and make first argument a TypeContainer
25968 as I was getting thoroughly confused between this and error19 :-)
25970 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
25971 (::FindMostEncompassedType): Implement.
25972 (::FindMostEncompassingType): Implement.
25973 (::StandardConversionExists): Implement.
25975 (UserImplicitCast): Re-vamp. We now need info about most specific
25976 source and target types so that we can do the necessary conversions.
25978 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
25979 mathematical union with no duplicates.
25981 2001-10-03 Miguel de Icaza <miguel@ximian.com>
25983 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
25984 in order from base classes to child classes, so that we can in
25985 child classes look up in our parent for method names and
25986 attributes (required for handling abstract, virtual, new, override
25987 constructs: we need to instrospect our base class, and if we dont
25988 populate the classes in order, the introspection might be
25989 incorrect. For example, a method could query its parent before
25990 the parent has any methods and would determine that the parent has
25991 no abstract methods (while it could have had them)).
25993 (RootContext::CreateType): Record the order in which we define the
25996 2001-10-02 Miguel de Icaza <miguel@ximian.com>
25998 * class.cs (TypeContainer::Populate): Also method definitions can
25999 fail now, keep track of this.
26001 (TypeContainer::FindMembers): Implement support for
26002 DeclaredOnly/noDeclaredOnly flag.
26004 (Constructor::Emit) Return the ConstructorBuilder.
26006 (Method::Emit) Return the MethodBuilder.
26007 Check for abstract or virtual methods to be public.
26009 * rootcontext.cs (RootContext::CreateType): Register all the
26010 abstract methods required for the class to be complete and the
26011 interface methods that must be implemented.
26013 * cs-parser.jay: Report error 501 (method requires body if it is
26014 not marked abstract or extern).
26016 * expression.cs (TypeOf::Emit): Implement.
26018 * typemanager.cs: runtime_handle_type, new global type.
26020 * class.cs (Property::Emit): Generate code for properties.
26022 2001-10-02 Ravi Pratap <ravi@ximian.com>
26024 * expression.cs (Unary::ResolveOperator): Find operators on base type
26025 too - we now conform exactly to the spec.
26027 (Binary::ResolveOperator): Same here.
26029 * class.cs (Operator::Define): Fix minor quirk in the tests.
26031 * ../errors/cs0215.cs : Added.
26033 * ../errors/cs0556.cs : Added.
26035 * ../errors/cs0555.cs : Added.
26037 2001-10-01 Miguel de Icaza <miguel@ximian.com>
26039 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
26040 single integer which is really efficient
26042 2001-10-01 Ravi Pratap <ravi@ximian.com>
26044 * expression.cs (Expression::ImplicitUserConversion): Use location
26045 even in the case when we are examining True operators.
26047 * class.cs (Operator::Define): Perform extensive checks to conform
26048 with the rules for operator overloading in the spec.
26050 * expression.cs (Expression::ImplicitReferenceConversion): Implement
26051 some of the other conversions mentioned in the spec.
26053 * typemanager.cs (array_type): New static member for the System.Array built-in
26056 (cloneable_interface): For System.ICloneable interface.
26058 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
26059 we start resolving the tree and populating types.
26061 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
26063 2001-10-01 Miguel de Icaza <miguel@ximian.com>
26065 * expression.cs (Expression::ExprClassFromMemberInfo,
26066 Expression::Literalize): Create literal expressions from
26067 FieldInfos which are literals.
26069 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
26070 type casts, because they were wrong. The test suite in tests
26073 (ImplicitNumericConversion): ushort to ulong requires a widening
26076 Int32 constant to long requires widening cast as well.
26078 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
26079 for integers because the type on the stack is not i4.
26081 2001-09-30 Miguel de Icaza <miguel@ximian.com>
26083 * expression.cs (report118): require location argument.
26085 * parameter.cs: Do not dereference potential null value.
26087 * class.cs: Catch methods that lack the `new' keyword when
26088 overriding a name. Report warnings when `new' is used without
26089 anything being there to override.
26091 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
26093 * class.cs: Only add constructor to hashtable if it is non-null
26094 (as now constructors can fail on define).
26096 (TypeManager, Class, Struct): Take location arguments.
26098 Catch field instance initialization in structs as errors.
26100 accepting_filter: a new filter for FindMembers that is static so
26101 that we dont create an instance per invocation.
26103 (Constructor::Define): Catch errors where a struct constructor is
26106 * cs-parser.jay: Pass location information for various new
26109 * delegate.cs (Delegate): take a location argument.
26111 * driver.cs: Do not call EmitCode if there were problesm in the
26112 Definition of the types, as many Builders wont be there.
26114 * decl.cs (Decl::Decl): Require a location argument.
26116 * cs-tokenizer.cs: Handle properly hex constants that can not fit
26117 into integers, and find the most appropiate integer for it.
26119 * literal.cs: Implement ULongLiteral.
26121 * rootcontext.cs: Provide better information about the location of
26122 failure when CreateType fails.
26124 2001-09-29 Miguel de Icaza <miguel@ximian.com>
26126 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
26129 * expression.cs (Binary::CheckShiftArguments): Add missing type
26131 (Binary::ResolveOperator): Add type to the logical and and logical
26132 or, Bitwise And/Or and Exclusive Or code paths, it was missing
26135 (Binary::DoNumericPromotions): In the case where either argument
26136 is ulong (and most signed types combined with ulong cause an
26137 error) perform implicit integer constant conversions as well.
26139 2001-09-28 Miguel de Icaza <miguel@ximian.com>
26141 * expression.cs (UserImplicitCast): Method should always be
26143 (Invocation::BetterConversion): Simplified test for IntLiteral.
26145 (Expression::ImplicitNumericConversion): Split this routine out.
26146 Put the code that performs implicit constant integer conversions
26149 (Expression::Resolve): Become a wrapper around DoResolve so we can
26150 check eclass and type being set after resolve.
26152 (Invocation::Badness): Remove this dead function
26154 (Binary::ResolveOperator): Do not compute the expensive argumnets
26155 unless we have a union for it.
26157 (Probe::Emit): Is needs to do an isinst and then
26158 compare against null.
26160 (::CanConvert): Added Location argument. If the Location argument
26161 is null (Location.Null), then we do not report errors. This is
26162 used by the `probe' mechanism of the Explicit conversion. We do
26163 not want to generate an error for something that the user
26164 explicitly requested to be casted. But the pipeline for an
26165 explicit cast first tests for potential implicit casts.
26167 So for now, if the Location is null, it means `Probe only' to
26168 avoid adding another argument. Might have to revise this
26171 (ClassCast): New class used to type cast objects into arbitrary
26172 classes (used in Explicit Reference Conversions).
26174 Implement `as' as well.
26176 Reverted all the patches from Ravi below: they were broken:
26178 * The use of `level' as a mechanism to stop recursive
26179 invocations is wrong. That was there just to catch the
26180 bug with a strack trace but not as a way of addressing
26183 To fix the problem we have to *understand* what is going
26184 on and the interactions and come up with a plan, not
26185 just get things going.
26187 * The use of the type conversion cache that I proposed
26188 last night had an open topic: How does this work across
26189 protection domains. A user defined conversion might not
26190 be public in the location where we are applying the
26191 conversion, a different conversion might be selected
26192 (ie, private A->B (better) but public B->A (worse),
26193 inside A, A->B applies, but outside it, B->A will
26196 * On top of that (ie, even if the above is solved),
26197 conversions in a cache need to be abstract. Ie, `To
26198 convert from an Int to a Short use an OpcodeCast', not
26199 `To convert from an Int to a Short use the OpcodeCast on
26200 the variable 5' (which is what this patch was doing).
26202 2001-09-28 Ravi Pratap <ravi@ximian.com>
26204 * expression.cs (Invocation::ConversionExists): Re-write to use
26205 the conversion cache
26207 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
26208 cache all conversions done, not just user-defined ones.
26210 (Invocation::BetterConversion): The real culprit. Use ConversionExists
26211 to determine if a conversion exists instead of acutually trying to
26212 perform the conversion. It's faster too.
26214 (Expression::ConvertExplicit): Modify to use ConversionExists to check
26215 and only then attempt the implicit conversion.
26217 2001-09-28 Ravi Pratap <ravi@ximian.com>
26219 * expression.cs (ConvertImplicit): Use a cache for conversions
26220 already found. Check level of recursion and bail out if necessary.
26222 2001-09-28 Miguel de Icaza <miguel@ximian.com>
26224 * typemanager.cs (string_concat_string_string, string_concat_object_object):
26225 Export standard methods that we expect for string operations.
26227 * statement.cs (Block::UsageWarning): Track usage of variables and
26228 report the errors for not used variables.
26230 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
26233 2001-09-27 Miguel de Icaza <miguel@ximian.com>
26235 * codegen.cs: remove unnneded code
26237 * expression.cs: Removed BuiltinTypeAccess class
26239 Fix the order in which implicit conversions are
26242 The previous fixed dropped support for boxed conversions (adding a
26243 test to the test suite now)
26245 (UserImplicitCast::CanConvert): Remove test for source being null,
26246 that code is broken. We should not feed a null to begin with, if
26247 we do, then we should track the bug where the problem originates
26248 and not try to cover it up here.
26250 Return a resolved expression of type UserImplicitCast on success
26251 rather than true/false. Ravi: this is what I was talking about,
26252 the pattern is to use a static method as a "constructor" for
26255 Also, do not create arguments until the very last minute,
26256 otherwise we always create the arguments even for lookups that
26257 will never be performed.
26259 (UserImplicitCast::Resolve): Eliminate, objects of type
26260 UserImplicitCast are born in a fully resolved state.
26262 * typemanager.cs (InitCoreTypes): Init also value_type
26263 (System.ValueType).
26265 * expression.cs (Cast::Resolve): First resolve the child expression.
26267 (LValue): Add new method AddressOf to be used by
26270 Change the argument of Store to take an EmitContext instead of an
26271 ILGenerator, because things like FieldExpr need to be able to call
26272 their children expression to generate the instance code.
26274 (Expression::Error, Expression::Warning): Sugar functions for
26277 (Expression::MemberLookup): Accept a TypeContainer instead of a
26278 Report as the first argument.
26280 (Expression::ResolvePrimary): Killed. I still want to improve
26281 this as currently the code is just not right.
26283 (Expression::ResolveMemberAccess): Simplify, but it is still
26286 (Unary::Resolve): Catch errors in AddressOf operators.
26288 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
26289 index to a byte for the short-version, or the compiler will choose
26290 the wrong Emit call, which generates the wrong data.
26292 (ParameterReference::Emit, ::Store): same.
26294 (FieldExpr::AddressOf): Implement.
26296 * typemanager.cs: TypeManager: made public variable instead of
26299 * driver.cs: document --fatal.
26301 * report.cs (ErrorMessage, WarningMessage): new names for the old
26302 Error and Warning classes.
26304 * cs-parser.jay (member_access): Turn built-in access to types
26305 into a normal simplename
26307 2001-09-27 Ravi Pratap <ravi@ximian.com>
26309 * expression.cs (Invocation::BetterConversion): Fix to cope
26310 with q being null, since this was introducing a bug.
26312 * expression.cs (ConvertImplicit): Do built-in conversions first.
26314 2001-09-27 Ravi Pratap <ravi@ximian.com>
26316 * expression.cs (UserImplicitCast::Resolve): Fix bug.
26318 2001-09-27 Ravi Pratap <ravi@ximian.com>
26320 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
26321 I had introduced long ago (what's new ?).
26323 * expression.cs (UserImplicitCast::CanConvert): Static method to do
26324 the work of all the checking.
26325 (ConvertImplicit): Call CanConvert and only then create object if necessary.
26326 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
26328 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
26329 that is the right way.
26331 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
26332 overloading resolution. Use everywhere instead of cutting and pasting code.
26334 (Binary::ResolveOperator): Use MakeUnionSet.
26336 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
26337 we have to convert to bool types. Not complete yet.
26339 2001-09-27 Miguel de Icaza <miguel@ximian.com>
26341 * typemanager.cs (TypeManager::CSharpName): support ushort.
26343 * expression.cs (Expression::TryImplicitIntConversion): Attempts
26344 to provide an expression that performsn an implicit constant int
26345 conversion (section 6.1.6).
26346 (Expression::ConvertImplicitRequired): Reworked to include
26347 implicit constant expression conversions.
26349 (Expression::ConvertNumericExplicit): Finished.
26351 (Invocation::Emit): If InstanceExpression is null, then it means
26352 that we perform a call on this.
26354 2001-09-26 Miguel de Icaza <miguel@ximian.com>
26356 * expression.cs (Unary::Emit): Remove some dead code.
26357 (Probe): Implement Resolve and Emit for `is'.
26358 (Expression::ConvertImplicitRequired): Attempt to do constant
26359 expression conversions here. Maybe should be moved to
26360 ConvertImplicit, but I am not sure.
26361 (Expression::ImplicitLongConstantConversionPossible,
26362 Expression::ImplicitIntConstantConversionPossible): New functions
26363 that tell whether is it possible to apply an implicit constant
26364 expression conversion.
26366 (ConvertNumericExplicit): Started work on explicit numeric
26369 * cs-parser.jay: Update operator constants.
26371 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
26372 (Parameters::GetSignature): Hook up VerifyArgs here.
26373 (Parameters::VerifyArgs): Verifies that no two arguments have the
26376 * class.cs (Operator): Update the operator names to reflect the
26377 ones that the spec expects (as we are just stringizing the
26380 * expression.cs (Unary::ResolveOperator): Fix bug: Use
26381 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
26382 previous usage did only work for our methods.
26383 (Expression::ConvertImplicit): Handle decimal implicit numeric
26384 conversions as well.
26385 (Expression::InternalTypeConstructor): Used to invoke constructors
26386 on internal types for default promotions.
26388 (Unary::Emit): Implement special handling for the pre/post
26389 increment/decrement for overloaded operators, as they need to have
26390 the same semantics as the other operators.
26392 (Binary::ResolveOperator): ditto.
26393 (Invocation::ConversionExists): ditto.
26394 (UserImplicitCast::Resolve): ditto.
26396 2001-09-26 Ravi Pratap <ravi@ximian.com>
26398 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
26399 operator, return after emitting body. Regression tests pass again !
26401 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
26402 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
26403 (Invocation::OverloadResolve): Ditto.
26404 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
26406 * everywhere : update calls to the above methods accordingly.
26408 2001-09-26 Miguel de Icaza <miguel@ximian.com>
26410 * assign.cs (Assign): Make it inherit from ExpressionStatement.
26412 * expression.cs (ExpressionStatement): New base class used for
26413 expressions that can appear in statements, so that we can provide
26414 an alternate path to generate expression that do not leave a value
26417 (Expression::Emit, and all the derivatives): We no longer return
26418 whether a value is left on the stack or not. Every expression
26419 after being emitted leaves a single value on the stack.
26421 * codegen.cs (EmitContext::EmitStatementExpression): Use the
26422 facilties of ExpressionStatement if possible.
26424 * cs-parser.jay: Update statement_expression.
26426 2001-09-25 Miguel de Icaza <miguel@ximian.com>
26428 * driver.cs: Change the wording of message
26430 2001-09-25 Ravi Pratap <ravi@ximian.com>
26432 * expression.cs (Binary::ResolveOperator): Had forgottten to set
26433 the type of the expression to the return type of the method if
26434 we have an overloaded operator match ! The regression tests pass again !
26435 (Unary::ResolveOperator): Ditto.
26437 * expression.cs (Invocation::ConversionExists): Correct the member lookup
26438 to find "op_Implicit", not "implicit" ;-)
26439 (UserImplicitCast): New class to take care of user-defined implicit conversions.
26440 (ConvertImplicit, ForceConversion): Take TypeContainer argument
26442 * everywhere : Correct calls to the above accordingly.
26444 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
26445 (ConvertImplicit): Do user-defined conversion if it exists.
26447 2001-09-24 Miguel de Icaza <miguel@ximian.com>
26449 * assign.cs: track location.
26450 (Resolve): Use implicit conversions on assignment.
26452 * literal.cs: Oops. Not good, Emit of short access values should
26453 pass (Bytes) or the wrong argument will be selected.
26455 * expression.cs (Unary::Emit): Emit code for -expr.
26457 (Unary::ResolveOperator): Handle `Substract' for non-constants
26458 (substract from zero from the non-constants).
26459 Deal with Doubles as well.
26461 (Expression::ConvertImplicitRequired): New routine that reports an
26462 error if no implicit conversion exists.
26464 (Invocation::OverloadResolve): Store the converted implicit
26465 expressions if we make them
26467 2001-09-24 Ravi Pratap <ravi@ximian.com>
26469 * class.cs (ConstructorInitializer): Take a Location argument.
26470 (ConstructorBaseInitializer): Same here.
26471 (ConstructorThisInitializer): Same here.
26473 * cs-parser.jay : Update all calls accordingly.
26475 * expression.cs (Unary, Binary, New): Take location argument.
26476 Update accordingly everywhere.
26478 * cs-parser.jay : Update all calls to the above to take a location
26481 * class.cs : Ditto.
26483 2001-09-24 Ravi Pratap <ravi@ximian.com>
26485 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
26486 (Invocation::BetterConversion): Same here
26487 (Invocation::ConversionExists): Ditto.
26489 (Invocation::ConversionExists): Implement.
26491 2001-09-22 Ravi Pratap <ravi@ximian.com>
26493 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
26494 Also take an additional TypeContainer argument.
26496 * All over : Pass in TypeContainer as argument to OverloadResolve.
26498 * typemanager.cs (CSharpName): Update to check for the string type and return
26501 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
26504 2001-09-21 Ravi Pratap <ravi@ximian.com>
26506 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
26507 (Invocation::BetterFunction): Implement.
26508 (Invocation::BetterConversion): Implement.
26509 (Invocation::ConversionExists): Skeleton, no implementation yet.
26511 Okay, things work fine !
26513 2001-09-21 Miguel de Icaza <miguel@ximian.com>
26515 * typemanager.cs: declare and load enum_type, delegate_type and
26518 * expression.cs (Expression::Emit): Now emit returns a value that
26519 tells whether a value is left on the stack or not. This strategy
26520 might be reveted tomorrow with a mechanism that would address
26521 multiple assignments.
26522 (Expression::report118): Utility routine to report mismatches on
26525 (Unary::Report23): Report impossible type/operator combination
26528 (Unary::IsIncrementableNumber): Whether the type can be
26529 incremented or decremented with add.
26530 (Unary::ResolveOperator): Also allow enumerations to be bitwise
26532 (Unary::ResolveOperator): Implement ++, !, ~,
26534 (Invocation::Emit): Deal with new Emit convetion.
26536 * All Expression derivatives: Updated their Emit method to return
26537 whether they leave values on the stack or not.
26539 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
26540 stack for expressions that are statements.
26542 2001-09-20 Miguel de Icaza <miguel@ximian.com>
26544 * expression.cs (LValue): New interface. Must be implemented by
26546 (LocalVariableReference, ParameterReference, FieldExpr): Implement
26549 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
26550 interface for generating code, simplifies the code.
26552 2001-09-20 Ravi Pratap <ravi@ximian.com>
26554 * expression.cs (everywhere): Comment out return statements in ::Resolve
26555 methods to avoid the warnings.
26557 2001-09-20 Miguel de Icaza <miguel@ximian.com>
26559 * driver.cs (parse): Report error 2001 if we can not open the
26562 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
26565 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
26568 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
26569 otherwise nested blocks end up with the same index.
26571 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
26573 * expression.cs: Instead of having FIXMEs in the Resolve
26574 functions, throw exceptions so it is obvious that we are facing a
26577 * cs-parser.jay (invocation_expression): Pass Location information.
26579 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
26580 Use a basename for those routines because .NET does not like paths
26583 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
26586 2001-09-19 Miguel de Icaza <miguel@ximian.com>
26588 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
26589 are loading the correct data types (throws an exception if not).
26590 (TypeManager::InitCoreTypes): Use CoreLookupType
26592 * expression.cs (Unary::ResolveOperator): return the child
26593 expression for expressions which are just +expr.
26594 (Unary::ResolveOperator): Return negative literals for -LITERAL
26595 expressions (otherwise they are Unary {Literal}).
26596 (Invocation::Badness): Take into account `Implicit constant
26597 expression conversions'.
26599 * literal.cs (LongLiteral): Implement long literal class.
26600 (IntLiteral): export the `Value' of the intliteral.
26602 2001-09-19 Ravi Pratap <ravi@ximian.com>
26604 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
26606 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
26607 instead of 'Operator'
26609 * expression.cs (Binary::ResolveOperator): Update accordingly.
26610 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
26613 * cs-parser.jay (unary_expression): Update to use the new names.
26615 * gen-treedump.cs (GetUnary): Same here.
26617 * expression.cs (Unary::Resolve): Implement.
26618 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
26619 operators are found instead of making noise ;-)
26620 (Unary::ResolveOperator): New method to do precisely the same thing which
26621 Binary::ResolveOperator does for Binary expressions.
26622 (Unary.method, .Arguments): Add.
26623 (Unary::OperName): Implement.
26624 (Unary::ForceConversion): Copy and Paste !
26626 * class.cs (Operator::Define): Fix a small bug for the case when we have
26629 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
26630 for the inbuilt operators. Only overloading works for now ;-)
26632 2001-09-18 Miguel de Icaza <miguel@ximian.com>
26634 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
26635 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
26637 * expression.cs (This::Emit): Implement.
26638 (This::Resolve): Implement.
26639 (TypeOf:Resolve): Implement.
26640 (Expression::ResolveSimpleName): Add an implicit this to instance
26642 (MemberAccess::Resolve): Deal with Parameters and Fields.
26643 Bind instance variable to Field expressions.
26644 (FieldExpr::Instance): New field used to track the expression that
26645 represents the object instance.
26646 (FieldExpr::Resolve): Track potential errors from MemberLookup not
26648 (FieldExpr::Emit): Implement.
26650 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
26651 the last instruction contains a return opcode to avoid generating
26652 the last `ret' instruction (this generates correct code, and it is
26653 nice to pass the peverify output).
26655 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
26656 initializer for static and instance variables.
26657 (Constructor::Emit): Allow initializer to be null in the case of
26658 static constructors. Only emit initializer for instance
26661 (TypeContainer::FindMembers): Return a null array if there are no
26664 Also fix the code for the MemberTypes.Method branch, as it was not
26665 scanning that for operators (or tried to access null variables before).
26667 * assign.cs (Assign::Emit): Handle instance and static fields.
26671 * driver.cs: Stop compilation if there are parse errors.
26673 * cs-parser.jay (constructor_declaration): Provide default base
26674 initializer for non-static constructors.
26675 (constructor_declarator): Do not provide a default base
26676 initializers if none was specified.
26677 Catch the fact that constructors should not have parameters.
26679 * class.cs: Do not emit parent class initializers for static
26680 constructors, that should be flagged as an error.
26682 2001-09-18 Ravi Pratap <ravi@ximian.com>
26684 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
26685 Move back code into TypeContainer::Populate.
26687 2001-09-18 Ravi Pratap <ravi@ximian.com>
26689 * class.cs (TypeContainer::AddConstructor): Fix the check to
26690 compare against Name, not Basename.
26691 (Operator::OpType): Change Plus and Minus to Add and Subtract.
26693 * cs-parser.jay : Update accordingly.
26695 * class.cs (TypeContainer::FindMembers): For the case where we are searching
26696 for methods, don't forget to look into the operators too.
26697 (RegisterMethodBuilder): Helper method to take care of this for
26698 methods, constructors and operators.
26699 (Operator::Define): Completely revamp.
26700 (Operator.OperatorMethod, MethodName): New fields.
26701 (TypeContainer::Populate): Move the registering of builders into
26702 RegisterMethodBuilder.
26703 (Operator::Emit): Re-write.
26705 * expression.cs (Binary::Emit): Comment out code path to emit method
26706 invocation stuff for the case when we have a user defined operator. I am
26707 just not able to get it right !
26709 2001-09-17 Miguel de Icaza <miguel@ximian.com>
26711 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
26714 (Expression::MemberLookup): Provide a version that allows to
26715 specify the MemberTypes and BindingFlags.
26717 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
26718 so it was not fetching variable information from outer blocks.
26720 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
26721 Beforefieldinit as it was buggy.
26723 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
26724 that Ravi put here.
26726 * class.cs (Constructor::Emit): Only emit if block is not null.
26727 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
26728 deal with this by semantically definining it as if the user had
26731 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
26732 constructors as we now "emit" them at a higher level.
26734 (TypeContainer::DefineDefaultConstructor): Used to define the
26735 default constructors if none was provided.
26737 (ConstructorInitializer): Add methods Resolve and Emit.
26739 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
26741 2001-09-17 Ravi Pratap <ravi@ximian.com>
26743 * class.cs (TypeContainer::EmitDefaultConstructor): Register
26744 the default constructor builder with our hashtable for methodbuilders
26747 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
26748 and argument_count is 0 in which case we have a match.
26749 (Binary::ResolveOperator): More null checking and miscellaneous coding
26752 2001-09-17 Ravi Pratap <ravi@ximian.com>
26754 * rootcontext.cs (IsNameSpace): Compare against null.
26756 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
26758 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
26759 and Unary::Operator.
26761 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
26764 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
26765 we have overloaded operators.
26766 (Binary::ResolveOperator): Implement the part which does the operator overload
26769 * class.cs (Operator::Emit): Implement.
26770 (TypeContainer::Emit): Emit the operators we have too.
26772 * expression.cs (Binary::Emit): Update to emit the appropriate code for
26773 the case when we have a user-defined operator.
26775 2001-09-17 Miguel de Icaza <miguel@ximian.com>
26777 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
26779 2001-09-16 Ravi Pratap <ravi@ximian.com>
26781 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
26782 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
26783 (Constructor::Emit): Implement.
26784 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
26785 if we have no work to do.
26786 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
26789 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
26790 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
26792 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
26795 2001-09-15 Ravi Pratap <ravi@ximian.com>
26797 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
26799 (Tree::RecordNamespace): Method to do what the name says ;-)
26800 (Tree::Namespaces): Property to get at the namespaces hashtable.
26802 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
26805 * rootcontext.cs (IsNamespace): Fixed it :-)
26807 2001-09-14 Miguel de Icaza <miguel@ximian.com>
26809 * class.cs (TypeContainer::FindMembers): Add support for
26811 (MethodCore): New class that encapsulates both the shared aspects
26812 of a Constructor and a Method.
26813 (Method, Constructor): Factored pieces into MethodCore.
26815 * driver.cs: Added --fatal which makes errors throw exceptions.
26816 Load System assembly as well as part of the standard library.
26818 * report.cs: Allow throwing exceptions on errors for debugging.
26820 * modifiers.cs: Do not use `parent', instead use the real type
26821 container to evaluate permission settings.
26823 * class.cs: Put Ravi's patch back in. He is right, and we will
26824 have to cope with the
26826 2001-09-14 Ravi Pratap <ravi@ximian.com>
26828 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
26829 FamORAssem, not FamANDAssem.
26831 2001-09-14 Miguel de Icaza <miguel@ximian.com>
26833 * driver.cs: Added --parse option that only parses its input files
26836 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
26837 incorrect. IsTopLevel is not used to tell whether an object is
26838 root_types or not (that can be achieved by testing this ==
26839 root_types). But to see if this is a top-level *class* (not
26840 necessarly our "toplevel" container).
26842 2001-09-14 Ravi Pratap <ravi@ximian.com>
26844 * enum.cs (Enum::Define): Modify to call the Lookup method on the
26845 parent instead of a direct call to GetType.
26847 2001-09-14 Ravi Pratap <ravi@ximian.com>
26849 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
26850 Modifiers.TypeAttr. This should just be a call to that method.
26852 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
26853 object so that we can determine if we are top-level or not.
26855 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
26858 * enum.cs (Enum::Define): Ditto.
26860 * modifiers.cs (FieldAttr): Re-write.
26862 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
26863 (TypeContainer::HaveStaticConstructor): New property to provide access
26864 to precisely that info.
26866 * modifiers.cs (MethodAttr): Re-write.
26867 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
26869 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
26870 of top-level types as claimed.
26872 2001-09-13 Miguel de Icaza <miguel@ximian.com>
26874 * expression.cs (MemberLookup): Fruitless attempt to lookup
26875 constructors. Maybe I need to emit default constructors? That
26876 might be it (currently .NET emits this for me automatically).
26877 (Invocation::OverloadResolve): Cope with Arguments == null.
26878 (Invocation::EmitArguments): new function, shared by the new
26879 constructor and us.
26880 (Invocation::Emit): Handle static and instance methods. Emit
26881 proper call instruction for virtual or non-virtual invocations.
26882 (New::Emit): Implement.
26883 (New::Resolve): Implement.
26884 (MemberAccess:Resolve): Implement.
26885 (MethodGroupExpr::InstanceExpression): used conforming to the spec
26886 to track instances.
26887 (FieldExpr::Resolve): Set type.
26889 * support.cs: Handle empty arguments.
26891 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
26892 SimpleLookup): Auxiliary routines to help parse a qualifier
26895 Update qualifier_identifier rule.
26897 * codegen.cs: Removed debugging messages.
26899 * class.cs: Make this a global thing, this acts just as a "key" to
26900 objects that we might have around.
26902 (Populate): Only initialize method_builders_to_methods once.
26904 * expression.cs (PropertyExpr): Initialize type from the
26907 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
26908 Resolve pattern. Attempt to implicitly convert value to boolean.
26911 * expression.cs: Set the type for the int32/int32 argument case.
26912 (Binary::ResolveOperator): Set the return type to boolean for
26913 comparission operators
26915 * typemanager.cs: Remove debugging print code.
26917 (Invocation::Resolve): resolve type.
26919 * class.cs: Allocate a MemberInfo of the correct size, as the code
26920 elsewhere depends on the test to reflect the correct contents.
26922 (Method::) Keep track of parameters, due to System.Reflection holes
26924 (TypeContainer::Populate): Keep track of MethodBuilders to Method
26927 (TypeContainer::FindMembers): Use ArrayList and then copy an array
26928 of the exact size and return that.
26930 (Class::LookupMethodByBuilder): New function that maps
26931 MethodBuilders to its methods. Required to locate the information
26932 on methods because System.Reflection bit us again.
26934 * support.cs: New file, contains an interface ParameterData and
26935 two implementations: ReflectionParameters and InternalParameters
26936 used to access Parameter information. We will need to grow this
26939 * expression.cs (Invocation::GetParameterData): implement a cache
26940 and a wrapper around the ParameterData creation for methods.
26941 (Invocation::OverloadResolve): Use new code.
26943 2001-09-13 Ravi Pratap <ravi@ximian.com>
26945 * class.cs (TypeContainer::EmitField): Remove and move into
26946 (Field::Define): here and modify accordingly.
26947 (Field.FieldBuilder): New member.
26948 (TypeContainer::Populate): Update accordingly.
26949 (TypeContainer::FindMembers): Implement.
26951 2001-09-13 Miguel de Icaza <miguel@ximian.com>
26953 * statement.cs: (VariableInfo::VariableType): New field to be
26954 initialized with the full type once it is resolved.
26956 2001-09-12 Miguel de Icaza <miguel@ximian.com>
26958 * parameter.cs (GetParameterInfo): Use a type cache to compute
26959 things only once, and to reuse this information
26961 * expression.cs (LocalVariableReference::Emit): Implement.
26962 (OpcodeCast::Emit): fix.
26964 (ParameterReference::Resolve): Implement.
26965 (ParameterReference::Emit): Implement.
26967 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
26968 that are expressions need to stay as Expressions.
26970 * typemanager.cs (CSharpName): Returns the C# name of a type if
26973 * expression.cs (Expression::ConvertImplicit): New function that
26974 implements implicit type conversions.
26976 (Expression::ImplicitReferenceConversion): Implements implicit
26977 reference conversions.
26979 (EmptyCast): New type for transparent casts.
26981 (OpcodeCast): New type for casts of types that are performed with
26982 a sequence of bytecodes.
26984 (BoxedCast): New type used for casting value types into reference
26985 types. Emits a box opcode.
26987 (Binary::DoNumericPromotions): Implements numeric promotions of
26988 and computation of the Binary::Type.
26990 (Binary::EmitBranchable): Optimization.
26992 (Binary::Emit): Implement code emission for expressions.
26994 * typemanager.cs (TypeManager): Added two new core types: sbyte
26997 2001-09-12 Ravi Pratap <ravi@ximian.com>
26999 * class.cs (TypeContainer::FindMembers): Method which does exactly
27000 what Type.FindMembers does, only we don't have to use reflection. No
27001 implementation yet.
27003 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
27004 typecontainer objects as we need to get at them.
27005 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
27007 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
27008 typecontainer object.
27010 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
27011 of just a Report object.
27013 2001-09-11 Ravi Pratap <ravi@ximian.com>
27015 * class.cs (Event::Define): Go back to using the prefixes "add_" and
27017 (TypeContainer::Populate): Now define the delegates of the type too.
27018 (TypeContainer.Delegates): Property to access the list of delegates defined
27021 * delegates.cs (Delegate::Define): Implement partially.
27023 * modifiers.cs (TypeAttr): Handle more flags.
27025 2001-09-11 Ravi Pratap <ravi@ximian.com>
27027 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
27029 (Operator::Define): Re-write logic to get types by using the LookupType method
27030 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
27031 (Indexer::Define): Ditto.
27032 (Event::Define): Ditto.
27033 (Property::Define): Ditto.
27035 2001-09-10 Ravi Pratap <ravi@ximian.com>
27037 * class.cs (TypeContainer::Populate): Now define operators too.
27038 (TypeContainer.Operators): New property to access the list of operators
27040 (Operator.OperatorMethodBuilder): New member to hold the method builder
27041 for the operator we are defining.
27042 (Operator::Define): Implement.
27044 2001-09-10 Ravi Pratap <ravi@ximian.com>
27046 * class.cs (Event::Define): Make the prefixes of the accessor methods
27047 addOn_ and removeOn_
27049 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
27050 of the location being passed in too. Ideally, this should go later since all
27051 error reporting should be done through the Report object.
27053 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
27054 (Populate): Iterate thru the indexers we have and define them too.
27055 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
27056 for the get and set accessors.
27057 (Indexer::Define): Implement.
27059 2001-09-09 Miguel de Icaza <miguel@ximian.com>
27061 * expression.cs (Binary::Resolve): Beginning of it. I scratched
27062 my previous implementation, did not work.
27064 * typemanager.cs: Add a couple of missing types (the longs).
27066 * literal.cs: Use TypeManager.bool_type instead of getting it.
27068 * expression.cs (EventExpr): New kind of expressions.
27069 (Expressio::ExprClassFromMemberInfo): finish
27071 2001-09-08 Miguel de Icaza <miguel@ximian.com>
27073 * assign.cs: Emit stores to static fields differently.
27075 2001-09-08 Ravi Pratap <ravi@ximian.com>
27077 * Merge in changes and adjust code to tackle conflicts. Backed out my
27078 code in Assign::Resolve ;-)
27080 2001-09-08 Ravi Pratap <ravi@ximian.com>
27082 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
27083 instead Report.Error and also pass in the location.
27084 (CSharpParser::Lexer): New readonly property to return the reference
27085 to the Tokenizer object.
27086 (declare_local_variables): Use Report.Error with location instead of plain
27090 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
27091 (Operator.CheckBinaryOperator): Ditto.
27093 * cs-parser.jay (operator_declarator): Update accordingly.
27095 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
27096 (CheckBinaryOperator): Same here.
27098 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
27099 on the name without any prefixes of namespace names etc. This is because we
27100 already might have something already fully qualified like
27101 'System.Console.WriteLine'
27103 * assign.cs (Resolve): Begin implementation. Stuck ;-)
27105 2001-09-07 Ravi Pratap <ravi@ximian.com>
27107 * cs-tokenizer.cs (location): Return a string which also contains
27110 * expression.cs (ElementAccess): New class for expressions of the
27111 type 'element access.'
27112 (BaseAccess): New class for expressions of the type 'base access.'
27113 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
27116 * cs-parser.jay (element_access): Implement action.
27117 (base_access): Implement actions.
27118 (checked_expression, unchecked_expression): Implement.
27120 * cs-parser.jay (local_variable_type): Correct and implement.
27121 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
27123 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
27125 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
27126 name and the specifiers.
27128 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
27130 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
27131 making them all public ;-)
27133 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
27136 2001-09-07 Miguel de Icaza <miguel@ximian.com>
27138 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
27140 (FieldExpr, PropertyExprs): New resolved expressions.
27141 (SimpleName::MemberStaticCheck): Perform static checks for access
27142 to non-static fields on static methods. Maybe this should be
27143 generalized for MemberAccesses.
27144 (SimpleName::ResolveSimpleName): More work on simple name
27147 * cs-parser.jay (primary_expression/qualified_identifier): track
27148 the parameter index.
27150 * codegen.cs (CodeGen::Save): Catch save exception, report error.
27151 (EmitContext::EmitBoolExpression): Chain to expression generation
27152 instead of temporary hack.
27153 (::EmitStatementExpression): Put generic expression code generation.
27155 * assign.cs (Assign::Emit): Implement variable assignments to
27156 local variables, parameters and fields.
27158 2001-09-06 Miguel de Icaza <miguel@ximian.com>
27160 * statement.cs (Block::GetVariableInfo): New method, returns the
27161 VariableInfo for a variable name in a block.
27162 (Block::GetVariableType): Implement in terms of GetVariableInfo
27164 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
27165 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
27167 2001-09-06 Ravi Pratap <ravi@ximian.com>
27169 * cs-parser.jay (operator_declaration): Continue on my quest : update
27170 to take attributes argument.
27171 (event_declaration): Ditto.
27172 (enum_declaration): Ditto.
27173 (indexer_declaration): Ditto.
27175 * class.cs (Operator::Operator): Update constructor accordingly.
27176 (Event::Event): Ditto.
27178 * delegate.cs (Delegate::Delegate): Same here.
27180 * enum.cs (Enum::Enum): Same here.
27182 2001-09-05 Ravi Pratap <ravi@ximian.com>
27184 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
27186 * ../tests/cs0658.cs : New file to demonstrate error 0658.
27188 * attribute.cs (Attributes): New class to encapsulate all attributes which were
27189 being passed around as an arraylist.
27190 (Attributes::AddAttribute): Method to add attribute sections.
27192 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
27193 (struct_declaration): Update accordingly.
27194 (constant_declaration): Update.
27195 (field_declaration): Update.
27196 (method_header): Update.
27197 (fixed_parameter): Update.
27198 (parameter_array): Ditto.
27199 (property_declaration): Ditto.
27200 (destructor_declaration): Ditto.
27202 * class.cs (Struct::Struct): Update constructors accordingly.
27203 (Class::Class): Ditto.
27204 (Field::Field): Ditto.
27205 (Method::Method): Ditto.
27206 (Property::Property): Ditto.
27207 (TypeContainer::OptAttribute): update property's return type.
27209 * interface.cs (Interface.opt_attributes): New member.
27210 (Interface::Interface): Update to take the extra Attributes argument.
27212 * parameter.cs (Parameter::Parameter): Ditto.
27214 * constant.cs (Constant::Constant): Ditto.
27216 * interface.cs (InterfaceMemberBase): New OptAttributes field.
27217 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
27218 the attributes as a parameter.
27219 (InterfaceProperty): Update constructor call.
27220 (InterfaceEvent): Ditto.
27221 (InterfaceMethod): Ditto.
27222 (InterfaceIndexer): Ditto.
27224 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
27225 pass the attributes too.
27226 (interface_event_declaration): Ditto.
27227 (interface_property_declaration): Ditto.
27228 (interface_method_declaration): Ditto.
27229 (interface_declaration): Ditto.
27231 2001-09-05 Miguel de Icaza <miguel@ximian.com>
27233 * class.cs (Method::Define): Track the "static Main" definition to
27234 create an entry point.
27236 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
27237 EntryPoint if we find it.
27239 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
27240 (EmitContext::ig): Make this variable public.
27242 * driver.cs: Make the default output file be the first file name
27243 with the .exe extension.
27245 Detect empty compilations
27247 Handle various kinds of output targets. Handle --target and
27248 rename -t to --dumper.
27250 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
27251 methods inherited from Expression return now an Expression. This
27252 will is used during the tree rewriting as we resolve them during
27255 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
27256 the spec. Missing entirely is the information about
27257 accessability of elements of it.
27259 (Expression::ExprClassFromMemberInfo): New constructor for
27260 Expressions that creates a fully initialized Expression based on
27261 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
27264 (Invocation::Resolve): Begin implementing resolution of invocations.
27266 * literal.cs (StringLiteral): Implement Emit.
27268 2001-09-05 Ravi Pratap <ravi@ximian.com>
27270 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
27273 2001-09-04 Ravi Pratap <ravi@ximian.com>
27275 * cs-parser.jay (attribute_arguments): Implement actions.
27276 (attribute): Fix bug in production. Implement action.
27277 (attribute_list): Implement.
27278 (attribute_target): Implement.
27279 (attribute_target_specifier, opt_target_specifier): Implement
27280 (CheckAttributeTarget): New method to check if the attribute target
27282 (attribute_section): Implement.
27283 (opt_attributes): Implement.
27285 * attribute.cs : New file to handle attributes.
27286 (Attribute): Class to hold attribute info.
27288 * cs-parser.jay (opt_attribute_target_specifier): Remove production
27289 (attribute_section): Modify production to use 2 different rules to
27290 achieve the same thing. 1 s/r conflict down !
27291 Clean out commented, useless, non-reducing dimension_separator rules.
27293 * class.cs (TypeContainer.attributes): New member to hold list
27294 of attributes for a type.
27295 (Struct::Struct): Modify to take one more argument, the attribute list.
27296 (Class::Class): Ditto.
27297 (Field::Field): Ditto.
27298 (Method::Method): Ditto.
27299 (Property::Property): Ditto.
27301 * cs-parser.jay (struct_declaration): Update constructor call to
27302 pass in the attributes too.
27303 (class_declaration): Ditto.
27304 (constant_declaration): Ditto.
27305 (field_declaration): Ditto.
27306 (method_header): Ditto.
27307 (fixed_parameter): Ditto.
27308 (parameter_array): Ditto.
27309 (property_declaration): Ditto.
27311 * constant.cs (Constant::Constant): Update constructor similarly.
27312 Use System.Collections.
27314 * parameter.cs (Parameter::Parameter): Update as above.
27316 2001-09-02 Ravi Pratap <ravi@ximian.com>
27318 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
27319 (TypeContainer.delegates): New member to hold list of delegates.
27321 * cs-parser.jay (delegate_declaration): Implement the action correctly
27322 this time as I seem to be on crack ;-)
27324 2001-09-02 Miguel de Icaza <miguel@ximian.com>
27326 * rootcontext.cs (RootContext::IsNamespace): new function, used to
27327 tell whether an identifier represents a namespace.
27329 * expression.cs (NamespaceExpr): A namespace expression, used only
27330 temporarly during expression resolution.
27331 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
27332 utility functions to resolve names on expressions.
27334 2001-09-01 Miguel de Icaza <miguel@ximian.com>
27336 * codegen.cs: Add hook for StatementExpressions.
27338 * class.cs: Fix inverted test for static flag in methods.
27340 2001-09-02 Ravi Pratap <ravi@ximian.com>
27342 * class.cs (Operator::CheckUnaryOperator): Correct error number used
27343 to make it coincide with MS' number.
27344 (Operator::CheckBinaryOperator): Ditto.
27346 * ../errors/errors.txt : Remove error numbers added earlier.
27348 * ../errors/cs1019.cs : Test case for error # 1019
27350 * ../errros/cs1020.cs : Test case for error # 1020
27352 * cs-parser.jay : Clean out commented cruft.
27353 (dimension_separators, dimension_separator): Comment out. Ostensibly not
27354 used anywhere - non-reducing rule.
27355 (namespace_declarations): Non-reducing rule - comment out.
27357 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
27358 with TypeContainer::AddEnum.
27360 * delegate.cs : New file for delegate handling classes.
27361 (Delegate): Class for declaring delegates.
27363 * makefile : Update.
27365 * cs-parser.jay (delegate_declaration): Implement.
27367 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
27369 * class.cs (Event::Define): Implement.
27370 (Event.EventBuilder): New member.
27372 * class.cs (TypeContainer::Populate): Update to define all enums and events
27374 (Events): New property for the events arraylist we hold. Shouldn't we move to using
27375 readonly fields for all these cases ?
27377 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
27379 * class.cs (Property): Revamp to use the convention of making fields readonly.
27380 Accordingly modify code elsewhere.
27382 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
27383 the Define method of the Property class.
27385 * class.cs : Clean up applied patch and update references to variables etc. Fix
27387 (TypeContainer::Populate): Update to define all the properties we have. Also
27388 define all enumerations.
27390 * enum.cs (Define): Implement.
27392 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
27394 * cs-parser.jay (overloadable_operator): The semantic value is an
27395 enum of the Operator class.
27396 (operator_declarator): Implement actions.
27397 (operator_declaration): Implement.
27399 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
27400 validity of definitions.
27401 (Operator::CheckBinaryOperator): Static method to check for binary operators
27402 (TypeContainer::AddOperator): New method to add an operator to a type.
27404 * cs-parser.jay (indexer_declaration): Added line to actually call the
27405 AddIndexer method so it gets added ;-)
27407 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
27408 already taken care of by the MS compiler ?
27410 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
27412 * class.cs (Operator): New class for operator declarations.
27413 (Operator::OpType): Enum for the various operators.
27415 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
27417 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
27418 ostensibly handle this in semantic analysis.
27420 * cs-parser.jay (general_catch_clause): Comment out
27421 (specific_catch_clauses, specific_catch_clause): Ditto.
27422 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
27423 (catch_args, opt_catch_args): New productions.
27424 (catch_clause): Rewrite to use the new productions above
27425 (catch_clauses): Modify accordingly.
27426 (opt_catch_clauses): New production to use in try_statement
27427 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
27428 and re-write the code in the actions to extract the specific and
27429 general catch clauses by being a little smart ;-)
27431 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
27432 Hooray, try and catch statements parse fine !
27434 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27436 * statement.cs (Block::GetVariableType): Fix logic to extract the type
27437 string from the hashtable of variables.
27439 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
27440 I end up making that mistake ;-)
27441 (catch_clauses): Fixed gross error which made Key and Value of the
27442 DictionaryEntry the same : $1 !!
27444 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27446 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
27448 * cs-parser.jay (event_declaration): Correct to remove the semicolon
27449 when the add and remove accessors are specified.
27451 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27453 * cs-parser.jay (IndexerDeclaration): New helper class to hold
27454 information about indexer_declarator.
27455 (indexer_declarator): Implement actions.
27456 (parsing_indexer): New local boolean used to keep track of whether
27457 we are parsing indexers or properties. This is necessary because
27458 implicit_parameters come into picture even for the get accessor in the
27459 case of an indexer.
27460 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
27462 * class.cs (Indexer): New class for indexer declarations.
27463 (TypeContainer::AddIndexer): New method to add an indexer to a type.
27464 (TypeContainer::indexers): New member to hold list of indexers for the
27467 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
27469 * cs-parser.jay (add_accessor_declaration): Implement action.
27470 (remove_accessor_declaration): Implement action.
27471 (event_accessors_declaration): Implement
27472 (variable_declarators): swap statements for first rule - trivial.
27474 * class.cs (Event): New class to hold information about event
27476 (TypeContainer::AddEvent): New method to add an event to a type
27477 (TypeContainer::events): New member to hold list of events.
27479 * cs-parser.jay (event_declaration): Implement actions.
27481 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
27483 * cs-parser.jay (dim_separators): Implement. Make it a string
27484 concatenating all the commas together, just as they appear.
27485 (opt_dim_separators): Modify accordingly
27486 (rank_specifiers): Update accordingly. Basically do the same
27487 thing - instead, collect the brackets here.
27488 (opt_rank_sepcifiers): Modify accordingly.
27489 (array_type): Modify to actually return the complete type string
27490 instead of ignoring the rank_specifiers.
27491 (expression_list): Implement to collect the expressions
27492 (variable_initializer): Implement. We make it a list of expressions
27493 essentially so that we can handle the array_initializer case neatly too.
27494 (variable_initializer_list): Implement.
27495 (array_initializer): Make it a list of variable_initializers
27496 (opt_array_initializer): Modify accordingly.
27498 * expression.cs (New::NType): Add enumeration to help us
27499 keep track of whether we have an object/delegate creation
27500 or an array creation.
27501 (New:NewType, New::Rank, New::Indices, New::Initializers): New
27502 members to hold data about array creation.
27503 (New:New): Modify to update NewType
27504 (New:New): New Overloaded contructor for the array creation
27507 * cs-parser.jay (array_creation_expression): Implement to call
27508 the overloaded New constructor.
27510 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
27512 * class.cs (TypeContainer::Constructors): Return member
27513 constructors instead of returning null.
27515 2001-08-26 Miguel de Icaza <miguel@ximian.com>
27517 * typemanager.cs (InitCoreTypes): Initialize the various core
27518 types after we have populated the type manager with the user
27519 defined types (this distinction will be important later while
27520 compiling corlib.dll)
27522 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
27523 on Expression Classification. Now all expressions have a method
27524 `Resolve' and a method `Emit'.
27526 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
27527 generation from working. Also add some temporary debugging
27530 2001-08-24 Miguel de Icaza <miguel@ximian.com>
27532 * codegen.cs: Lots of code generation pieces. This is only the
27533 beginning, will continue tomorrow with more touches of polish. We
27534 handle the fundamentals of if, while, do, for, return. Others are
27535 trickier and I need to start working on invocations soon.
27537 * gen-treedump.cs: Bug fix, use s.Increment here instead of
27540 * codegen.cs (EmitContext): New struct, used during code
27541 emission to keep a context. Most of the code generation will be
27544 * cs-parser.jay: Add embedded blocks to the list of statements of
27545 this block. So code generation proceeds in a top down fashion.
27547 2001-08-23 Miguel de Icaza <miguel@ximian.com>
27549 * statement.cs: Add support for multiple child blocks.
27551 2001-08-22 Miguel de Icaza <miguel@ximian.com>
27553 * codegen.cs (EmitCode): New function, will emit the code for a
27554 Block of code given a TypeContainer and its ILGenerator.
27556 * statement.cs (Block): Standard public readonly optimization.
27557 (Block::Block constructors): Link children.
27558 (Block::Child): Child Linker.
27559 (Block::EmitVariables): Emits IL variable declarations.
27561 * class.cs: Drop support for MethodGroups here, delay until
27563 (Method::): Applied the same simplification that I did before, and
27564 move from Properties to public readonly fields.
27565 (Method::ParameterTypes): Returns the parameter types for the
27566 function, and implements a cache that will be useful later when I
27567 do error checking and the semantic analysis on the methods is
27569 (Constructor::GetCallingConvention): Renamed from CallingConvetion
27570 and made a method, optional argument tells whether this is a class
27571 or a structure to apply the `has-this' bit.
27572 (Method::GetCallingConvention): Implement, returns the calling
27574 (Method::Define): Defines the type, a second pass is performed
27575 later to populate the methods.
27577 (Constructor::ParameterTypes): implement a cache similar to the
27578 one on Method::ParameterTypes, useful later when we do semantic
27581 (TypeContainer::EmitMethod): New method. Emits methods.
27583 * expression.cs: Removed MethodGroup class from here.
27585 * parameter.cs (Parameters::GetCallingConvention): new method.
27587 2001-08-21 Miguel de Icaza <miguel@ximian.com>
27589 * class.cs (TypeContainer::Populate): Drop RootContext from the
27592 (Constructor::CallingConvention): Returns the calling convention.
27593 (Constructor::ParameterTypes): Returns the constructor parameter
27596 (TypeContainer::AddConstructor): Keep track of default constructor
27597 and the default static constructor.
27599 (Constructor::) Another class that starts using `public readonly'
27600 instead of properties.
27602 (Constructor::IsDefault): Whether this is a default constructor.
27604 (Field::) use readonly public fields instead of properties also.
27606 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
27607 track of static constructors; If none is used, turn on
27608 BeforeFieldInit in the TypeAttributes.
27610 * cs-parser.jay (opt_argument_list): now the return can be null
27611 for the cases where there are no arguments.
27613 (constructor_declarator): If there is no implicit `base' or
27614 `this', then invoke the default parent constructor.
27616 * modifiers.cs (MethodAttr): New static function maps a set of
27617 modifiers flags into a MethodAttributes enum
27618 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
27619 MethodAttr, TypeAttr to represent the various mappings where the
27620 modifiers are used.
27621 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
27623 2001-08-19 Miguel de Icaza <miguel@ximian.com>
27625 * parameter.cs (GetParameterInfo): Fix bug where there would be no
27628 * interface.cs (PopulateIndexer): Implemented the code generator
27629 for interface indexers.
27631 2001-08-17 Miguel de Icaza <miguel@ximian.com>
27633 * interface.cs (InterfaceMemberBase): Now we track the new status
27636 (PopulateProperty): Implement property population. Woohoo! Got
27637 Methods and Properties going today.
27639 Removed all the properties for interfaces, and replaced them with
27640 `public readonly' fields.
27642 2001-08-16 Miguel de Icaza <miguel@ximian.com>
27644 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
27645 initialize their hashtables/arraylists only when they are needed
27646 instead of doing this always.
27648 * parameter.cs: Handle refs and out parameters.
27650 * cs-parser.jay: Use an ArrayList to construct the arguments
27651 instead of the ParameterCollection, and then cast that to a
27654 * parameter.cs: Drop the use of ParameterCollection and use
27655 instead arrays of Parameters.
27657 (GetParameterInfo): Use the Type, not the Name when resolving
27660 2001-08-13 Miguel de Icaza <miguel@ximian.com>
27662 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
27663 and instead use public readonly fields.
27665 * class.cs: Put back walking code for type containers.
27667 2001-08-11 Miguel de Icaza <miguel@ximian.com>
27669 * class.cs (MakeConstant): Code to define constants.
27671 * rootcontext.cs (LookupType): New function. Used to locate types
27674 2001-08-08 Miguel de Icaza <miguel@ximian.com>
27676 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
27677 this System.Reflection code is. Kudos to Microsoft
27679 * typemanager.cs: Implement a type cache and avoid loading all
27680 types at boot time. Wrap in LookupType the internals. This made
27681 the compiler so much faster. Wow. I rule!
27683 * driver.cs: Make sure we always load mscorlib first (for
27684 debugging purposes, nothing really important).
27686 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
27687 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
27689 * rootcontext.cs: Lookup types on their namespace; Lookup types
27690 on namespaces that have been imported using the `using' keyword.
27692 * class.cs (TypeContainer::TypeAttr): Virtualize.
27693 (Class::TypeAttr): Return attributes suitable for this bad boy.
27694 (Struct::TypeAttr): ditto.
27695 Handle nested classes.
27696 (TypeContainer::) Remove all the type visiting code, it is now
27697 replaced with the rootcontext.cs code
27699 * rootcontext.cs (GetClassBases): Added support for structs.
27701 2001-08-06 Miguel de Icaza <miguel@ximian.com>
27703 * interface.cs, statement.cs, class.cs, parameter.cs,
27704 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
27705 Drop use of TypeRefs, and use strings instead.
27707 2001-08-04 Miguel de Icaza <miguel@ximian.com>
27711 * class.cs (Struct::Struct): set the SEALED flags after
27712 checking the modifiers.
27713 (TypeContainer::TypeAttr): new property, returns the
27714 TypeAttributes for a class.
27716 * cs-parser.jay (type_list): Oops, list production was creating a
27717 new list of base types.
27719 * rootcontext.cs (StdLib): New property.
27720 (GetInterfaceTypeByName): returns an interface by type name, and
27721 encapsulates error handling here.
27722 (GetInterfaces): simplified.
27723 (ResolveTree): Encapsulated all the tree resolution here.
27724 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
27727 * driver.cs: Add support for --nostdlib, to avoid loading the
27728 default assemblies.
27729 (Main): Do not put tree resolution here.
27731 * rootcontext.cs: Beginning of the class resolution.
27733 2001-08-03 Miguel de Icaza <miguel@ximian.com>
27735 * rootcontext.cs: Provide better error reporting.
27737 * cs-parser.jay (interface_base): set our $$ to be interfaces.
27739 * rootcontext.cs (CreateInterface): Handle the case where there
27740 are no parent interfaces.
27742 (CloseTypes): Routine to flush types at the end.
27743 (CreateInterface): Track types.
27744 (GetInterfaces): Returns an array of Types from the list of
27745 defined interfaces.
27747 * typemanager.c (AddUserType): Mechanism to track user types (puts
27748 the type on the global type hash, and allows us to close it at the
27751 2001-08-02 Miguel de Icaza <miguel@ximian.com>
27753 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
27754 RecordInterface instead.
27756 * cs-parser.jay: Updated to reflect changes above.
27758 * decl.cs (Definition): Keep track of the TypeBuilder type that
27759 represents this type here. Not sure we will use it in the long
27760 run, but wont hurt for now.
27762 * driver.cs: Smaller changes to accomodate the new code.
27764 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
27767 * rootcontext.cs (CreateInterface): New method, used to create
27768 the System.TypeBuilder type for interfaces.
27769 (ResolveInterfaces): new entry point to resolve the interface
27771 (CodeGen): Property, used to keep track of the code generator.
27773 2001-07-26 Miguel de Icaza <miguel@ximian.com>
27775 * cs-parser.jay: Add a second production for delegate_declaration
27778 (enum_body): Put an opt_comma here instead of putting it on
27779 enum_body or enum_member_declarations so we can handle trailing
27780 commas on enumeration members. Gets rid of a shift/reduce.
27782 (type_list): Need a COMMA in the middle.
27784 (indexer_declaration): Tell tokenizer to recognize get/set
27786 * Remove old targets.
27788 * Re-add the parser target.
27790 2001-07-13 Simon Cozens <simon@simon-cozens.org>
27792 * cs-parser.jay: Add precendence rules for a number of operators
27793 ot reduce the number of shift/reduce conflicts in the grammar.
27795 2001-07-17 Miguel de Icaza <miguel@ximian.com>
27797 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
27800 Get rid of old crufty code.
27802 * rootcontext.cs: Use this to keep track of the parsed
27803 representation and the defined types available to the program.
27805 * gen-treedump.cs: adjust for new convention.
27807 * type.cs: Split out the type manager, and the assembly builder
27810 * typemanager.cs: the type manager will live here now.
27812 * cil-codegen.cs: And the code generator here.
27814 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
27816 * makefile: Fixed up for easy making.
27818 2001-07-13 Simon Cozens <simon@simon-cozens.org>
27820 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
27823 (unary_expression): Expand pre_increment_expression and
27824 post_decrement_expression to reduce a shift/reduce.
27826 2001-07-11 Simon Cozens
27828 * cs-tokenizer.cs: Hex numbers should begin with a 0.
27830 Improve allow_keyword_as_indent name.
27832 2001-06-19 Miguel de Icaza <miguel@ximian.com>
27834 * Adjustments for Beta2.
27836 2001-06-13 Miguel de Icaza <miguel@ximian.com>
27838 * decl.cs: Added `Define' abstract method.
27839 (InTransit): new property, used to catch recursive definitions.
27841 * interface.cs: Implement `Define'.
27843 * modifiers.cs: Map Modifiers.constants to
27844 System.Reflection.TypeAttribute flags.
27846 * class.cs: Keep track of types and user-defined types.
27847 (BuilderInit): New method for creating an assembly
27848 (ResolveType): New function to launch the resolution process, only
27849 used by interfaces for now.
27851 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
27852 that are inserted into the name space.
27854 2001-06-08 Miguel de Icaza <miguel@ximian.com>
27856 * ARGH. I have screwed up my tree so many times due to the use of
27857 rsync rather than using CVS. Going to fix this at once.
27859 * driver.cs: Objetify driver. Load assemblies, use assemblies to
27862 2001-06-07 Miguel de Icaza <miguel@ximian.com>
27864 * Experiment successful: Use System.Type rather that our own
27867 2001-05-25 Miguel de Icaza <miguel@ximian.com>
27869 * cs-parser.jay: Removed nsAliases from here.
27871 Use new namespaces, handle `using XXX;'
27873 * namespace.cs: Reimplemented namespace handling, use a recursive
27874 definition of the class. Now we can keep track of using clauses
27875 and catch invalid using clauses.
27877 2001-05-24 Miguel de Icaza <miguel@ximian.com>
27879 * gen-treedump.cs: Adapted for all the renaming.
27881 * expression.cs (Expression): this class now has a Type property
27882 which returns an expression Type.
27884 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
27885 `Type', as this has a different meaning now in the base
27887 2001-05-22 Miguel de Icaza <miguel@ximian.com>
27889 * interface.cs, class.cs: Removed from all the sources the
27890 references to signature computation, as we can not do method
27891 signature computation during the parsing time, as we are not
27892 trying to solve at that point distinguishing:
27896 void a (NS.Blah x) {}
27899 Which depending on the context might be valid or not, as we do not
27900 know if Blah is the same thing as NS.Blah at that point.
27902 * Redid everything so the code uses TypeRefs now instead of
27903 Types. TypeRefs are just temporary type placeholders, that need
27904 to be resolved. They initially have a pointer to a string and the
27905 current scope in which they are used. This is used later by the
27906 compiler to resolve the reference to an actual Type.
27908 * DeclSpace is no longer a CIR.Type, and neither are
27909 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
27910 are all DeclSpaces, but no Types.
27912 * type.cs (TypeRefManager): This implements the TypeRef manager,
27913 which keeps track of all the types that need to be resolved after
27914 the parsing has finished.
27916 2001-05-13 Miguel de Icaza <miguel@ximian.com>
27918 * ARGH. We are going to have to store `foreach' as a class rather
27919 than resolving it, as we need to verify error 1579 after name
27920 resolution. *OR* we could keep a flag that says `This request to
27921 IEnumerator comes from a foreach statement' which we can then use
27922 to generate the error.
27924 2001-05-10 Miguel de Icaza <miguel@ximian.com>
27926 * class.cs (TypeContainer.AddMethod): we now add methods to the
27927 MethodGroup instead of the method hashtable.
27929 * expression.cs: Add MethodGroup abstraction, which gets us one
27930 step closer to the specification in the way we handle method
27933 * cs-parser.jay (primary_expression): qualified_identifier now
27934 tried to match up an identifier to a local variable reference or
27935 to a parameter reference.
27937 current_local_parameters is now a parser global variable that
27938 points to the current parameters for the block, used during name
27941 (property_declaration): Now creates an implicit `value' argument to
27944 2001-05-09 Miguel de Icaza <miguel@ximian.com>
27946 * parameter.cs: Do not use `param' arguments as part of the
27947 signature, per the spec.
27949 2001-05-08 Miguel de Icaza <miguel@ximian.com>
27951 * decl.cs: Base class for classes, structs and interfaces. This
27952 is the "Declaration Space"
27954 * cs-parser.jay: Use CheckDef for checking declaration errors
27955 instead of having one on each function.
27957 * class.cs: Factor out some code for handling error handling in
27958 accordance to the "Declarations" section in the "Basic Concepts"
27959 chapter in the ECMA C# spec.
27961 * interface.cs: Make all interface member classes derive from
27962 InterfaceMemberBase.
27964 2001-05-07 Miguel de Icaza <miguel@ximian.com>
27966 * Many things: all interfaces are parsed and generated in
27967 gen-treedump. Support for member variables, constructors,
27968 destructors, properties, constants is there.
27970 Beginning of the IL backend, but very little done, just there for
27973 2001-04-29 Miguel de Icaza <miguel@ximian.com>
27975 * cs-parser.jay: Fix labeled statement.
27977 * cs-tokenizer.cs (escape): Escape " and ' always.
27978 ref_line, ref_name: keep track of the line/filename as instructed
27979 by #line by the compiler.
27982 2001-04-27 Miguel de Icaza <miguel@ximian.com>
27984 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
27985 to match the values in System.CodeDOM.
27987 Divid renamed to Divide.
27989 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
27991 (Statements.set): remove.
27993 * System.CodeDOM/CodeCatchClause.cs: always have a valid
27996 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
27997 falseStatements always have valid values.
27999 * cs-parser.jay: Use System.CodeDOM now.