1 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
3 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
6 2008-02-19 Marek Safar <marek.safar@gmail.com>
8 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
10 2008-02-19 Marek Safar <marek.safar@gmail.com>
13 * expression.cs: Do not fold immediately LogicalAnd operators when the left
14 side is a false constant, because we still need to evaluate the right-hand
17 * statement.cs (If): Emit two types of boolean constants (simple constant,
18 side-effect constant).
20 2008-02-19 Marek Safar <marek.safar@gmail.com>
22 * constant.cs (SideEffectConstant): Don't emit boolean constant.
24 * expression.cs: Fold immediately LogicalAnd operators when both sides are
27 2008-02-18 Marek Safar <marek.safar@gmail.com>
30 * ecore.cs (IsApplicable): Params methods have lower priority.
32 * support.cs: Return correct parameter modifier for params types.
34 2008-02-18 Marek Safar <marek.safar@gmail.com>
36 * generic.cs (TypeParameter): Cache attribute target name.
38 * support.cs: Removed unused variable.
40 * typemanager.cs: Removed debugging leftover.
42 * ecore.cs: Use local type instead of a property;
44 * class.cs (VerifyMembers): Consider also parent to test whether type member
47 * expression.cs (FullMethodDesc): Removed.
49 * attribute.cs (IsValidArgumentType): Made static.
51 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
53 Cleanup to be more readable.
54 * Makefile (GMCS_PROFILE): Remove.
55 (COMPILER_NAME): New helper.
57 2008-02-15 Miguel de Icaza <miguel@novell.com>
59 * cs-tokenizer.cs: if a conditional expression happens inside a
60 (...) this also means that we do not need to de-ambiguate between
61 an parenthesized expression and a cast.
65 * constant.cs (SideEffectConstant): a constant value that happens
66 to have a side effect.
68 Fixes the build regressions introduced by the fix for #359789
70 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
72 * expression.cs (Conditional.Emit): when emitting the ternary
73 operator, use local variables to generate code verifiable code.
75 The verifier cannot infer that the type on stack before the
76 stloc.0 is executed is of type ParentB. This happens because the
77 stack merge algorithm uses only parent types when deciding which
78 is the common type. This is described in Part III 1.8.1.3 of ECMA
81 This code compiled with mcs is not verifiable under MS. The MS
82 verifier picks the first common interface of Foo and Bar, which is
83 wrong, but doesn't use a full join type of the 2 interfaces.
85 CSC uses a clever hack to compile such code in a verifiable
86 way. It stores the intermediate values in a local variable with
91 2008-02-14 Miguel de Icaza <miguel@novell.com>
93 * expression.cs: Do not fold BitwiseAnd operators when the left
94 side is a false constant, because we still need to evaluate the
99 * support.cs: Instead of throwing an InternalErrorException when
100 the position of the stream is outside the boundary of our buffer,
101 reset the state of the reader, and restart the reading from the
102 beginning of the file.
104 2008-02-14 Marek Safar <marek.safar@gmail.com>
106 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
108 2008-02-14 Marek Safar <marek.safar@gmail.com>
110 A fix for bug #361686
111 * decl.cs: A protected types used inside a private class which parents
112 derives from the protected class are accessible.
114 2008-02-13 Marek Safar <marek.safar@gmail.com>
116 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
117 the parameterless constructor.
119 2008-02-13 Marek Safar <marek.safar@gmail.com>
121 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
122 lookup methods to use standard member cache when doing member lookup.
124 2008-02-12 Marek Safar <marek.safar@gmail.com>
126 * driver.cs: Don't report full path for referenced module as assembly error.
128 2008-02-12 Marek Safar <marek.safar@gmail.com>
130 * Makefile: Fixed `qh' target to work on all machines.
132 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
133 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
134 and HasElementType with TypeManager implementation.
136 2008-02-08 Marek Safar <marek.safar@gmail.com>
138 A fix for bugs #325134, #359749
139 * expression.cs, ecore.cs: Try to resolve an extension method even if the
140 first binds point to non-method member expression.
142 2008-02-08 Marek Safar <marek.safar@gmail.com>
144 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
146 2008-02-08 Marek Safar <marek.safar@gmail.com>
148 A fix for bugs #321394, #323028
149 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
150 Reworked naive IsAccessibleAs implementation to handle nested types.
152 2008-02-05 Jb Evain <jbevain@novell.com>
154 * class.cs: use generic type comparison for parameters
157 2008-02-05 Marek Safar <marek.safar@gmail.com>
159 A fix for bug #325372
160 * class.cs: Use generic type comparison when testing method signatures.
162 2008-02-05 Marek Safar <marek.safar@gmail.com>
164 A fix for bug #357047
165 * ecore.cs: Applied C# 3.0 changes to better conversion.
167 2008-02-05 Marek Safar <marek.safar@gmail.com>
169 A fix for bug #358374
170 * cs-parser.jay: Correctly set modifiers for all constructor types.
172 2008-02-04 Marek Safar <marek.safar@gmail.com>
174 A fix for bug #355251
175 * generic.cs: Added base class constraint based type inference.
177 2008-02-01 Marek Safar <marek.safar@gmail.com>
179 A fix for bug #357255
180 * decl.cs: One more missing visibility check.
182 2008-02-01 Marek Safar <marek.safar@gmail.com>
184 * support.cs: Fixed broken return.
186 2008-01-25 Marek Safar <marek.safar@gmail.com>
188 * report.cs: Correctly reset warnings count after probing.
190 2008-01-25 Martin Baulig <martin@ximian.com>
193 (NamespaceEntry.SymbolFileID): Make this work again after
194 MemberName.ToString() is gone.
196 2008-01-25 Marek Safar <marek.safar@gmail.com>
198 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
201 2008-01-25 Marek Safar <marek.safar@gmail.com>
203 * generic.cs: Use full implicit conversion for type inference fixing.
205 2008-01-24 Marek Safar <marek.safar@gmail.com>
207 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
208 Fixed user operator conversions.
210 2008-01-24 Marek Safar <marek.safar@gmail.com>
212 * generic.cs: Do nullable type to null comparison optimization during
215 2008-01-24 Marek Safar <marek.safar@gmail.com>
217 A fix for bug #355163
218 * generic.cs: Enabled l-value resolve on nullable expressions.
220 2008-01-24 Marek Safar <marek.safar@gmail.com>
222 A fix for bug #353986
223 * class.cs: Ingore static ctors with parameters for any further checks.
225 2008-01-24 Marek Safar <marek.safar@gmail.com>
227 A fix for bug #354310
228 * namespace.cs: Removed redundant check.
230 2008-01-24 Marek Safar <marek.safar@gmail.com>
232 A fix for bug #354928
233 * expression.cs: ElementInitializers can be resolved only once.
235 2008-01-24 Marek Safar <marek.safar@gmail.com>
237 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
238 Condition expressions.
240 2008-01-23 Marek Safar <marek.safar@gmail.com>
242 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
244 2008-01-22 Marek Safar <marek.safar@gmail.com>
246 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
249 * generic.cs: Implemented coalesce expression.
251 2008-01-22 Marek Safar <marek.safar@gmail.com>
253 A fix for bug #355145
254 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
255 expression tree type inference.
257 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
260 * expression.cs (Binary.IsUnsignedType): Fix typo.
262 2008-01-22 Marek Safar <marek.safar@gmail.com>
264 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
266 2008-01-22 Marek Safar <marek.safar@gmail.com>
268 A fix for bug #355161
269 * ecore.cs, expression.cs: Wider range of extension method supported
272 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
274 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
275 AssemblyBuilder to operate in compiler context. Fixes mcs part of
278 2008-01-22 Marek Safar <marek.safar@gmail.com>
280 A fix for bug #355148
281 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
283 2008-01-22 Miguel de Icaza <miguel@novell.com>
285 * expression.cs (CreateExpressionTree): Add support for or and
286 logical or, and indent following the coding conventions.
288 * typemanager.cs (LinqExpression): renamed from
289 ExpressionTreeManager, for a shorter name.
291 Use TypeManager.CoreLookupType to lookup types from our core
292 assemblies and turn those into "Type" variables.
294 Consumers that previously used "Namespace" and "Type" from this
295 class should instead use the TypeExpression which is a type that
296 is fully resolved (without involving the regular C# resolution
299 This typically looks like this:
301 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
302 new MemberAccess (texpr, name, type_arguments, loc)
304 This avoids the problem in: #355178
306 2008-01-21 Marek Safar <marek.safar@gmail.com>
308 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
309 feature in parser only as we do in other cases.
311 2008-01-21 Marek Safar <marek.safar@gmail.com>
313 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
314 typemanager.cs: A refactoring of params arguments to reuse existing
315 expressions (params -> array initializer) to emit params argument instead
316 of specialized handling.
317 It was required by expression tree implementation and it has other benefits
318 as well, we now apply same optimization for params arguments as we do for
321 2008-01-18 Marek Safar <marek.safar@gmail.com>
323 A fix for bug #353526
324 * generic.cs: A type inference of params arguments may not required any
325 temporary array creation.
327 2008-01-18 Marek Safar <marek.safar@gmail.com>
329 A fix for bug #353534
330 * generic.cs, ecore.cs, expression.cs: A method group type inference is
331 supported for delegates only.
333 2008-01-18 Marek Safar <marek.safar@gmail.com>
335 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
336 type for more than 1 candidates.
338 2008-01-18 Marek Safar <marek.safar@gmail.com>
340 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
343 2008-01-16 Marek Safar <marek.safar@gmail.com>
345 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
346 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
347 operator) expressions.
349 2008-01-16 Zoltan Varga <vargaz@gmail.com>
351 * statement.cs: Avoid declaring an IL variable for this_variable since it is
352 not accessed from the generated IL.
354 2008-01-14 Marek Safar <marek.safar@gmail.com>
356 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
357 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
358 statement.cs: The first expression tree implementation drop, mostly
361 2008-01-14 Marek Safar <marek.safar@gmail.com>
363 * ecore.cs (IsNestedChild): Refactored.
365 2008-01-11 Marek Safar <marek.safar@gmail.com>
367 * lambda.cs: Don't use a cast on unknown expression statement.
369 2008-01-10 Geoff Norton <gnorton@novell.com>
371 * cs-tokenizer.cs: One more token to distinguish between method and lambda
374 2008-01-09 Marek Safar <marek.safar@gmail.com>
376 * doc.cs: Report better /doc crash details.
378 2008-01-09 Marek Safar <marek.safar@gmail.com>
380 A fix for bug #352536
381 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
383 2008-01-08 Marek Safar <marek.safar@gmail.com>
385 A fix for bug #352287
386 * ecore.cs, expression.cs: Do `this' access checking in all member access
389 2008-01-08 Marek Safar <marek.safar@gmail.com>
391 * rootcontext.cs, driver.cs: Switch to linq mode by default.
393 * report.cs: Reset message stacks.
395 2008-01-08 Marek Safar <marek.safar@gmail.com>
397 * generic.cs (InferInPhases): Correctly calculate params position.
399 2008-01-08 Marek Safar <marek.safar@gmail.com>
401 * cs-tokenizer.cs: No need to parse full string when parsing lambda
404 2008-01-07 Marek Safar <marek.safar@gmail.com>
406 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
408 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
410 * driver.cs: Updated --help option.
412 2008-01-07 Marek Safar <marek.safar@gmail.com>
414 * generic.cs (InferParamsTypeArguments): Removed.
415 (InferInPhases): Add params type inference.
416 (LowerBoundInference): Fixed scoring mechanism.
418 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
420 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
422 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
423 byte array for unsigned "baked" assemblies.
425 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
427 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
428 array for assemblies that are not strongnamed.
430 2008-01-04 Marek Safar <marek.safar@gmail.com>
432 A fix for bug #351481
433 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
434 declaring type for nested generic types.
436 2008-01-04 Marek Safar <marek.safar@gmail.com>
438 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
441 2008-01-03 Marek Safar <marek.safar@gmail.com>
443 A fix for bug #351047
444 * expression.cs (Binary.ResolveOperator): Allow equality operators between
445 null and structs only when equality and inequality operators are defined
446 either as an user-operators or predefined operators.
448 2008-01-03 Marek Safar <marek.safar@gmail.com>
450 A fix for bug #351047
451 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
453 2008-01-03 Marek Safar <marek.safar@gmail.com>
455 A fix for bug #351257
456 * cs-tokenizer.cs: Advance line number for '\r' correctly.
458 2008-01-03 Marek Safar <marek.safar@gmail.com>
460 A fix for bug #351157
461 * class.cs (Using): Fixed yet another broken cloning.
463 (Block): Put back more sensible default value for statements.
465 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
467 * codegen.cs: Allow AssemblyVersion with only major version component.
470 2007-12-29 Marek Safar <marek.safar@gmail.com>
472 A fix for bug #324654
473 * class.cs: Use FullName property as member name.
475 2007-12-28 Marek Safar <marek.safar@gmail.com>
477 A fix for bug #342117
478 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
479 constructor constraint.
481 2007-12-28 Marek Safar <marek.safar@gmail.com>
483 A fix for bug #338273
484 * class.cs (ProbertyBase): Access modifier checks are required for overrides
487 2007-12-28 Marek Safar <marek.safar@gmail.com>
489 A fix for bug #350839
490 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
492 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
494 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
497 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
499 * statement.cs: Changed some Hashtables to use HybridDictionaries
500 instead. It was observed that some HashTables only contained a few
501 items in the vast majority of cases. Since HybridDictionary is
502 more efficient on small sets (<10 elements), "known_variables"
503 from class ExplicitBlock as well as "labels" and "constants " from
504 class Block were changed to HybridDictionaries.
506 Atsai results: (56216kb->54987kb)
508 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
511 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
513 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
516 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
518 * expression.cs: foreach loop to for loop, saved on allocation of
519 enumerator (59333kb->59141kb)
521 * statement.cs. Changed foreach loops to for loops, saved on
522 allocation of enumerator (59141kb->59006kb)
524 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
525 when constructed with no specified capacity. This was causing a
526 few ArrayLists to allocate more memory than they would potentially
527 need in the Block class and MemberCache class. Setting the
528 ArrayLists to construct with a capacity of 1 saves some
529 memory. (56216kb->55585kb)
531 2007-12-27 Marek Safar <marek.safar@gmail.com>
533 A fix for bug #347189 (2nd issue)
534 * expression.cs (MemberAccess): Nested type can be found in base non-generic
537 2007-12-27 Miguel de Icaza <miguel@novell.com>
539 * report.cs: Do not use colors if stdout and stderr are not a
542 2007-12-27 Marek Safar <marek.safar@gmail.com>
544 A fix for bug #346998
545 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
548 2007-12-27 Marek Safar <marek.safar@gmail.com>
550 A fix for bug #343465
551 * class.cs: Explicit method name for nested types uses dots only.
553 2007-12-27 Marek Safar <marek.safar@gmail.com>
555 A fix for bug #343707
556 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
558 2007-12-27 Marek Safar <marek.safar@gmail.com>
560 * ecore.cs: Report type inference errors only when arguments count matches
563 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
565 * expression.cs, report.cs: New warning.
567 * typemanager.cs: Catch anonymous method type too.
569 2007-12-23 Marek Safar <marek.safar@gmail.com>
571 A fix for bug #346379
572 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
574 2007-12-23 Marek Safar <marek.safar@gmail.com>
576 A fix for bug #347359
577 * expression.cs (Invocation): Don't resolve already resolved expression.
579 2007-12-23 Marek Safar <marek.safar@gmail.com>
581 A fix for bug #347189
582 * class.cs (FixedField): Use non-dependent code only in the define phase.
584 2007-12-23 Marek Safar <marek.safar@gmail.com>
586 A fix for bug #348076
587 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
589 2007-12-22 Marek Safar <marek.safar@gmail.com>
591 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
592 discovered extension methods.
594 2007-12-22 Marek Safar <marek.safar@gmail.com>
596 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
599 2007-12-21 Miguel de Icaza <miguel@novell.com>
601 * report.cs (ErrorMessage): Add support for using colors on
602 terminals that support it.
604 2007-12-21 Marek Safar <marek.safar@gmail.com>
606 * ecore.cs: Use information about expanded params for error reporting.
608 2007-12-21 Marek Safar <marek.safar@gmail.com>
610 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
611 and logic for params overloads.
613 2007-12-15 Miguel de Icaza <miguel@novell.com>
615 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
616 as this is also created from the parser. Fixes #349034
618 2007-12-12 Miguel de Icaza <miguel@novell.com>
620 * statement.cs (Throw.CloneTo): it is valid to have empty
621 expressions for throw.
623 2007-12-03 Marek Safar <marek.safar@gmail.com>
625 * cs-parser.jay: Set delegate constraint parsing region correctly.
627 2007-12-03 Marek Safar <marek.safar@gmail.com>
629 A fix for bug #345467
630 * typemanager.cs (IsEqual): Compare generic parameters position only.
632 2007-11-28 Marek Safar <marek.safar@gmail.com>
634 * expression.cs (BaseAccess): Type arguments can be null.
636 2007-11-27 Raja R Harinath <harinath@gmail.com>
638 * statement.cs (Block.Resolve): Ensure flow-branching tree is
639 consistent even when an error has occured.
640 (Switch.Resolve): Likewise.
642 2007-11-22 Marek Safar <marek.safar@gmail.com>
644 A fix for bug #334505
645 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
648 2007-11-22 Marek Safar <marek.safar@gmail.com>
650 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
651 refactorings required to resolve extension methods correctly when mixing
652 generics and non-generics members.
654 2007-11-20 Marek Safar <marek.safar@gmail.com>
656 A fix for bug #342584
657 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
660 2007-11-19 Marek Safar <marek.safar@gmail.com>
662 A fix for bug #342512
663 * delegate.cs: Use delegate argument expression when is available. Don't
664 emit virtual call when class is sealed.
666 2007-11-16 Marek Safar <marek.safar@gmail.com>
668 A fix for bug #325423
669 * assign.cs (FieldInitializer): Use resolved expression for emit.
671 * class.cs: Print less confusing error message.
673 2007-11-16 Marek Safar <marek.safar@gmail.com>
675 * cs-tokenizer.cs: Removed GMCS ifdefs.
677 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
680 * cs-parser.jay: Disabled nullable check.
682 * generic-mcs: Copied more generic stuff.
684 2007-11-16 Marek Safar <marek.safar@gmail.com>
686 * gcs-parser.jay: Merged to cs-parser.jay.
688 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
689 * *.csproj, *.sources: Updated to use only jay parser file.
691 2007-11-16 Marek Safar <marek.safar@gmail.com>
693 * gcs-parser.jay: Added nullable and default expression feature checks.
695 2007-11-16 Marek Safar <marek.safar@gmail.com>
697 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
698 it fixes many TODOs and hidden bugs.
700 * expression: Removed duplicate error check.
702 2007-11-15 Marek Safar <marek.safar@gmail.com>
704 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
705 implicitly type local variable only when it is used in a declaration.
707 2007-11-15 Marek Safar <marek.safar@gmail.com>
709 * attribute.cs: Use CS0612 for empty strings.
711 2007-11-14 Marek Safar <marek.safar@gmail.com>
713 * lambda.cs, statement.cs: Contextual return may act as a statement.
715 2007-11-14 Marek Safar <marek.safar@gmail.com>
717 A fix for a regression cause by #324222
718 * class.cs: Don't report unused even when it implements an interface.
720 2007-11-13 Marek Safar <marek.safar@gmail.com>
722 A fix for bug #341205
723 * ecore.cs, expression.cs: Method group expression cannot do static
724 method access with an instance reference check before overloading takes
727 2007-11-13 Marek Safar <marek.safar@gmail.com>
729 A fix for bug #325359
730 * class.cs: Use predictable name for automatically generated property.
732 2007-11-12 Marek Safar <marek.safar@gmail.com>
734 A fix for bug #324996
735 * expression.cs (Is): Handle case where D is nullable and T is not
738 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
740 2007-11-12 Marek Safar <marek.safar@gmail.com>
742 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
743 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
744 Flush small error reporting changes.
746 2007-11-09 Marek Safar <marek.safar@gmail.com>
748 A fix for bug #324996
749 * expression.cs: Rewrote Is expression implementation to work with
750 generics, nullable types, anonymous method. A const result expression
751 uses existing infrastructure instead of custom not fully-featured one.
753 2007-11-08 Marek Safar <marek.safar@gmail.com>
755 A fix for bug #340202
756 * class.cs: Consider generics for volatile field.
758 2007-11-08 Marek Safar <marek.safar@gmail.com>
760 A fix for bug #335594
761 * expression.cs: Use conversion rules when handling string addition.
763 2007-11-07 Marek Safar <marek.safar@gmail.com>
765 A fix for bug #336651
766 * expression.cs: Fixed a crash when probing is on.
768 2007-11-07 Marek Safar <marek.safar@gmail.com>
770 A fix for bug #324242
771 * covert.cs: Added a conversion from any nullable-type with an
772 underlying enum-type to the type System.Enum.
774 2007-11-07 Marek Safar <marek.safar@gmail.com>
776 A fix for bug #324222
777 * class.cs: Report all non-used event fields.
779 2007-11-07 Marek Safar <marek.safar@gmail.com>
781 A fix for bug #325161
782 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
783 qualifier for generic types.
785 2007-11-07 Marek Safar <marek.safar@gmail.com>
787 A fix for bug #322971
788 * expression.cs, ecore.cs: Added intermediate result value check for
791 2007-11-07 Marek Safar <marek.safar@gmail.com>
793 A fix for bug #324754
794 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
795 when it was requested.
797 2007-11-07 Marek Safar <marek.safar@gmail.com>
799 A fix for bug #325101
800 * expression.cs: Do type not value comparison for `is' expression.
802 2007-11-07 Marek Safar <marek.safar@gmail.com>
804 A fix for bug #320236
805 * convert.cs: Don't apply user conversion on underlying target type.
807 2007-11-06 Marek Safar <marek.safar@gmail.com>
809 * expression.cs: Don't use unresolved expression for error reporting.
811 2007-11-06 Marek Safar <marek.safar@gmail.com>
813 A fix for bugs #337712, #324490
814 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
815 overloading resolution too.
817 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
818 the process consistent and more robust.
820 * expression.cs, linq.cs, report.cs: Update.
822 2007-11-02 Marek Safar <marek.safar@gmail.com>
824 A fix for bug #332909
825 * attribute.cs: Resolve attributes in correct context using error
828 * rootcontext.cs: Define Obsolete attribute members as core members.
830 2007-11-02 Marek Safar <marek.safar@gmail.com>
832 * statement.cs: Removed unused methods.
834 2007-10-31 Wade Berrier <wberrier@novell.com>
836 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
837 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
840 2007-10-31 Marek Safar <marek.safar@gmail.com>
842 A fix for bug #338102
843 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
844 methods registered as non-generics.
846 2007-10-31 Marek Safar <marek.safar@gmail.com>
848 A fix for bugs #337712, #324490
849 * delegate.cs: Delegate covariance and contravariance is not allowed for
852 2007-10-31 Marek Safar <marek.safar@gmail.com>
854 A fix for bug #337719
855 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
858 2007-10-30 Marek Safar <marek.safar@gmail.com>
860 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
862 2007-10-29 Marek Safar <marek.safar@gmail.com>
864 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
867 2007-10-29 Raja R Harinath <rharinath@novell.com>
869 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
871 2007-10-29 Marek Safar <marek.safar@gmail.com>
873 A fix for bug #334652
874 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
875 extension methods when we have not found the best candidate in normal
878 2007-10-27 Marek Safar <marek.safar@gmail.com>
880 * AssemblyInfo.cs: Keep up-to-date.
882 2007-10-27 Marek Safar <marek.safar@gmail.com>
884 * Makefile: Fixed generics compiler name.
886 2007-10-27 Marek Safar <marek.safar@gmail.com>
888 * lambda.test: removed, lambda parsing is done differently.
890 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
892 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
894 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
896 2007-10-27 Marek Safar <marek.safar@gmail.com>
898 * Makefile, *.sources : All C# compilers are in mcs folder.
900 * *.cs: Use existing 2_1 define for smcs.
902 2007-10-26 Marek Safar <marek.safar@gmail.com>
904 A fix for bug #335847
905 * assign.cs, expression.cs: Couple of changes to avoid creating a
906 temporary variable for each object initializer assignment statement. It
907 simplifies struct initialization too, otherwise two temporary variables
909 Implemented optimization of redundant default element initializers.
911 2007-10-25 Marek Safar <marek.safar@gmail.com>
913 A fix for bug #336766
914 * expression.cs (Class.CheckBase): Use generic name when method is
917 2007-10-25 Marek Safar <marek.safar@gmail.com>
919 A fix for bug #334737
920 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
921 variable and not variable argument for prepared copies.
923 2007-10-24 Marek Safar <marek.safar@gmail.com>
925 A fix for bug #325110
926 * class.cs, expression.cs, attribute.cs: Use open generic method when
927 checking conditional attribute.
929 2007-10-24 Marek Safar <marek.safar@gmail.com>
931 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
932 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
933 FeatureIsNotAvailable.
935 2007-10-24 Marek Safar <marek.safar@gmail.com>
937 ** C# 3.0 Partial methods
939 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
940 methods support. Because of member cache issue with generics only
941 non-generics partial methods are fully supported.
943 2007-10-23 Marek Safar <marek.safar@gmail.com>
945 * class.cs, decl.cs: Rewrote member overloads check to cope with
946 generics and to use member cache for member checking. It also improves
947 performance and fixes remaining overloads issues.
949 2007-10-20 Marek Safar <marek.safar@gmail.com>
951 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
952 roottypes.cs, typemanager.cs:
954 A member cache creation logic changed to add members immediately and
955 not rely on fallback. The member cache is now only prefered way
956 how to access and find type declaration members. It saves 5 MB of memory
957 during MWF compilation and makes code ready for more optimizations and
958 clean-ups, it's also a pre-requirement for partial methods.
960 2007-10-18 Raja R Harinath <harinath@gmail.com>
962 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
963 handling for generic parameters.
965 2007-10-15 Marek Safar <marek.safar@gmail.com>
967 * class.cs (FixedField): Removed redundant volatile check.
969 2007-10-15 Marek Safar <marek.safar@gmail.com>
971 * class.cs, decl.cs: Fixed overload members verification to do only one
972 check per possible collision.
974 2007-10-13 Marek Safar <marek.safar@gmail.com>
976 A fix for bug #325478
977 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
978 and create only one disposable flags container.
980 2007-10-12 Marek Safar <marek.safar@gmail.com>
982 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
983 * statement.cs (Fixed): Fixed variables cloning.
985 2007-10-12 Marek Safar <marek.safar@gmail.com>
987 A fix for bug #333342
988 * class.cs (EventField): Don't mark value type event as synchronized.
990 2007-10-12 Marek Safar <marek.safar@gmail.com>
992 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
993 inference to identify best candidate method correctly.
994 (ProperyExpr): A range variable is read only and cannot be modified.
996 2007-10-11 Marek Safar <marek.safar@gmail.com>
998 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
999 logic to identify best candidate method correctly.
1001 2007-10-11 Marek Safar <marek.safar@gmail.com>
1003 * location.cs (Equals, GetHashCode): Removed.
1005 2007-10-11 Marek Safar <marek.safar@gmail.com>
1007 * report.cs: Implemented message recorder. It is used mainly for lambda
1008 expressions to capture otherwise swallowed error messages.
1010 * anonymous.cs, lambda.cs.cs: Do full parameters check.
1012 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
1014 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
1016 * expression.cs (MemberAccess): Always report lookup failure.
1018 * location.cs: Implemented Equals, GetHashCode.
1020 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
1022 2007-10-10 Jb Evain <jbevain@novell.com>
1024 * codegen.cs: re-enable assembly version check.
1026 2007-10-09 Marek Safar <marek.safar@gmail.com>
1028 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
1031 * namespace.cs (UsingAlias): Do correct version check.
1033 2007-10-08 Marek Safar <marek.safar@gmail.com>
1035 * expresison.cs, ecore.cs: Issue extension method error message when
1038 * rootcontext.cs: Added ISO_2 compiler mode option.
1040 2007-10-08 Marek Safar <marek.safar@gmail.com>
1042 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
1045 2007-10-08 Marek Safar <marek.safar@gmail.com>
1047 * attribute.cs (GetString, GetBoolean): Work with both literal and
1050 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
1051 Moved method overload specific methods to MethodGroupExpr.
1053 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
1054 it should be less memory consuming.
1056 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
1058 * codegen.cs: remove the assembly version check until the buildbot is
1061 2007-10-07 Jb Evain <jbevain@novell.com>
1063 * attribute.cs (Attribute.GetString): if the value
1064 expression is a StringConstant, return its string value.
1066 2007-10-07 Jb Evain <jbevain@novell.com>
1068 * typemanager.cs: add `assembly_version_attribute_type`.
1069 * codegen.cs: on attribute emission, check that the
1070 AssemblyVersionAttribute doesn't overflow.
1072 2007-10-05 Marek Safar <marek.safar@gmail.com>
1074 A fix for bug #324677
1075 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
1076 parent container of a scope container with currently resolved one.
1078 2007-10-05 Marek Safar <marek.safar@gmail.com>
1080 A fix for bug #325534
1081 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
1084 2007-10-05 Marek Safar <marek.safar@gmail.com>
1086 A fix for bug #327504
1087 * class.cs (Operator.Define): Refactored implicit and explicit user
1088 operator conversion rules.
1090 2007-10-05 Marek Safar <marek.safar@gmail.com>
1092 A fix for bug #327520
1093 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
1095 2007-10-04 Marek Safar <marek.safar@gmail.com>
1097 A fix for bug #328022
1098 * class.cs (MethodData.Define): Use correct method to check whether
1099 a method implementents an accessor.
1101 2007-10-04 Marek Safar <marek.safar@gmail.com>
1103 A fix for bug #330069
1104 * statement.cs (Fixed.Resolve): Read the first array element only when
1105 an array is instantiated.
1107 2007-10-04 Marek Safar <marek.safar@gmail.com>
1109 * expression.cs, assign.cs, generics.cs: Print correct operator when
1110 compound assignment is used.
1112 2007-10-04 Marek Safar <marek.safar@gmail.com>
1114 A fix for bug #325841
1115 * expression.cs (ArrayAccess): Use full argument cloning only for
1116 string compound concatenation.
1118 2007-10-03 Marek Safar <marek.safar@gmail.com>
1120 A fix for bug #328774
1121 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
1123 (PropertyExpr.EmitAssign): Fixed string concatenation compound
1126 2007-10-03 Raja R Harinath <rharinath@novell.com>
1129 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
1130 Event accessibility checks here. Remove some bogus code that
1131 accidently made GenericMethods work.
1132 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
1134 2007-09-25 Marek Safar <marek.safar@gmail.com>
1136 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
1138 * statement.cs (Block): Refactored AddVariable to allow error handling
1141 * generic.cs: New stub.
1143 2007-09-23 Marek Safar <marek.safar@gmail.com>
1145 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
1148 2007-09-17 Marek Safar <marek.safar@gmail.com>
1150 * class.cs: Use partial container to record whether any partial part
1151 contains static field initializer and therefore default contructor has
1154 2007-09-14 Marek Safar <marek.safar@gmail.com>
1156 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
1157 mono-list when only one of two partial parts has defined accessibility
1160 2007-09-14 Marek Safar <marek.safar@gmail.com>
1162 A fix for bug #82845
1164 * class.cs (TypeContainer): Set correct resolve context for all field
1167 2007-09-13 Marek Safar <marek.safar@gmail.com>
1169 * assign.cs: Fixed a crash when field is resolved twice with an error.
1171 * codegen.cs: Changed InFieldInitializer to be flag.
1173 * anonymous.cs, ecore.cs, expression.cs: Update after
1174 IsInFieldInitializer rename.
1176 * const.cs: Removed unused parameter.
1178 * class.cs: Changed the way how we resolve and emit field initializers.
1179 The field initilizers have to have access to contructor block to emit
1180 compiler generated code.
1182 2007-09-13 Marek Safar <marek.safar@gmail.com>
1184 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
1185 generics use TypeContainer instead.
1187 2007-09-12 Marek Safar <marek.safar@gmail.com>
1189 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
1191 * lambda.cs (ResolveParameters): Use more powerful
1192 InflateGenericArgument.
1194 * parameters.cs: Better exception message.
1196 2007-09-10 Marek Safar <marek.safar@gmail.com>
1198 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
1199 correct expression block type.
1201 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
1203 * expression.cs (Invocation): Extracted method group resolve to
1206 2007-09-07 Marek Safar <marek.safar@gmail.com>
1208 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
1209 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
1211 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
1212 generic extension methods.
1214 2007-09-06 Marek Safar <marek.safar@gmail.com>
1216 A fix for bug #82676 (Do I get it right now?)
1217 * convert.cs (Binary.ResolveOperator): An interface is converted to the
1218 object before a standard conversion is applied.
1220 2007-09-06 Marek Safar <marek.safar@gmail.com>
1222 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
1225 2007-09-05 Marek Safar <marek.safar@gmail.com>
1227 A fix for bug #82676
1228 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
1229 non-generic interface types.
1231 2007-09-05 Marek Safar <marek.safar@gmail.com>
1233 A fix for bug #82690
1234 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
1236 2007-09-05 Marek Safar <marek.safar@gmail.com>
1238 A fix for bug #82571
1239 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
1240 modifier for container based methods.
1242 2007-09-05 Marek Safar <marek.safar@gmail.com>
1244 A fix for bug #82676
1245 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
1246 any interface-type T means to any of interface type T.
1248 2007-09-04 Marek Safar <marek.safar@gmail.com>
1250 * namespace.cs: We have 2 versions of System.Core assembly.
1252 2007-09-04 Marek Safar <marek.safar@gmail.com>
1254 A fix for bug #82652
1255 * class.cs (Class.GetClassBases): Compare types and not expressions.
1257 2007-09-04 Marek Safar <marek.safar@gmail.com>
1259 A fix for bug #82620
1260 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
1261 actually never worked before.
1262 (IndexerAccess): Emit prepared arguments before they are modified.
1264 2007-09-04 Marek Safar <marek.safar@gmail.com>
1266 A fix for bug #82563
1267 * assign.cs: Revert wrong fix.
1269 * expression.cs (VariableReference.EmitAssign): Handle ref reference
1271 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
1272 Instead of ldelema/stdind we have to use temporary variables to handle
1273 cases like String.Concat (params string[]).
1275 2007-08-31 Marek Safar <marek.safar@gmail.com>
1277 * class.cs: EmitAttributes to Emit rename.
1279 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
1281 (MemberCore.HasClsCompliantAttribute): Don't depend on
1282 GetClsCompliantAttributeValue execution.
1284 2007-08-31 Marek Safar <marek.safar@gmail.com>
1286 * anonymous.cs: Use shorter type prefix.
1288 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
1291 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
1292 variables when probing is on.
1294 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
1295 unresolved variables.
1296 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
1297 handle transparent identifiers.
1299 2007-08-26 Marek Safar <marek.safar@gmail.com>
1301 * attribute.cs (IsClsCompliant): Add nullable types test.
1303 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
1305 * doc.cs : catch other types of exception than XmlException to
1306 report CS1570. Fixed bug #82565.
1308 2007-08-23 Marek Safar <marek.safar@gmail.com>
1310 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
1311 The number of delegate parameters has to match.
1312 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
1315 2007-08-21 Marek Safar <marek.safar@gmail.com>
1317 * anonymous.cs (AnonymousMethod): Generate private anonymous method
1318 to fix problem with private arguments.
1320 2007-08-20 Marek Safar <marek.safar@gmail.com>
1322 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
1324 * decl.cs (MemberName): Ignore generic type with no generic arguments.
1326 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
1327 empty. Add cloning suport.
1329 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
1331 2007-08-20 Marek Safar <marek.safar@gmail.com>
1333 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
1334 to create EmptyCast. It handles EmptyConstantCast specialization for
1337 2007-08-18 Marek Safar <marek.safar@gmail.com>
1339 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
1340 (EmitArrayArgument): One routine for array arguments.
1341 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
1343 2007-08-17 Marek Safar <marek.safar@gmail.com>
1345 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
1347 2007-08-17 Marek Safar <marek.safar@gmail.com>
1349 * anonymous.cs: MemberLookupFinal update.
1351 * class.cs (ConstructorInitializer): Is expression based.
1353 * delegate.cs: MethodGroupExpr update.
1355 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
1357 (Error_MemberLookupFailed): Customizable error override.
1358 (MethodGroupExpr): Keep queried type for later usage.
1359 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
1362 * expression.cs: Error_MemberLookupFailed refactoring.
1363 (New.DoResolve): Resolve as much as possible.
1364 (ElementInitializer.Error_MemberLookupFailed): Object initializer
1365 customization for invalid member types.
1367 * statement.cs: MethodGroupExpr update.
1369 2007-08-16 Marek Safar <marek.safar@gmail.com>
1371 * modifier.cs (Check): Check all modifiers and not only accessibility
1374 2007-08-16 Marek Safar <marek.safar@gmail.com>
1376 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
1377 type and not an expression.
1379 2007-08-16 Marek Safar <marek.safar@gmail.com>
1381 * statement.cs (Catch.Clone): Type and variable can be null.
1383 2007-08-16 Marek Safar <marek.safar@gmail.com>
1385 A fix for bug #81979
1386 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
1387 I am really not sure whether this is the best fix.
1389 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
1392 2007-08-14 Marek Safar <marek.safar@gmail.com>
1394 ** C# 3.0 Object and collection initializers (major re-write)
1396 * assign.cs (DoResolve): Initializers are not assign related.
1398 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
1399 used during collection or object initialization.
1401 * expression.cs (Error_InvalidArguments): Add initializers specific
1402 messages. More will come later because it requires some general
1404 (New.DoResolve): Better error handling for unsafe types.
1405 (EmptyExpressionStatement): New class.
1406 (ElementInitializer): An object initializer expression.
1407 (CollectionElementInitializer): A collection initializer expression.
1408 (CollectionOrObjectInitializers): A block of object or collection
1410 (NewInitialize): New expression with element/object initializers.
1412 * statement.cs: Reverted object/collection initializer hacks.
1414 * typemanager.cs (CSharpName): Filter __arglist type.
1416 2007-08-09 Marek Safar <marek.safar@gmail.com>
1418 ** C# 3.0 Anonymous Types (update to the latest standard)
1420 * expression.cs (Binary.ResolveOperator): Threat all null based types
1422 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
1423 (AnonymousTypeParameter): Updated.
1425 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
1426 (AnonymousTypeClass): New anonymous type container.
1428 * class.cs (AddField): Return operation result.
1430 * generic.cs: Another empty TypeArguments overload.
1432 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
1433 are stored at top of normal hierarchy.
1435 * typemanager.cs (CSharpName): Filter anonymous types.
1437 2007-08-09 Marek Safar <marek.safar@gmail.com>
1439 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
1440 as single Concat call. How could we miss that :-(
1442 2007-08-08 Marek Safar <marek.safar@gmail.com>
1444 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
1446 2007-08-07 Miguel de Icaza <miguel@novell.com>
1448 * expression.cs: Fix the previous commit, the creation of the
1449 arguments array list needs also to be conditional on the arguments
1452 * class.cs: Add a little bit of help to help narrow down problems.
1454 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
1455 not try to copy in that case.
1457 * driver.cs: When building SMCS, include a new different set of
1458 default assemblies here. Do this here so we can control whether
1459 to include the default assemblies with /noconfig.
1461 2007-08-03 Marek Safar <marek.safar@gmail.com>
1463 A fix for bug #81979
1464 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
1467 2007-08-03 Marek Safar <marek.safar@gmail.com>
1469 A fix for bug #82300
1471 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
1472 we are in probing scope.
1474 2007-08-03 Marek Safar <marek.safar@gmail.com>
1476 A fix for bug #82301
1478 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
1479 (Statement.CloneTo): Clone and not map children blocks.
1481 2007-08-03 Marek Safar <marek.safar@gmail.com>
1483 A fix for bug #82299
1485 * expression.cs (LocalVariableReference.CloneTo): Remap local info
1488 * statement.cs (Statement.CloneTo): Clone variables before statements
1489 to allow remaping of local variables.
1491 2007-08-03 Marek Safar <marek.safar@gmail.com>
1493 A fix for bug #82296
1496 * report.cs: Log crash details for future clone problems.
1498 * statement.cs (Return.Clone): Don't clone non-existent expression.
1500 2007-08-03 Raja R Harinath <harinath@gmail.com>
1502 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
1503 (Class.AddBasesForPart): Move CS0537 check here from ...
1504 * cs-parser.jay (class_declaration): ... here. Move calling of
1505 'AddBasesForPart' to ...
1506 (class_bases): ... here.
1507 (struct_declaration, interface_declaration): Update to changes.
1509 2007-08-02 Marek Safar <marek.safar@gmail.com>
1511 A fix for bug #81923
1513 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
1514 conversion is allowed.
1516 2007-08-02 Marek Safar <marek.safar@gmail.com>
1518 A fix for bug #81564
1520 * ecore.cs (EventExpr): Add IsBase handling.
1522 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
1525 2007-08-02 Raja R Harinath <harinath@gmail.com>
1527 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
1528 * cs-parser.jay: Some whitespace cleanups.
1529 (current_delegate): New.
1531 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
1532 a dummy code block, and use 'type_name' instead of 'member_name'.
1533 (interface_declaration, class_declaration): Likewise.
1534 (delegate_declaration): Likewise. Rearrange slightly and use
1536 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
1537 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
1539 2007-08-02 Marek Safar <marek.safar@gmail.com>
1541 A fix for bug #82039
1543 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
1546 * typemanager.cs (CSharpName): Split to string overload.
1548 2007-08-02 Marek Safar <marek.safar@gmail.com>
1551 * report.cs: Updated warning CS0472.
1553 2007-08-01 Marek Safar <marek.safar@gmail.com>
1555 A fix for bug #82181
1557 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
1559 2007-08-01 Marek Safar <marek.safar@gmail.com>
1561 A fix for bug #82277
1562 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
1564 2007-08-01 Marek Safar <marek.safar@gmail.com>
1566 ** C# 3.0 Type Inference (major bits are working)
1568 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
1569 (.ImplicitStandardConversionExists): Uses compatible.
1570 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
1571 (.InferReturnType): New method.
1572 (.Compatible): Refactored.
1573 (.ResolveParameters): Uses factory to create resolved parameters.
1574 (.CompatibleMethod): Add probing mode support.
1575 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
1576 clearly distinguish between 2 different operations.
1577 (LambdaMethod): Moved to lambda.cs.
1578 (AnonymousMethod): Removed unused fields and methods.
1579 (AnonymousDelegate): Simplified.
1581 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
1583 * convert. cs (ImplicitConversionStandard): Compatible works differently.
1585 * delegate.cs (Delegate): New mehods to reduce code duplication.
1586 (.GetConstructor): New method.
1587 (.GetInvokeMethod): New method.
1588 (DelegateCreation): Updated.
1590 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
1592 (OverloadResolve): Made probing little bit faster.
1594 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
1597 * generic.cs (TypeInferenceContext): Dummy implementation.
1599 * iterators.cs: Updated after Resolve/Define rename.
1601 * lambda.cs (LambdaExpression)
1602 (.ResolveParameters): Handles both type of arguments and type inference too.
1604 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
1605 (InflateTypes): Updated.
1607 * support.cs (InflateTypes): Changed signature and updated.
1609 * typemanager.cs (LookupMemberCache): Better dynamic type check.
1610 (MemberLookup_FindMembers): More MS tricks.
1611 (GetParameterData): Ditto.
1612 (GetDelegateParameters): Uses quick path for dynamic types.
1614 2007-08-01 Marek Safar <marek.safar@gmail.com>
1616 * class.cs (MethodData.Define): EmitContext is required for generic stuff
1619 2007-07-31 Marek Safar <marek.safar@gmail.com>
1621 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
1624 2007-07-26 Jb Evain <jbevain@novell.com>
1626 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
1627 which takes a boolean 'report_errors', similar to the GetMethod.
1628 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
1629 in .net 2.1, do not report errors here.
1631 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
1632 System.Runtime.CompilerServices.RequiredAttributeAttribute and
1633 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
1636 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
1637 of the type InternalsVisibleToAttribute before the first call
1638 to CoreLookupType which is allowed to fail (third boolean parameter
1639 to true). Because, during the resolution for a type that is not
1640 immediately found, we try to check if the type is not defined in
1641 a friend assembly, and to do so, we need the
1642 InternalVisibleToAttribute.
1644 2007-07-23 Miguel de Icaza <miguel@novell.com>
1646 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
1647 feature that allows structs to be compared against null and inline
1648 the result as true or false.
1650 Notice that the same code is not permitted inside a generic block
1651 of code that would do:
1653 class Foo<T> where T : struct {
1660 It is only allowed if the type of T is not bound (no where
1661 clause). In my opinion, this CSC 2 behavior is broken but people
1662 seem to be using it (IronRuby does, a few bug reports on bugzilla
1663 have it and some people have complained about it).
1665 All of the users that depend on this behavior have code that is
1668 * report.cs (Warning, Error): make these take object arguments,
1669 not strings, as that allows us to take advantage of Format.
1671 2007-07-20 William Holmes <billholmes54@gmail.com>
1673 * decl.cs: Changed MemberName.CountTypeArguments to also check the
1674 Left member variable for the Count.
1675 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
1676 MemberName.CountTypeArguments to avoid a NRE.
1678 This code is contributed under the MIT X11 license
1680 2007-07-18 Marek Safar <marek.safar@gmail.com>
1682 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
1684 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
1686 * doc.cs : generic method arguments are written as ``x while generic
1687 type arguments are `x. Combined with the previous change, fixed bug
1690 2007-07-18 Raja R Harinath <rharinath@novell.com>
1693 * expression.cs (Binary.ResolveOperator): When converting
1694 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
1696 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
1698 * doc.cs : when T: or whatever x: is specified, it does not really
1699 check the doc comment's syntax correctness. Fixed bug #82006.
1701 2007-07-18 Marek Safar <marek.safar@gmail.com>
1703 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
1704 LambdaExpression better.
1706 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
1708 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
1710 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
1711 as it can be generated.
1713 * expression.cs (Invocation.Error_InvalidArguments): Show correct
1716 * lambda.cs (LambdaExpression): Refactored to share same code with
1717 AnonymousMethodExpression.
1719 2007-07-17 Marek Safar <marek.safar@gmail.com>
1721 * anonymous.cs (MakeName): Include host name for easier debugging.
1722 (LambdaMethod): New class for lambda spcecific stuff.
1724 * attribute.cs: Set EmitContext return type.
1726 * class.cs: Set EmitContext return type.
1728 * codegen.cs (EmitContext): Return type cannot be null to stop messing
1729 with null/void meaning.
1731 * iterators.cs (ContainerType): Implemented.
1733 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
1735 * statement.cs (Return): Updated to lambda expressions.
1736 (Block.CloneTo): Parent can be null.
1738 2007-07-13 Marek Safar <marek.safar@gmail.com>
1740 A fix for bug #81917
1741 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
1743 * class.cs (FixedField): Check whether field is in unsafe scope.
1745 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
1746 (FieldExpr.Emit): Fixed buffers cannot be volatile.
1748 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
1751 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
1753 2007-07-13 Marek Safar <marek.safar@gmail.com>
1755 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
1756 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
1759 2007-07-13 Marek Safar <marek.safar@gmail.com>
1761 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
1763 2007-07-13 Marek Safar <marek.safar@gmail.com>
1765 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
1766 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
1768 * codegen.cs(EmitContext): Add ProbingMode flag.
1770 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
1772 * driver.cs: For now set both warning values.
1774 * ecore.cs (SimpleName): Name is readonly.
1775 (MethodGroup.OverloadResolve): One quick path for probing.
1777 * expression.cs (Unary): Set Oper r/o.
1778 (Binary): Set Oper r/o.
1779 (ParameterReference): Set few instance variables as r/o.
1780 (ParameterReference.DoResolveBase): Don't capture aruments when
1782 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
1783 (Arglist): arguments are private.
1784 (SizeOf): type is private and r/o.
1785 (MemberAccess): arguments are private.
1787 * report.cs: Enhanced reporting on/off capabilities.
1789 * lambda.cs: Uses ec.IsInProbingMode.
1790 (ContextualReturn): Derives from return.
1792 * rootcontext.cs: For now set both warning values.
1794 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
1796 (Return.Resolve): Don't die immediately.
1797 (Block.Resolve): Speed-up probing.
1798 (Block.CloneTo): Clone only child blocks.
1800 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
1802 * iterators.cs: reverted Miguel's latest change (r81925) as it
1803 breaks the build in System.
1805 2007-07-13 Miguel de Icaza <miguel@novell.com>
1807 * iterators.cs (Yield.CheckContext): Check for the iterator type
1808 also here as we can call into Yield even in codepaths that are not
1810 (MethodOrOperator is the only path that was checked).
1812 In addition to the standard check, use a more specific check for
1813 constructors to report a more verbose error.
1815 2007-07-12 Miguel de Icaza <miguel@novell.com>
1817 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
1818 report the warning and continue
1820 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
1821 values on the stack on the call to Emit. Use EmitStatement if
1822 possible, or using Emit + Pop if not possible. Fixes #82064
1824 2007-07-12 Raja R Harinath <rharinath@novell.com>
1826 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
1827 avoid try...finally in some cases.
1829 2007-07-10 Marek Safar <marek.safar@gmail.com>
1831 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
1833 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
1834 instead of method. Re-use standard error handling.
1835 (ConstructorInitializer.Emit): Simplified.
1837 * delegate.cs: Updated after Invocation.EmitCall change.
1839 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
1840 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
1841 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
1842 method and don't permanently changing input arguments.
1843 (MethodGroupExpr): Introduced resolved best_candidate, when method group
1844 is resolved it has one of the candidates is the best one which is later
1845 used to emit. Removed a few unused method.
1846 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
1848 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
1849 (Binary.ResolveOperator): Ditto.
1850 (ConditionalLogicalOperator.DoResolve): Ditto.
1851 (Invocation): Uses method group.
1852 (Invocation.DoResolve): Simplified.
1853 (Invocation.EmitCall): Removed useless is_static.
1854 (Invocation.Emit): Delegate to method group.
1855 (Invocation.EmitStatement): Simplified.
1856 (New): Uses method group.
1857 (MemberAccess.DoResolve): Don't destroy original expression.
1859 * statement.cs (ForEach.Resolve): Use null for no method arguments.
1861 2007-07-04 Marek Safar <marek.safar@gmail.com>
1863 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
1866 * lambda.cs: Add custom error message type.
1868 2007-07-03 Marek Safar <marek.safar@gmail.com>
1870 * lambda.cs: Simplified little bit.
1872 * parameter.cs: Introduced ImplicitLambdaParameter.
1873 (Parameters.CreateFullyResolved): New factory instead of ctor.
1877 * delegate.cs: Updated parameter creation.
1879 2007-07-03 Marek Safar <marek.safar@gmail.com>
1881 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
1884 * generic.cs: Synchronized with gmcs.
1886 2007-07-03 Marek Safar <marek.safar@gmail.com>
1888 * class.cs (Indexer): Check return type as soon as possible.
1890 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
1893 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
1895 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
1897 * parameter.cs (Parameter): Use expression type when it is available.
1899 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
1900 method modifier for the first parameter only.
1902 2007-06-24 Marek Safar <marek.safar@gmail.com>
1904 A fix for bug #81938
1905 * typemanager.cs (ChangeType): Fixed couple of char conversions.
1907 * constant.cs: Tide up an exception message.
1909 2007-06-22 Marek Safar <marek.safar@gmail.com>
1911 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
1912 an uninitialized variable is used.
1914 * expression.cs (LocalVariableReference.DoResolve): Ditto.
1916 2007-06-22 Marek Safar <marek.safar@gmail.com>
1918 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
1919 not found error handling.
1921 * expression.cs (ArrayCreation): Removed redundant fields and little bit
1923 (ArrayCreation.ResolveArrayElement): To be ready to customization.
1924 (ArrayCreation.DoResolve): Simplified.
1925 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
1926 its own resolve process.
1927 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
1929 2007-06-20 Marek Safar <marek.safar@gmail.com>
1931 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
1934 2007-06-20 Marek Safar <marek.safar@gmail.com>
1936 * cs-tokenizer.cs: Removed var related stuff.
1938 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
1939 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
1940 a type and a keyword at same time.
1942 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
1945 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
1946 implicitly typed arrays, more changes will follow.
1948 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
1950 2007-06-19 Marek Safar <marek.safar@gmail.com>
1952 * ecore.cs (VarExpr): Removed Handled field.
1954 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
1955 build-in assign functionality.
1956 (ForEach.Resolve): Removed all implicitly typed local variable code and
1958 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
1959 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
1961 2007-06-18 Marek Safar <marek.safar@gmail.com>
1963 * assign.cs: Removed implicitly typed local variable check.
1965 * expression.cs (LocalVariableReference.DoResolve): Add check for self
1966 referencing implicitly typed local variable.
1967 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
1970 * statement.cs (Fixed): Removed unsupported implicitly typed local
1973 2007-06-15 Marek Safar <marek.safar@gmail.com>
1975 * decl.cs (MemberName): Moved all Unbound stuff to parser.
1977 2007-06-14 Marek Safar <marek.safar@gmail.com>
1979 A fix for bugs #81855 and #76274
1980 * attribute.cs (AttachTo): Always set owner for global attributes to
1983 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
1986 * cs-parser.jay: Assembly and module attributes must precede all other
1987 elements except using clauses and extern alias declarations.
1989 2007-06-13 Marek Safar <marek.safar@gmail.com>
1991 A fix for bug #81748
1993 * expression.cs: More checks for non ISO-1 features.
1995 2007-06-12 Marek Safar <marek.safar@gmail.com>
1997 A fix for bug #81807
1998 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
1999 present inside switch statement and it is required by nullable check.
2001 2007-06-12 Marek Safar <marek.safar@gmail.com>
2003 A fix for bug #81840
2004 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
2005 when type matching fails.
2007 * namespace.cs: Tiny error message change.
2009 2007-06-12 Marek Safar <marek.safar@gmail.com>
2011 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
2012 reporting. Added automatic property check.
2014 * class.cs: Updated after CheckAbstractAndExtern relocation.
2015 (AEventPropertyAccessor.GetSignatureForError): Customized.
2017 2007-06-11 Marek Safar <marek.safar@gmail.com>
2019 * class.cs (DefineBaseTypes): Base type can be undefined.
2021 * ecore.cs (TypeLookup): Minor refactoring.
2022 (DoResolveAsTypeStep): Removed redundant check.
2024 * namespace.cs (Lookup): Removed redundant check.
2026 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
2027 ResolveAsTypeTerminal step.
2028 (BootstrapCorlib_*): Simplified.
2029 (PopulateCoreType): Core types can be now external.
2031 2007-06-07 Marek Safar <marek.safar@gmail.com>
2033 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
2035 (InferTypeArguments): Infers anonymous expression type arguments.
2036 (Compatible): Split to Compatible and InferTypeArguments.
2038 * lambda.cs: Updated.
2040 2007-06-08 Marek Safar <marek.safar@gmail.com>
2042 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
2044 2007-06-07 Raja R Harinath <harinath@gmail.com>
2046 Fix #80477, cs0135-2.cs, cs0135-3.cs
2047 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
2048 names to the "known" variables list.
2049 (Block.CheckInvariantMeaningInBlock): Handle the fact the
2050 parameter names are also "known".
2051 (Block.CheckError136): Remove.
2052 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
2055 2007-06-07 Marek Safar <marek.safar@gmail.com>
2057 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
2059 2007-06-06 Marek Safar <marek.safar@gmail.com>
2061 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
2062 internal error not an user error.
2064 * expression.cs (IsApplicable): Refactored to make debugging easier.
2066 * support.cs: More tricks for non-mono runtimes.
2068 * typemanager.cs (CoreLookupType): Made public.
2069 (InitSystemCore): All linq specific stuff moved to linq.cs
2071 2007-06-05 Marek Safar <marek.safar@gmail.com>
2073 * typemanager.cs (CSharpSignature): One more missing build-in types
2075 More tricks for non-mono runtime.
2077 2007-06-05 Raja R Harinath <harinath@gmail.com>
2079 * statement.cs (Block.CheckError136_InParents): Remove.
2080 (Block.AddVariable): Use GetParameterInfo instead.
2081 (ToplevelBlock.ProcessArguments): Likewise.
2083 2007-06-04 Raja R Harinath <rharinath@novell.com>
2085 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
2087 (ToplevelBlock.GetParameterInfo): Split out of ...
2088 (ToplevelBlock.GetParameterRefernce): ... this.
2089 (ToplevelBlock.ParameterMap): Remove.
2090 * expression.cs (ParameterReference): Update to use
2091 ToplevelParameterInfo.
2093 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
2096 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
2097 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
2099 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
2100 (ToplevelBlock.ProcessParameters) ... here.
2101 (ToplevelBlock..ctor): Invoke it.
2103 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
2106 * statement.cs (IKnownVariable): New interface.
2107 (LocalInfo): Implement it.
2108 (ToplevelParameterInfo): New class.
2109 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
2110 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
2111 GetKnownVariableInfo.
2113 2007-06-03 Raja R Harinath <harinath@gmail.com>
2115 Partly speed up CS0136 error checks.
2116 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
2117 'recurse' parameter.
2118 (Block.DoCheckError136): Only check errors in parameters. Move
2119 local variable checks ...
2120 (Block.AddVariable): ... here, and ...
2121 (ToplevelBlock.ResolveMeta): ... here.
2123 2007-06-02 Raja R Harinath <harinath@gmail.com>
2125 * statement.cs (Block.IsChildOf): Remove.
2127 * statement.cs (Statement.Clone): Move special case code ...
2128 (Block.CloneTo): ... here.
2130 2007-05-29 Raja R Harinath <rharinath@novell.com>
2132 * statement.cs (ToplevelBlock.container): Remove field. It's
2133 redundant with 'Parent'.
2134 (ToplevelBlock.ContainerBlock): Remove accessor.
2135 (ToplevelBlock..ctor): Update to changes. Register anonymous
2136 child with parent here, ...
2137 * cs-parser.jay (end_anonymous): ... not here. Don't modify
2139 (start_anonymous): Don't save current_block.
2140 (top_current_block): Remove.
2142 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
2143 (Block.Resolve): Update to changes.
2144 (Block..ctor): Move setting of "correct" 'Toplevel'
2145 and 'Explicit' fields to ...
2146 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
2148 2007-05-27 Raja R Harinath <harinath@gmail.com>
2151 * statement.cs (Block.Implicit): Remove.
2152 (Block): Update to changes.
2153 * flowanalysis.cs: Likewise.
2155 Mildly speed up CheckInvariantMeaningInBlock
2156 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
2157 Recursively call AddKnownVariable to all enclosing blocks.
2158 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
2159 Remove recursive calls.
2160 (Block): Update to changes.
2162 New ExplicitBlock invariants
2163 * statement.cs (Block.Explicit): New field. It points to the
2164 immediately enclosing non-implicit block.
2165 (Block..ctor): Maintain the invariant.
2166 * cs-parser.jay: Take advantage of invariant.
2168 Introduce ExplicitBlock
2169 * statement.cs (ExplicitBlock): New.
2170 (ToplevelBlock): Derive from it.
2171 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
2173 (Block.Implicit): Update to changes.
2174 * cs-parser.jay: Update to changes.
2177 * codegen.cs (EmitContext.IsLastStatement): Remove.
2178 * statement.cs (Block.DoEmit): Update to changes.
2180 2007-05-25 Raja R Harinath <rharinath@novell.com>
2182 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
2183 modifying current_block directly.
2185 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
2187 * class.cs: Implemented automatic properties (C# 3.0)
2188 Thanks to Marek for the help.
2190 2007-05-23 Raja R Harinath <rharinath@novell.com>
2192 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
2193 variable as assigned, note also that all its components are
2195 (MyBitVector.SetRange): New. Function to set multiple bits to true.
2197 2007-05-19 Marek Safar <marek.safar@gmail.com>
2199 * anonymous.cs, class.cs: Emit Compiler generated attribute when
2200 member is marked as compiler generated.
2202 * decl.cs (MemberCore): Refactored ModFlags into property.
2204 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
2205 (Check): Check only accessibility modifiers.
2207 2007-05-18 Raja R Harinath <rharinath@novell.com>
2209 Track all assignable slots in one bit array
2210 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
2211 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
2212 logic from VariableMap constructor here. Use the same 'offset'
2213 variable that's later used for computing offsets of local
2215 * flowanalysis.cs (UsageVector.parameters): Remove.
2216 (UsageVector): Update to changes.
2217 (VariableMap): Remove.
2219 Avoid creating ParameterMap in every block
2220 * statement.cs (Block.ParameterMap): Move ...
2221 (ToplevelBlock.ParameterMap): ... here.
2222 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
2224 * flowanalysis.cs (FlowBranching.param_map): Remove.
2225 (FlowBranching.UsageVector): Update to changes.
2226 (FlowBranchingToplevel.CheckOutParameters): Likewise.
2228 * statement.cs (Block.CloneTo): Clone Toplevel field too.
2230 * expression.cs (ParameterReference): Distinguish between block
2231 where parameter was referenced and declared.
2233 2007-05-18 Marek Safar <marek.safar@gmail.com>
2235 * flowanalysis.cs, statement.cs: Put back improved error handling.
2237 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
2241 Imporved object and collection initialization (C# 3.0).
2243 2007-05-15 Marek Safar <marek.safar@gmail.com>
2245 A fix for bug #81380
2246 * expression.cs (Is.DoResolve): Only value types have constant `is'
2249 2007-05-15 Raja R Harinath <rharinath@novell.com>
2251 * statement.cs (ToplevelBlock.child): Remove.
2253 2007-05-15 Raja R Harinath <harinath@gmail.com>
2255 Rationalize ResolveMeta: refactoring
2256 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
2257 out constant handling code into ...
2258 (Block.DoResolveConstants): ... this.
2260 Rationalize ResolveMeta: kill local_map
2261 * statement.cs (Block.local_map, Block.LocalMap): Remove.
2262 (Block.AssignableSlots): New.
2263 (Block.ResolveMeta): Make protected. Don't create a VariableMap
2264 for locals -- move code from VariableMap here. Avoid unnecessary
2266 * flowanalysis.cs (FlowBranching.local_map): Remove.
2267 (FlowBranching..ctor): Use Block.AssignableSlots.
2268 (VariableMap): Remove unused constructors.
2270 2007-05-11 Raja R Harinath <rharinath@novell.com>
2272 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
2274 2007-05-11 Marek Safar <marek.safar@gmail.com>
2276 * typemanager.cs (IsFriendAssembly): Should not be called for building
2279 2007-05-09 Marek Safar <marek.safar@gmail.com>
2281 * literal.cs (NullConstant): Print null in all cases.
2283 * expression.cs (Binary.ResolveOperator): Implemented delegate
2284 comparison based on C# 2.0 changes.
2286 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
2288 This code is contributed under the MIT X11 license
2290 The following enables support for several C# 3.0 language features:
2292 * cs-tokenizer.cs: Added support for the "var" keyword.
2294 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
2295 Added VarExpr class to facilitate type inferencing.
2297 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
2298 to support anonymous types.
2300 * assign.cs: Added support for type inferencing and initialization.
2302 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
2304 * expression.cs: Added implicit array support to ArrayCreation.
2305 Added 5 types and 1 interface:
2307 IInitializable Implementing classes can inject initializing
2308 statements after object instantiation.
2310 Initializer Stores data for object initialization.
2312 AnonymousType An expression for anonymous types.
2314 AnonymousTypeParameter Stores data about an anonymous type's field.
2316 NewInitialize An expression for object initialization.
2318 CollectionInitialize An expression for collection initialization.
2320 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
2323 2007-05-06 Marek Safar <marek.safar@gmail.com>
2325 A fix for bug #81500
2326 * cs-tokenizer.cs: Add special handling for coalescing operator.
2328 2007-05-06 Marek Safar <marek.safar@gmail.com>
2330 A fix for bug #81529
2331 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
2332 its value from base class until it is redefined.
2334 2007-05-02 Raja R Harinath <rharinath@novell.com>
2336 Fix regression in cs0631-3.cs
2337 * cs-parser.jay (operator_declarator): Add opt_attributes to error
2338 fallback. Make error fallback catch more cases.
2340 2007-05-01 Miguel de Icaza <miguel@novell.com>
2342 * cs-parser.jay: Allow parameters in operator declarations to have
2345 2007-04-27 Miguel de Icaza <miguel@novell.com>
2347 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
2350 * lambda.cs (ContextualReturn.Resolve): An expression is valid
2351 inside the ContextualReturn, it does not have to be an
2352 ExpressionStatement.
2354 2007-04-24 Miguel de Icaza <miguel@novell.com>
2356 * lambda.cs (ContextualReturn.Resolve): if the return type is not
2359 2007-04-23 Miguel de Icaza <miguel@novell.com>
2361 * anonymous.cs (AnonymousContainer): split the virtual Resolve
2362 method in two methods: ResolveNoDefine and Resolve.
2364 ResolveNoDefine will stop just after ResolveTopBlock has been
2367 Resolve will then continue by creating a method and issuing the
2368 call to method.Define ().
2370 (AnonymousMethod): Split and implement the new Resolve and
2371 ResolveNoDefine as well.
2373 * lambda.cs (LambdaExpression): Split the anonymous method
2374 resolution code into a separate routine (CoreCompatibilityTest)
2375 from DoCompatibleTest.
2377 (LambdaExpression.TryBuild): New method, this method tries to
2378 build the LambdaExpression with the given set of types to be used
2379 as the types for the various parameters of the lambda expression.
2381 If the compilation succeed with the given types, the infered type
2382 of the Anonymous method is returned, otherwise null is returned.
2384 2007-04-23 Marek Safar <marek.safar@gmail.com>
2386 A fix for bug #81414
2387 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
2389 2007-04-22 Miguel de Icaza <miguel@novell.com>
2391 * cs-tokenizer.cs: Change various identifiers here from the
2392 camelCasing to the recommended Linux-like style for instance
2393 variables from the Coding Guidelines.
2395 2007-04-19 Martin Baulig <martin@ximian.com>
2398 (Convert.ImplicitReferenceConversionCore): Allow conversions from
2399 System.Enum to System.ValueType.
2401 2007-04-13 Martin Baulig <martin@ximian.com>
2403 Rewrote implicit reference conversions. We need to distinguish
2404 between implicit reference conversions (13.1.4) and implicit
2405 boxing conversions (13.1.5).
2407 According to the spec, there's an an implicit conversion
2408 "From a one-dimensional array-type S[] to IList<T> and base
2409 interfaces of this interface, provided there is an implicit
2410 reference conversion from S to T." Note that this does not
2411 include boxing conversions.
2414 (Convert.ImplicitTypeParameterBoxingConversion): New method.
2415 (Convert.ImplicitReferenceConversion): Split into
2416 ImplicitReferenceConversionCore() and
2417 ImplicitBoxingConversionExist().
2418 (Convert.ImplicitReferenceConversionExists): Use the new
2419 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
2421 2007-04-12 Martin Baulig <martin@ximian.com>
2423 * convert.cs (Convert.ImplicitReferenceConversion): Move the
2424 `TypeManager.null_type' checks up to the top of the method.
2426 2007-04-11 Marek Safar <marek.safar@gmail.com>
2428 A fix for bug #81350
2429 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
2432 2007-04-11 Martin Baulig <martin@ximian.com>
2434 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
2435 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
2436 to make this work for generic classes; fixes #79561.
2438 2007-04-11 Martin Baulig <martin@ximian.com>
2440 * expression.cs (As): Add support for nullable types; fixes #79371.
2442 2007-04-11 Martin Baulig <martin@ximian.com>
2444 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
2445 `type.FullName' is null; fixes #80243.
2447 2007-04-11 Martin Baulig <martin@ximian.com>
2449 * expression.cs (Invocation.IsApplicable): Don't modify the method
2450 if type inference succeeded, but the method was not applicable.
2453 2007-04-10 Marek Safar <marek.safar@gmail.com>
2455 A fix for bug #81324
2456 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
2457 internal and external namespaces containers.
2459 2007-04-10 Martin Baulig <martin@ximian.com>
2461 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
2462 TypeManager.DropGenericMethodArguments() so we also call
2463 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
2465 2007-04-10 Martin Baulig <martin@ximian.com>
2467 * iterators.cs (Iterator.CreateIterator): Don't crash if
2468 `method.ReturnType' is null. This happens if something went wrong
2469 while resolving that typ (we already reported an error in this case).
2471 2007-04-10 Martin Baulig <martin@ximian.com>
2473 * expression.cs (New.DoResolve): Don't call CheckComImport() on
2474 generic interfaces; report the CS0144 directly.
2476 2007-04-10 Martin Baulig <martin@ximian.com>
2478 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
2479 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
2481 2007-04-10 Martin Baulig <martin@ximian.com>
2483 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
2485 2007-04-09 Raja R Harinath <rharinath@novell.com>
2488 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
2489 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
2492 * statement.cs (For.Resolve): If resolution fails, use
2495 2007-04-08 Marek Safar <marek.safar@gmail.com>
2497 * anonymous.cs (MakeName): Make faster and zero-based.
2498 (VerifyExplicitParameterCompatibility): Back to mode where generic
2499 parameter is ignored.
2500 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
2502 * class.cs (EmitType): Method can emit another new method.
2504 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
2506 * driver.cs: Updated.
2508 * lambda.cs: Reuse predefined empty parameters.
2510 * parameter.cs: Updated
2512 * support.cs: Implemented InflateTypes.
2514 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
2515 (InitSystemCore): Introduced to isolate 3.0 dependencies.
2517 2007-04-03 Martin Baulig <martin@ximian.com>
2521 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
2522 version of TypeManager.IsOverride() which also works with generic
2525 2007-04-03 Martin Baulig <martin@ximian.com>
2530 (Convert.ExplicitReferenceConversion): We need to cast when
2531 converting from IList<T> to S[].
2533 2007-04-01 Marek Safar <marek.safar@gmail.com>
2535 * decl.cs (FindExtensionMethods): Consider all candidates with same name
2538 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
2540 2007-03-31 Marek Safar <marek.safar@gmail.com>
2542 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
2543 argument and return type inferring.
2545 * codegen.cs (InferReturnType): Flag whether return can be inferred.
2546 (ReturnType): Turned to property.
2548 * statement.cs (Return): Implemented return type inferring.
2550 * support.cs (ReflectionParameters): Use local types if possible.
2552 2007-03-30 Raja R Harinath <rharinath@novell.com>
2554 * flowanalysis.cs (FlowBranching.Reachability): Remove.
2555 (FlowBranching.UsageVector): Update to changes.
2557 Prepare to kill 'Reachability'
2558 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
2559 argument of constructor.
2561 2007-03-29 Raja R Harinath <rharinath@novell.com>
2563 Prepare to kill 'Reachability'
2564 * flowanalysis.cs (UsageVector.is_unreachable): New.
2565 (UsageVector): Update to maintain 'is_unreachable' in parallel to
2566 'reachability', and verify they're consistent.
2569 * expression.cs (New.EmitStatement): Handle type parameters here too.
2571 2007-03-29 Martin Baulig <martin@ximian.com>
2576 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
2577 CompilerGeneratedClass.
2578 (ScopeInfo.EmitScopeInstance): Make this protected.
2579 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
2580 `ec.CurrentAnonymousMethod.Scope == Scope'.
2582 * statement.cs (Block.ScopeInfo): Make this a property.
2584 2007-03-27 Raja R Harinath <harinath@gmail.com>
2586 Prepare to kill 'Reachability'
2587 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
2588 (FlowBranching.UsageVector.Reachability): Remove property.
2589 (FlowBranching.UsageVector.IsUnreachable): New property.
2590 (FlowBranching.UsageVector.ResetBarrier): New.
2591 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
2592 * codegen.cs, statement.cs: Update to changes.
2594 2007-03-27 Martin Baulig <martin@ximian.com>
2599 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
2602 2007-03-26 Raja R Harinath <rharinath@novell.com>
2604 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
2605 instead of TriState. Remove all mention of TriState.
2607 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
2608 replaced by a boolean. Add boolean 'is_unreachable' field, check
2609 and maintain invariants.
2611 2007-03-25 Marek Safar <marek.safar@gmail.com>
2613 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
2615 2007-03-25 Marek Safar <marek.safar@gmail.com>
2617 * expression.cs: Stop using obsolete 2.0 opcodes.
2619 2007-03-25 Marek Safar <marek.safar@gmail.com>
2621 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
2622 one of the latests Martin's fixes.
2624 2007-03-23 Miguel de Icaza <miguel@novell.com>
2626 * expression.cs: On BigEndian systems, swap the bytes, temporary
2627 solution until we get a new bitconverter class.
2629 2007-03-23 Martin Baulig <martin@ximian.com>
2633 * decl.cs (MemberCache.AddMembers): Add generic methods both as
2634 "Method" and "Method`1". Normally, a cache lookup is done on the
2635 "Method" form (ie. without the generic arity), but this one makes
2636 lookups on the full form work as well.
2638 2007-03-22 Raja R Harinath <rharinath@novell.com>
2640 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
2643 2007-03-20 Bill Holmes <billholmes54@gmail.com>
2645 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
2646 ordered_member_list, to TypeBuilder to store members to be defined
2647 in the order they were parsed in.
2648 - ordered_explicit_member_list contains all properties indexers
2649 and methods that are defined as explicit implementation of an
2650 interface or base class.
2651 - ordered_member_list contains all properties indexers and methods
2652 that are not defined as explicit implementation of an interface
2655 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
2656 functionality in these removed classes has been replaced with
2657 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
2658 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
2660 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
2661 to CheckForDuplications inside GetMethod and SetMethod Define Method
2662 to handle method property and indexer name conflicts.
2666 All code is contributed under the MIT/X11 license.
2668 2007-03-20 Martin Baulig <martin@ximian.com>
2670 * class.cs (TypeContainer.Interfaces): Removed; they're now
2671 included in `TypeContainer.Types'.
2673 2007-03-20 Martin Baulig <martin@ximian.com>
2675 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
2677 * class.cs (TypeContainer.CreateType): New public method. This is
2678 now called before DefineType() to create the TypeBuilders.
2679 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
2680 has already been created by CreateType().
2681 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
2682 don't resolve our base classes here; this has been moved into
2683 DefineBaseTypes(). We're now called from CreateType().
2684 (TypeContainer.DefineBaseTypes): New private method; resolve our
2685 base classes here. We're now called from DefineType().
2688 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
2689 our types first to create all the TypeBuilders. After that, call
2690 TypeContainer.DefineType() on all the types which'll resolve their
2691 base classes and setup the resolve order.
2693 2007-03-20 Martin Baulig <martin@ximian.com>
2695 * class.cs (TypeContainer.Enums): Removed; they're now included in
2696 `TypeContainer.Types'.
2698 2007-03-20 Martin Baulig <martin@ximian.com>
2701 (TypeContainer.DefineType): Don't call ResolveMembers() here.
2702 (TypeContainer.DoResolveMembers): Call DefineType() on our
2703 `compiler_generated' classes; moved here from DefineNestedTypes().
2706 (RootContext.ResolveTree): Call ResolveMembers() on all
2707 TypeContainer's in the `type_container_resolve_order'.
2709 2007-03-19 Marek Safar <marek.safar@gmail.com>
2711 * class.cs: Use corlib to handle InternalMethodImplAttribute.
2713 2007-03-17 Marek Safar <marek.safar@gmail.com>
2715 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
2716 implementation flags.
2718 2007-03-17 Marek Safar <marek.safar@gmail.com>
2720 * class.cs: More optimizations for type parameters.
2722 2007-03-15 Marek Safar <marek.safar@gmail.com>
2724 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
2726 * ecore.cs, parameter.cs: More common code for both corlibs.
2728 * typemanager.cs (IsGenericMethod): Simplified.
2730 2007-03-15 Raja R Harinath <rharinath@novell.com>
2732 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2734 * statement.cs, iterators.cs, lambda.cs: Update to changes.
2736 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
2737 unconditionally. Simplify explanation.
2738 (Try.Resolve, Using.Resolve): Likewise.
2740 2007-03-15 Martin Baulig <martin@ximian.com>
2744 * decl.cs (DeclSpace): If we're a partial class, use our
2745 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
2747 2007-03-15 Raja R Harinath <rharinath@novell.com>
2749 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2751 (FlowBranching.UsageVector): Update to changes.
2752 (FlowBranching.MergeSiblings): Likewise.
2753 * statement.cs: Likewise.
2755 2007-03-15 Martin Baulig <martin@ximian.com>
2760 (MemberCache): Added a special .ctor for type parameters.
2763 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
2766 2007-03-09 Martin Baulig <martin@ximian.com>
2768 * enum.cs (Enum): Make this a TypeContainer.
2769 (EnumMember): Derive from `Const'.
2772 (Const.DoResolveValue): New protected virtual method; move most of
2773 the functionality of ResolveValue() here so we can override it in
2775 (Const.CreateConstantReference): Make this virtual.
2777 * class.cs (Kind): Add `Kind.Enum'.
2778 (TypeContainer.Emit): Don't emit the enums here; they're already
2779 in the `RootContext.typecontainer_resolve_order'.
2781 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
2782 here; they're already in the `typecontainer_resolve_order'.
2784 * ecore.cs (EnumConstant.ConvertImplicitly): Add
2785 TypeManager.DropGenericTypeArguments().
2788 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
2789 (TypeManager.IsEnumType): Likewise.
2790 (TypeManager.EnumToUnderlying): Likewise.
2791 (TypeManager.IsEqual): Add support for enums.
2793 2007-03-12 Raja R Harinath <rharinath@novell.com>
2795 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
2796 DefaultParameterValueAttribute to be undefined, say if System.dll
2799 2007-03-11 Marek Safar <marek.safar@gmail.com>
2801 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
2804 2007-03-10 Marek Safar <marek.safar@gmail.com>
2806 * class.cs, parameter.cs: Unified parameters verification.
2808 2007-03-08 Martin Baulig <martin@ximian.com>
2810 * cs-parser.jay (constructor_header): Pass the location to the
2811 newly created TopLevelBlock.
2813 2007-03-07 Martin Baulig <martin@ximian.com>
2815 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
2817 2007-03-06 Miguel de Icaza <miguel@novell.com>
2819 * convert.cs (ExplicitReferenceConversionExists): Sync this method
2820 with the changes from David, fixes the build.
2822 2007-03-05 David Mitchell <dmitchell@logos.com>
2824 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
2825 and its base interfaces to a one-dimensional array type S[],
2826 provided there is an implicit or explicit reference conversion
2829 2007-03-03 Marek Safar <marek.safar@gmail.com>
2831 * cs-tokenizer.cs: Implemented basic linq grammar.
2833 * driver.cs: Set linq lang version on demand.
2835 2007-02-26 Marek Safar <marek.safar@gmail.com>
2837 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
2839 2007-02-25 Marek Safar <marek.safar@gmail.com>
2841 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
2844 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
2846 Check property and event extern attributes.
2848 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
2851 2007-02-24 Marek Safar <marek.safar@gmail.com>
2853 A fix for bug #80407
2854 * ecore.cs: Don't report ambiguity error when methods have same parent.
2856 2007-02-23 Marek Safar <marek.safar@gmail.com>
2858 A fix for bug #80878
2859 * class.cs, cs-parser.jay: Event property can host anonymous methods.
2861 2007-02-22 Marek Safar <marek.safar@gmail.com>
2863 * attribute.cs: Enable ExtensionAttribute presence test.
2865 2007-02-22 Marek Safar <marek.safar@gmail.com>
2867 * class.cs: Warn about missing GetHashCode only when Equals is override.
2869 * decl.cs: Check accessibility of type arguments.
2871 * typemanager.cs: Correctly report nullable array.
2873 2007-02-20 Marek Safar <marek.safar@gmail.com>
2875 * class.cs, report.cs: Capture more details when things go wrong.
2877 2007-02-20 Marek Safar <marek.safar@gmail.com>
2879 A fix for bug #80650
2880 * cs-parser.jay: Anonymous container starts at constructor declaration
2881 and not at block beginning because it has to be usable in constructor
2884 * statement.cs: Use context location and not block one for error reporting.
2886 2007-02-18 Marek Safar <marek.safar@gmail.com>
2888 A fix for bug #78712
2889 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
2892 2007-02-18 Marek Safar <marek.safar@gmail.com>
2894 A fix for bug #80493 by Atsushi Enomoto
2895 * cs-parser.jay: Ignore invalid attribute target.
2897 2007-02-18 Marek Safar <marek.safar@gmail.com>
2899 * cs-tokenizer.cs: Ignore '\0' as white space character.
2901 2007-02-17 Miguel de Icaza <miguel@novell.com>
2903 * cs-parser.jay: Add support for lambda expressions to the mcs
2906 * lambda.cs: Only clone when we are probing, not on the final call
2907 (Compatible is the final call).
2909 * statement.cs (CloneContext): Introduce class to provide block
2910 remapping during clone.
2912 All statements Clone themselves now.
2914 (Clone): special handling for blocks, when we clone a block, we
2915 register the block inside this routine, as children of the block
2916 might trigger a lookup.
2918 * expression.cs: Add support for CloneContext in all expressions.
2920 2007-02-17 Marek Safar <marek.safar@gmail.com>
2922 A fix for bug #80493
2923 * statement.cs: Report ambiguous warning when interfaces are not related.
2925 2007-02-15 Marek Safar <marek.safar@gmail.com>
2927 C# 3.0 extension methods.
2929 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
2930 cannot be used directly.
2932 * class.cs (Class.Emit): Emit extension attribute if any class method
2933 is extension method.
2934 (Method.Define): Add basic extension method validation conditions.
2935 (Method.Emit): Emit extension attribute for method.
2937 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
2938 extension method exists. Currently we follow same approach as Microsoft
2939 does, emit even if a method or a class are private but this can change
2942 * cs-parser.jay: Add handling of `this' keyword in method parameters
2945 * decl.cs (DeclSpace.IsStaticClass): New property.
2946 (MemberCache.FindExtensionMethods): Looks for extension methods with
2947 defined name and extension type.
2949 * doc.cs: Updated after OverloadResolve changes.
2951 * driver.cs: Add new soft reference to System.Core.dll.
2953 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
2954 (ExtensionMethodGroupExpr): Represents group of extension methods.
2956 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
2957 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
2958 to MethodGroupExpr and made non-static for easier customization.
2959 (Invocation.DoResolve): Add extension method lookup when no standard
2961 (MemberAccess.DoResolve): Try extension methods if no member exists.
2963 * modifiers.cs: Add METHOD_EXTENSION modifier.
2965 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
2966 as well as candidate extension type.
2967 (ComputeNamespaces): When assembly constains extension methods registers
2969 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
2970 extension method lookup.
2971 (Namespace.LookupExtensionMethod): Looks for extension method in this
2973 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
2974 find a method which matches name and extensionType.
2976 * parameter.cs (Parameter): Add This modifer.
2977 (HasExtensionMethodModifier): New property.
2978 (Resolve): Add extension parameter check.
2979 (ModFlags): turned to property to exclude this modifier as it is not real
2981 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
2983 * support.cs (ParameterData): Add ExtensionMethodType.
2984 (ReflectionParameters): Implemented ExtensionMethodType interface property.
2986 * typemanager.cs: Add type and ctor extension attribute type.
2988 2007-02-15 Miguel de Icaza <miguel@novell.com>
2990 * report.cs (DisableErrors, EnableErrors): used to prevent error
2991 output when we are "trying" to compile various methods with
2994 * ecore.cs (Expression): Add Clone method that calls the virtual
2995 CloneTo method. The current CloneTo method in Expression throws
2996 an exception so we can track down all the places where this must
2997 be implemented (not using abstract, because that would be a lot of
2998 up-front-work before we can start testing the implementation
3001 Important: we only need Clone capabilities for expressions created
3002 by the parser, as the expressions we will be cloning are
3003 expressions in the pre-resolved state. This vastly simplifies
3006 (SimpleName): Add CloneTo that does nothing.
3007 (EmptyCast): Add CloneTo.
3009 * expression.cs (Binary): Implement CloneTo.
3010 (Invocation.IsApplicable): Store the current ec in
3011 EmitContext.TempEc and restore it on return. This is used so we
3012 do not have to sprinkle hundres of methods with an extra
3013 EmitContext, we know that the only user is the lambda expression
3014 ImplicitConversionExists code.
3016 (Argument): Add Cloning capabilities.
3017 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
3018 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
3019 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
3020 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
3021 IndexerAccess): Add Clone capability.
3023 (LocalVariableReference, This): TODO: needs cloned Block mapping.
3025 (Argument): Add cloning capability.
3027 * assign.cs (Assign): Implement CloneTo.
3029 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
3031 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
3032 version by calling Convert with the EmitContext (that we are
3033 currently storing in ec, this is not great, but will do for now,
3034 to avoid passing EmitContext parameters to hundreds of functions
3035 that do not need them now).
3037 (SetExpression): Remove, it is not needed.
3039 (ContextualReturn): Implement CloneTo.
3041 * statement.cs (Statement): Implement cloning infrastructure,
3042 similar to expressions.
3044 (Block): Partial implementation of Clone for statements.
3046 (Return): Implement clone.
3048 * constant.cs (Constant.CloneTo): New method, does nothing.
3050 * codegen.cs (TempEc): Add a static EmitContext as a temporary
3051 solution, until we decide how to exactly do this.
3053 2007-02-14 Marek Safar <marek.safar@gmail.com>
3055 A fix for bug #80493
3056 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
3057 a property is override we need to use second accessor.
3059 2007-02-13 Marek Safar <marek.safar@gmail.com>
3061 A fix for bug #80418
3062 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
3065 2007-02-13 Marek Safar <marek.safar@gmail.com>
3067 Another fix for bug #80749
3068 * pending.cs: Abstract class has priority over interfaces.
3070 2007-02-13 Marek Safar <marek.safar@gmail.com>
3072 Another fix for bug #80749
3073 * pending.cs: Abstract class has priority over interfaces.
3075 2007-02-13 Marek Safar <marek.safar@gmail.com>
3077 Another fix for bug #80749
3078 * pending.cs: Abstract class has priority over interfaces.
3080 2007-02-13 Marek Safar <marek.safar@gmail.com>
3082 Another fix for bug #80749
3083 * pending.cs: Abstract class has priority over interfaces.
3085 2007-02-13 Marek Safar <marek.safar@gmail.com>
3087 * class.cs Better error message.
3089 * driver.cs: Add shorter versions of -optimize option.
3091 2007-02-13 Martin Baulig <martin@ximian.com>
3093 * class.cs (Constructor.Emit): Check the return value of
3094 ec.ResolveTopBlock() and return on error.
3096 2007-02-13 Raja R Harinath <rharinath@novell.com>
3098 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
3099 message to fix error message regression.
3101 2007-02-12 Marek Safar <marek.safar@gmail.com>
3103 * delegate.cs: Delegate creation expression cannot be of Nullable type.
3105 2007-02-12 Marek Safar <marek.safar@gmail.com>
3107 A fix for bug #80749
3108 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
3109 its parent container.
3111 * class.cs (DefineFieldInitializers): Each initializer can has different
3114 * const.cs: Updated.
3116 2007-02-11 Miguel de Icaza <miguel@novell.com>
3118 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
3119 now all the heavy lifting to check that embedded statements or
3120 expressions have the right form is done in the ContextualReturn.
3122 (ContextualReturn): New class.
3124 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
3125 method that can be invoked to report 201, so we do not replicate
3128 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
3130 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
3131 treating tabs as spaces.
3133 2007-02-09 Marek Safar <marek.safar@gmail.com>
3135 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
3136 * assign.cs: Use full implicit conversion for right side check.
3138 2007-02-09 Marek Safar <marek.safar@gmail.com>
3140 * statement.cs (Switch): Switch over boolean type is not standardized.
3142 2007-02-08 Marek Safar <marek.safar@gmail.com>
3144 A fix for bug #80755
3145 * decl.cs (FindBaseEvent): Don't use method cache for events.
3147 2007-02-07 Marek Safar <marek.safar@gmail.com>
3149 * cs-parser.jay: Better syntax error handling.
3151 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
3152 instead of underlying type value.
3154 2007-02-06 Marek Safar <marek.safar@gmail.com>
3156 * driver.cs: Check define identifier before is registered.
3158 * namespace.cs: Use existing error message.
3160 * report.cs: New warning.
3162 2007-02-06 Marek Safar <marek.safar@gmail.com>
3164 A fix for bug #80742
3165 * expression.cs: Delegate Invoke method can be called directly.
3167 2007-02-06 Marek Safar <marek.safar@gmail.com>
3169 A fix for bug #80676
3170 * class.cs (IsEntryPoint): The Main method can have params modifier.
3172 2007-02-04 Miguel de Icaza <miguel@novell.com>
3174 * parameter.cs (Parameter, Parameters): Add Clone method.
3176 * anonymous.cs (Compatible): Turn method into virtual method, so
3177 LambdaExpression can implement a different behavior.
3179 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
3180 out the basic checking here, so it can be used by
3183 * lambda.cs: Introduce "Compatible" function that will do the
3186 2007-02-02 Marek Safar <marek.safar@gmail.com>
3188 * attribute.cs: Unified one error message.
3190 * class.cs (Class): Use type attributes and not properties to test static
3192 (IsEntryPoint): Don's pass local variable.
3194 * convert.cs: Removed duplicate check.
3196 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
3198 * driver.cs: Don't crash when soft reference does not exist.
3200 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
3201 (UsingEntry): Removed redundant allocation.
3203 * parameter.cs: Add fast path for type parameters.
3205 * support.cs: Don't allocate attribute when it's not used.
3207 2007-01-30 Miguel de Icaza <miguel@novell.com>
3210 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
3211 this into a virtual method, so we can override it in LambdaExpression.
3213 * driver.cs: Improve diagnostics in case of failure.
3215 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
3216 write a function that is slightly more complex and that parses:
3218 type identifier [, type identifier]* )
3220 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
3223 (canEmpty ? i >= 0 : i > 0)
3225 2007-01-30 Raja R Harinath <rharinath@novell.com>
3227 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
3228 exception on possibly valid code.
3230 2007-01-29 Raja R Harinath <rharinath@novell.com>
3232 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
3234 (parse_opt_type_arguments): Remove. It's almost the same as
3236 (parse_namespace_or_typename): Use parse_less_than.
3238 2007-01-28 Miguel de Icaza <miguel@novell.com>
3240 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
3241 this bug took a few hours to find, because the state saved and
3242 restored by PushPosition and PopPosition was ignoring the state of
3243 parse_generic_less_than.
3245 I can also now remove the handling of OP_LT and OP_GT, this solves
3248 * cs-tokenizer.cs: store the location for the ARROW token, we use
3251 (PushPosition, PopPosition): save/restore also `current_token',
3252 restore `parse_generic_less_than' (was missing).
3254 (parse_opt_type_arguments): use parse_type, not
3255 parse_namespace_or_typename to parse types.
3257 * lambda.cs: Empty new file, will eventually have the lambda
3258 expression implementation.
3260 * lambda.test: used to test the internal tokenizer.
3262 * report.cs (FeatureIsNotISO1): Rename from
3263 FeatureIsNotStandardized, because it was about the language level
3264 (1 vs 2) it was not about standarization.
3266 (FeatureRequiresLINQ): New.
3268 * support.cs (SeekableStreamReader): Only require that the reader
3269 is a TextReader, not a StreamReader, so we can plug StringReader.
3271 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
3272 given position in the input stream the following tokens can be
3273 parsed as a type followed by an identifier.
3275 (is_punct): after a '(' if parse_type_and_parameter returns true,
3276 then return a special token OPEN_PARENS_LAMBDA which is used to
3277 avoid reduce/reduce errors in the grammar for the
3278 lambda_expression rules.
3280 (parse_type): implement a type parser inside the
3281 tokenizer, the parser only returns true or false depending on
3282 whether the input at a given position can be parsed as a type.
3284 (peek_token): new method used during type parsing.
3286 2007-01-28 Raja R Harinath <rharinath@novell.com>
3289 * anonymous.cs (ScopeInfo.InflateParameters): New.
3290 (AnonymousContainer.Resolve): Use it to redirect types of
3291 delegate parameters.
3293 2007-01-27 Raja R Harinath <rharinath@novell.com>
3296 * expression.cs (Error_InvalidArguments): Don't use two different
3297 messages for CS1503. Use ExtraInformation and
3298 SymbolRelatedToPreviousError instead.
3301 * decl.cs (DeclSpace.initialize_type_params): Don't access
3302 'type_params' of a partial class directly.
3304 2007-01-26 Miguel de Icaza <miguel@novell.com>
3306 * constant.cs: Removed a handful of out-of-range checks that were
3309 2007-01-25 Marek Safar <marek.safar@gmail.com>
3311 * expression.cs (CheckUselessComparison): Add additional check for char
3314 * namespace.cs: Fixed typo.
3316 2007-01-23 Miguel de Icaza <miguel@novell.com>
3318 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
3319 gone, instead we inline the test, preventing the needless casts to
3320 longs, ulongs and doubles for the parameters, avoiding calls to
3321 methods that overchecked stuff, and instead inlined things
3324 2007-01-20 Marek Safar <marek.safar@gmail.com>
3326 * cs-parser.jay: Better parameter error handling.
3328 2007-01-17 Marek Safar <marek.safar@gmail.com>
3330 A fix for bug #80368, #80522
3331 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
3332 whether array initializer contains constants only.
3333 (ArrayCreation.Emit): Use better formula to decide when
3334 are array initializers for static initialization.
3335 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
3336 have to emit even constants otherwise they are pre-initialized.
3338 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
3339 Raja R Harinath <rharinath@novell.com>
3341 Fix emit order of 'get' vs. 'set'.
3342 * support.cs (Accessors): New.
3343 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
3344 Note the order in which accessors are declared in the source.
3345 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
3346 Refactored from Property.Define and Indexer.Define.
3347 (PropertyBase.DefineAccessors): New helper that calls the above in
3348 appropriate order as noted by the parser.
3349 (Property.Define, Indexer.Define): Update to changes.
3350 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
3352 2007-01-17 Raja R Harinath <rharinath@novell.com>
3354 Fix cs0029-6.cs and gcs0029-2.cs (regression)
3355 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
3356 there's an implicit conversion from the current type to the target
3357 type before converting the underlying constant.
3359 2007-01-16 Marek Safar <marek.safar@gmail.com>
3361 * const.cs (ResolveValue): Updated after constant conversion was made more
3364 * constant.cs (GetAttributableValue): constant to object conversion is
3365 used for attributes only.
3366 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
3367 constant conversions.
3368 (LongConstant.ConvertImplicitly): Ditto.
3370 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
3371 (ImplicitConversionStandard): Handle constant conversion as extra step.
3372 It solves the issue when constant conversion was called indirectly like
3373 inside array initializer and constant folding was skipped.
3375 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
3378 * statement.cs(ImplicitConversionStandard): Updated after constant
3379 conversion was made more generic.
3381 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
3383 * expression.cs (As.DoResolve): Use GenericConstraints instead of
3384 Constraints, solves the problem where the compiler incorrectly
3385 reported that a type parameter was not constrained to a class (Bug
3388 2007-01-14 Marek Habersack <grendello@gmail.com>
3390 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
3392 2007-01-14 Marek Safar <marek.safar@gmail.com>
3394 A fix for bug #80368
3395 * assign.cs (FieldInitializer): New class implements field
3396 initializer statement.
3398 * attribute.cs: Update after FieldMember rename.
3400 * class.cs (PropertyBasedMember): New common class for property based
3402 (InterfaceMemberBase): New base class for all members which can be used as
3403 an interface members.
3404 (MethodCore): Moved really common code to InterfaceMemberBase.
3405 (Method.Define): Equal and GetHasCode detection is relevant for methods
3407 (MethodData.Define): Don't assume that public event implements an
3408 interface automatically.
3409 (MethodData.DefineMethodBuilder): Issue an error even if only extern
3411 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
3412 (FieldMember): Merged with FieldBase.
3413 (EventProperty.AEventPropertyAccessor): New specialization to check whether
3414 event extern modifier can be used.
3415 (EventField.EventFieldAccessor): Moved event field specific code here.
3416 (Event.AllowedModifiers): Even event can be extern.
3417 (Event.FindOutBaseMethod): New override specific to events.
3418 (Indexer.parameters): Reintroduce parameters because base class holds
3419 only properties common data.
3420 (Indexer.CheckForDuplications): Indexers are threated as methods so we
3421 need do extra parameters check.
3423 * const.cs: Update after FieldMember rename.
3425 * decl.cs (MemberCache.FindBaseEvent): New method.
3427 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
3428 to reflect that indexer is now derived from PropertyBased.
3430 * ecore.cs (GetMemberType): Made public.
3431 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
3434 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
3436 * typemanager.cs (CSharpSignature): Correctly print event accessors.
3437 (RegisterEvent): Removed.
3438 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
3439 (GetPrivateFieldOfEvent): Renamed to GetEventField.
3441 2007-01-11 Raja R Harinath <rharinath@novell.com>
3444 * statement.cs (CollectionForeach.TryType): Prefer generic
3445 GetEnumerator over non-generic variant. Fix code to follow comments.
3447 2007-01-09 Raja R Harinath <rharinath@novell.com>
3450 * support.cs (ReflectionParameter): Don't use an invalid index on
3451 the generic parameter data.
3453 2007-01-08 Miguel de Icaza <miguel@novell.com>
3455 * driver.cs: Just add a tiny bit of infrastructure.
3457 2007-01-02 Marek Safar <marek.safar@gmail.com>
3459 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
3460 where field type is struct from current assembly.
3462 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
3465 2007-01-02 Marek Safar <marek.safar@gmail.com>
3467 A fix for bug #80381
3468 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
3471 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
3473 (Namespace.LookupType): Always use core types from corlib when speficied.
3475 * report.cs: A new warning.
3477 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
3478 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
3479 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
3481 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
3482 (InitCoreTypes): Set expression type of object_type and value_type
3483 immediately after lookup.
3485 2007-01-01 Miguel de Icaza <miguel@novell.com>
3487 * cs-tokenizer.cs: Accept Pc class characters (Connector
3488 Punctuation) as valid identifiers. Fixes #78259
3490 * expression.cs (Invocation.DoResolve): Moved the check for the
3491 use of `this' for doing method calls to the Invocation resolution
3492 step, after overload resolution has taken place instead of doing
3493 the check at the low-level `This.DoResolve' level.
3495 The `This.DoResolve'(appens before overload resolution, so it has
3496 no way of knowing if the method that will be called will be
3497 instace or static, triggering an erroneous report for cs0188 (Bug
3500 We now do the check for instance method invocations after we know
3501 what method will be called.
3503 (This.CheckThisUsage): Move the actual use of this structure
3504 checking into its own method and expose it.
3506 * Everywhere that called Error_ValueCannotBeConverted: pass a new
3509 Exceptions: Null.ConvertImplicitly,
3510 Constant.ImplicitConversionRequired as there are too many call
3511 sites for passing the ec.
3513 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
3514 EmitContext, if the value is null, then we do not try to provide
3515 the extra information from the error (If a userdefined conversion
3516 exists, as UserDefinedConversion requires a non null-EmitContext).
3520 2006-12-30 Raja R Harinath <rharinath@novell.com>
3522 * flowanalysis.cs (MyBitVector): Document some invariants.
3523 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
3524 introduced below, and add a couple of others,
3526 2006-12-30 Marek Safar <marek.safar@gmail.com>
3528 * attribute.cs (GetMethodObsoleteAttribute): Uses new
3529 GetPropertyFromAccessor and GetEventFromAccessor.
3531 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
3532 overrides non-obsolete one.
3533 (Indexer.Define): Error message has been moved to the parser.
3535 * cs-parser.jay: Better syntax errors handling.
3537 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
3538 when an invocation has no arguments.
3540 * ecore.cs: Removed not used caching.
3542 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
3545 * report.cs: Add a new warning.
3547 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
3549 * typemanager.cs (enumeration_type): Removed.
3550 (CSharpSignature): Reuses IsSpecialMethod.
3551 (IsEqual): Hack for MS BCL.
3552 (GetPropertyFromAccessor): New method.
3553 (GetEventFromAccessor): New method.
3554 (IsSpecialMethod): Fixed to handle more cases.
3556 2006-12-30 Marek Safar <marek.safar@gmail.com>
3558 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
3559 Made white spaces array static.
3561 * ecore.cs (RemoveGenericArity): Optimized.
3563 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
3565 (MyBitVector.initialize_vector): Simplified.
3567 2006-12-22 Miguel de Icaza <miguel@novell.com>
3569 * ecore.cs: Am not entirely happy with this hack, but it seems to
3570 address the issue in 80257 (a small test case for
3573 I set the MethodGroupExpr.Type to an internal compiler type
3574 (itself in this case) to force the resolution to take place. Why
3575 it does not take place with a null is beyond me.
3577 2006-12-20 Marek Safar <marek.safar@gmail.com>
3579 A fix for bug #80288
3580 * expression.cs (ResolveOperator): Consider user defined conversion for
3581 logical and operator too.
3582 (EmitBranchable): Optimization for logical and when full constant folding
3583 could not be applied but one operand is constant.
3585 2006-12-19 Marek Safar <marek.safar@gmail.com>
3587 * class.cs (GetClassBases): Write 5 times every day, will never use
3588 FullName for error reporting.
3590 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
3592 2006-12-19 Martin Baulig <martin@ximian.com>
3594 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
3595 the symbol file info here.
3597 2006-12-18 Marek Safar <marek.safar@gmail.com>
3599 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
3600 of `elseif' is taking then following sections are not taking.
3601 Fixes an issue reported on mono mailing list.
3603 2006-12-18 Marek Safar <marek.safar@gmail.com>
3605 A fix for bug #80300
3606 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
3607 a caller is not taking.
3609 2006-12-18 Raja R Harinath <rharinath@novell.com>
3611 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
3612 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
3613 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
3614 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
3615 * class.cs: Update to changes.
3617 2006-12-17 Marek Safar <marek.safar@gmail.com>
3619 A fix for bug #79934
3620 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
3623 * class.cs (ResolveMembers): Register an iterator in current container and
3626 2006-12-16 Raja R Harinath <rharinath@novell.com>
3629 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
3630 satisfy a params annotated parameter.
3632 2006-12-16 Marek Safar <marek.safar@gmail.com>
3634 A fix for bug #77014
3635 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
3636 paramters correctly and not rely on hacks in Parameters class.
3637 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
3639 (Invocation.VerifyArgumentsCompat): Ditto.
3640 (Invocation.EmitArguments): Changed to correctly emit params arguments at
3643 * parameter.cs (HasParams): Don't assume that params is the last one.
3645 * support.cs (ReflectionParameters.ctor): Look for params attribute
3647 (ReflectionParameters.ParameterType): Removed hack when we returned last
3648 parameter for out of range parameters.
3649 (ParameterName, ParameterModifier): Ditto.
3651 2006-12-14 Marek Safar <marek.safar@gmail.com>
3653 A fix for bug #79987
3654 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
3655 when assembly is not CLS compliant but type is. I have no idea why is this
3658 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
3660 2006-12-13 Miguel de Icaza <miguel@novell.com>
3662 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
3663 in struct constructors, they are basically no-ops.
3665 2006-12-12 Marek Safar <marek.safar@gmail.com>
3667 * cs-tokenizer.cs (Position): Save preprocessor status too.
3669 2006-12-12 Marek Safar <marek.safar@gmail.com>
3671 A fix for bug #77794
3672 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
3674 2006-12-12 Marek Safar <marek.safar@gmail.com>
3676 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
3678 (pp_expr): Report error for an invalid expression.
3679 (handle_preprocessing_directive): Simplified; add more error checking.
3681 2006-12-11 Marek Safar <marek.safar@gmail.com>
3683 A fix for bug #74939
3684 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
3685 directives handling.
3687 2006-12-10 Marek Safar <marek.safar@gmail.com>
3689 A fix for bugs #80093, and #75984
3690 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
3691 logic, it seems to me as it worked before "by coincidence".
3692 (xtoken): Simplified to use reworked handle_preprocessing_directive.
3693 (cleanup): Enabled endif check.
3695 2006-12-09 Marek Safar <marek.safar@gmail.com>
3697 A fix for bug #80162
3698 * statement.cs (CollectionForeach.TryType): Generics and non-generics
3699 enumerators are never ambiguous.
3701 2006-12-08 Raja R Harinath <rharinath@novell.com>
3704 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
3706 2006-12-06 Marek Safar <marek.safar@gmail.com>
3708 A fix for bug #80144
3709 * class.cs (EventProperty.Define): Explicit implementation means
3710 that an even is used.
3712 2006-12-06 Marek Safar <marek.safar@gmail.com>
3714 Fixes the operators implementation (part II)
3716 * cfold.cs (DoConstantNumericPromotions): Renamed to
3717 DoBinaryNumericPromotions and simplified.
3718 (BinaryFold): Couple of conversion fixes; simplified.
3720 * constant.cs, ecore.cs, literal.cs
3721 (ToType): Renamed to ConvertImplicitly.
3722 (Reduce): Renamed to ConvertExplicitly.
3724 * class.cs, convert.cs: Updated.
3726 * expression.cs: TryReduce doesn't throw an exception.
3728 2006-12-01 Marek Safar <marek.safar@gmail.com>
3730 A fix for bug #80108
3731 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
3734 2006-11-30 Marek Safar <marek.safar@gmail.com>
3736 Fixes unary operators implementation (part I)
3739 * cfold.cs (Error_CompileTimeOverflow): Made internal
3741 * const.cs (IConstant): Changed to use reference to constant and
3742 not constant itself.
3743 Updated IConstant implementations.
3745 * constant.cs (CreateConstant): New factory method.
3746 Updated IConstant implementation.
3748 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
3750 * ecore.cs: Updated to use CreateConstantReference.
3752 * enum.cs: Reflects IConstant changes.
3754 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
3756 * literal.cs (NullConstant): Change to be independently usable.
3758 2006-11-29 Martin Baulig <martin@ximian.com>
3760 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
3761 we need to emit the scope initializer before calling the base .ctor.
3763 * anonymous.cs: Merged back from the new anonymous methods branch.
3764 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
3766 * expression.cs (ParameterReference.DoResolveBase): Create a
3767 "normal" ScopeInfo when capturing parameters rather than using the
3768 root scope; this makes things work with anonymous methods having
3772 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
3774 2006-11-22 Marek Safar <marek.safar@gmail.com>
3776 A fix for bug #79987
3777 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
3778 check to a base class.
3779 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
3780 only when assembly has missing attribute.
3781 * report.cs: Update.
3783 2006-11-21 Marek Safar <marek.safar@gmail.com>
3785 * cs-tokenizer.cs: Merged with gmcs version.
3787 2006-11-20 Marek Safar <marek.safar@gmail.com>
3790 * cs-parser.jay: Better error message when partial keyword is misplaced.
3792 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
3794 A fix for bug #79810
3795 report.cs: CS1058 only applies to 2.0 profile (gmcs).
3796 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
3797 a RuntimeWrappedException by default.
3799 2006-11-18 Marek Safar <marek.safar@gmail.com>
3801 A fix for bug #79843
3802 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
3804 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
3806 2006-11-18 Marek Safar <marek.safar@gmail.com>
3808 * driver.cs, namespace.cs: Uses faster IndexOf version.
3810 2006-11-17 Marek Safar <marek.safar@gmail.com>
3812 A fix for bug #79941
3813 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
3815 (Operator.Define): Implicit/Explicit operator of same type is duplicate
3816 even if internal name is different.
3817 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
3818 (UserDefinedConversion): Simplified as the operators cannot be internal.
3819 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
3821 (MethodLookup): Replaced EmitContext with parentType.
3822 * expression.cs: Updated.
3824 2006-11-09 Raja R Harinath <rharinath@novell.com>
3826 * driver.cs (BadAssembly): Handle all the ugliness of
3827 DefineDynamicAssembly.
3829 2006-11-08 Raja R Harinath <rharinath@novell.com>
3831 Address parts of #58244 -- most of what's left is in the runtime
3832 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
3833 CS1509 error checks, and handle them for all assembly loads, not
3834 just the first invocation.
3835 (LoadModule): Likewise. Move handling of 'adder_method' ...
3836 * codegen.cs (AssemblyClass.AddModule): ... here.
3838 2006-11-02 Marek Safar <marek.safar@gmail.com>
3840 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
3841 IEnumerable<T> is ambiguous.
3843 2006-10-31 Marek Safar <marek.safar@gmail.com>
3845 A fix for bug #67689
3846 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
3847 GetEnumerator is ambiguous.
3849 * report.cs: Add new warning.
3851 2006-10-29 Marek Safar <marek.safar@gmail.com>
3853 A fix for bug #78602
3854 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3855 to protected member can be nested type.
3857 2006-10-28 Marek Safar <marek.safar@gmail.com>
3859 A fix for bug #78965
3860 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3861 to protected member must derive from current type.
3863 2006-10-27 Marek Safar <marek.safar@gmail.com>
3865 assign.cs: Reuses error method.
3867 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
3868 instead of type for constants.
3869 (Expression.Error_ValueAssignment): Common error method.
3871 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
3874 2006-10-27 Marek Safar <marek.safar@gmail.com>
3876 A fix for bug #79081
3877 * expression.cs (MemberAccess.DoResolve): Check nested type
3880 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
3882 * doc.cs : nested delegates were not handled. Fixed bug #79754.
3884 2006-10-26 Marek Safar <marek.safar@gmail.com>
3886 A fix for bug #76591
3887 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
3889 2006-10-26 Marek Safar <marek.safar@gmail.com>
3891 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
3892 type forwarder of the same type multiple times.
3894 2006-10-26 Raja R Harinath <rharinath@novell.com>
3897 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
3898 instance as an rvalue, even when we later resolve as an lvalue.
3900 2006-10-25 Martin Baulig <martin@ximian.com>
3902 * anonymous.cs: Fix #79673.
3904 2006-10-24 Marek Safar <marek.safar@seznam.cz>
3906 A fix for bug #79666
3907 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
3908 ignored when is optimized (= default value) as its value is already set.
3910 2006-10-23 Marek Safar <marek.safar@seznam.cz>
3912 A fix for bug #79724
3913 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
3914 TypeContainer for type lookup.
3916 2006-10-23 Marek Safar <marek.safar@seznam.cz>
3918 A fix for bug #79231
3919 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
3920 * expression.cs (OverloadResolve): Always convert type name for
3922 (ResolveNamespaceOrType): Don't confuse a nested type with any
3925 2006-10-18 Martin Baulig <martin@ximian.com>
3927 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
3929 2006-10-17 Miguel de Icaza <miguel@novell.com>
3931 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
3932 an int32, but requesting an int64 from the conversion
3934 2006-10-12 Martin Baulig <martin@ximian.com>
3937 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
3939 2006-10-12 Martin Baulig <martin@ximian.com>
3942 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
3944 2006-10-11 Miguel de Icaza <miguel@novell.com>
3946 * convert.cs: Remove broken code: I was doing the "Existance"
3947 tests for Implicit conversions.
3949 2006-10-10 Miguel de Icaza <miguel@novell.com>
3951 * convert.cs: Added one missing case in
3952 ImplicitStandardConversionExists uint64 to intptr.
3956 * typemanager.cs (uintptr_type): another core known type.
3958 * ecore.cs (OperatorCast): routine used to do cast operations that
3959 depend on op_Explicit. We could change some of the Decimal
3960 conversions to use this.
3962 This one has a probe mechanism that checks both types for an op_
3963 which it coudl be used to eliminate two classes: CastToDecimal
3964 and CastFromDecimal.
3966 * convert.cs: Implement the conversions documented in #59800
3968 2006-10-10 Martin Baulig <martin@ximian.com>
3970 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
3971 before RootScope.ResolveMembers().
3973 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
3974 `CurrentType' if appropriate.
3976 2006-10-09 Marek Safar <marek.safar@seznam.cz>
3978 A fix for bug #78568
3979 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
3980 when contains binary operators.
3981 * cs-parser.jay: Updated.
3983 2006-10-09 Martin Baulig <martin@ximian.com>
3986 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
3987 moved that into Define() and also do the other type parameter
3988 checks there. Fixes #79094. Added gtest-292.cs.
3991 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
3992 since that doesn't include type parameters; don't use `Ldelema'
3993 for type parameters. Fixes #78980. Added gtest-293.cs.
3995 2006-10-08 Marek Safar <marek.safar@seznam.cz>
3998 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
3999 conversion is allowed.
4001 2006-10-06 Marek Safar <marek.safar@seznam.cz>
4003 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
4004 error reporting when no error occurs.
4006 2006-10-06 Marek Safar <marek.safar@seznam.cz>
4008 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
4011 2006-10-06 Raja R Harinath <rharinath@novell.com>
4014 * class.cs (DefineTypeBuilder): Check circular dependencies before
4015 setting the parent of the TypeBuilder.
4016 (CheckRecursiveDefinition): Don't use 'BaseType', since
4017 it may not be valid until after DefineTypeBuilder. Use
4018 'base_type' instead.
4020 2006-10-04 Martin Baulig <martin@ximian.com>
4022 Merged the Anonymous Methods patch.
4024 * anonymous.cs, iterators.cs: The new anonymous methods code.
4026 * statement.cs (Variable): New public abstract class.
4027 (LocalInfo.Variable): New public property.
4028 (LocalInfo.ResolveVariable): New public method.
4029 (Block.Flags): Add `IsIterator'.
4030 (Block.AddVariable): Improved the CS0136 check.
4031 (Block.AnonymousChildren): New public property.
4032 (Block.AddAnonymousChild): New public method.
4033 (ToplevelBlock): Update to use the new anonymous method framework.
4034 (ToplevelBlock.ctor): `container' is now a `Block' and not a
4035 `ToplevelBlock'; this is required to correctly implement the
4037 (Fixed, Using): Use `TemporaryVariable' instead of directly
4038 creating the `LocalBuilder'.
4040 * parameter.cs (Parameter.ResolveVariable): New public method.
4041 (Parameters.ResolveVariable): Likewise.
4043 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
4045 * class.cs (TypeContainer): Replaced the `iterators' list and
4046 corresponding methods with a list of `CompilerGeneratedClass'es.
4047 (TypeContainer.ResolveMembers): New public method.
4048 (Method): `IIteratorContainer' has been replaced by
4051 * expression.cs (VariableReference): New public abstract base
4052 class for `LocalVariableReference', `ParameterReference' and
4055 * codegen.cs (EmitContext): Removed `capture_context',
4056 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
4057 (EmitContext.EmitThis): Removed.
4059 * cs-parser.jay: Replace `iterator_container' with
4062 2006-10-04 Martin Baulig <martin@ximian.com>
4064 * generic.cs (GenericMethod): Don't make this abstract.
4065 (Constraints.Clone): Added dummy implementation.
4067 2006-10-04 Raja R Harinath <harinath@gmail.com>
4070 * namespace.cs (LookForAnyGenericType): Avoid nullref on
4071 'declspaces'. Avoid allocating arrays willy-nilly.
4074 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
4075 cases out of the switch.
4077 2006-09-28 Marek Safar <marek.safar@seznam.cz>
4079 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
4080 message when non-generic type is used with the type arguments.
4081 * expression.cs: Updated.
4083 2006-09-28 Raja R Harinath <rharinath@novell.com>
4086 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
4087 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4088 Change semantics slightly. Don't insist on having only one
4089 temporary EmptyExpression -- just throttle the creation of new ones.
4092 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
4093 non-interfaces too. If no methods are found, don't try to create
4096 2006-09-28 Marek Safar <marek.safar@seznam.cz>
4098 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
4101 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
4102 us produce better error message.
4104 2006-09-27 Marek Safar <marek.safar@seznam.cz>
4106 * expression.cs (Binary.ResolveOperator): Warn about a side effect
4107 of the `|' operator.
4109 * report.cs: A new warning added.
4111 2006-09-27 Martin Baulig <martin@ximian.com>
4113 * generic.cs (GenericMethod): Don't make this abstract.
4115 2006-09-27 Martin Baulig <martin@ximian.com>
4118 (InternalErrorException): Added overloaded ctor taking a params array.
4120 2006-09-26 Marek Safar <marek.safar@seznam.cz>
4122 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
4123 Fixed the cases when same error was reported twice.
4125 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
4126 now report symbol information.
4128 2006-09-25 Martin Baulig <martin@ximian.com>
4130 * class.cs: Completely unified with the gmcs version.
4132 2006-09-25 Martin Baulig <martin@ximian.com>
4134 * typemanager.cs (TypeManager.IsNullableType): New public function.
4135 (TypeManager.IsNullableTypeOf): Likewise.
4136 (TypeManager.IsNullableValueType): Likewise.
4138 * class.cs (MethodCore): Added the `GenericMethod' argument from
4139 gmcs and also unified all classes derived from `MethodCore' with gmcs.
4141 2006-09-24 Raja R Harinath <harinath@gmail.com>
4143 * convert.cs: Unify with gmcs version.
4145 2006-09-24 Marek Safar <marek.safar@seznam.cz>
4147 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
4148 verify them as well.
4150 * report.cs: New warning.
4152 2006-09-24 Marek Safar <marek.safar@seznam.cz>
4154 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
4155 for anonymous block with out argument.
4157 2006-09-24 Marek Safar <marek.safar@seznam.cz>
4159 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
4160 not used private events only.
4162 2006-09-23 Marek Safar <marek.safar@seznam.cz>
4164 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
4166 * const.cs (Const.Define): Check for constant type.
4167 (Const.IsConstantTypeValid): Looks for valid constant types.
4169 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
4171 * ecore.cs (EmptyConstantCast): New common class for all constant based
4174 * expression.cs (Is.DoResolve): Handle null constant especially.
4175 (New.DoResolve): Check for new void().
4176 (MemberAccess.DoResolve): Cope with all kind of nulls.
4178 * literal.cs (NullConstant): Uses EmptyConstantCast.
4179 (NullDefault): Based on EmptyConstantCast.
4180 (NullLiteral): Uses EmptyConstantCast.
4182 * statement.cs (Block.ResolveMeta): Check for constant type.
4184 2006-09-22 Martin Baulig <martin@ximian.com>
4186 * delegate.cs, attribute.cs: Merged with the gmcs versions.
4188 2006-09-22 Raja R Harinath <rharinath@novell.com>
4190 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
4194 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
4195 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
4198 2006-09-22 Martin Baulig <martin@ximian.com>
4200 * ecore.cs: Merged with the gmcs version.
4202 * generic.cs (ConstructedType): New dummy class.
4203 (TypeArguments): Don't make this abstract.
4206 (TypeManager.IsGenericTypeDefinition): New method.
4207 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
4209 2006-09-22 Raja R Harinath <rharinath@novell.com>
4211 * expression.cs (ComposedCast): Check for arrays of TypedReference
4212 before creating the type, not after.
4214 2006-09-21 Marek Safar <marek.safar@seznam.cz>
4216 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
4217 after ToType change.
4219 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
4220 when constant must be implicitly convertible.
4222 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
4224 * ecore.cs (NullCast): Derives from NullConstant.
4226 * expression.cs (Is.DoResolve): Removed useless variables.
4227 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
4228 (New.Constantify): Add enum support.
4229 (MemberAccess.DoResolve): Add warning when accessing null constant or
4232 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
4235 * literal.cs (NullConstant): New abstract class with common
4236 functionality for all null specializations.
4237 (NullDefault): Represents default(X) when result can be
4239 (NullLiteral): Updated.
4241 * report.cs: Add new warning.
4243 2006-09-21 Martin Baulig <martin@ximian.com>
4245 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
4247 2006-09-21 Martin Baulig <martin@ximian.com>
4249 * generic.cs (GenericConstraints): New dummy class.
4250 (Constraints): Likewise.
4251 (TypeParameter): Likewise.
4252 (TypeParameterName): Likewise.
4253 (GenericMethod): Likewise.
4255 * typemanager.cs (TypeManager.GetGenericArguments): New method.
4257 * decl.cs: Merged with the gmcs version.
4259 2006-09-21 Raja R Harinath <rharinath@novell.com>
4261 * generic.cs (TypeParameter): Implement IMemberContainer.
4262 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
4264 * rootcontext.cs: Unify with gmcs version.
4266 * report.cs: Unify with gmcs version.
4267 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
4268 from gmcs/generics.cs.
4269 * generics.cs (TypeParameter): New dummy class.
4271 * support.cs: Unify with gmcs version.
4273 2006-09-20 Raja R Harinath <rharinath@novell.com>
4275 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
4276 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
4278 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
4279 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
4280 * mcs.exe.sources: Add generic.cs.
4282 * codegen.cs: Unify with gmcs version.
4284 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
4285 (EmitContext): Add GenericDeclContainer implementation.
4286 * decl.cs (MemberCore, DeclSpace): Likewise.
4287 * namespace.cs: Remove #ifdef GMCS_SOURCE.
4289 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
4290 MCS TypeManager has a corresponding dummy method.
4292 2006-09-19 Martin Baulig <martin@ximian.com>
4294 * expression.cs: Completely merged with the gmcs version.
4296 2006-09-19 Martin Baulig <martin@ximian.com>
4298 * expression.cs (Invocation): Merged with the gmcs version.
4299 (ArrayAccess.GetStoreOpcode): Likewise.
4301 2006-09-19 Martin Baulig <martin@ximian.com>
4304 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
4305 (TypeManager.IsGenericMethodDefinition): Likewise.
4307 2006-09-19 Martin Baulig <martin@ximian.com>
4310 (TypeManager.IsEqual): Moved the gmcs implementation here.
4311 (TypeManager.DropGenericTypeArguments): Likewise.
4312 (TypeManager.DropGenericMethodArguments): Likewise.
4313 (TypeManager.GetTypeArguments): Moved here from gmcs.
4314 (TypeManager.HasGenericArguments): Likewise.
4316 2006-09-19 Martin Baulig <martin@ximian.com>
4318 * expression.cs (Binary): Merged with the gmcs version.
4320 2006-09-19 Martin Baulig <martin@ximian.com>
4322 * expression.cs (Probe, As, Is): Merged with the gmcs version.
4324 2006-09-19 Martin Baulig <martin@ximian.com>
4326 * typemanager.cs: Merged with the gmcs version.
4328 2006-09-16 Raja R Harinath <rharinath@novell.com>
4330 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
4331 * driver.cs: Likewise.
4333 2006-09-16 Marek Safar <marek.safar@seznam.cz>
4336 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
4337 only if parent type is class.
4338 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
4341 2006-09-15 Marek Safar <marek.safar@seznam.cz>
4344 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
4346 * typemanager.cs(CSharpName): Converts NullType to null.
4348 2006-09-15 Martin Baulig <martin@ximian.com>
4351 (TypeManager.GetMethodName): Added mcs implementation.
4352 (TypeManager.IsEqual): Likewise.
4355 (SimpleName.RemoveGenericArity): Added dummy implementation.
4357 * pending.cs: Merged with the gmcs version.
4359 2006-09-15 Martin Baulig <martin@ximian.com>
4361 * statement.cs: Merge with the gmcs version.
4363 2006-09-15 Martin Baulig <martin@ximian.com>
4365 * statement.cs (Switch): Merge with the gmcs implementation
4366 (without nullables), which is newer.
4368 2006-09-15 Martin Baulig <martin@ximian.com>
4370 * statement.cs (Block.Variables): Make this public.
4371 (ToplevelBlock.Parameters): Make this a property.
4372 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
4374 2006-09-15 Martin Baulig <martin@ximian.com>
4376 * namespace.cs: Merge with the gmcs version.
4378 2006-09-15 Martin Baulig <martin@ximian.com>
4380 * decl.cs (MemberName): Minor code cleanups.
4382 2006-09-15 Martin Baulig <martin@ximian.com>
4384 * parameter.cs: Merge with the gmcs version.
4386 2006-09-15 Martin Baulig <martin@ximian.com>
4388 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
4389 and an error in mcs.
4391 2006-09-15 Martin Baulig <martin@ximian.com>
4393 * flowanalysis.cs: Merged from GMCS; added the generics code into
4394 a `GMCS_SOURCE' conditional so we can share this file.
4396 2006-09-08 Martin Baulig <martin@ximian.com>
4398 * typemanager.cs (TypeManager.interlocked_type): New public field.
4399 (TypeManager.int_interlocked_compare-exchange): New public field.
4400 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
4401 enumerator types here and call InitGenericCoreTypes().
4402 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
4403 after calling InitEnumUnderlyingTypes().
4406 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
4407 `classes_second_stage'.
4409 2006-09-14 Marek Safar <marek.safar@seznam.cz>
4411 * assign.cs, ecore.cs, expression.cs: Share error message text.
4412 * class.cs (FieldMember.Define): Check for varible of static type.
4413 * driver.cs (LoadAssembly): Uses error output for errors.
4414 * statement.cs: Updated.
4416 2006-09-08 Marek Safar <marek.safar@seznam.cz>
4418 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
4421 2006-09-07 Martin Baulig <martin@ximian.com>
4424 (MainDriver): Revert r62663 from Marek; see #70506 for details.
4426 2006-08-29 Miguel de Icaza <miguel@novell.com>
4428 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
4430 2006-08-17 Miguel de Icaza <miguel@novell.com>
4432 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
4433 #52019 and #79064, the use of the \uXXXX sequence in source code
4434 to represent unicode characters.
4436 2006-08-15 Marek Safar <marek.safar@seznam.cz>
4438 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
4440 * class.cs, ecore.cs, statement.cs: Merged to one error message.
4442 2006-08-13 Miguel de Icaza <miguel@novell.com>
4444 * assign.cs: Catch attempts to assign to a method groups in += and
4447 2006-08-13 Marek Safar <marek.safar@seznam.cz>
4450 * cs-parser.jay: Don't destroy current array type by typeof of array's.
4452 2006-08-12 Marek Safar <marek.safar@seznam.cz>
4454 * class.cs (Method.Define): Issue a warning when generic method looks like
4456 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
4459 2006-08-09 Marek Safar <marek.safar@seznam.cz>
4461 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
4463 * decl.cs (MemberCache.FindMembers): When container is interface we need to
4464 search all base interfaces as a member can be ambiguous.
4465 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
4466 Constructor member type filter.
4467 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
4468 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
4469 reporting for returned memberinfos.
4470 * report.cs: Updated.
4471 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
4472 version to work on all runtimes.
4473 (TypeManager.RealMemberLookup): Removed members filtering.
4475 2006-08-08 Raja R Harinath <rharinath@novell.com>
4477 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
4478 (PropertyExpr.EmitAssign): Likewise.
4479 * expression.cs (Indirection.EmitAssign): Likewise.
4480 (LocalVariableReference.EmitAssign): Likewise.
4481 (ParameterReference.EmitAssign): Likewise.
4482 (Invocation.EmitArguments): Likewise.
4483 (ArrayAccess.EmitAssign): Likewise.
4484 (IndexerAccess.EmitAssign): Likewise.
4485 (This.EmitAssign): Likewise.
4486 (ConditionalLogicalOperator.Emit): Likewise.
4489 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
4490 instead of ArrayList. If the hashtable has a LocalBuilder, don't
4491 leave it in after returning it.
4492 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
4494 2006-08-06 Marek Safar <marek.safar@seznam.cz>
4496 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
4499 2006-08-03 Raja R Harinath <rharinath@novell.com>
4501 Fix cs0146-3.cs and cs0146-4.cs.
4502 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
4503 enclosing types don't depend on the current type.
4505 2006-08-02 Raja R Harinath <rharinath@novell.com>
4508 * class.cs (TypeContainer.DoDefineMembers): Use
4509 FindBaseMemberWithSameName on Parent, since we're interested in
4510 whether we hide inherited members or not.
4511 (FindBaseMemberWithSameName): Make slightly more robust.
4513 Fix the non-generic testcase from #77396
4514 * decl.cs (DeclSpace.DeclContainer): Remove override.
4516 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
4517 declspaces for doppelgangers too.
4518 (UsingEntry): Implement IResolveContext.
4519 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
4520 'this' as the resolve context.
4521 (LocalAliasEntry): Likewise.
4523 Implement parts of #77403
4524 * roottypes.cs (RootDeclSpace): New. Used to represent the
4525 toplevel declaration space. Each namespace declaration introduces
4526 a "partial" root declaretion space.
4527 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
4528 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
4529 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
4530 from 'current_namespace.SlaveDeclSpace'.
4531 (namespace_declaration): Likewise.
4532 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
4533 check. It can't happen now.
4534 * decl.cs (DeclSpace.LookupType): Likewise.
4535 * driver.cs (MainDriver): Sanity check.
4537 2006-08-01 Raja R Harinath <rharinath@novell.com>
4539 * decl.cs (DeclSpace.FindNestedType): Remove.
4540 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
4541 LookupTypeContainer to get the container of the nested type.
4542 * class.cs (TypeContainer.FindNestedType): Make non-override.
4544 2006-07-31 Raja R Harinath <rharinath@novell.com>
4546 * decl.cs (DeclSpace.PartialContainer): Move field from ...
4547 * class.cs (TypeContainer.PartialContainer): ... here.
4548 (TypeContainer.AddBasesForPart): New helper.
4549 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
4551 * cs-parser.jay (current_class): Convert to DeclSpace.
4552 (struct_declaration, interface_declaration, class_declaration):
4553 Use AddBasesForPart instead of .Bases directly.
4554 * const.cs, iterators.cs: Update to changes.
4556 2006-07-28 Raja R Harinath <rharinath@novell.com>
4558 * class.cs (TypeContainer.AddMemberType): Rename from
4560 (TypeContainer.AddMember): Rename from AddToMemberContainer.
4561 (AddTypeContainer): New. Combine AddClassOrStruct and
4563 (AddPartial): Update. Add 'is_partial' argument.
4564 * roottypes.cs: Update to changes.
4565 * cs-parser.jay (push_current_class): New helper for handling
4566 current_container and current_class.
4567 (struct_declaration, interface_declaration, class_declaration):
4570 2006-07-26 Raja R Harinath <rharinath@novell.com>
4572 * roottypes.cs: Rename from tree.cs.
4574 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
4575 * tree.cs (Tree, ITreeDump): Remove types.
4576 * rootcontext.cs (tree, Tree): Remove fields.
4577 (root, ToplevelTypes): New.
4578 * *.cs: Update to rename.
4580 * tree.cs (Tree.RecordDecl): Remove.
4581 (RootTypes.AddToTypeContainer): Record the toplevel type in its
4583 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
4585 2006-07-23 Raja R Harinath <harinath@gmail.com>
4587 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
4588 DoFlowAnalysis and OmitStructFlowAnalysis here.
4589 (ec.With): Rename from WithUnsafe and generalize.
4590 (ec.WithCheckState): Remove. All users can be handled by 'With'.
4591 (ec.WithFlowAnalyis): New.
4592 * ecore.cs, expression.cs, statement.cs: Update.
4594 2006-07-22 Raja R Harinath <harinath@gmail.com>
4596 * statement.cs (Block.ResolveMeta): Simplify slightly.
4598 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
4599 multiple boolean fields. Convert InUnsafe, constant_check_state,
4600 check_state to flags.
4601 (CheckState, ConstantCheckState): Update.
4602 (InUnsafe): New read-only property.
4603 (FlagsHandle): Rename from CheckStateHandle and convert to handle
4605 (WithUnsafe): New helper similar to WithCheckState.
4606 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
4607 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
4609 2006-07-21 Raja R Harinath <rharinath@novell.com>
4611 Make comparisons use the same IL irrespective of whether they're
4612 in a 'checked' or 'unchecked' context: one of the issues in #78899
4613 * codegen.cs (EmitContext.CheckState): Make read-only property.
4614 (EmitContext.ConstantCheckState): Likewise.
4615 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
4616 helper that implement a save/restore stack for CheckState
4617 values. This is the only way to change check-state.
4618 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
4619 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
4620 (CheckedExpr.EmitBranchable): New forwarding method.
4621 (UnCheckedExpr): Likewise.
4622 * statement.cs (Block.ResolveMeta): Use WithCheckState.
4623 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
4624 (Checked.Resolve, checked.DoEmit): Likewise.
4626 2006-07-20 Miguel de Icaza <miguel@novell.com>
4628 * anonymous.cs: Cache the resolved anonymous delegate, and return
4629 this so that the ResolveTopBlock is only triggered once, not
4632 Currently we trigger ResolvetopBlock twice due to a first pass of
4633 argument check compatibility, and a second pass that does the
4636 2006-07-15 Marek Safar <marek.safar@seznam.cz>
4638 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
4640 * rootcontext.cs (Reset): Add helper_classes.
4642 2006-07-15 Marek Safar <marek.safar@seznam.cz>
4645 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
4648 2006-07-13 Miguel de Icaza <miguel@novell.com>
4650 * statement.cs (Lock): Handle expressions of type
4651 TypeManager.null_type specially. Fixes #78770
4653 2006-07-08 Marek Safar <marek.safar@seznam.cz>
4655 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
4658 2006-07-08 Marek Safar <marek.safar@seznam.cz>
4660 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
4661 for accessors as well.
4662 * ecore.cs (EventExpr): Add AccessorTable.
4664 2006-07-01 Marek Safar <marek.safar@seznam.cz>
4667 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
4668 for CS0122 where appropriate.
4669 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
4671 (Filter): Assembly can be null in the case of top level attributes.
4673 2006-06-25 Marek Safar <marek.safar@seznam.cz>
4677 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
4678 is done at global level.
4680 2006-06-24 Marek Safar <marek.safar@seznam.cz>
4682 A fix for #77002, Implemented TypeForwarder support.
4684 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
4685 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
4686 * typemanager.cs (): Add type_forwarder_attr_type.
4688 2006-06-24 Marek Safar <marek.safar@seznam.cz>
4690 * report.cs: Add CS0469 warning.
4692 2006-06-21 Martin Baulig <martin@ximian.com>
4694 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
4695 the `try'-block, so we also report CS0016 etc. there.
4697 2006-06-21 Martin Baulig <martin@ximian.com>
4700 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
4702 2006-06-21 Martin Baulig <martin@ximian.com>
4704 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
4705 also report CS1686 for parameters.
4707 2006-06-21 Martin Baulig <martin@ximian.com>
4709 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
4710 instead of an error if the value is not implicitly convertible to
4711 the switch types; fixes #77964.
4713 2006-06-21 Raja R Harinath <rharinath@novell.com>
4716 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
4717 FieldBuilder is null.
4720 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
4721 'left' and 'right' before error-checking.
4723 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
4725 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
4727 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
4728 (FieldExpr.DoResolve): likewise.
4729 (PropertyExpr.InstanceResolve): likewise.
4730 (EventExpr.InstanceResolve): likewise.
4732 2006-06-04 Marek Safar <marek.safar@seznam.cz>
4734 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
4735 attribute applicable tests for attribute argument.
4737 2006-06-02 Raja R Harinath <rharinath@novell.com>
4740 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
4741 (Binary.OverloadResolve_PredefinedIntegral): New.
4742 (Binary.OverloadResolve_PredefinedFloating): New.
4743 (Binary.OverloadResolve_PredefinedString): New.
4744 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
4745 Follow the standard more closely, and treat numeric promotions in
4746 terms of overload resolution.
4747 (Binary.CheckShiftArguments): Simplify.
4749 2006-06-01 Raja R Harinath <rharinath@novell.com>
4751 * flowanalysis.cs (MyBitVector): Simplify representation.
4752 (MyBitVector.Clone): Avoid allocating BitArray.
4753 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
4754 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
4755 (*): Update. Change all references to MyBitVector.And and
4756 MyBitVector.Or to &= and |=.
4758 2006-05-29 Raja R Harinath <rharinath@novell.com>
4761 * cs-parser.jay (formal_parameter_list): Extend the pattern below
4762 to param arguments too.
4764 2006-05-26 Miguel de Icaza <miguel@novell.com>
4766 * cs-parser.jay: Catch another parsing form for arglist being
4767 followed by other arguments. Fixes #78313.
4769 2006-05-24 Raja R Harinath <rharinath@novell.com>
4771 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
4772 checking of out parameters to ...
4773 (FlowBranchingToplevel.Merge): ... here.
4774 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
4775 set, propagate the origin upward, and only complain if there was
4777 (FlowBranchingException.AddContinueOrigin): Likewise.
4778 (FlowBranchingException.AddReturnOrigin): Likewise.
4779 (FlowBranchingException.AddGotoOrigin): Likewise.
4781 2006-05-23 Raja R Harinath <rharinath@novell.com>
4783 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
4784 unreachable, skip it.
4785 (FlowBranchingException.Merge): Always propagate jumps, even if
4786 the finally block renders subsequent code unreachable.
4788 2006-05-18 Raja R Harinath <rharinath@novell.com>
4791 * statement.cs (Goto.Resolve): Move responsibility for resolving
4792 'goto' to FlowBranching.AddGotoOrigin.
4793 (Goto.SetResolvedTarget): New. Callback to set the
4794 LabeledStatement that's the target of the goto.
4795 (Goto.DoEmit): Use Leave instead of Br when crossing an
4796 unwind-protect boundary.
4797 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
4798 LookupLabel and adjust to new semantics.
4799 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
4800 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
4801 Goto.SetResolvedTarget to update target.
4802 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
4803 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
4804 AddBreakOrigin & co. Delay propagation until ...
4805 (FlowBranchingException.Merge): ... this.
4807 * statement.cs (Block.Resolve): Always depend on flow-branching to
4808 determine unreachability. Kill workaround that originally emitted
4809 only one statement after an "unreachable" label (see infloop in
4812 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
4813 This is still "wrong", but anything better would probably need a
4814 multi-pass algorithm.
4815 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
4816 usage vector. Force current usage vector to be reachable, to
4817 optimistically signify backward jumps.
4818 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
4820 (FlowBranchingLabeled.Merge): New. If no backward jump was
4821 detected, return the original salted-away usage vector instead,
4822 updated with appropriate changes. Print unreachable warning if
4824 * statement.cs (Block.Resolve): Don't print unreachable warning on
4825 a labeled statement.
4827 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
4829 * driver.cs: Pass filename without path to AssemblyBuilder's
4830 AddResourceFile. Fixes bug #78407.
4832 2006-05-17 Raja R Harinath <rharinath@novell.com>
4834 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
4835 * flowanalysis.cs (FlowBranchingLabeled): ... here.
4836 (FlowBranching.MergeChild): Overwrite
4837 reachability information from Labeled branchings too.
4839 2006-05-16 Raja R Harinath <rharinath@novell.com>
4841 * statement.cs (Goto.Resolve): Merge jump origins here ...
4842 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
4844 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
4845 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
4846 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
4847 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
4849 * statement.cs (Goto.Resolve): ... not here.
4850 (Goto.Emit): Remove CS1632 check.
4852 2006-05-14 Marek Safar <marek.safar@seznam.cz>
4854 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
4857 2006-05-11 Raja R Harinath <rharinath@novell.com>
4859 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
4860 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
4861 (FlowBranchingException.Label): Likewise.
4863 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
4865 (MyBitVector.Or): Use it to avoid losing information (Count).
4866 (FlowBranching.MergeOrigins): Likewise.
4868 * flowanalysis.cs (UsageVector.IsDirty): Remove.
4869 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
4870 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
4871 (UsageVector.ToString): Simplify.
4872 (UsageVector.MergeSiblings): Move here from ...
4873 (FlowBranching.Merge): ... here.
4874 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
4877 2006-05-10 Raja R Harinath <rharinath@novell.com>
4879 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
4880 null bitvector is treated as all-true.
4882 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
4883 (MyBitVector): Rationalize invariants. 'vector != null' implies
4884 that we have our own copy of the bitvector. Otherwise,
4885 'InheritsFrom == null' implies all inherited bits are true.
4887 2006-05-09 Marek Safar <marek.safar@seznam.cz>
4889 * statement.cs (LocalInfo): Add IsConstant.
4890 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
4891 local variable for constants.
4893 2006-05-09 Raja R Harinath <rharinath@novell.com>
4895 * flowanalysis.cs (MyBitVector.Empty): New.
4896 (MyBitVector): Don't allow InheritedFrom to be null.
4897 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
4898 (UsageVector, FlowBranching): Update to changes.
4900 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
4901 recursion. The 'Parent == null' condition isn't sufficient for
4903 (FlowBranching.AddBreakOrigin): Likewise.
4904 (FlowBranching.AddContinueOrigin): Likewise.
4905 (FlowBranching.AddReturnOrigin): Likewise.
4906 (FlowBranching.StealFinallyClauses): Likewise.
4907 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
4908 (FlowBranching.CheckOutParameters): Likewise.
4909 (FlowBranchingToplevel): Terminate all the above recursions here.
4910 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
4911 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
4913 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
4915 (FlowBranchingToplevel): New. Empty for now.
4916 (FlowBranching.MergeTopBlock): Update.
4917 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
4918 branching for the anonymous delegate.
4919 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
4921 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
4922 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
4923 information at the start of the merge. Reorganize.
4925 2006-05-07 Marek Safar <marek.safar@seznam.cz>
4927 * class.cs (MethodData.Define): Method cannot implement interface accessor.
4929 2006-05-07 Marek Safar <marek.safar@seznam.cz>
4931 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
4932 to newly introduced ctor.
4934 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
4935 message to one place.
4936 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
4939 2006-05-07 Marek Safar <marek.safar@seznam.cz>
4941 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
4943 * ecore.cs (Expression.ResolveAsConstant): Updated.
4945 * statement.cs (ResolveMeta): Updated.
4947 2006-05-06 Marek Safar <marek.safar@seznam.cz>
4949 * cs-parser.jay: __arglist cannot be used in initializer.
4951 2006-05-06 Marek Safar <marek.safar@seznam.cz>
4954 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
4957 2006-05-05 Raja R Harinath <rharinath@novell.com>
4959 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
4960 (LabeledStatement): Add 'name' parameter.
4961 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
4962 (Block.AddLabel): Update to changes.
4963 * cs-parser.jay (labeled_statement): Likewise.
4965 * flowanalysis.cs (BranchingType.Labeled): New.
4966 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
4967 (FlowBranchingLabeled): New. Does nothing for now, but will
4968 eventually handle 'goto' flows.
4969 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
4970 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
4971 that's terminated ...
4972 (Block.Resolve): ... here.
4974 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
4975 (UsageVector.MergeFinallyOrigins): Likewise.
4976 (FlowBranching.InTryOrCatch): Likewise.
4977 (FlowBranching.AddFinallyVector): Likewise.
4978 (FlowBranchingException): Update to changes.
4981 * statement.cs (Return.Resolve): Move error checking to ...
4982 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
4983 (FlowBranchingException): Handle return origins like break and
4985 (FlowBranching.UsageVector.CheckOutParameters): Remove.
4987 2006-05-04 Marek Safar <marek.safar@seznam.cz>
4990 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
4993 2006-05-04 Marek Safar <marek.safar@seznam.cz>
4996 * class.cs (MethodData.Define): Do public accessor check only when method
4997 implements an interface.
4999 2006-05-04 Raja R Harinath <rharinath@novell.com>
5001 Remove special handling of 'break'
5002 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
5003 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
5004 (UsageVector.Break): Remove.
5005 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
5007 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
5009 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
5010 UsageVector.Breaks (). Don't set NeedsReturnLabel.
5012 2006-05-03 Marek Safar <marek.safar@seznam.cz>
5015 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
5016 be the interface member.
5018 2006-05-03 Marek Safar <marek.safar@seznam.cz>
5021 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
5022 for emitting small (int) values.
5024 2006-05-03 Raja R Harinath <rharinath@novell.com>
5027 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
5028 control-flow passes through the 'finally' after merging-in all the
5029 control-flows from 'try' and the 'catch' clauses.
5031 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
5032 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
5033 always true at the only non-recursive entry point.
5034 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
5035 FlowBranchingBreakable.
5036 (FlowBranchingLoop): Remove.
5037 * statement.cs (Return.DoResolve): Update to changes.
5040 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
5041 (FlowBranching.CreateBranching): Handle it: create a
5042 FlowBranchingContinuable.
5043 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
5044 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
5045 except that it handles the 'continue' command.
5046 (FlowBranching.UsageVector.MergeOrigins): Rename from
5048 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
5049 except that it overrides AddContinueOrigin.
5050 (FlowBranchingException): Override AddContinueOrigin, similar to
5052 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
5053 Create a new branching around the embedded statement.
5054 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
5055 control flow after the embedded statement.
5056 (Continue.Resolve): Move all error checking to AddContinueOrigin.
5058 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
5059 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
5060 FlowBranchingBreakable.
5061 (FlowBranchingSwitch): Remove.
5064 * statement.cs (Break.Resolve): Simplify. Move responsibility for
5065 error reporting to ...
5066 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
5067 Rename from 'AddBreakVector'. Add new location argument. Return
5068 a bool indicating whether the 'break' crosses an unwind-protect.
5069 (FlowBranchingException.AddBreakOrigin): Add.
5070 (FlowBranchingException.Merge): Propagate 'break's to surrounding
5071 flowbranching after updating with the effects of the 'finally'
5073 (FlowBranchingBreakable): New common base class for
5074 FlowBranchingLoop and FlowBranchingSwitch.
5076 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
5078 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
5080 2006-05-02 Raja R Harinath <rharinath@novell.com>
5082 * statement.cs (Do.Resolve): If the loop is infinite, set the
5084 (While.Resolve, For.Resolve): Set a barrier after the embedded
5085 statement. There's no direct control flow that goes from the end
5086 of the embedded statement to the end of the loop.
5087 * flowanalysis.cs (FlowBranching.Infinite): Remove.
5088 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
5089 above ensure that the reachability is correctly computed.
5091 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
5092 (UsageVector.MergeBreakOrigins): If the current path is
5093 unreachable, treat it as if all parameters/locals are initialized.
5094 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
5095 infinite loops before merging-in break origins.
5097 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
5098 (Reachability.Reachable): Split part into ...
5099 (Reachability.Unreachable): ... this. Simplify.
5100 (Reachability.IsUnreachable): Use 'Unreachable' instead.
5102 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
5103 (Reachability.SetThrowsSometimes): Likewise.
5104 (FlowBranchingBlock.MergeTopBlock): Don't compare against
5105 TriState.Always, use corresponding property.
5106 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
5107 (Block.Resolve): Likewise. Remove some redundant checks.
5109 2006-05-02 Raja R Harinath <harinath@gmail.com>
5111 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
5112 (Reachability.Meet): Don't bother checking AlwaysThrows --
5113 barrier is always set.
5114 (FlowBranchingBlock.Merge): Likewise.
5116 2006-05-01 Raja R Harinath <harinath@gmail.com>
5118 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
5119 checks for unreachable.
5121 2006-05-01 Marek Safar <marek.safar@seznam.cz>
5124 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
5126 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
5127 whether field is really assigned.
5129 2006-04-30 Raja R Harinath <harinath@gmail.com>
5131 * flowanalysis.cs (Reachability): Make 4-argument constructor
5133 (Reachability.Meet): Rename from 'And'. Remove static variant.
5134 (Reachability.Always): Rename from the highly misleading
5135 'Reachability.Never'.
5136 (FlowBranching.Merge): Update to changes. Mark an impossible
5137 situation with a 'throw'.
5138 (*): Update to changes.
5140 2006-04-29 Raja R Harinath <harinath@gmail.com>
5142 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
5144 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
5145 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
5146 (*): Update to changes.
5147 * statement.cs: Update to changes.
5149 2006-04-28 Marek Safar <marek.safar@seznam.cz>
5152 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
5154 2006-04-28 Raja R Harinath <harinath@gmail.com>
5156 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
5159 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
5160 argument to two arguments: an usage-vector and a bool. Move call
5161 to FlowBranching.Merge () ...
5162 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
5164 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
5165 handling of loop and switch reachability to ...
5166 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
5168 2006-04-27 Raja R Harinath <harinath@gmail.com>
5170 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
5171 handling to FlowBranchingLoop.InLoop.
5172 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
5174 2006-04-26 Marek Safar <marek.safar@seznam.cz>
5177 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
5178 anonymous method is allowed from AnonymousContainer here.
5180 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
5182 2006-04-24 Raja R Harinath <rharinath@novell.com>
5185 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
5187 2006-04-23 Marek Safar <marek.safar@seznam.cz>
5190 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
5191 (DoubleConstant.Reduce): Ditto.
5193 2006-04-23 Raja R Harinath <rharinath@novell.com>
5195 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
5196 Remove 'lvalue_right_side' argument. Move parts to ...
5197 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
5198 (LocalVariable.DoResolveLValue): ... these.
5200 2006-04-21 Raja R Harinath <rharinath@novell.com>
5203 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
5204 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
5205 (LocalVariableReference.DoResolveBase): Use it to implement new
5207 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
5208 (Argument.Resolve): Simplify. Move CS1510 check ...
5209 * ecore.cs (Expression.ResolveLValue): ... here.
5210 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
5211 (PropertyExpr.DoResolveLValue): Likewise.
5212 (FieldExpr.Report_AssignToReadonly): Likewise.
5213 (FieldExpr.DoResolve): Add 'out_access' argument. Use
5214 LValueMemberAccess or LValueMemberOutAccess on instance depending
5216 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
5217 DoResolve as appropriate.
5219 2006-04-20 Raja R Harinath <rharinath@novell.com>
5222 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
5223 implicit conversions on 'out' and 'ref' arguments.
5225 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
5226 improve clarity. Remove dead code.
5229 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
5230 (Catch.Resolve): Resolve VarBlock if it exists.
5232 2006-04-19 Miguel de Icaza <miguel@novell.com>
5234 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
5235 twice, this was some residual code, the enumerator was emitted
5236 properly in the two branche of if later.
5238 2006-04-19 Raja R Harinath <rharinath@novell.com>
5240 * expression.cs (Cast.ResolveLValue): Remove. The result of a
5241 cast is never an lvalue.
5242 (Cast.DoResolve, Cast.ResolveRest): Combine.
5243 (Argument.Emit): Simplify slightly. Move 'Expr is
5244 IMemoryLocation' check ...
5245 (Argument.Resolve): ... here.
5246 (Argument.Error_LValueRequired): Remove. Inline into only user.
5248 Simplifications. Fix cs0191-2.cs
5249 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
5250 CS1649 and CS1651 to ...
5251 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
5252 the actual selection of the error code and message to a lookup
5253 table. Add a dummy return value to simplify callsites.
5254 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
5255 readonly fields of other instances of the same type. Move CS0197
5257 * expression.cs (Argument.Resolve): ... here. Simplify code.
5258 Ensure that ec.InRefOutArgumentResolving is only set during LValue
5259 resolution of an out or ref argument. The code simplification
5260 above uses this invariant.
5262 2006-04-18 Raja R Harinath <rharinath@novell.com>
5264 Possibly fix #77752. Fix cs1690-[4-7].cs.
5265 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
5266 CheckMarshallByRefAccess. Drop parameter.
5267 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
5269 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
5271 * report.cs (AllWarnings): Add CS1690.
5272 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
5274 (LocalVariableReference.DoResolveBase): Update.
5276 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5278 * class.cs (MethodOrOperator): Moved common parts from method class.
5279 detect obsolete attributes.
5280 (Method.Define): Simplified as it reuses code from base.
5281 (Constructor.ValidAttributeTargets): Fixed issue found during
5283 (Destructor.ValidAttributeTargets): Fixed issue found during
5285 (Operator): Finished refactoring set off by #78020. Operator class is now
5286 ordinary method class.
5288 * anonymous.cs: Updated.
5290 * decl.cs (DeclSpace): Add IsGeneric
5292 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5294 * class.cs (Constructor.Emit): Don't emit the attributes twice.
5296 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5298 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
5299 detect obsolete attributes.
5300 (Method.CreateEmitContext): Moved to MethodOrOperator.
5302 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5305 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
5306 customized exception to make crash detection easier.
5307 (MethodOrOperator): Started to work on new base class for methods and
5309 (Method): Derives from MethodOrOperator.
5310 (Constructor.Emit): Emits its own attributes.
5311 (AbstractPropertyEventMethod.Emit): Ditto.
5312 (Operator): Derives from MethodOrOperator, will refactor fully in extra
5314 (Operator.Emit): It's temporary more tricky than should be.
5316 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
5318 * report.cs (InternalErrorException): Add ctor with inner exception.
5320 2006-04-08 Marek Safar <marek.safar@seznam.cz>
5323 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
5326 2006-04-07 Marek Safar <marek.safar@seznam.cz>
5329 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
5332 2006-04-06 Marek Safar <marek.safar@seznam.cz>
5334 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
5335 attribute is present and Guid not.
5336 (Interface.ApplyAttributeBuilder): Ditto.
5338 * attribute.cs: Add error message.
5340 2006-04-06 Marek Safar <marek.safar@seznam.cz>
5344 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
5345 sources (it's composite) so hold them in extra array as they are used in
5346 Emit phase only. It worked in the previous versions by mistake.
5347 (Attribute.Emit): Emit attribute for more owners when exist.
5349 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
5350 it has now different behaviour.
5352 2006-04-04 Marek Safar <marek.safar@seznam.cz>
5354 * constant.cs (Constant.IsDefaultInitializer): New method.
5356 * class.cs: Updated.
5358 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
5359 re-initialize default values. It saves KBs almost for every assembly.
5360 Thanks Zoltan for the idea.
5361 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
5362 (ArrayCreation.DoResolve): Resolve only once.
5363 (ArrayCreation.Emit): Emit static initializer only when it is faster.
5364 (ArrayCreation.GetAttributableValue): Cope with optimized values.
5366 2006-04-03 Zoltan Varga <vargaz@gmail.com>
5368 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
5371 2006-04-01 Marek Safar <marek.safar@seznam.cz>
5373 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
5374 in an embedded statement too.
5376 2006-04-01 Raja R Harinath <rharinath@novell.com>
5379 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
5381 2006-04-01 Marek Safar <marek.safar@seznam.cz>
5385 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
5388 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
5390 2006-03-31 Marek Safar <marek.safar@seznam.cz>
5392 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
5395 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
5396 LocalTemporary change.
5398 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
5400 (ClassOrStruct.DefineFieldInitializers): Implemented static field
5401 initializers optimization.
5402 (ClassOrStruct.TypeAttr): Moved from modifiers.
5403 (Constructor.CheckBase): Don't crash when static ctor has parameters.
5404 (FieldBase.ResolveInitializer): Resolves initializer.
5405 (FieldBase.HasDefaultInitializer): New property.
5407 * cs-parser.jay: Removed message.
5409 * expression.cs (CompilerGeneratedThis): New specialization.
5411 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
5413 2006-03-28 Marek Safar <marek.safar@seznam.cz>
5415 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
5417 2006-03-27 Marek Safar <marek.safar@seznam.cz>
5419 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
5420 be now EnumConstants only.
5422 2006-03-27 Marek Safar <marek.safar@seznam.cz>
5424 * attribute.cs, driver.cs: Reset more caches.
5426 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5428 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
5430 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5432 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
5433 for easier reuse. Updated all overrides.
5434 (IntegralConstant): New base class for all integral constants.
5435 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
5436 of the constant range, report custom error.
5437 (UIntConstant.Reduce): Fixed uint conversion.
5439 * ecore.cs, literal.cs: Reduce updates.
5441 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5445 * class.cs (Constructor.Define): Removed extra if for default ctors.
5446 A patch from Atsushi Enomoto.
5448 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5450 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
5451 GetAttributableValue.
5453 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
5456 * convert.cs (ImplicitConversionRequired): Error message moved to
5459 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
5460 automatic implicit conversion of an output value.
5461 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
5463 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
5465 (TypeOf.GetAttributableValue): Add extra handling for object type.
5467 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
5468 special error message.
5470 2006-03-25 Marek Safar <marek.safar@seznam.cz>
5472 * class.cs (Constructor.Emit): Don't crash when struct ctor is
5474 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
5475 compatible with MS runtime.
5477 2006-03-23 Marek Safar <marek.safar@seznam.cz>
5479 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
5480 attribute arguments here.
5482 * class.cs (Indexer.Define): The check was moved to attribute class.
5484 2006-03-22 Marek Safar <marek.safar@seznam.cz>
5486 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
5487 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
5490 2006-03-22 Raja R Harinath <rharinath@novell.com>
5492 Support ParameterDefaultValueAttribute in gmcs. Also applied to
5493 mcs to keep code differences small.
5494 * attribute.cs (Attribute.GetParameterDefaultValue): New.
5495 * typemanager.cs (parameter_default_value_attribute_type): New.
5496 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
5499 2006-03-21 Marek Safar <marek.safar@seznam.cz>
5501 * expression.cs (StringConcat.Append): Reverted back to no warning state.
5503 2006-03-21 Marek Safar <marek.safar@seznam.cz>
5505 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
5507 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
5510 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
5512 * doc-bootstrap.cs : fix build.
5514 2006-03-20 Marek Safar <marek.safar@seznam.cz>
5516 * expression.cs (StringConcat.Append): Issue a warning when empty string
5519 2006-03-20 Marek Safar <marek.safar@seznam.cz>
5521 * assign.cs (CompoundAssign.ResolveSource): Removed.
5523 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
5526 * class.cs (TypeContainer.FindMethods): Removed.
5527 (TypeContainer.CheckMemberUsage): Made static.
5529 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
5531 * constant.cs (CheckRange): Removed unused type argument.
5532 (CheckUnsigned): Removed unused type argument.
5534 * cs-parser.jay: Updated after MemberAccess clean up.
5535 Uses Length for empty string test.
5537 * cs-tokenizer.cs: Uses Length for empty string test.
5538 (IsCastToken): Made static.
5539 (is_hex): Made static.
5540 (real_type_suffix): Made static.
5542 * decl.cs (SetupCache): Made static.
5543 (OnGenerateDocComment): Removed unused ds argument.
5545 * delegate.cs (VerifyDelegate): Removed unused argument.
5547 * doc.cs: Uses Length for empty string test.
5549 * driver.cs: Uses Length for empty string test.
5551 * enum.cs (IsValidEnumType): Made static
5553 * expression.cs (EnumLiftUp): Removed unused argument.
5554 (ResolveMethodGroup): Ditto.
5555 (BetterConversion): Ditto.
5556 (GetVarargsTypes): Ditto.
5557 (UpdateIndices): Ditto.
5558 (ValidateInitializers): Ditto.
5559 (MemberAccess.ctor): Ditto.
5560 (GetIndexersForType): Ditto.
5562 * flowanalysis.cs: (MergeFinally): Removed unused argument.
5564 * iterators.cs: Updated after MemberAccess clean up.
5566 * location.cs: Uses Length for empty string test.
5568 * namespace.cs: Uses Length for empty string test.
5570 * report.cs (CheckWarningCode): Made static.
5572 * statement.cs (LabeledStatement): Removed unused argument.
5574 * typemanager.cs (FilterNone): Removed.
5576 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5578 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
5581 * class.cs: Updated.
5583 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5585 * cs-parser.jay.cs: __arglist is not allowed for delegates.
5587 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5591 * expression.cs (VerifyArgumentsCompat): Reverted to double error
5592 reporting, it's more tricky than I thought.
5594 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5598 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
5600 (AnonymousMethod.ImplicitStandardConversionExists): New method.
5601 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
5602 Add more error reporting; Fixed issue with params.
5604 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
5606 * cs-parser.jay: AnonymousMethod requires host container.
5608 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
5610 2006-03-18 Raja R Harinath <harinath@gmail.com>
5612 * class.cs: Change 'TypeContainer ds' constructor argument to
5613 'DeclSpace parent'. Some classes were missed below due to
5614 different naming convention.
5616 * class.cs (MemberCore.Parent): Delete. This makes the
5617 ParentContainer changes below enforceable by the compiler.
5619 Treat pointers to enclosing declaration space as 'DeclSpace', not
5621 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
5622 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
5624 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
5626 (Block.AddThisVariable): Likewise.
5627 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
5628 (AbstractPropertyEventMethod.Emit): Likewise.
5629 (AbstractPropertyEventMethod.EmitMethod): Likewise.
5630 (GetMethod.Define, SetMethod.Define): Likewise.
5631 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
5632 (DelegateMethod.EmitMethod): Likewise.
5634 Fix regression test-partial-13.cs.
5635 Rationalize use of PartialContainer. Ensure that the partial
5636 class semantics can be tied to type-correctness, i.e., any
5637 violation will cause a compile error.
5638 * class.cs, const.cs: Access all fields that belong to class
5639 TypeContainer via ParentContainer. Arguments of EmitContexts and
5640 Resolve()-like functions still use 'Parent'.
5642 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
5643 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
5644 (PropertyMethod.CheckModifiers): Remove unused argument.
5645 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
5648 2006-03-17 Raja R Harinath <harinath@gmail.com>
5650 Make semantics of PartialContainer simpler.
5651 * decl.cs (DeclSpace.IsPartial): Remove.
5652 * class.cs (TypeContainer.IsPartial): Likewise.
5653 (TypeContainer..ctor): Set PartialContainer to point to self.
5654 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
5655 (TypeContainer.FindNestedType): Likewise.
5656 (MemberCore.ParentContainer): Simplify. Remove deprecation.
5658 2006-03-17 Marek Safar <marek.safar@seznam.cz>
5660 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
5662 2006-03-15 Marek Safar <marek.safar@seznam.cz>
5664 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
5667 2006-03-15 Marek Safar <marek.safar@seznam.cz>
5669 * class.cs (Operator.Define): An error for base conversion was not
5672 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
5674 * iterator.cs : yield break is allowed in try statement which has
5675 catch clauses. Fixed bug #77767.
5677 2006-03-13 Marek Safar <marek.safar@seznam.cz>
5679 A fix for #77593, #77574.
5681 * class.cs (MethodCore.CheckBase): Another if for operator.
5683 2006-03-09 Marek Safar <marek.safar@seznam.cz>
5685 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
5688 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
5689 (DelegateCreation.ImplicitStandardConversionExists): New method for just
5692 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
5695 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
5696 Updated after another emitcontext usage was clean up. It should help us to
5697 synchronize with gmcs easier.
5699 2006-03-04 Marek Safar <marek.safar@seznam.cz>
5703 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
5704 (Event.Define): ditto
5705 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
5707 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
5708 Removed redundant code and set NewSlot for Invoke method too.
5710 * parameter.cs (Parameters.ctor): Add custom, type ctor.
5711 (Parameters.MergeGenerated): New method. Use this method when you merge
5712 compiler generated argument with user arguments.
5714 2006-03-03 Marek Safar <marek.safar@seznam.cz>
5716 * attribute.cs (ResolveAsTypeTerminal): Removed.
5718 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
5719 specialization for predefined types; 30% speed up.
5720 Finally placed obsolete check to right place.
5721 (Expression.ResolveType): Removed.
5723 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
5724 Updated after ResolveType was removed.
5726 * expression.cs (Cast.ctor): Check void cast.
5727 (Binary.ResolveAsTypeTerminal): Is never type.
5728 (Conditional.ResolveAsTypeTerminal): Is never type.
5730 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
5732 2006-03-01 Raja R Harinath <rharinath@novell.com>
5735 * expression.cs (ParameterReference.DoResolveBase): Change return
5737 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
5741 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
5744 * typemanager.cs (GetFullNameSignature): Don't nullref on
5745 protected accessors.
5747 2006-02-27 Marek Safar <marek.safar@seznam.cz>
5749 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
5750 these two separated members to simplify the code.
5751 (Attribute.Resolve): Refactored to use new fields and methods.
5752 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
5753 implemented obsolete attribute checking.
5754 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
5755 implemented obsolete checking again. It look line never ending quest ;-)
5756 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
5758 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
5760 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
5762 *class.cs (Property.Define): Add RegisterProperty call.
5764 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
5765 argument groups (only 2).
5767 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
5768 encoding expression to arguments.
5769 (Expression.ExprClassToResolveFlags): Just turned to property.
5771 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
5772 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
5773 optimized as well as implemented support for zero-length attributes.
5775 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
5776 Add caching of PropertyInfo's.
5778 2006-02-25 Marek Safar <marek.safar@seznam.cz>
5780 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
5781 error multiple times.
5783 2006-02-25 Marek Safar <marek.safar@seznam.cz>
5785 New partial class implementation.
5786 A fix for #77027, #77029, #77403
5788 * attribute.cs (Attributable): Made attributes protected.
5790 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
5791 the replacements of ClassPart and PartialContainer.
5792 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
5793 (TypeContainer.AddInterface): Ditto.
5794 (TypeContainer.AddPartial): The main method for partial classes. It checks
5795 for errors and merges ModFlags and attributes. At the end class is added to
5797 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
5799 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
5800 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
5801 from the rest of partial classes.
5802 (TypeContainer.GetClassBases): Simplified.
5803 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
5805 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
5806 (TypeContainer.HasExplicitLayout): Uses Flags now.
5807 (PartialContainer): Removed.
5808 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
5809 (StaticClass): Was merged with Class.
5810 (Class.GetClassBases): class and static class bases are verified here.
5811 (Class.TypeAttr): Added static attributes when class is static.
5812 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
5813 (MemberBase): In some cases we need to call parent container for partial
5814 class. It should be eliminated but it's not easy now.
5816 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
5818 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
5819 partial classed to accumulate class comments.
5820 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
5822 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
5824 * driver.cs (MainDriver): Tree.GetDecl was removed.
5826 * modifiers.cs (Modifiers): Add partial modifier.
5828 * tree.cs (Tree.decl): Removed.
5829 (RootTypes): Started to use this class more often for root types
5832 2006-02-22 Marek Safar <marek.safar@seznam.cz>
5836 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
5837 external interface does not have an attribute.
5839 2006-02-22 Marek Safar <marek.safar@seznam.cz>
5841 Another prerequisites for new partial classs implementation.
5843 * attribute.cs (Attribute.Equal): Implemented.
5844 (Attribute.Emit): Changed as attributes can be applied more than twice.
5845 (Attributes.Emit): Check for duplicate attributes here.
5847 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
5848 as a parameter, clean-up.
5850 2006-02-11 Marek Safar <marek.safar@seznam.cz>
5854 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
5855 contains obsolete attribute check which can in some cases look for base
5856 type of current class which is not initialized yet.
5857 (TypeContainer.BaseType): Replacement of ptype.
5859 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
5861 2006-02-11 Marek Safar <marek.safar@seznam.cz>
5863 First of prerequisites for new partial classs implemention.
5865 * attribute.cs (Attributable): Extended by ResolveContext;
5866 Attributes finally have correct context for resolving in all cases.
5867 (AttachTo): Attribute owner is assigned here.
5869 * codegen.cs (IResolveContext): Introduce new interface to hold
5870 all information needed in resolving phase.
5871 (EmitContext): Implements IResolveContext; more clean-up needed here.
5873 * decl.cs (MemberCore): Implemented IResolveContext.
5875 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
5876 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
5877 parameter.cs, statement.cs, tree.cs, typemanager.cs:
5878 Refactored to use new IResolveContext instead of EmitContext; cleanup
5880 2006-02-06 Miguel de Icaza <miguel@novell.com>
5882 * codegen.cs (EmitScopeInitFromBlock): check here the
5883 capture_context, there is no need to make two calls to the
5886 * anonymous.cs: Add some debugging messages that might help me
5887 track other instances of this problem in the future (the
5888 regression of test 467).
5890 * cs-parser.jay: track the variable block, as we need to initalize
5891 any captured variables declared in this block for the "catch"
5892 portion of the "Try" statement.
5894 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
5895 scope initialization for captured variables.
5897 Also, move the emit for the variables after the block location has
5900 2006-02-06 Marek Safar <marek.safar@seznam.cz>
5902 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
5904 2006-02-02 Miguel de Icaza <miguel@novell.com>
5906 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
5907 commit yesterday, the initialization for the roots is necessary.
5908 What is not necessary is the scope activation.
5910 2006-02-02 Raja R Harinath <rharinath@novell.com>
5912 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
5913 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
5915 (Argument.Resolve): Remove CS0206 checks.
5917 2006-02-01 Miguel de Icaza <miguel@novell.com>
5919 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
5920 scopes for all the roots, the scopes will now be emitted when the
5921 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
5923 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
5924 code. This reduces a lot of existing cruft.
5926 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
5927 that the ScopeInfo is generated as we enter the scope, not at the
5928 time of use, which is what we used to do before.
5930 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
5931 every time a Block is about to be emitted if we have a
5934 2006-02-01 Raja R Harinath <rharinath@novell.com>
5936 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
5938 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
5940 * typemanager.cs (cons_param_array_attribute): Make private.
5941 (Reset): Set it to null.
5942 (InitCoreHelpers): Don't initialize it.
5943 (ConsParamArrayAttribute): New. Initialize it as needed.
5944 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
5946 2006-01-31 Miguel de Icaza <miguel@novell.com>
5948 * expression.cs: There might be errors reported during the
5949 selection of applicable methods. If there are errors, do not
5950 continue execution as it will lead the compiler to crash.
5952 2006-01-30 Miguel de Icaza <miguel@novell.com>
5954 * expression.cs: Member access is not allowed on anonymous
5955 methods. Fixes #77402.
5957 2006-01-30 Raja R Harinath <rharinath@novell.com>
5960 * cs-parser.jay (VariableDeclaration): Don't set
5961 current_array_type to null.
5962 (field_declaration, event_declaration, declaration_statement):
5963 Set it to null here.
5965 2006-01-28 Raja R Harinath <harinath@gmail.com>
5967 * typemanager.cs (GenericParameterPosition): New.
5970 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
5972 * doc.cs : To process "include" elements, first we should create
5973 another list than XmlNodeList, because it could result in node
5974 removal, which could result in that the XmlNodeList gives up
5977 (Also made code identical to gmcs again.)
5979 2006-01-25 Miguel de Icaza <miguel@novell.com>
5981 * ecore.cs: Introduce an error report that we were not catching
5982 before, if not silent, we must report the error. Gonzalo ran into
5985 2006-01-23 Miguel de Icaza <miguel@novell.com>
5987 A fix for bug: #76957
5989 * iterators.cs (MoveNextMethod.CreateMethodHost): call
5990 ComputeMethodHost before creating the method, this is a new
5993 * anonymous.cs (AnonymousContainer): Now we track all the scopes
5994 that this method references (RegisterScope). The actual scope
5995 where the method is hosted is computed with the ComputeMethodHost
5996 before we create the method.
5998 Moved the Deepest routine here.
6000 (AnonymousContainer.ComputeMethodHost): New routine used to
6001 compute the proper ScopeInfo that will host the anonymous method.
6003 (ScopeInfo): Deal with multiple roots. The problem was that we
6004 did not have a unique root where all ScopeInfos could be hanged
6005 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
6008 Remove AdjustMethodScope which is now computed at the end. Remove
6009 LinkScope which did a partial link, instead link all ScopeInfos
6010 before code generation from the new "LinkScopes" routine.
6012 Simplify all the Add* routines as they no longer need to maintain
6013 the tree, they just need to record that they are using variables
6016 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
6017 routines to produce the forest of ScopeInfo trees.
6019 * class.cs (TypeContainer.AppendMethod): This is just like
6020 AddMethod, but ensures that an interface implementation method
6021 (IEnumerable.XXX) is not inserted at the beginning of the queue of
6022 methods, but at the end.
6024 We use this functionality to ensure that the generated MoveNext
6025 method in the iterator class is resolved/emitted before the
6026 enumerator methods created.
6028 This is required because the MoveNext method computes the right
6029 ScopeInfo for the method. And the other methods will eventually
6030 need to resolve and fetch information computed from the anonymous
6033 2006-01-21 Raja R Harinath <harinath@gmail.com>
6034 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6037 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
6039 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
6040 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
6042 2006-01-18 Raja R Harinath <rharinath@novell.com>
6044 Fix #76656, cs0231-2.cs.
6045 * cs-parser.jay (formal_parameter_list): Make error case catch
6047 (parenthesized_expression_0): Add CS1026 check.
6048 (invocation_expression): Remove unused { $$ = lexer.Location }.
6050 2006-01-17 Raja R Harinath <rharinath@novell.com>
6053 * cs-parser.jay (statement_expression): Don't list out the
6054 individual statement-expressions. Convert syntax error into
6057 2006-01-16 Raja R Harinath <rharinath@novell.com>
6060 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
6061 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
6062 CheckIntermediateModification.
6063 (FieldExpr.DoResolve): Add new two-argument version that
6064 allows us to resolve the InstanceExpression as an lvalue.
6065 The one-argument variant is now just a wrapper.
6066 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
6067 Resolve the lhs as an lvalue if the it has a value type.
6068 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
6069 from Assign.DoResolve.
6070 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
6071 resolved as an lvalue.
6072 (PropertyExpr.DoResolve): Update.
6073 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
6074 has a value type. Move CS1612 check here from
6075 CheckIntermediateModification.
6076 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
6077 * expression.cs (EmptyExpression.OutAccess): New. Used as the
6078 'right_side' of a ResolveLValue on an 'out' argument.
6079 (EmptyExpression.LValueMemberAccess): New. Used as the
6080 'right_side' of a propagated ResolveLValue on a value type.
6081 (LocalVariableReference.DoResolveBase): Recognize
6082 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
6084 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
6085 EmptyExpression.Null.
6087 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
6089 * typemanager.cs : added IsGenericParameter(). In mcs it always
6091 * doc.cs : for generic parameters, use GenericParameterPosition,
6094 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
6096 * expression.cs: Fix Console.WriteLine ((this = x).foo);
6098 2006-01-12 Miguel de Icaza <miguel@novell.com>
6100 This fixes the problem where we used ldfld instead of ldflda to
6101 load the "THIS" pointer on captured parameters, when THIS is a
6102 value type. See bug #77205.
6104 * iterators.cs (CapturedThisReference.Emit): Pass false to
6105 EmitThis (we do not need the address).
6107 * codegen.cs (EmitThis): it needs to know whether we need the
6108 address of `this' or not. This is used by value types.
6110 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
6111 every other call passes false.
6113 2006-01-12 Raja R Harinath <rharinath@novell.com>
6116 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
6118 * expression.cs (Invocation.OverloadResolve): Update.
6119 (Invocation.DoResolve): Avoid double resolution of invocation.
6121 2006-01-11 Raja R Harinath <rharinath@novell.com>
6124 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
6125 unary negation of floating point types as 0-expr; negation cannot
6126 overflow in floating point types.
6129 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
6130 on operands of 'void' type.
6133 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
6134 and ExclusiveOr for boolean constants too.
6136 2006-01-09 Raja R Harinath <rharinath@novell.com>
6139 * expression.cs (Invocation.OverloadResolve): Replace reflected
6140 override methods with their base virtual methods, rather than
6142 * typemanager.cs (TypeManager.GetOverride): New.
6144 2006-01-05 Jb Evain <jbevain@gmail.com>
6146 * class.cs (Property.Define, Indexer.Define): do not tag the
6147 properties as SpecialName | RTSpecialName.
6149 2006-01-04 Miguel de Icaza <miguel@novell.com>
6151 * class.cs (MethodCore.IsDuplicateImplementation): This method was
6152 doing a low-level comparission of parameter types. It was lacking
6153 a check for __argslist.
6155 2005-12-30 Miguel de Icaza <miguel@novell.com>
6157 * expression.cs (ParameterReference.DoResolveBase): Allow
6158 reference parameters if they are local to this block.
6160 This allows the ref and out parameters of a delegate to be used in
6161 an anonymous method, for example:
6163 delegate void set (out int x);
6165 set s = delegate (out int x){
6169 This is used by functionality introduced late in the C# language.
6171 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
6172 method that take ref and out parameters.
6174 Fixes #77119 which was a late change in the spec.
6176 2005-12-23 Miguel de Icaza <miguel@novell.com>
6178 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
6179 parent if its the same scope. Fixes #77060.
6181 2005-12-21 Miguel de Icaza <miguel@novell.com>
6183 * driver.cs: Report the case of no source files and no -out:
6186 2005-12-20 Raja R Harinath <rharinath@novell.com>
6189 * expression.cs (ComposedCast.GetSignatureForError): Define.
6191 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6195 * namespace.cs (NamespaceEntry): Add extern_aliases as a
6196 ListDictionary, to contain the ExternAliasEntry entries (in
6197 addition to the NamespaceEntry.aliases hashtable). This field is
6198 shared between the original entry and its doppelganger (bodyless
6200 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
6201 extern_aliases field.
6202 (NamespaceEntry.Lookup): Move the IsImplicit check after the
6203 lookup in extern_aliases.
6205 2005-12-16 Raja R Harinath <rharinath@novell.com>
6208 * class.cs (TypeContainer.Mark_HasEquals): New.
6209 (TypeContainer.Mark_HasGetHashCode): New.
6210 (ClassPart): Override them.
6211 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
6214 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
6215 'parent' argument to the base constructor.
6217 Remove all mention of TypeContainer from decl.cs.
6218 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
6219 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
6220 (DeclSpace.DeclSpace): Likewise.
6221 (DeclSpace.DefineMembers): Remove unused argument.
6222 * cs-parser.jay (pop_current_class): Update to changes. Simplify
6223 debugging check -- we don't care if the debug code throws an
6224 InvalidCastException instead of an InternalErrorException.
6225 * class.cs (TypeContainer.DefineMembers): Update to changes.
6226 (TypeContainer.DoDefineMembers): Likewise.
6227 (TypeContainer.GetMethods): Likewise.
6228 (PropertyMember.Define): Likewise.
6229 (MemberBase.Parent): New property that forwards to
6230 MemberCore.Parent, but ensures that we get a TypeContainer.
6231 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
6232 (RootContext.PopulateTypes): Likewise. Remove special case code
6233 for !RootContext.StdLib: DefineMembers is idempotent.
6235 2005-12-14 Miguel de Icaza <miguel@novell.com>
6237 * convert.cs (ExplicitConversionCore): Check the return value from
6238 ExplicitConversionCore which can return null on failure. Fixes #76914
6240 2005-12-13 Marek Safar <marek.safar@seznam.cz>
6242 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
6244 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
6246 * doc.cs : The search for referenced namespace was insufficient to
6247 get global one as it used to do. Fixed bug #76965.
6249 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
6251 * doc.cs : check name in cref in the last phase that whether it is
6254 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6256 * cs-tokenizer.cs : reverted the latest change: it somehow broke
6259 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6261 * doc.cs : so it turned out that we cannot skip override check for
6262 interface members. Fixed bug #76954.
6264 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6266 * cs-tokenizer.cs : fixed bug #75984:
6267 - #warning and #error should not be handled when the source line
6269 - #line is not checked strictly when the source line is disabled.
6270 - #define and #undef is on the other hand checked strictly at any
6273 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
6275 * cs-tokenizer.cs : missing Location (actually, filename) in one of
6278 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6280 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
6282 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
6284 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
6285 (FieldBase.Initializer): Initializer is now optional.
6286 (EventField.Define): Only event field can have initializer.
6288 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
6290 * const.cs (Const): Reuse initializer.
6292 * cs-parser.jay: Updated after FieldBase changes.
6293 Added current_array_type to simplify array initializers.
6295 * ecore.cs (NullCast.IsDefaultValue): Implemented.
6297 * expression.cs, iterators.cs: Updated.
6299 * namespace.cs (NamespaceEntry): Made UsingFound private.
6301 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6303 * parameterCollection.cs: Obsolete, removed.
6304 * parser.cs: Obsolete, removed.
6306 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6309 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
6311 * enum.cs (Enum.Define): Set obsolete context here.
6313 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
6316 - FindDocumentedMember() now expects 1) paramList as null
6317 when "we don't have to check the number of parameters" and
6318 2) Type.EmptyTypes when "there is no arguments".
6319 - Introduced FoundMember struct to hold the exact type which was
6320 used to find the documented member (the above change broke
6321 test-xml-044; it might be better just to use DeclaringType than
6322 what MS does, like this change does, but it depends on usage.)
6324 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
6326 * doc.cs : documented member might be from DeclaringType for nested
6327 types. Fixed bug #76782.
6329 2005-12-03 Ben Maurer <bmaurer@ximian.com>
6331 * anonymous.cs: Have the param code handle leaving copies on the
6332 stack etc. Allows anonymous params to take part in the assignment
6333 code (++, +=, etc). Fixes bug #76550
6335 * expression.cs: Handle the prepare_for_load/leave_copy by passing
6336 it down to the anon code.
6338 * iterators.cs: Use dummy var here
6340 * codegen.cs: Handle new vars
6342 2005-12-01 Marek Safar <marek.safar@seznam.cz>
6345 * class.cs (MethodData.Define): Set proper Obsolete context.
6347 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
6349 (FieldExpr.DoResolve): Ditto.
6351 2005-12-01 Marek Safar <marek.safar@seznam.cz>
6354 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
6355 parent is not obsolete.
6357 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
6359 * doc.cs : (FindDocumentedMember) find parameterless members first
6360 and get CS0419 in the early stage. Fixed first case of bug #76727.
6362 2005-11-30 Marek Safar <marek.safar@seznam.cz>
6365 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
6366 no error was reported.
6368 *expression.cs (Binary.DoResolve): left can be null.
6370 2005-11-22 Marek Safar <marek.safar@seznam.cz>
6373 * class.cs (MethodData.Emit): Parameters should be labeled first.
6375 2005-11-21 Marek Safar <marek.safar@seznam.cz>
6378 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
6380 2005-11-18 Marek Safar <marek.safar@seznam.cz>
6382 * attribute.cs (AreParametersCompliant): Moved to Parameter.
6384 * class.cs (MethodCore): Parameter clean up.
6385 (IMethodData): Added ParameterInfo.
6386 (MethodData): Parameter clean up.
6387 (Indexer.Define): Parameter clean up.
6399 * typemanager.cs: Parameter clean up.
6401 * delegate.cs (Define): Get rid of duplicated code.
6403 * expression.cs (ParameterReference): Removed useless parameters
6405 (Invocation): Ditto.
6407 * parameter.cs (ParamsParameter): New class, params specialization.
6408 (ArglistParameter): Attemp to separate arglist.
6409 (Parameter): Refactored to be reusable and faster.
6410 (Parameter.Modifier): Made understandable.
6411 (Parameters): Changed to be used as a class for `this' assembly
6412 parameters. Refactored to use new specialized classes.
6414 * support.cs (ParameterData): Added Types property.
6415 (InternalParameters): Deleted.
6417 2005-08-20 Martin Baulig <martin@ximian.com>
6419 Merging this patch from GMCS to fix #75867.
6421 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
6422 scope if we don't already have it.
6424 2005-11-17 Martin Baulig <martin@ximian.com>
6427 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
6428 inherit the scope from our parent. Fixes #76653.
6430 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6432 * doc.cs : the previous patch does not actually fix the bug.
6433 PropertyInfo override check is now implemented and really fixed it.
6434 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
6436 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6438 * doc.cs : apply "override filter" also to properties.
6441 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6443 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
6444 no need to check overrides. For classes, omit those results from
6445 interfaces since they must exist in the class. Fixed bug #76726.
6447 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6449 * typemanager.cs : (GetFullNameSignature) differentiate indexers
6450 with different parameters. Fixed the second problem in #76685.
6452 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6454 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
6455 get expected 'protected' access in CheckValidFamilyAccess()).
6458 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6460 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
6461 Fixed bug #76705. CS1569 was incorrectly commented out.
6463 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
6465 * doc.cs : use Invocation.IsOverride() to do real override check.
6466 * expression.cs : made Invocation.IsOverride() internal.
6468 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
6470 * doc.cs : use TypeManager.FindMembers() instead of (possible)
6471 TypeBuilder.FindMembers() and filter overriden base members out.
6474 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6476 * doc.cs : ref/out parameters are represented as '@' (instead of
6477 '&' in type FullName). Fixed bug #76630 (additionally crefs).
6479 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6481 * doc.cs : when there was no '.' in cref to methods in doc comment,
6482 then parameters were missing in the output. Fixed bug #76691.
6484 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6486 * driver.cs : don't output docs when there is an error.
6489 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6492 Now it should detect indexers. Fixed primary concern in bug #76685.
6493 Fixed CS0419 message to not show the identical member signature in
6496 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6498 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
6499 instead of Type.FindMembers() since it does not handle events.
6502 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
6504 * codegen.cs: Fixed typo (speficied -> specified).
6506 2005-11-11 Marek Safar <marek.safar@seznam.cz>
6509 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
6511 2005-11-11 Marek Safar <marek.safar@seznam.cz>
6513 * attribute.cs: Changed error message.
6515 * cs-tokenizer.cs: One more check.
6517 2005-11-10 Marek Safar <marek.safar@seznam.cz>
6519 * statement.cs (Block.Resolve): Ignore empty statement.
6521 2005-11-10 Marek Safar <marek.safar@seznam.cz>
6523 * report.cs: Made error/warning methods more strict to avoid
6526 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
6527 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
6528 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
6529 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
6531 2005-11-08 Marek Safar <marek.safar@seznam.cz>
6533 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
6534 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
6536 * class.cs (TypeContainer.IsComImport): New property.
6537 (Constructor.Define): Create proper ctor for ComImport types.
6539 * expression.cs (New.CheckComImport): Fixed.
6541 2005-11-07 Miguel de Icaza <miguel@novell.com>
6543 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
6544 that a parameter has been captured does not mean that we do not
6545 have to do the rest of the processing. This fixes the second part
6546 of #76592. If there was another anonymous method capturing
6547 values in the past, the Scope would never be set for the second
6548 method that captured the same parameter.
6550 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
6551 properly manipulate the stack. Second part of fix for #76592.
6553 * expression.cs (New): Add support for invoking "new" on
6554 interfaces that have been flagged with the ComImport attribute and
6555 the CoClass. Fixes #76637
6557 * statement.cs (Try.DoEmit): When a variable is captured, do not
6558 try to emit the vi.LocalBuilder variable as it has been captured.
6559 Create a temporary variable and store the results on the
6560 FieldBuilder. Fixes #76642
6562 2005-11-07 Marek Safar <marek.safar@seznam.cz>
6564 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
6566 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
6568 * expression.cs (Binary.DoResolve): Added && optimalization.
6570 * typemanager.cs (AddUserType): Removed useless argument.
6572 2005-11-04 Marek Safar <marek.safar@seznam.cz>
6574 * statement.cs (Block.variables): Uses ListDictionary.
6576 2005-11-03 Marek Safar <marek.safar@seznam.cz>
6579 * class.cs (PartialContainer.EmitType): Customized to emit
6580 security attributes.
6581 (ClassPart.ApplyAttributeBuilder): Transform security attribute
6582 for partial classes.
6584 2005-11-03 Marek Safar <marek.safar@seznam.cz>
6587 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
6588 access has to be fixed.
6590 * typemanager.cs (IsUnmanagedType): Wrong common field type.
6592 2005-11-01 Marek Safar <marek.safar@seznam.cz>
6595 * ecore.cs (NullCast.Reduce): Implemented.
6597 * expression.cs (ArrayCreation.CheckIndices): Correcly check
6600 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
6602 (Foreach.Resolve): Catch null properly.
6604 2005-10-29 Marek Safar <marek.safar@seznam.cz>
6606 * cs-tokenizer.cs: Warning text fix.
6608 * driver.cs: AllWarningNumbers exposed on public interface.
6610 * report.cs (): Reviewed warning numbers.
6611 (IsValidWarning): Use binary search.
6613 2005-10-29 Marek Safar <marek.safar@seznam.cz>
6615 * driver.cs: Implemeted resource visibility.
6616 (Resources): New class for code sharing between /res: and
6619 2005-10-28 Marek Safar <marek.safar@seznam.cz>
6622 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
6625 * convert (Convert.ImplicitReferenceConversion): NullCast holds
6628 * ecore.cs (NullCast): Child is contant only.
6630 * literal.cs (NullLiteral.Reduce): null can be converted to any
6633 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
6635 * driver.cs: Use Encoding.Default as default code page instead
6638 2005-10-27 Raja R Harinath <rharinath@novell.com>
6641 * expression.cs (Invocation.Error_InvalidArguments): Handle
6642 __arglist parameters.
6643 (Invocation.VerifyArgumentsCompat): Likewise.
6644 * support.cs (ReflectionParameters.GetSignatureForError): Print
6645 __arglist parameters.
6646 (InternalParamters.GetSignatureForError): Likewise.
6647 * parameter.cs (Parameters.GetSignatureForError): Likewise.
6649 2005-10-26 Marek Safar <marek.safar@seznam.cz>
6651 * attribute.cs (GetPropertyValue): Made public.
6653 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
6655 Add new property WrapNonExceptionThrows to handle 2.0 assembly
6657 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
6660 * driver.cs: Reflect method name change.
6662 * statement.cs (Try.Resolve): Warn when try has both general
6665 * typemanager.cs: runtime_compatibility_attr_type new predefined
6668 2005-10-26 Raja R Harinath <harinath@gmail.com>
6671 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
6672 treat it as an empty parameter list.
6674 2005-10-26 Raja R Harinath <rharinath@novell.com>
6677 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
6678 ResolveAsTypeStep silent.
6679 * statement.cs (Block.AddConstant): Mark block as used.
6680 (Block.ResolveMeta): Avoid piling on error messages
6681 if a constant initializer resolution fails.
6683 2005-10-25 Raja R Harinath <rharinath@novell.com>
6685 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
6687 (NamespaceEntry.VerifyAllUsing): New.
6688 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
6689 behaviour. Delegates actual resolution of alias to ...
6690 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
6691 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
6693 * driver.cs (Driver.MainDriver): Update.
6695 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
6696 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
6698 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
6700 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
6701 RootNamespace.DefineNamespacesForAll.
6703 2005-10-24 Raja R Harinath <harinath@gmail.com>
6705 * typemanager.cs (assemblies, external_aliases, modules)
6706 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
6707 (ComputeNamespaces, GetRootNamespace): Remove extra staging
6708 overhead. Move resposibility ...
6709 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
6710 * driver.cs, attribute.cs, codegen.cs: Update to changes.
6712 2005-10-23 Raja R Harinath <harinath@gmail.com>
6714 * namespace.cs (RootNamespace.all_namespaces): Renamed from
6715 cached_namespaces. Improve usage.
6716 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
6717 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
6718 Move from GlobalRootNamespace and simplify.
6719 (RootNamespace.Global): Make instance variable.
6720 (RootNamespace.RootNamespace): Add "alias name" parameter.
6721 (GlobalRootNamespace): Simplify drastically.
6722 (Namespace.Lookup): Don't use GetNamespace.
6723 * typemanager.cs (GetRootNamespace): Rename from
6724 ComputeNamespaceForAlias.
6725 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
6727 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6729 * anonymous.cs (AnonymousContainer): Don't crash when container
6732 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6734 * expression.cs (Binary.DoResolve): Warn when comparing same
6737 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6740 * expression.cs (Binary.DoResolve): It looks like there are no
6741 convetsion rules in enum context.
6743 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6745 Add support for extern alias qualifiers.
6746 * typemanager.cs: Move some LookupTypeReflection code
6747 to namespace.cs, to have cleaner code. Added some methods
6748 to help us keep track of the extern aliased references.
6749 * driver.cs: Add suport for extern alias assemblies on command
6750 line and check for their warnings/errors. Also keep track of the
6751 extern aliased assemblies.
6752 * namespace.cs: Move the global functionality of Namespace
6753 to GlobalRootNamespace/RootNamespace. Now the global namespace
6754 is GlobalRootNamespace.Globa. Also the code moved from
6755 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
6756 Finally added LocalAliasEntry (AliasEntry before) and
6757 ExternAliasEntry, to handle alias statements.
6758 * cs-parser.jay: Add support in the grammar for extern alias
6760 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
6761 Update callings to Namespace (now in GlobalRootNamespace).
6763 2005-10-18 Raja R Harinath <rharinath@novell.com>
6766 * class.cs (TypeContainer.DefineType): Move updating of
6767 topological sort earlier in the code.
6768 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
6770 2005-10-18 Marek Safar <marek.safar@seznam.cz>
6773 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
6775 * constant.cs (Constant.TryReduce): Moved from Cast class.
6776 (Reduce): Made little bit more OO and fixed missing conversions.
6778 * ecore.cs (Reduce): Implemented.
6779 (Binary.EnumLiftUp): New method to upgrade values to enum values.
6781 * literal.cs (Reduce): Implemented.
6783 * class.cs: Reverted Miguel's wrong commit.
6785 2005-10-14 Miguel de Icaza <miguel@novell.com>
6787 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
6789 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
6791 * cs-parser.jay, expression.cs : CS0214 was missing error location
6792 for constants. Fixed bug #76404.
6794 2005-10-11 Marek Safar <marek.safar@seznam.cz>
6797 * convert.cs (ExplicitConversionCore): Fixed object->enum
6800 2005-10-10 Raja R Harinath <rharinath@novell.com>
6802 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
6804 (PropertyExpr.EmitCall): Likewise.
6805 * expression.cs (Invocation.EmitArguments): Handle case where
6807 (Invocation.EmitCall): Avoid allocating temporary variable if
6808 there are no arguments.
6810 2005-10-07 Raja R Harinath <rharinath@novell.com>
6813 * convert.cs (ImplicitConversionStandard): Move conversion of
6814 void* to arbitrary pointer types ...
6815 (ExplicitConversionStandard): .. here.
6816 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
6817 error to always print typenames.
6819 2005-10-07 Raja R Harinath <rharinath@novell.com>
6821 * convert.cs (GetConversionOperator): Rename from
6822 GetConversionOperators. Move operator selection code from ...
6823 (UserDefinedConversion): ... here.
6825 2005-10-06 Marek Safar <marek.safar@seznam.cz>
6827 * convert.cs (ExplicitConversionCore): Removed duplicate enum
6830 2005-10-05 Marek Safar <marek.safar@seznam.cz>
6832 * assign.cs (Assign.DoResolve): Error method changed.
6834 * cfold.cs (DoConstantNumericPromotions): Error method changed.
6836 * const.cs (ResolveValue): Reset in_transit immediately.
6838 * constant.cs: Error method changed.
6840 * convert.cs: Removed useless location parameter.
6841 (ExplicitNumericConversion): Don't do double enum check.
6842 (ExplicitConversionCore): Renamed from ExplicitConversion.
6843 (ExplicitUnsafe): Extracted from ExplicitConversion.
6844 (ExplicitConversion): Uses for error reporting.
6846 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
6848 (ResolveBoolean): Uses common error method.
6849 (CastToDecimal): Get rid of ec.
6850 (CastFromDecimal): Optimized.
6851 (ConvCast): Get rid of ec.
6853 * enum.cs (ResolveValue): Reset in_transit immediately.
6854 (Emit): Return after first error.
6856 * expression.cs: Convert changes.
6858 * literal.cs: Error method changed.
6860 * statement.cs: Error method changed.
6862 2005-10-03 Raja R Harinath <rharinath@novell.com>
6864 * support.cs (SeekableStreamReader.Position): Don't error out when
6865 the requested position is just beyond the end of the current
6868 2005-09-28 Raja R Harinath <rharinath@novell.com>
6870 * support.cs (SeekableStreamReader): Simplify drastically. Don't
6871 try to keep in sync with the byte count of the underlying Stream.
6872 However, this limits us to a window size of 2048 characters: i.e.,
6873 the maximum lookahead of our lexer/parser can be 2048 characters.
6875 2005-09-28 Marek Safar <marek.safar@seznam.cz>
6878 * driver.cs: Fix compilation files with full root path.
6880 2005-09-25 Miguel de Icaza <miguel@novell.com>
6882 * report.cs (SymbolRelatedToPreviousError): Format the output so
6883 it does not use an open parenthesis that is never closed.
6885 * driver.cs: Follow coding guidelines
6887 2005-09-27 Marek Safar <marek.safar@seznam.cz>
6890 * const.cs (Const.ResolveValue): Check for assigning non-null
6891 value to reference type.
6893 2005-09-27 Marek Safar <marek.safar@seznam.cz>
6895 * anonymous.cs: Implemented ExprClassName.
6897 * assign.cs (Assign.DoResolve): Don't chrash when type is not
6900 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
6903 * class.cs (StaticClass.DefineContainerMembers): Report protected
6906 * codegen.cs: if(ed) PRODUCTION.
6908 * convert.cs (Error_CannotImplicitConversion): Better error
6911 * cs-parser.jay: More error checks.
6913 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
6915 * driver.cs (CSCParseOption): Enabled wrong option check.
6917 * ecore.cs (Expression.ExprClassName): Turned to property.
6918 (MemberExpr.CheckIntermediateModification): For checking boxed
6919 value types modification.
6921 * statement.cs (Fixed.Resolve): Expression type must be
6922 convertible to fixed type.
6923 (CollectionForeach.GetEnumeratorFilter,TryType):
6924 Small refactoring for easier error checking.
6926 2005-09-26 Marek Safar <marek.safar@seznam.cz>
6928 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
6931 * class.cs (GeneratedBaseInitializer): New class for customization
6932 compiler generated initializers.
6933 (MemberBase.DoDefine): Check Obsolete attribute here.
6934 (FieldMember.DoDefine): Ditto.
6936 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
6939 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
6940 (MemberCore.GetObsoleteAttribute): Removed argument.
6941 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
6942 (MemberCore.CheckObsoleteType): New helper.
6946 * statement.cs: Updates after MemberCore changes.
6948 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
6949 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
6951 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
6952 obsolete attribute for compiler construct.
6953 (As.DoResolve): Cache result.
6955 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
6957 2005-09-26 Raja R Harinath <rharinath@novell.com>
6960 * expression.cs (This.VerifyFixed): In a value type T, the type of
6961 'this' is T&, iow, 'this' is either an out or ref parameter. In a
6962 value type R, 'this' is treated as a value parameter.
6964 2005-09-22 Miguel de Icaza <miguel@novell.com>
6966 * statement.cs (Lock): Use the TemporaryVariable class instead of
6967 manually using local variables as those do not work when variables
6970 * ecore.cs: Moved the TemporaryVariable class from being a nested
6971 class inside Foreach to be a public class that can be employed in
6974 2005-09-19 Marek Safar <marek.safar@seznam.cz>
6976 * cs-parser.jay: interface_accessors replaced by
6977 accessor_declarations.
6979 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
6982 * statement.cs (GotoCase.Resolve): Convert null constant to
6984 (SwitchLabel.ResolveAndReduce): Ditto.
6985 (SwitchLabel.NullStringCase): Custom null stamp.
6986 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
6988 typemanager.cs (CSharpSignature): Don't skip first argument
6991 2005-09-18 Miguel de Icaza <miguel@novell.com>
6993 * driver.cs: Set InEmacs based on the environment variable EMACS.
6995 * location.cs (InEmacs): in this mode, do not report column
6996 location as it confuses Emacs.
6998 2005-09-16 Marek Safar <marek.safar@seznam.cz>
7000 * cfold.cs, constant.cs, convert.cs, ecore.cs,
7001 expression.cs, iterators.cs, literal.cs: Store constants and
7004 * class.cs (MemberBase.ShortName): Pass location.
7006 * cs-parser.jay: Some location fixes.
7008 * ecore.cs (Expression.Location): Made virtual.
7010 2005-09-05 Miguel de Icaza <miguel@novell.com>
7012 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
7013 if the underlying types are the same, otherwise we need to produce
7014 code that will do the proper cast.
7016 This was exposed by Marek's constant rewrite which produced
7017 invalid code for the call site:
7020 void Method (X v) {}
7024 This fixes test-49.cs
7026 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
7028 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
7029 Type/Object should be allowed as well. Fixed bug #75968.
7031 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
7033 * expression.cs : (Binary.DoResolve): when one is enum constant and
7034 another is constant 0, then return enum one *as enum type*.
7037 2005-09-02 Raja R Harinath <rharinath@novell.com>
7039 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
7043 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
7044 flow-branching for LocalVariableReferences in case we were invoked
7045 from a MemberAccess.
7046 * expression.cs (LocalVariableReference.VerifyAssigned): New.
7048 (LocalVariableReference.DoResolveBase): ... this.
7049 (MemberAccess.Resolve): Do the check that was disabled during
7052 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
7055 (PartialContainer.Create): check abstract/sealed/static strictly
7056 but abstract/sealed can exist only at one side. Fixed bug #75883.
7058 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
7061 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
7062 specified, don't default to UnmanagedType.I4.
7064 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
7066 * expression.cs : conditional operator should check possibly
7067 incorrect assign expression. Fixed bug #75946.
7069 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
7071 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
7072 Reverting the change. gmcs is much complex than mcs on this matter.
7074 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
7076 * cs-tokenizer.cs : To read another token ahead of the actual
7077 consumption, use new SavedToken and cache token instead of moving
7078 back the stream with SeekableStreamReader (it seemed problematic).
7080 driver.cs : Thus use StreamReader directly.
7081 * support.cs : Thus removed SeekableStreamReader.
7083 2005-08-30 Raja R Harinath <rharinath@novell.com>
7086 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
7087 (ScopeInfo.EmitScopeType): Use it to construct field names from
7088 names of captured locals.
7091 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
7092 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
7093 Pass 'target_type' to BoxedCast. Don't default to 'object'.
7094 (ExplicitConversion): Remove enum cases already handled by
7095 implicit conversion. Move implicit conversion check to the beginning.
7096 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
7097 * expression.cs (ArrayCreation.EmitDynamicInitializers):
7098 Don't treat System.Enum as a struct.
7100 2005-08-30 Jb Evain <jbevain@gmail.com>
7102 * attribute.cs: handles as expression in parameters.
7104 2005-08-30 Raja R Harinath <rharinath@novell.com>
7107 * class.cs (TypeContainer.VerifyClsName): Don't use a
7108 PartialContainer when verifying CLS compliance.
7109 (AbstractPropertyEventMethod): Set Parent here, ...
7110 (PropertyMethod): ... not here.
7112 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
7114 * attribute.cs : escaped attribute name should not be allowed to be
7115 resolved (e.g. @class as classAttribute). Fixed bug #75930.
7117 2005-08-29 Raja R Harinath <rharinath@novell.com>
7120 * convert.cs (ImplicitStandardConversionExists): Allow zero also
7121 when converting a long constant to unsigned long.
7122 * expression.cs (Invocation.OverloadResolve): Add sanity check to
7123 detect where IsApplicable and VerifyArgumentsCompat disagree.
7125 2005-08-29 Raja R Harinath <rharinath@novell.com>
7126 and Carlos Alberto Cortez <carlos@unixmexico.org>
7129 * class.cs (TypeContainer.CanElideInitializer): New helper.
7130 (TypeContainer.EmitFieldInitializers): Use it to determine if we
7131 can safely emitting the initializer of a field.
7133 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7135 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
7136 allowed inside a switch (without loop). Fixed bug #75433.
7138 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
7140 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
7141 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
7143 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7145 * driver.cs : kinda reverting the default encoding changes (not exact
7146 revert since I noticed that "codepage:reset" might not work fine).
7148 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7150 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
7151 Location. Now getter and setter store location correctly.
7152 (errors/cs0111-12.cs now reports the expected location.)
7154 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7156 * driver.cs : Use default encoding on the environment.
7157 Removed (now that) extra parameter for SeekableStreamReader.
7158 * support.cs : (SeekableStreamReader) third .ctor() argument for
7159 StreamReader is not required (always true). preamble size could
7160 be acquired in simpler and safe way.
7162 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
7164 * cs-parser.jay: report CS0642 at warning level 3
7165 and report CS0642 for an if else statement also
7166 fixes bug #74745. Patch by John Luke (and a bit
7168 Removed extra CS0642 warning check for "while",
7170 * statement.cs: In Block.Resolve(), CS0642 check
7171 is reimplemented to check a sequence of an empty
7172 statement and a block.
7174 Both fix bug #66777.
7176 2005-08-24 Marek Safar <marek.safar@seznam.cz>
7178 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
7179 detection until I fix it.
7181 * cs-tokenizer.cs: Changed error message.
7183 * cs-parser.jay: Fixed 2 error locations.
7185 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
7186 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
7189 * enum.cs (GetSignatureForError): Fixed.
7191 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
7195 * typemanager.cs (RegisterProperty): Removed.
7197 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
7199 2005-08-24 Raja R Harinath <rharinath@novell.com>
7202 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
7203 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
7205 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7207 * expression.cs : tiny fix is required for not warning positive ulong.
7210 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7212 * expression.cs : add CS0652 check for constant and integral
7213 expression. Fixed bug #53974.
7215 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7217 * expression.cs : in DoNumericPromotions(), check if there is implicit
7218 conversion overload for string (to check CS0034). Fixed bug #52492.
7220 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7222 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
7224 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7226 * ecore.cs : report location when it is *not* Null.
7228 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7234 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
7235 correctly. Fixed bug #75721.
7237 2005-08-23 Raja R Harinath <rharinath@novell.com>
7239 * support.cs (SeekableStreamReader.Position): Avoid an expensive
7240 loop that performs 'min (pos, char_count)'.
7243 * expression.cs (Unary.ResolveOperator): Don't discard implicit
7244 converted value in Operator.OnesComplement.
7246 2005-08-22 Ben Maurer <bmaurer@ximian.com>
7248 * anonymous.cs: If the anon method is pulled into a helper class,
7249 it needs to be `internal' not `private'. Fixes runtime behavior on
7252 2005-08-20 Martin Baulig <martin@ximian.com>
7254 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7255 scope if we don't already have it.
7257 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
7258 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
7261 2005-08-17 Marek Safar <marek.safar@seznam.cz>
7264 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
7267 2005-08-16 Marek Safar <marek.safar@seznam.cz>
7269 The big constants rewrite
7270 Fix #75746, #75685 and more
7271 As a side effect saved 1MB for MWF ;-)
7273 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
7274 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
7275 enum based for corlib compilation.
7277 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
7280 * class.cs (FixedField.Define): Use ResolveAsConstant.
7282 * const.cs (IConstant): Interface constants and enums.
7283 (Const.ResolveValue): New method for constant resolvning.
7284 (ExternalConstant): Constants from imported assemblies.
7286 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
7287 conversion; like enums.
7288 (Constant.ToType): Converts this constant to different type.
7289 (Constant.Increment): Adds 1.
7291 * convert.cs (ImplicitConversionRequired): Simplified.
7293 * cs-parser.jay: Create EnumMember directly.
7295 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
7297 * doc.cs (GenerateEnumDocComment): Removed.
7299 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
7300 (ConvertIntLiteral): Removed.
7301 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
7303 * enum.cs (EnumMember): Implement IConstant.
7304 (Enum.IsValidEnumConstant): Removed.
7305 (Enum.GetNextDefaultValue): Removed.
7306 (Enum.FindMembers): Updated.
7307 (Enum.GenerateDocComment): Iterate enum members.
7309 * expression.cs (Cast.TryReduce): Handle enums correctly.
7310 (New.Constantify): Made public.
7311 (MemberAccess.DoResolve): Removed contant specific if(s).
7313 * literal.cs (NullLiteral): Implement new abstract methods.
7315 * statement.cs (GotoCase.Resolve): Use new constant methods.
7316 (SwitchLabel.ResolveAndReduce): Use new constant methods.
7318 * typemanager.cs (LookupEnum): Removed.
7319 (IsEnumType): Fixed to work with corlib.
7320 (RegisterConstant): Removed.
7321 (LookupConstant): Removed.
7322 (GetConstant): Changed to work with IConstant.
7324 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
7326 * location.cs : Fixed overflown (>255) column number.
7328 2005-08-03 Raja R Harinath <rharinath@novell.com>
7330 First cut of the qualified-alias-member feature.
7331 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
7333 * cs-parser.jay (DOUBLE_COLON): New token.
7334 (namespace_or_type_name): Add rule for recognizing
7335 qualified-alias-members.
7336 (primary_expression): Likewise.
7337 (element_access): Allow QualifiedAliasMember as a possible
7338 type-bearing expression.
7339 (local_variable_type, local_variable_pointer_type): Likewise.
7340 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
7341 aliases in the current and enclosing namespace declarations.
7342 (NamespaceEntry.UsingAlias): Add CS0440 warning.
7343 * decl.cs (MemberName.is_double_colon): New.
7344 (MemberName.MemberName): Add new constructor for alias-member.
7345 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
7346 * expression.cs (QualifiedAliasMember): New expression type.
7348 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7350 * location.cs : it borked when no argument was specified.
7352 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7354 * location.cs : tiny ToString() format fix.
7356 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7358 * statement.cs : oops, it was missing.
7360 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7362 A set of fixes for precise line/column location.
7365 "token" field now holds a file/line "delta", a line number offset
7366 from the segment, and a column number. See also:
7367 http://lists.ximian.com/pipermail/mono-devel-list/2004-
7368 December/009508.html
7369 Removed static IsNull. Use instance IsNull property instead.
7371 For some tokens it stores Location. For Identifier it stores
7372 LocatedToken which is a pair of string name and location.
7373 Column numbers are adjusted only at getChar().
7375 Use Location.ToString() for reporting (it now contains column).
7377 Largely modified to use LocatedToken instead of
7378 string (IDENTIFIER), and to acquire Location from some tokens.
7379 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
7380 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
7382 Now MemberName holds Location. DeclSpace.ctor() receives Location
7383 as a parameter. Removed extra parameters to all derived classes.
7384 Replaced Location.IsNull() with instance property.
7385 * assign.cs, expression.cs :
7386 Added .ctor() overload that omits Location.
7388 Added "nameEscaped" flag that indicates the identifier was escaped
7389 in the source file. This fixes bug #57047.
7391 2005-08-02 Marek Safar <marek.safar@seznam.cz>
7393 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
7394 New method, looking for lo-case imported cls type.
7396 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
7399 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
7401 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
7403 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
7405 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
7407 Optimized to save 3.5 MB for SWF compilation.
7409 2005-08-01 Marek Safar <marek.safar@seznam.cz>
7411 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
7412 (PartialContainer.Create): Moved logic AddToContainer.
7413 (PartialContainer.MarkForDuplicationCheck): Shares name.
7415 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
7418 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
7420 (Namespace.GetSignatureForError): New method.
7422 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
7423 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
7425 2005-08-01 Raja R Harinath <rharinath@novell.com>
7428 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
7429 member lookup rather than qualifier_type, since qualifier_type can
7432 2005-08-01 Marek Safar <marek.safar@seznam.cz>
7434 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
7437 2005-07-31 Miguel de Icaza <miguel@novell.com>
7439 * statement.cs: Copy the local exception into the exception
7440 captured local. Fixes 75674
7442 2005-07-31 Raja R Harinath <harinath@gmail.com>
7445 * expression.cs (Invocation.OverloadResolve): Don't report error
7446 CS1501 if error CS1502 has been reported.
7447 (New.DoResolve): Delegate CS1501 reporting to
7448 Invocation.OverloadResolve.
7451 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
7452 invariant-meaning-in-block property in an enclosing block if
7455 2005-07-29 Marek Safar <marek.safar@seznam.cz>
7457 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
7458 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
7459 (Switch.CheckSwitch): Just save 50kb for SWF.
7461 2005-07-27 Martin Baulig <martin@ximian.com>
7463 * anonymous.cs (CaptureContext.AddField): Added
7464 `AnonymousContainer am' argument; compute its toplevel scope if
7465 it's not already computed. Fixes #75649.
7467 2005-07-26 Raja R Harinath <rharinath@novell.com>
7470 * class.cs (Constructor.Emit): Reset block to null if the block
7473 2005-07-25 Marek Safar <marek.safar@seznam.cz>
7475 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
7477 2005-07-25 Marek Safar <marek.safar@seznam.cz>
7479 * class.cs (MethodData.Define): Check whether accessor implementing
7480 interface is public.
7482 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
7484 2005-07-22 Marek Safar <marek.safar@seznam.cz>
7487 * namespace.cs (LookupType): Moved same type check to...
7489 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
7492 2005-07-21 Raja R Harinath <rharinath@novell.com>
7494 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
7495 already found a typebuilder.
7496 * class.cs (MethodCore.IsDuplicateImplementation): Compare
7497 MemberNames, not strings.
7499 * const.cs (Error_ExpressionMustBeConst):
7500 Rename from Error_EpressionMustBeConst.
7501 * const.cs, class.cs, statement.cd: Update.
7503 2005-07-21 Marek Safar <marek.safar@seznam.cz>
7507 * const.cs (Const.LookupConstantValue): Report missing contant expression
7509 (Error_EpressionMustBeConstant): Only one error method.
7511 * class.cs, statement.c: Updated.
7513 2005-07-20 Raja R Harinath <rharinath@novell.com>
7515 * statement.cs (Block.Flags): Add back HasVarargs.
7516 (Block.flags): Make protected.
7517 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
7519 * typemanager.cs (types, typecontainers, user_types): Remove.
7520 (UserTypes, TypeContainers): Likewise.
7521 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
7522 (CleanUp, Reset): Update.
7523 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
7524 (GetNestedType): Use Type.GetNestedType.
7525 (CoreLookupType): Take two arguments, the namespace and the
7526 basename of the type. Update to use the Namespace.Lookup
7528 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
7529 (RealMemberLookup): Use IsNestedChildOf instead of playing with
7530 string concatenation and substring matches.
7531 * class.cs, enum.cs, delegate.cs: Update to changes.
7533 2005-07-20 Marek Safar <marek.safar@seznam.cz>
7535 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
7536 Expression and made virtual.
7538 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
7539 (ImplicitStandardConversionExists): Fixed `byte' typo ?
7541 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
7543 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
7546 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
7549 2005-07-18 Marek Safar <marek.safar@seznam.cz>
7552 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
7553 AssemblyCultureAttribute is not used on executable.
7556 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
7558 2005-07-16 Raja R Harinath <rharinath@novell.com>
7561 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
7562 New. Reports CS0252/CS0253.
7563 Mostly taken from preliminary patch by Duncak Mak.
7564 (Binary.DoResolveOperator): Store results of operator lookup.
7565 Use them to detect if we need to warn about unintended reference
7568 2005-07-15 Raja R Harinath <rharinath@novell.com>
7571 * namespace.cs (Namespace.Lookup): Add back location parameter.
7572 (Namespace.LookupType): Add CS0436 report. Add location parameter.
7573 * delegate.cs, ecore.cs, expression.cs: Update to changes.
7575 * codegen.cs (EmitContext.DeclSpace): Make readonly.
7576 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
7577 (Namespace.LookupType): ... this.
7578 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
7580 * typemanager.cs (LookupTypeReflection): Remove buggy code that
7581 purported to handle pointers.
7582 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
7585 2005-07-15 Marek Safar <marek.safar@seznam.cz>
7587 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
7590 2005-07-15 Raja R Harinath <rharinath@novell.com>
7592 * namespace.cs (Namespace.Lookup): Drop location parameter.
7593 (NamespaceEntry.LookupAlias): Remove. Merge into ...
7594 (NamespaceEntry.Lookup): ... this.
7595 (NamespaceEntry.Error_AmbiguousTypeReference):
7596 Move here from DeclSpace.
7597 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
7599 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
7600 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
7601 Move to NamespaceEntry.
7602 * delegate.cs, expression.cs: Update to changes.
7604 2005-07-14 Marek Safar <marek.safar@seznam.cz>
7606 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
7607 CheckAttributeType and refactored.
7608 (Attribute.ResolvePossibleAttributeType): Changed to reuse
7609 ResolveAsTypeTerminal error handling.
7610 (ResolveAsTypeTerminal): Introduced because of global attributes extra
7612 (GetSignatureForError): Print errors in same way.
7615 * codegen.cs: Reflect attribute GetSignatureForError change.
7618 * expression.cs: Add silent parameter to ResolveAsTypeStep.
7620 * namespace.cs (UsingEntry): Refactored to make fields private.
7623 statement.cs: Error_UnexpectedKind has extra parameter.
7625 2005-07-14 Raja R Harinath <rharinath@novell.com>
7627 * ecore.cs (IAlias): Remove.
7628 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
7629 that implement the interface.
7630 * namespace.cs (Namespace): Likewise.
7631 (Namespace.declspaces): Renamed from 'defined_names'.
7632 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
7633 DeclSpace instead of an IAlias.
7634 * tree.cs (Tree.AddDecl): Update.
7636 2005-07-12 Raja R Harinath <rharinath@novell.com>
7638 * statement.cs (Block.Flags); Remove HasVarargs.
7639 (Block.HasVarargs): Move to ToplevelBlock.
7640 (Block.ThisVariable, Block.AddThisVariable): Likewise.
7641 (Block.Variables): Make protected. Initialize variable hashtable
7643 (Block.AddVariable): Update.
7644 (Block.Resolve): Update to changes.
7645 (ToplevelBlock.HasVarargs): New boolean.
7646 (ToplevelBlock.ThisVariable): Move here from Block.
7647 (ToplevelBlock.AddThisVariable): Likewise.
7648 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
7649 * expression.cs (This.ResolveBase): Update to changes.
7650 (ArglistAccess.DoResolve): Likewise.
7652 2005-07-11 Marek Safar <marek.safar@seznam.cz>
7655 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
7657 * class.cs (TypeContainer.VerifyMembers): Distinguish between
7658 not used and not used & assigned.
7659 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
7661 2005-07-11 Marek Safar <marek.safar@seznam.cz>
7664 * expression.cs (Is.DoResolve): null is never provided type.
7666 2005-07-08 Marek Safar <marek.safar@seznam.cz>
7669 * cs-parser.jay: Less strict event error rule to catch more errors.
7671 2005-07-08 Martin Baulig <martin@ximian.com>
7673 Fix test-iter-10.cs - distinguish whether we `yield' in a property
7674 gettter (allowed) or setter (not allowed).
7676 * class.cs (Accessor): Implement IIteratorContainer.
7677 (Accessor.Yields): New public field.
7678 (PropertyBase.PropertyMethod.Define): Handle iterators on a
7682 (get_accessor_declaration, set_accessor_declaration): Set the
7683 `yields' flag on the accessor, not the property.
7684 (property_declaration): Do the iterators check on a per-accessor
7685 basis and not for the whole property.
7687 2005-07-08 Martin Baulig <martin@ximian.com>
7689 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
7690 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
7692 2005-07-07 Marek Safar <marek.safar@seznam.cz>
7695 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
7696 (ExtractSecurityPermissionSet): Cope with self referencing security
7697 attributes properly.
7699 * driver.cs (SetOutputFile): Made public property OutputFile.
7701 2005-07-07 Raja R Harinath <rharinath@novell.com>
7704 * class.cs (TypeContainer.first_nonstatic_field): Rename from
7705 has_nonstatic_fields. Make into a FieldBase pointer.
7706 (TypeContainer.AddField): Add CS0282 check.
7707 (TypeContainer.EmitType): Update.
7709 2005-07-06 Miguel de Icaza <miguel@novell.com>
7711 * cs-tokenizer.cs (consume_identifier): Do not create strings to
7712 compare if they start with __.
7714 2005-07-06 Raja R Harinath <rharinath@novell.com>
7716 * statement.cs (Switch.SwitchGoverningType): Only look at
7717 UserCasts that don't need implicit standard conversions to one of
7718 the allowed switch types (Fixes test-322.cs).
7719 (LocalInfo.Resolve): Re-enable sanity-test.
7721 2005-07-06 Marek Safar <marek.safar@seznam.cz>
7723 * cs-tokenizer.cs (consume_identifier): Detect double undescores
7725 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
7727 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
7729 2005-07-06 Raja R Harinath <rharinath@novell.com>
7732 * ecore.cs (SimpleName.GetSignatureForError): Add.
7733 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
7734 (MemberAccess.GetSignatureForError): Add.
7736 2005-07-05 Marek Safar <marek.safar@seznam.cz>
7738 The big error and warning messages review.
7768 * typemanager.cs: Updated.
7770 * class.cs: (MethodCore.SetYields): Moved here to share.
7771 (PropertyMethod.Define): Moved iterator setup here.
7773 * iterators.cs: Add orig_method to have full access to parent
7776 2005-07-05 Raja R Harinath <rharinath@novell.com>
7778 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
7779 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
7780 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
7781 variable of struct type.
7782 * expression.cs (Unary.ResolveOperator): Update to change.
7783 (Indirection.VerifyFixed): Likewise.
7784 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
7785 (ParameterReference.VerifyFixed): Value parameters are fixed.
7786 (This.VerifyFixed): Treat 'this' as a value parameter.
7787 * statement.cs (LocalInfo.IsFixed): Remove.
7789 2005-07-01 Martin Baulig <martin@ximian.com>
7791 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
7792 `ec.EmitThis ()' to get the correct scope.
7794 2005-07-01 Martin Baulig <martin@ximian.com>
7796 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
7797 instance is a ParameterReference; fixes #75299.
7799 2005-07-01 Martin Baulig <martin@ximian.com>
7801 Reverted Marek's latest patch (r46725):
7802 - it contains structural changes which are neither mentioned in
7803 the ChangeLog nor explained anywhere; for example the additional
7804 argument of EmitContext's and Iterator's .ctor's and the
7805 TypeContainer.DefineMembers() change.
7806 - structural changes like this should go in in seperate patches
7807 and not be hidden in a huge patch which just seems to affect
7808 warnings and errors.
7809 a big and hard to understand patch.
7810 - it breaks iterators and causes regressions, for instance in
7813 2005-06-30 Raja R Harinath <rharinath@novell.com>
7816 * expression.cs (Indexers.map): Remove.
7817 (Indexers.Append): Filter out inaccessible setters and getters.
7818 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
7821 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
7823 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
7824 (FieldExpr.Emit, PropertyExpr.Emit): Update.
7825 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
7826 * expression.cs (Invocation.EmitCall): Add CS0120 check.
7828 2005-06-30 Marek Safar <marek.safar@seznam.cz>
7831 * class.cs (FieldBase.GetInitializerExpression): One more field
7834 2005-06-28 Miguel de Icaza <miguel@novell.com>
7836 * pending.cs: Do not define a proxy if the base method is virtual,
7837 it will be picked up by the runtime (bug 75270).
7839 2005-06-08 Martin Baulig <martin@ximian.com>
7841 The big Iterators rewrite :-)
7843 * iterators.cs: Rewrite this to use the anonymous methods framework.
7845 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
7846 before the TypeContainers; see 2test-21.cs.
7849 (TypeContainer.DefineType): Don't create a new EmitContext if we
7850 already have one (this only happens if we're an Iterator).
7851 (TypeContainer.Define): Also call Define() on all our iterators.
7852 (Method.CreateEmitContext): Added support for iterators.
7855 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
7856 (AnonymousContainer.CreateMethodHost): Moved here from
7857 AnonymousMethod and made abstract.
7858 (AnonymousContainer.CreateScopeType): New abstract method.
7859 (AnonymousContainer.IsIterator): New public property.
7860 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
7861 get the ScopeTypeBuilder rather than manually defining it here.
7862 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
7865 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
7866 before RootContext.DefineTypes().
7868 * codegen.cs (EmitContext.RemapToProxy): Removed.
7869 (EmitContext.CurrentAnonymousMethod): Changed type from
7870 AnonymousMethod -> AnonymousContainer.
7871 (EmitContext.ResolveTopBlock): Protect from being called twice.
7872 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
7873 (EmitContext.EmitThis): Removed the iterators hacks; use the
7874 anonymous methods framework for that.
7877 (ToplevelBlock.Container): Make this a property, not a field.
7878 (ToplevelBlock.ReParent): New public method; move the
7879 ToplevelBlock into a new container.
7880 (Foreach.TemporaryVariable): Simplify.
7882 2005-06-05 Martin Baulig <martin@ximian.com>
7884 * statement.cs (LocalInfo.CompilerGenerated): New flag.
7885 (Block.AddTemporaryVariable): New public method; creates a new
7886 `LocalInfo' for a temporary variable.
7887 (Block.EmitMeta): Create the LocalBuilders for all the temporary
7889 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
7890 non-iterator variables.
7892 2005-06-05 Martin Baulig <martin@ximian.com>
7894 * statement.cs (Foreach.TemporaryVariable): Create the
7895 LocalBuilder in the Emit phase and not in Resolve since in some
7896 situations, we don't have an ILGenerator during Resolve; see
7897 2test-19.cs for an example.
7899 2005-06-04 Martin Baulig <martin@ximian.com>
7901 **** Merged r45395 from GCS ****
7903 The big Foreach rewrite - Part II.
7905 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
7906 with `PropertyInfo ienumerator_getcurrent'.
7908 * codegen.cs (VariableStorage): Removed.
7911 (Foreach): Derive from Statement, not ExceptionStatement.
7912 (Foreach.CollectionForeach): New nested class. Moved all the code
7913 dealing with collection foreach here.
7914 (Foreach.ForeachHelperMethods): Removed.
7915 (Foreach.TemporaryVariable): Implement IMemoryLocation.
7917 2005-05-23 Martin Baulig <martin@ximian.com>
7919 * statement.cs (Try.DoResolve): Don't create a `finally' if we
7920 don't need to. Fix #75014.
7922 2005-05-20 Martin Baulig <martin@ximian.com>
7924 Merged r44808 from GMCS.
7926 * class.cs (TypeContainer.CircularDepException): Removed.
7927 (TypeContainer.DefineType): Removed the `InTransit' stuff.
7928 (TypeContainer.CheckRecursiveDefinition): Check for circular class
7929 (CS0146) and interface (CS0529) dependencies here.
7931 2005-06-21 Raja R Harinath <rharinath@novell.com>
7933 * expression.cs (Invocation.EmitCall): Fix initialization
7934 'this_call' to reflect current behaviour. Fix indentation.
7936 * convert.cs (FindMostEncompassedType): Add two trivial special
7937 cases (number_of_types == 0 || number_of_types == 1).
7938 (FindMostEncompasingType): Likewise.
7940 2005-06-17 Raja R Harinath <rharinath@novell.com>
7942 Some cleanups preparing for the fix of #75283.
7943 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
7945 (EventExpr.InstanceResolve): Likewise.
7946 (EventExpr.DoResolve): Remove redundant checks.
7948 2005-06-10 Duncan Mak <duncan@novell.com>
7950 * cs-tokenizer.cs (process_directives): New flag for controlling
7951 the processing of preprocessor directives.
7952 (x_token): After seeing a '#', return Token.NONE instead of going
7953 to handle_preprocessing_directive() when not processing
7954 directives. This avoids unnecessary processing during the token peek in
7959 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
7960 the existing error reporting methods instead of Report.Error.
7962 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
7963 after Raja's rewrite.
7965 2005-06-08 Miguel de Icaza <miguel@novell.com>
7967 * class.cs: Small fix.
7969 2005-06-08 Raja R Harinath <rharinath@novell.com>
7972 * class.cs (GetPartialBases): Fix return value check of
7975 2005-06-07 Raja R Harinath <rharinath@novell.com>
7977 Ensure that partial classes are registered in their enclosing
7978 namespace. Initial part of fix of #75160.
7979 * tree.cs (Tree.RecordDecl): Add new namespace argument.
7980 Register declspace with namespace here, not in
7981 DeclSpace.RecordDecl.
7982 * cs-parser.jay: Pass namespace to RecordDecl.
7983 * class.cs (PartialContainer.Create): Likewise.
7984 (ClassPart.DefineType): New sanity-check. Throws an exception if
7986 * decl.cs (Declspace.RecordDecl): Remove.
7987 * namespace.cs (NamespaceEntry.DefineName): Remove.
7989 2005-06-06 Marek Safar <marek.safar@seznam.cz>
7991 * rootcontext.cs: Reset TargetExt as well.
7993 2005-06-03 Raja R Harinath <rharinath@novell.com>
7995 * ecore.cs (Expression.Resolve): Emit CS0654 error when
7998 2005-06-02 Raja R Harinath <rharinath@novell.com>
8000 Fix #75080, cs0119.cs.
8001 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
8003 (Expression.Resolve): ... this. Use it. Remove bogus code
8004 allowing ExprClass.Type and ExprClass.Namespace for
8005 ResolveFlags.VariableOrValue.
8006 (Expression.Resolve) [1-argument variant]: Change default resolve
8007 flags based on language version.
8008 (Expression.Error_UnexpectedKind): Use a simple string array
8009 rather than an ArrayList.
8010 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
8012 (TypeOfVoid.DoResolve): Likewise.
8013 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
8014 flags argument -- it always has the same value.
8016 2005-05-31 Raja R Harinath <rharinath@novell.com>
8019 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
8020 Use it in the error message.
8021 * assign.cs, expression.cs, statement.cs: Update.
8023 2005-05-30 Raja R Harinath <rharinath@novell.com>
8026 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
8027 the "almostMatchedMember" case too.
8028 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
8029 that failed the accessibility checks to 'almost_match'.
8031 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
8033 * attribute.cs: Use internal MethodBuilder methods to set
8034 ExactSpelling and SetLastError on PInvoke methods, instead
8035 of passing them via charset. Fixes #75060.
8037 2005-05-27 Raja R Harinath <rharinath@novell.com>
8039 * parameter.cs (Parameter): Remove TODO comment.
8040 (Parameter.DefineParameter): Remove Location parameter.
8041 (Parameters.LabelParameters): Likewise.
8042 * class.cs (Constructor.Emit): Update to change.
8043 (MethodData.Emit): Likewise.
8044 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
8045 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
8047 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
8050 Removed Parameters.Location and added Parameter.Location instead.
8051 Removed Location parameter from Emit() and GetSignature().
8058 Modified all related calls.
8060 2005-05-26 Raja R Harinath <rharinath@novell.com>
8062 Improve user-defined conversion handling.
8063 * convert.cs (GetConversionOperators): Rewrite. Return only the
8064 applicable operators.
8065 (AddConversionOperators): New. Helper for GetConversionOperators.
8066 (FindMostEncompassedType, FindMostEncompassingType): Verify that
8067 there is only one most encompassed/encompassing type.
8068 (FindMostSpecificSource, FindMostSpecificTarget): Remove
8069 "applicable operator" handling.
8070 (UserConversion): Move cache here from GetConversionOperators.
8071 Directly cache the chosen operator, rather than the whole
8073 (ExplicitNumericConversion): Fix buggy implementation of Decimal
8074 case. Allow conversion of decimal to sbyte and byte too.
8075 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
8076 New static methods. Used to avoid allocating EmptyExpressions in
8079 2005-05-24 Duncan Mak <duncan@novell.com>
8081 * ecore.cs (CastFromDecimal): New class for casting a decimal to
8082 another class, used in Convert.ExplicitNumericConversion.
8083 (CastToDecimal): New class, similar to above, but casts to
8084 System.Decimal, used in Convert.ImplicitNumericConversion and also
8085 in explicit convesion from double/float to decimal.
8087 * convert.cs (ImplicitNumericConversion): Handle implicit
8088 conversions to System.Decimal.
8089 (ExplicitNumericConversion): handle explicit conversions to
8094 2005-05-20 Miguel de Icaza <miguel@novell.com>
8096 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
8097 know the type at this stage, just break through. Fixes #75008
8099 2005-05-19 Martin Baulig <martin@ximian.com>
8102 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
8103 to disable error reporting.
8105 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
8106 here since we don't want to report an error; see the new test-336.cs.
8108 2005-05-19 Raja R Harinath <rharinath@novell.com>
8110 * statement.cs (ToplevelBlock.GetParameterReference)
8111 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
8112 Move here from class Block.
8113 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
8114 * expression.cs (ParameterReference.DoResolveBase): Likewise.
8116 2005-05-18 Martin Baulig <martin@ximian.com>
8121 (FlowBranching.Reachability): Add non-static public And() and Or()
8123 (FlowBranchingSwitch): New class; do the `break_origins' thing
8124 like in FlowBranchingLoop.
8125 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
8126 reachability, not just locals and parameters.
8127 (FlowBranching.MergeChild): Remove some of the hacks for loop and
8128 switch; MergeBreakOrigins() now takes care of that.
8130 2005-05-18 Martin Baulig <martin@ximian.com>
8132 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8133 a loop and may leave it, reset the barrier; fixes #74974.
8135 2005-05-17 Marek Safar <marek.safar@seznam.cz>
8137 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
8140 * cs-parser.jay: Catch more lexical errors.
8142 * report.cs: Add one more Error method.
8145 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
8147 2005-05-17 Martin Baulig <martin@ximian.com>
8149 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
8152 2005-05-16 Raja R Harinath <rharinath@novell.com>
8154 Fix test-382.cs. Emit values of decimal constants.
8155 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
8157 (TypeContainer.AddField): ... this.
8158 (TypeContainer.EmitFieldInitializers): Allow the list of fields
8159 with initializers to include 'Const's.
8160 (ClassPart.RegisterFieldForInitialization): Forward to
8162 * const.cs (Const.Const): Pass initializer to base class.
8163 (Const.Define): In case of decimal constants, register them for
8164 initialization in a static constructor.
8166 2005-05-14 Martin Baulig <martin@ximian.com>
8168 * statement.cs (Block.Resolve): Correctly handle unreachable code;
8169 do not call ResolveUnreachable() on unreachable statements in
8170 here, see the comment in the source code.
8172 2005-05-13 Raja R Harinath <rharinath@novell.com>
8175 * expression.cs (BinaryResolveOperator): If one of the operands of
8176 an equality comparison is 'null' and the other is a pointer type,
8177 convert the null to a NullPointer.
8178 * convert.cs (ImplicitReferenceConversion): If the expression is a
8179 NullLiteral and the target type is a pointer type, return a
8180 NullPointer instead.
8181 (ImplicitConversionStandard): Likewise.
8183 2005-05-13 Marek Safar <marek.safar@seznam.cz>
8185 * cs-parser.jay: Set readonly context based on special constructs.
8187 * expression.cs (LocalVariableReference.DoResolveBase): Improved
8188 readonly variable error handling.
8190 * rootcontext.cs (EmitCode): Don't verify members when error
8193 * statement.cs (LocalInfo): Add reaodnly context information.
8194 (SetReadOnlyContext, GetReadOnlyContext): New methods.
8196 2005-05-13 Raja R Harinath <rharinath@novell.com>
8198 * statement.cs (Block.Resolve): Revert change below. Modify fix
8199 for #74041 to initialize 'resolved' to false only for explicit
8200 blocks. Fixes #74873.
8202 2005-05-12 Raja R Harinath <harinath@gmail.com>
8205 * typemanager.cs (unmanaged_enclosing_types): New.
8206 (IsUnmanagedType): Avoid infloops by using
8207 'unmanaged_enclosing_types' to talk with recursive invocations.
8209 2005-05-13 Martin Baulig <martin@ximian.com>
8211 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
8212 instance variable, not a local. Fix #74873.
8213 (Block.ResolveUnreachable): Set it to true here.
8215 2005-05-11 Duncan Mak <duncan@novell.com>
8217 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
8218 continuing to process for 'arg'.
8219 (handle_preprocessing_directive): Check the argument of the #endif
8220 directive and report error CS1025 if there are any trailing
8223 According to the C# spec, having even whitespace after the #endif
8224 directive is illegal; however, because we call arg.TrimEnd ()
8225 beforehand, we have the same behavior as csc, allowing whitespace
8226 after the directive.
8230 2005-05-11 Marek Safar <marek.safar@seznam.cz>
8234 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
8235 (Constructor.GetObsoleteAttribute): Implemented correctly.
8237 2005-05-10 Martin Baulig <martin@ximian.com>
8239 * support.cs (ReflectionParameters.ParameterModifier): Use
8240 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
8241 and `ParameterAttributes.In'. Fixes #74884.
8243 2005-05-10 Marek Safar <marek.safar@seznam.cz>
8245 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
8247 * expression.cs (Argument.GetParameterModifier): Turned to property.
8248 (Invocation.Error_InvalidArguments): Add more descriptive errors.
8250 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
8253 2005-05-09 Raja R Harinath <rharinath@novell.com>
8256 * decl.cs (MemberCache.AddMethods): Register override methods,
8257 rather than non-override methods.
8258 * typemanager.cs (RegisterOverride): New.
8259 (IsOverride): Update.
8261 2005-05-09 Marek Safar <marek.safar@seznam.cz>
8265 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
8266 recursive declaration.
8268 * statement.cs (Block.ResolveMeta): Report any error in resolving.
8270 2005-05-06 Marek Safar <marek.safar@seznam.cz>
8272 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
8274 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
8276 2005-05-05 Raja R Harinath <rharinath@novell.com>
8279 * decl.cs (DeclSpace.FamilyAccessible):
8280 Use TypeManager.IsNestedFamilyAccessible.
8282 Fix reopened #64812.
8283 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
8286 2005-05-04 Raja R Harinath <rharinath@novell.com>
8287 Abin Thomas <projectmonokochi@rediffmail.com>
8288 Anoob V E <projectmonokochi@rediffmail.com>
8289 Harilal P R <projectmonokochi@rediffmail.com>
8292 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
8293 allow access to all static members.
8295 2005-05-04 Martin Baulig <martin@ximian.com>
8297 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
8299 2005-05-04 Martin Baulig <martin@ximian.com>
8303 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
8304 section at the end; make things work if `default' is not the last
8307 2005-05-04 Martin Baulig <martin@ximian.com>
8311 * statement.cs (Switch): Replaced the `got_default' field with a
8312 `default_section' one.
8313 (Switch.CheckSwitch): Set `default_section' here.
8314 (Switch.Resolve): If we're a constant switch and the constant is
8315 not found, use the default section.
8317 2005-05-03 Martin Baulig <martin@ximian.com>
8319 * expression.cs (ArrayAccess.EmitGetLength): New public method.
8321 * statement.cs (Foreach.ArrayForeach): New nested class.
8322 (Foreach.TemporaryVariable): New nested class.
8323 (Foreach.EmitArrayForeach): Removed; this is now in the new
8326 2005-05-03 Raja R Harinath <rharinath@novell.com>
8328 * pending.cs (BaseImplements): Move the #74773 fix here. This is
8330 (VerifyPendingMethods): Revert change below.
8332 * typemanager.cs (IsOverride, RegisterNonOverride): New.
8333 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
8334 that used to trigger warning -28. Remove warning -28.
8335 * expression.cs (Invocation.OverloadResolve): Use
8336 TypeManager.IsOverride to distinguish override methods.
8339 * pending.cs (VerifyPendingMethods): If a base type implements the
8340 requested interface, don't bother checking individual methods of
8341 the base type. As a side-effect, this prevents the creation of
8342 unnecessary proxies.
8344 2005-05-02 Martin Baulig <martin@ximian.com>
8348 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8349 Also `And' the locals if the old vector is null.
8350 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
8351 null; in this case we basically reset all the variables.
8353 2005-05-02 Martin Baulig <martin@ximian.com>
8357 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
8358 Added `FlowBranching branching' argument; always `and' the
8359 variables instead of `or'ing them unless we're an infinite loop.
8361 * statement.cs (While.Resolve): Create a new sibling unless we're
8364 2005-05-02 Martin Baulig <martin@ximian.com>
8368 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
8369 arguments; use it instead of creating a new TopLevelBlock.
8370 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
8371 our ConstructorInitializer.
8374 (TopLevelBlock.TopLevelBranching): New public property.
8375 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
8376 and create our `TopLevelBranching'.
8378 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
8379 anonymous method host, use `block.TopLevelBranching' rather than
8380 creating a new branching.
8382 2005-04-20 Miguel de Icaza <miguel@novell.com>
8384 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
8385 a ScopeInfo, if any of the current children is a child of the new
8386 entry, move those children there.
8388 2005-04-30 Martin Baulig <martin@ximian.com>
8390 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
8391 at the beginning of a SwitchSection. Fix #73335.
8393 2005-04-27 Marek Safar <marek.safar@seznam.cz>
8396 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
8398 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
8399 (FieldExpr.DoResolve): Obsolete members are ignored for field
8402 2005-04-26 Marek Safar <marek.safar@seznam.cz>
8404 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
8405 of arrays detection.
8407 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
8409 (Field.VerifyClsCompliance): Volatile fields are not compliant.
8411 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
8414 2005-04-25 Ben Maurer <bmaurer@ximian.com>
8416 * cs-parser.jay: Use the prefered version of -unsafe in error
8419 2005-04-22 Marek Safar <marek.safar@seznam.cz>
8421 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
8424 2005-04-20 John Luke <john.luke@gmail.com>
8426 * driver.cs: fix typo in error message, --outout to --output
8428 2005-04-20 Marek Safar <marek.safar@seznam.cz>
8430 * codegen.cs (InRefOutArgumentResolving): New field.
8432 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
8433 fields outside contructor.
8435 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
8437 2005-04-19 Miguel de Icaza <miguel@novell.com>
8439 * anonymous.cs (CaptureContext.EmitParameterInstance): The
8440 parameter code was not completed ever, so it was not as up-to-date
8441 as local variables. Must finish it.
8443 The bug fix was to compare the Toplevel of the block, not the
8444 current block. Thanks for Ben for pointing this out.
8446 2005-04-19 Raja R Harinath <rharinath@novell.com>
8448 * decl.cs (AddMethods): Use the declaring type of the problem
8449 method to determine if we want to squash a warning.
8451 2005-04-19 Marek Safar <marek.safar@seznam.cz>
8453 * attribute.cs: Removed debug output.
8455 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
8457 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
8460 2005-04-18 Raja R Harinath <rharinath@novell.com>
8463 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
8464 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
8465 all null comparisons against reference types.
8467 2005-04-18 Marek Safar <marek.safar@seznam.cz>
8470 * class.cs (TypeContainer.CircularDepException) New nested
8472 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
8473 (TypeContainer.DefineType): Removed error, reset InTransit before
8475 (Class.DefineType): Throw exception when is in Transit.
8476 Catch exception and report error.
8477 (Struct.DefineType): Throw exception when is in Transit.
8478 Catch exception and report error.
8479 (Interface.DefineType): Throw exception when is in Transit.
8480 Catch exception and report error.
8482 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
8483 handle nested exception handlers.
8485 * flowanalysis.cs (InTryWithCatch): New method, search for try with
8488 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
8489 InFinally and InCatch storage.
8491 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
8492 (Catch.Resolve): Set and Restore ec.InCatch.
8493 (Try.Resolve): Set and Restore ec.InFinally.
8494 (Try.HasCatch): True when try has catch.
8496 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
8498 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
8499 for the same event member, so exclude such cases from warning 419.
8502 2005-04-16 Miguel de Icaza <miguel@novell.com>
8504 * expression.cs (Binary.ResolveOperator): Apply patch from John
8505 Luke to fix bug 59864: operators &, | and ^ on enumerations
8506 require that the same enum type on both sides.
8508 * driver.cs: Add warnings to old flag usage, this is to assist
8509 people who produce Makefiles and hope that the Makefiles will be
8512 * class.cs (TypeContainer.EmitType): Moved the definition of the
8513 special $PRIVATE$ field from the resolve phase to the Emit phase.
8514 During resolve we do not know if we are a struct with
8515 HasExplicitLayout, we know this only after the attributes for the
8518 Set the FieldOffset to zero on the dummy field that we create for
8519 the class. Fixes 74590.
8521 2005-04-16 Raja R Harinath <rharinath@novell.com>
8524 * ecore.cs (PropertyExpr.resolved): New.
8525 (DoResolve): Use it to handle a case of double resolution here.
8526 Handle a case of identical-name-and-type-name.
8527 * expression.cs (ArrayCreation.CheckIndices): Avoid double
8528 resolution by storing the results of expression resolution back
8529 into the "probes" array.
8531 2005-04-15 Raja R Harinath <rharinath@novell.com>
8533 Fix cs0208-7.cs and cs0208-8.cs.
8534 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
8535 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
8536 error reporting to point out the reason a struct is not unmanaged.
8538 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8540 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
8541 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
8543 2005-04-13 Raja R Harinath <rharinath@novell.com>
8546 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
8547 IdenticalNameAndTypeName here.
8548 (EventExpr.InstanceResolve): Likewise.
8550 2005-04-13 Marek Safar <marek.safar@seznam.cz>
8552 C# 2.0 DefaultCharSetAttribute implementation
8554 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
8555 which allows us to set GlobalNamespace for every resolve.
8556 (Attribute.ResolveArguments): Cut from Resolve.
8557 (Attribute.GetCharSetValue): Returns CharSet named argument.
8558 (Attribute.DefinePInvokeMethod): Gets default charset from
8560 (GlobalAttribute.ResolveAsTypeStep): Override.
8561 (GlobalAttribute.ResolveArguments): Override.
8563 * class.cs (TypeAttr): Is protected.
8565 * codegen.cs (ModuleClass.DefaultCharSet): New member.
8566 (ModuleClass.DefaultCharSetType): New memeber.
8567 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
8569 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
8570 charset from module.
8572 * delegate.cs (TypeAttr): Override.
8573 (Delegate.DefineType): Use this TypeAttr.
8575 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
8576 at very early stage (before types are defined) to resolve model
8577 module attributes. It will probably not work with corlib but it
8580 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
8581 charset from module.
8583 * typemanager.cs (default_charset_type): New type.
8585 2005-04-13 Raja R Harinath <rharinath@novell.com>
8587 * decl.cs (MemberCache.AddMethods): Don't warn if
8588 System.Object.Finalize has buggy MethodAttributes.
8590 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
8593 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8595 * doc.cs : detect ambiguous reference to overloaded members.
8596 Fixed bug #71603. MS 1.1 csc does not detect it.
8598 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8600 * doc.cs : delegates must not be referenced with parameters.
8603 2005-04-12 Miguel de Icaza <miguel@novell.com>
8605 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
8607 2005-04-10 Miguel de Icaza <miguel@novell.com>
8609 * driver.cs (MainDriver): Stop processing if the CLS stage found
8612 (CompilerCallableEntryPoint.InvokeCompiler): Always
8613 reset after execution; Take a TextWriter argument for the
8616 * report.cs: Use the error stream instead of hardcoding stderr.
8618 2005-04-09 Miguel de Icaza <miguel@novell.com>
8620 * class.cs: Reduce code paths to test, too small of an
8621 optimization to make it worth the extra testing. Always perform
8624 2005-04-08 Raja R Harinath <rharinath@novell.com>
8627 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
8628 operators that had errors reported on them.
8630 2005-04-08 Marek Safar <marek.safar@seznam.cz>
8632 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
8634 (Attribute.Resolve): Add named argument type checking.
8636 * class.cs (FixedField.Define): Use IsPrimitiveType
8638 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
8640 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
8641 unsafe parameter types.
8643 * statement.cs (Using.ResolveExpression): Add better error description.
8645 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
8647 2005-04-08 Raja R Harinath <rharinath@novell.com>
8650 * attribute.cs (Attribute.GetAttributeUsage): Resolve
8651 AttributeUsageAttribute in the emitcontext of the attribute class,
8652 not in the emitcontext of the attributable entity it was attached to.
8653 * cs-parser.jay: Use 'current_class', not 'current_container',
8654 when creating a GlobalAttribute.
8656 2005-04-08 Alp Toker <alp@atoker.com>
8658 * pending.cs: The fix to #58413 failed to compile methods implementing
8659 interfaces with/without params modifiers and vice versa, even though
8660 params modifiers aren't part of the signature. Make the modifier check
8661 less strict as in csc.
8663 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
8664 Anoob V E <projectmonokochi@rediffmail.com>
8665 Harilal P R <projectmonokochi@rediffmail.com>
8668 * pending.cs (TypeAndMethods.mods): New. Store the parameter
8669 modifiers of pending methods.
8670 (PendingImplementation.PendingImplementation): Initialize it.
8671 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
8672 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
8673 with ParameterData. Add check for modifiers.
8674 * class.cs (MethodData.Define): Update to changes.
8676 2005-04-07 Raja R Harinath <rharinath@novell.com>
8678 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
8680 2005-04-07 Marek Safar <marek.safar@seznam.cz>
8682 * class.cs (PropertyMethod.Define): Check private accessor in abstract
8685 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
8688 * typemanager.cs: Registered RequiredAttributeAttribute.
8690 2005-04-06 Marek Safar <marek.safar@seznam.cz>
8692 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
8693 Warning CS0169 is back at level 3.
8694 (IMethodData.SetMemberIsUsed): New method.
8696 * decl.cs (IsUsed): New value; moved from FieldBase.Status
8697 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
8699 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
8701 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
8703 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
8706 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
8709 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
8710 to avoid the problems with nested types.
8712 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
8713 Anoob V.E <projectmonokochi@rediffmail.com>
8714 Harilal P.R <projectmonokochi@rediffmail.com>
8715 Raja R Harinath <rharinath@novell.com>
8718 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
8720 * typemanager (GetConstructor): Make public.
8722 2005-04-05 John Luke <john.luke@gmail.com>
8723 Raja R Harinath <rharinath@novell.com>
8726 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
8727 struct too. Return false quicker in a few cases.
8728 (VerifyUnManaged): Use it.
8730 2005-04-05 Raja R Harinath <rharinath@novell.com>
8733 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
8734 not 'unreachable_seen'.
8736 2005-04-04 Marek Safar <marek.safar@seznam.cz>
8738 * attribute.cs (Attribute.GetValue): Removed unused.
8740 * codegen.cs (CodeGen.TrimExt): Removed unused.
8742 * cs-parser.jay (output): Removed unused.
8744 * cs-tokenizer.cs (hex_digits): Removed unused.
8746 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
8748 * expression.cs (Indirection.LoadExprValue): Removed unused.
8749 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
8751 * iterators.cs (Iterator.param_types): Removed unused.
8753 * statement.cs (Goto.block): Removed unused.
8754 (ToplevelBlock.did): Removed unused.
8755 (Switch.ResolveConstantSwitch): Removed unused.
8757 2005-04-01 Ben Maurer <bmaurer@ximian.com>
8759 * rootcontext.cs: Allow mcs to bootstrap with the compilation
8762 2005-04-01 Raja R Harinath <rharinath@novell.com>
8764 Fix #74232 and cs0208-3.cs.
8765 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
8766 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
8767 unmanaged type. Don't use FieldBuilders when 't' is a
8768 TypeBuilder. Use ModFlags and MemberType fields.
8769 * class.cs (MemberBase.member_type): Rename from MemberType.
8770 (MemberBase.MemberType): New property. Determines member_type on
8772 (MemberBase.DoDefine): Don't initialize MemberType here.
8773 (FieldMember.Define): Likewise.
8775 2005-04-01 Marek Safar <marek.safar@seznam.cz>
8778 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
8779 Attributes are emitted there.
8781 2005-04-01 Raja R Harinath <rharinath@novell.com>
8783 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
8784 keyword in 'partial enum' too.
8785 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
8787 Report from Kamil Skalski <nazgul@omega.pl>.
8790 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
8791 have partial containers too.
8793 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
8794 in block' checks to Block.CheckInvariantMeaningInBlock.
8795 * statement.cs (Block.GetKnownVariableInfo): Make private.
8796 (Block.IsVariableUsedInChildBlock): Remove.
8797 (Block.IsVariableUsedInBlock): Likewise.
8798 (Block.CheckInvariantMeaningInBlock): New. Show location of
8799 conflicting declaration.
8800 (Block.AddVariable): Make error messages less long-winded and more
8801 specific. Show location of conflicting declaration.
8802 * parameter.cs (Parameters.Location): New readonly property.
8804 2005-03-31 Raja R Harinath <rharinath@novell.com>
8806 Clean up semantics of invoking ResolveMemberAccess.
8807 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
8808 can have an instance, ensure that we pass in a non-TypeExpression
8809 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
8810 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
8811 argument. Update to changes and simplify.
8812 (FieldExpr.Emitinstance): Remove CS0120 check.
8813 (PropertyExpr.EmitInstance): Likewise.
8814 * expression.cs (Argument.Resolve): Likewise.
8815 (Invocation.DoResolve): Update to changes in semantics of
8818 2005-03-31 Marek Safar <marek.safar@seznam.cz>
8821 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
8824 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
8826 2005-03-31 Raja R Harinath <rharinath@novell.com>
8828 Fix difference in behaviour with commandline invocation.
8829 * driver.cs (Driver.Reset): New.
8830 (CompilerCallableEntryPoint): Call it.
8832 * statement.cs (If.Resolve): Avoid spurious "uninitialized
8833 variable" warnings if the boolean expression failed to resolve.
8835 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
8837 * attribute.cs: Fix the union of several permissions when some of them
8838 are unrestricted (so the result isn't an unrestricted permission set).
8841 2005-03-30 Raja R Harinath <rharinath@novell.com>
8843 * ecore.cs (MemberExpr): New class. Convert from interface
8845 (MemberExpr.ResolveMemberAccess): Refactor and move here from
8846 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
8848 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
8849 (MethodGroupExpr.IsExplicitImpl): Remove.
8850 (Expression.GetFieldFromEvent): Remove.
8851 (SimpleName.MemberStaticCheck): Remove.
8852 (SimpleName.DoSimpleNameResolve): Update to changes.
8853 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
8854 (MemberAccess.IdenticalNameAndTypeName): Remove.
8855 (MemberAccess.error176): Move to MemberExpr.
8856 (MemberAccess.DoResolve): Update to changes.
8857 (BaseAccess.DoResolve): Likewise.
8859 2005-03-30 Marek Safar <marek.safar@seznam.cz>
8861 C# 2.0 Conditional attribute class implementation
8863 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
8864 Analyzes class whether it has attribute which has ConditionalAttribute
8865 and its condition is not defined.
8867 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
8868 (Class.IsExcluded): New method. Search for at least one defined
8869 condition in ConditionalAttribute of attribute class.
8871 2005-03-30 Raja R Harinath <rharinath@novell.com>
8873 * ecore.cs (PropertyExpr): Derive from Expression, not
8874 ExpressionStatement.
8875 (PropertyExpr.EmitStatement): Remove.
8877 2005-03-29 Raja R Harinath <rharinath@novell.com>
8880 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
8881 internal field "value__" of an enum be private. The examples for
8882 "value__" that I found on MSDN all used FieldAttributes.Private.
8884 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
8885 Don't mention IL method attribute names.
8887 Fix #47991. Remove a TODO.
8888 * statement.cs (Block.Toplevel): Make into a field.
8889 (Block.Parameters): Move into ToplevelBlock.
8890 (Block.known_variables): Rename from child_variable_names.
8891 (Block.Block): Remove variants that take Parameters. Initialize
8892 'Toplevel' with the immediately surrounding toplevel block.
8893 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
8894 LocalInfo parameter.
8895 (Block.GetKnownVariableInfo): New.
8896 (Block.IsVariableNameUsedInChildBlock): Update.
8897 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
8898 the block, even though it may not be in scope.
8899 (Block.AddVariable): Remove Parameters parameter. Use
8900 Toplevel.Parameters instead.
8901 (Block.AddConstant): Remove Parameters parameter.
8902 (Block.GetParameterReference): Update to use Toplevel.Parameters.
8903 (Block.IsParamaterReference): Likewise.
8904 (Block.IsLocalParameter): Likewise. Simplify a lot.
8905 (ToplevelBlock.Parameters): New. Moved from Block.
8906 (ToplevelBlock.ToplevelBlock): Update to changes. Always
8907 initialize Parameters to a non-null value.
8908 * cs-parser.jay: Update to changes.
8909 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
8910 simple names that mean different things in the same block. Use
8911 Block.IsVariableNameUsedInBlock.
8913 2005-03-28 Raja R Harinath <rharinath@novell.com>
8915 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
8916 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
8917 GetTypeHandle. It is possible for a reflected type to derive from
8918 a TypeBuilder (e.g., int[] derives from the TypeBuilder
8919 System.Array during mscorlib compilation).
8920 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
8921 contain a method_hash, don't create one either. Don't create a
8922 deep copy of the base cache's method_hash.
8923 (MemberCache.SetupCache): Rename back from DeepCopy.
8924 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
8925 already initialized. If we see an override function, add its
8926 underlying base virtual function to the member_hash too.
8928 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
8930 2005-03-26 Raja R Harinath <harinath@acm.org>
8933 * assign.cs (Assign.DoResolve): When the RHS of an assignment
8934 fails to resolve, ensure that the LHS is still resolved as an
8937 2005-03-25 Raja R Harinath <harinath@acm.org>
8939 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
8941 (Enum.current_ec): Remove.
8942 (Enum.LookupEnumValue): Remove EmitContext argument.
8943 Just uses the one created during DefineType.
8944 (Enum.FindMembers): Update.
8945 * expression.cs (MemberAccess.DoResolve): Update.
8947 2005-03-22 Marek Safar <marek.safar@seznam.cz>
8949 * assign.cs (Assign.DoResolve): Check for CS1717 when
8950 source and target are same (uses Equals).
8952 * expression.cs (LocalVariableReference, ParameterReference,
8953 This): Implemented Equals, GetHashCode.
8955 * statement.cs (Block.GetParameterReference): Removed useless
8958 2005-03-22 Raja R Harinath <rharinath@novell.com>
8961 * statement.cs (Block.AddVariable): Ensure that we skip implicit
8962 blocks before deciding whether the error is cs0136 or cs0128.
8964 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
8965 (using_alias_directive, using_namespace_directive): Pass
8966 MemberName, not an expression to Namespace.UsingAlias and
8968 (MakeName): Use the MemberName of the namespace.
8969 * namespace.cs (Namespace.MemberName): New.
8970 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
8971 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
8973 * decl.cs (MemberName.Name): Make readonly.
8974 (MemberName.FromDotted): New "constructor".
8975 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
8976 (MemberCore.Name): Compute from MemberName on demand.
8977 (MemberCore.SetMemberName): Provide a way to change the
8979 (MemberCore.AddToContainer): Don't take a fullname parameter.
8980 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
8981 fully qualified name of the container to the member name.
8982 (TypeContainer.AddToTypeContainer): Use a fully qualified name
8983 only if the type is a member of the root container.
8984 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
8985 MemberName.Left rather than searching for an embedded ".".
8986 (PartialContainer.CreatePart): Update to changes in RootContext.
8987 (MemberBase.ShortName): Turn into a property. Use
8988 MemberCore.SetMemberName.
8989 (MemberBase.ExplicitInterfaceName): Remove.
8990 (MemberBase.UpdateMemberName): Remove.
8991 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
8992 (PropertyBase.SetMemberName): New override.
8993 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
8994 (Tree.GetDecl): New.
8995 (Tree.AllDecls): Rename from Decls.
8996 * attribute.cs, enum.cs, report.cs: Update to changes.
8997 * driver.cs (MainDriver): Use MemberName.FromDotted on
8998 RootContext.MainClass.
9000 2005-03-21 Marek Safar <marek.safar@seznam.cz>
9002 * class.cs (FixedField.Define): Check for CS1664 and more sanity
9005 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
9007 2005-03-18 Marek Safar <marek.safar@seznam.cz>
9009 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
9010 property accessor modifiers.
9012 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
9013 fixed buffer attribute (CS1716).
9014 (PropertyMethod.HasCustomAccessModifier): When property accessor
9015 has custom modifier.
9017 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
9019 (PropertyExpr.DoResolveLValue): Add CS0272.
9021 2005-03-17 Miguel de Icaza <miguel@novell.com>
9023 * convert.cs: When converting to a pointer, use the proper Conv.U
9024 or Conv.I depending on the source data type.
9026 * cs-tokenizer.cs: Make the size for large decimal constants,
9029 2005-03-17 Martin Baulig <martin@ximian.com>
9031 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
9032 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
9034 2005-03-17 Martin Baulig <martin@ximian.com>
9036 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
9037 to bool so we can return an error condition.
9038 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
9041 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
9043 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
9046 2005-03-16 Raja R Harinath <rharinath@novell.com>
9048 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
9049 Refactor to avoid traversing the list of assemblies, and to avoid
9050 string concatenation.
9051 * typemanager.cs (guid_attr_type): Remove.
9052 (negative_hits, pointers, references): Remove hashes.
9054 (GetConstructedType): New. Uses type_hash to handle constructed
9055 types (arrays, references, pointers).
9056 (GetReferenceType, GetPointerType): Use it.
9057 (GetNestedType): New. Uses type_hash to handle nested types of
9059 (LookupType, LookupTypeDirect): Remove.
9060 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
9061 'types' hash and LookupTypeReflection directly.
9062 (params_string, params_object): Use GetConstructedType.
9063 * namespace.cs (Namespace.cached_types): New. Cache of reflected
9065 (Namespace.Lookup): Use cached_types.
9066 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
9067 provided by old TypeManager.LookupType.
9068 * rootcontext.cs (MakeFQN): Remove.
9069 * decl.cs (DeclSpace.MakeFQN): Likewise.
9070 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
9071 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9072 TypeManager.GetConstructedType.
9073 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
9075 2005-03-15 Marek Safar <marek.safar@seznam.cz>
9077 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
9080 * cs-parser.jay: Reports CS1527 for any namespace element.
9082 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
9085 * expression.cs (ParameterReference.IsAssigned): Changed error to
9087 (Error_WrongNumArguments): Moved CS0245 detection here.
9089 * statement.cs (Return.Resolve): Add CS1622 report.
9091 2005-03-11 Marek Safar <marek.safar@seznam.cz>
9093 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
9095 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
9097 * attribute.cs expression.cs: Get rid of some allocations.
9099 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
9101 * doc.cs : just eliminate the latest change.
9103 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
9105 * doc.cs : commented out the latest change. It breaks xml-030.cs
9107 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
9109 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
9110 fail. So invoke CreateType() in FindDocumentedType().
9112 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
9114 * cs-tokenizer.cs : added IsKeyword().
9115 * doc.cs : Detect keyword incorrectly used as identifier.
9116 Allow identifiers prefixed by @.
9118 2005-03-10 Marek Safar <marek.safar@seznam.cz>
9120 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
9121 It caused exception in namespace resolving (again!).
9123 * class.cs (Class.ctor): Removed exit.
9124 (PropertyMethod.ctor): ditto.
9126 * codegen.cs (Codegen.Reset): Reset static data.
9127 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
9129 * cs-tokenizer.cs (Cleanup): Removed.
9131 * driver.cs (GetSystemDir): Rewrote to one line command.
9132 It caused problem with unloaded dynamic modules.
9133 (UnixParseOption): Removed Exit.
9134 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
9135 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
9136 Now can be mcs used as library.
9138 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
9141 * location.cs (Reset): Reset static data.
9143 * namespace.cs (Reset): Reset static data.
9145 * report.cs (Report.Reset): Reset static data.
9147 * rootcontext.cs (RootContext.Reset): Reset static data.
9149 * tree.cs (RootTypes.ctor): Use Location.Null
9151 * typemanager.cs (TypeManager.Reset): Reset static data.
9152 (CoreLookupType): Removed Exit.
9153 (TypeHandle.Reset): Reset static data.
9155 2005-03-10 Raja R Harinath <rharinath@novell.com>
9158 * typemanager.cs (ComputeNamespaces): Import namespaces from
9159 referenced modules too.
9161 2005-03-09 Raja R Harinath <rharinath@novell.com>
9163 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
9166 2005-03-09 Raja R Harinath <rharinath@novell.com>
9168 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
9169 enclosing DeclSpace. This ensures that a name-lookup populates
9170 more caches and there are fewer 'TypeExpression's. Carve out
9171 nested type lookup into ...
9172 (LookupNestedTypeInHierarchy): ... this.
9174 2005-03-09 Raja R Harinath <rharinath@novell.com>
9176 Clean up a few partial-class semantics.
9177 Fixes test-357.cs and cs1618-2.cs.
9178 * cs-parser.jay (struct_declaration): Use 'current_class' as
9179 parent of newly-created struct. Remove call to Register ().
9180 Use 'pop_current_class' to complete handing the current struct.
9181 (interface_declaration): Likewise.
9182 (class_declaration): Likewise.
9183 (enum_declaration): Use 'current_class' as parent of newly created
9185 (delegate_declaration): Likewise.
9186 (pop_current_class): New function. This is used to handle closing
9187 up the 'current_class' and 'current_container', and pointing them
9188 to the enclosing class/container.
9189 (CSharpParser): Initialize 'current_class' too.
9190 * decl.cs (MemberCore): Add check for invariant: a partial
9191 container is not a parsed entity, and thus does not enclose any
9193 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
9194 (DeclSpace.BaseTypeExpr): Use it.
9195 (DeclSpace.LookupType): Add check for invariant.
9196 * class.cs (TypeContainer): Add check for invariant: a nested
9197 class should have the same NamespaceEntry as its enclosing class.
9198 (TypeContainer.EmitFieldInitializers): Make virtual.
9199 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
9201 (TypeContainer.Register): Remove.
9202 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
9203 null. Use TypeResolveEmitContext for resolving base types and
9204 interfaces. Move initialization of Parts.TypeBuilder here from
9206 (TypeContainer.DefineNestedTypes): ... here.
9207 (PartialContainer): Take a Namespace not a NamespaceEntry.
9208 (PartialContainer.Create): Don't use Register. Call the
9209 appropriate Add... function directly.
9210 (ClassPart): Take both the PartialContainer and the enclosing
9211 class as constructor arguments.
9212 (ClassPart.EmitFieldInitializers): Override.
9213 (ClassPart.PartFindNestedTypes): Remove.
9214 (FieldBase.GetInitializerExpression): Resolve the initializer
9215 expression in the emit context of the enclosing class.
9216 * tree.cs (RootTypes): Remove Register ().
9218 2005-03-08 Marek Safar <marek.safar@seznam.cz>
9220 * cs-parser.jay: Removed CS0134.
9222 * driver.cs: Removed CS1901.
9224 * expression.cs (SizeOf.DoResolve): Don't report CS0233
9225 for predefined types.
9227 2005-03-07 Duncan Mak <duncan@novell.com>
9229 * codegen.cs (Save): Catch UnauthorizedAccessException as
9230 well. Fixes bug #73454.
9232 2005-03-07 Marek Safar <marek.safar@seznam.cz>
9234 * cs-tokenizer.cs (xtoken): Add CS1035.
9236 * class.cs (MethodData.Define): Add CS0683.
9237 (FieldMember.ctor): Add CS0681.
9239 2005-03-07 Raja R Harinath <rharinath@novell.com>
9241 * ecore.cs (SimpleName.DoResolve): Rename from
9242 SimpleName.DoResolveAllowStatic.
9243 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
9244 Pass 'intermediate' flag to MemberStaticCheck.
9245 (SimpleName.MemberStaticCheck): Skip "static check" only in case
9246 of "intermediate" lookups via MemberAccess.
9247 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
9248 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
9250 2005-03-07 Raja R Harinath <rharinath@novell.com>
9253 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
9254 slipped in because of variable names that are identical to a
9255 builtin type's BCL equivalent ('string String;', 'int Int32;').
9256 (PropertyExpr.EmitInstance): Likewise.
9258 2005-03-04 Marek Safar <marek.safar@seznam.cz>
9260 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
9262 * report.cs (warning_ignore_table): Made public.
9264 2005-03-04 Raja R Harinath <rharinath@novell.com>
9267 * class.cs (MethodData.Emit): Pass 'container' to
9268 container.GetObsoleteAttribute instead of 'container.Parent'.
9270 2005-03-03 Marek Safar <marek.safar@seznam.cz>
9272 * cs-parser.jay: Add 1534 error test.
9274 * iterators.cs (Yield.CheckContext): Add error 1629.
9275 (Iterator.ctor): Save unsafe modifier.
9276 (MoveNextMethod.DoEmit): Restore unsafe context.
9278 * namespace.cs (UsingAlias): Better error message.
9280 2005-03-03 Dan Winship <danw@novell.com>
9282 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
9283 the warning message [#73219]
9285 2005-03-03 Raja R Harinath <rharinath@novell.com>
9287 Fix compile with MCS 1.0.0.0.
9288 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
9289 w_restore to not depend on string constant folding.
9291 2005-03-03 Raja R Harinath <rharinath@novell.com>
9293 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
9294 CS0246 check to users who passed 'silent = false'.
9295 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
9297 (SimpleName.SimpleNameResolve): Update.
9298 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
9299 (MemberAccess.IdenticalNameAndTypeName): Update.
9300 * doc.cs (FindDocumentedTypeNonArray): Update.
9302 2005-03-03 Raja R Harinath <rharinath@novell.com>
9304 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
9305 * parameters.cs (ComputeAndDefineParameters): Remove.
9306 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
9307 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
9308 Use GetParameterInfo.
9310 2005-03-02 Marek Safar <marek.safar@seznam.cz>
9312 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
9314 2005-03-02 Raja R Harinath <rharinath@novell.com>
9316 Unify DeclSpace.LookupType and DeclSpace.FindType.
9317 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
9318 is in charge of defining nested types on demand.
9319 (DeclSpace.LookupType): Use it when the current_type is a
9320 TypeBuilder. Use LookupTypeDirect for reflected types.
9321 (DeclSpace.FindType): Remove.
9322 (DeclSpace.LookupInterfaceOrClass): Likewise.
9323 (DeclSpace.DefineTypeAndParents): Likewise.
9324 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
9325 DeclSpace.LookupType.
9326 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
9327 * typemanager.cs (LookupType): Simplify.
9328 (AddUserType): Remove type from negative_hits.
9329 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
9330 * class.cs (TypeContainer.FindMembers): Move handling of nested
9332 (TypeContainer.FindMembers_NestedTypes): ... here.
9333 (TypeContainer.FindNestedType): Implement override.
9334 (ClassPart.FindNestedType): Delegate to PartialContainer.
9335 (ClassPart.PartFindNestedType): Looks up the nested types of the
9338 2005-03-02 Martin Baulig <martin@ximian.com>
9340 * class.cs (TypeContainer.DoDefineMembers): We also need a default
9341 static constructor in static classes.
9343 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
9345 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
9346 sizeParamIndex is not specified.
9348 2005-03-01 Marek Safar <marek.safar@seznam.cz>
9351 * report.cs (WarningMessage.IsEnabled): Missing null check.
9353 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9355 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
9356 in the fields and not in the properties.
9358 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
9360 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
9363 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9365 * attribute.cs: Small refactoring (improved robustness).
9366 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
9367 (ValidateGuid): Removed.
9368 (Resolve): Removed referenced to above mentioned.
9369 (GetAttributeUsage): Made private and changed to work without
9371 (GetIndexerAttributeValue): Don't crash.
9372 (GetConditionalAttributeValue): Ditto.
9373 (GetClsCompliantAttributeValue): Ditto.
9374 (ExtractSecurityPermissionSet): All attributes exceptions are
9376 (GetPropertyValue): New helper.
9377 (GetMethodImplOptions): New method.
9378 (DefinePInvokeMethod): Reuse common code. Implemented handling of
9379 some missing properties.
9381 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
9382 (Method.ApplyAttributeBuilder): Updated.
9384 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
9387 2005-02-28 Raja R Harinath <rharinath@novell.com>
9390 * report.cs (Report.SymbolRelatedToPreviousError): Handle
9391 non-simple types (array, pointer, reference).
9393 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9395 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
9397 * class.cs (MethodCore.IsDuplicateImplementation): Special error
9399 (Method.CheckBase): Catch wrong destructor here.
9400 (MethodData.Define): Add errors 550, 668.
9402 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
9404 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
9406 * pending.cs (VerifyPendingMethods): Add error 551.
9408 * typemanager.cs (CSharpName): Next error report helper.
9410 2005-02-25 Marek Safar <marek.safar@seznam.cz>
9412 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
9413 attributes. Removed useless attribute double check.
9414 It saves almost 2MBs for corlib.
9416 2005-02-25 Raja R Harinath <rharinath@novell.com>
9419 * statement.cs (ExpressionStatement.Resolve): Make robust to being
9420 called twice in case of error.
9422 2005-02-23 Chris Toshok <toshok@ximian.com>
9424 Fix compiler portions of #72827.
9425 * statement.cs (Block.Emit): call Begin/EndScope on the
9426 EmitContext instead of the ILGenerator.
9428 * codegen.cs (EmitContext.BeginScope): new method, call
9429 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
9431 (EmitContext.BeginScope): same, but EndScope and CloseScope
9433 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
9434 offset and call the superclass's OpenScope(int) with it.
9435 (SymbolWriter.CloseScope): get the current il
9436 offset and call superclass's CloseScope(int) with it.
9438 2005-02-23 Marek Safar <marek.safar@seznam.cz>
9440 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
9441 CS1677 for out and ref as well.
9443 * class.cs (Method.Define): Add error CS1599 detection.
9445 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
9447 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
9449 * delegate.cs (Delegate.Define): Add error CS1599 detection.
9451 * support.cs.cs (ModifierDesc): New helper method.
9453 2005-02-23 Raja R Harinath <rharinath@novell.com>
9454 Abin Thomas <projectmonokochi@rediffmail.com>
9455 Anoob V E <projectmonokochi@rediffmail.com>
9456 Harilal P R <projectmonokochi@rediffmail.com>
9459 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
9460 MemberLookup (used for error reporting) actually returns a result.
9461 Fix error report number (122, not 112).
9463 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
9464 Anoob V E <projectmonokochi@rediffmail.com>
9465 Harilal P R <projectmonokochi@rediffmail.com>
9468 * pending.cs (PendingImplementation.GetAbstractMethods):
9469 Find NonPublic members too.
9471 2005-02-22 Marek Safar <marek.safar@seznam.cz>
9473 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
9476 * class.cs (MethodCore.CheckMethodAgainstBase):
9477 Add error 239 report.
9479 2005-02-21 Raja R Harinath <rharinath@novell.com>
9482 * expression.cs (Invocation.IsApplicable): Make public.
9483 (Invocation.IsParamsMethodApplicable): Likewise.
9484 * delegate.cs (Delegate.VerifyApplicability): Don't use
9485 Invocation.VerifyArgumentCompat for parameter applicability
9486 testing. Use Invocation.IsApplicable and
9487 Invocation.IsParamsMethodApplicable.
9489 2005-02-21 Marek Safar <marek.safar@seznam.cz>
9491 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
9493 * class.cs (Operator.Define): Add error 217 report.
9495 2005-02-21 Raja R Harinath <rharinath@novell.com>
9497 * namespace.cs (UsingEntry.Resolve): Undo change below.
9499 2005-02-21 Raja R Harinath <rharinath@novell.com>
9502 * ecore.cs (Expression.MemberLookupFailed): Add argument to
9503 disable the error message when the extended MemberLookup also
9505 (Expression.MemberLookupFinal): Update.
9506 (SimpleName.DoSimpleNameResolve): Update.
9507 * expression.cs (MemberAccess.ResolveNamespaceOrType):
9508 Don't use MemberLookupFinal.
9509 (New.DoResolve): Update.
9510 (BaseAccess.CommonResolve): Update.
9512 2005-02-21 Raja R Harinath <rharinath@novell.com>
9515 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
9516 occured previously, don't resolve again.
9518 2005-02-21 Marek Safar <marek.safar@seznam.cz>
9521 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
9522 argument. Call ResolveAttributeUsage for unresolved.
9523 when types doesn't match ctor arguments.
9525 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
9526 for nested attribute classes.
9527 (Class.attribute_usage): Removed.
9528 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
9529 for attribute class.
9531 * ecore.cs (IsAttribute): Removed.
9533 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
9535 * rootcontext.cs (RegisterAttribute): Removed, attributes are
9537 (attribute_types): Removed.
9538 (EmitCode): Global attributes are emited as the latest.
9540 2005-02-18 Marek Safar <marek.safar@seznam.cz>
9542 * class.cs (EmitFieldInitializers): Don't emit field initializer
9543 for default values when optimilization is on.
9545 * constant.cs (Constant.IsDefaultValue): New property.
9547 * driver.cs: Add /optimize handling.
9551 * literal.cs: Implement new IsDefaultValue property.
9553 * rootcontext.cs (Optimize): New field, holds /optimize option.
9555 2005-02-18 Raja R Harinath <rharinath@novell.com>
9557 Fix crasher in re-opened #72347.
9558 * namespace.cs (Namespace.Lookup): Return null if
9559 DeclSpace.DefineType returns null.
9562 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
9564 2005-02-18 Raja R Harinath <rharinath@novell.com>
9566 Fix remainder of #63202. Change semantics of DoResolveLValue: it
9567 now returns null if it cannot resolve to an lvalue.
9568 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
9569 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
9570 returned null. Remove check for SimpleName.
9571 (EventExpr.DoResolveLValue): New.
9572 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
9573 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
9575 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
9577 (Unary.ResolveOperator): Move CS0211 check ...
9578 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
9580 (Unary.DoResolveLValue): Simplify.
9581 (AddressOf.DoResolveLValue): New.
9582 (ArrayAccess.DoResolveLValue): New.
9584 2005-02-16 Marek Safar <marek.safar@seznam.cz>
9586 * attribute.cs (Attribute.Resolve): Add arguments casting for
9587 when types doesn't match ctor arguments.
9589 2005-02-16 Raja R Harinath <rharinath@novell.com>
9591 Fix parts of #63202.
9592 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
9593 lookup of operator in base type. Ensure that all checks happen
9594 when the operator resolves to an "op_..." method.
9596 2005-02-15 Raja R Harinath <rharinath@novell.com>
9599 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
9600 'ignore_cs0104' parameter. Pass it to ...
9601 (NamespaceEntry.Lookup): ... this.
9602 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
9603 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
9604 (TypeLookupExpression.DoResolveAsTypeStep): Update.
9605 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
9606 Update. Request that cs0104 errors be ignored.
9607 (ComposedCast.ResolveAsTypeStep): Update.
9609 2005-02-14 Raja R Harinath <rharinath@novell.com>
9612 * expression.cs (Invocation.BetterFunction): Remove support for
9613 comparing virtual functions and their overrides.
9614 (Invocation.IsOverride): New.
9615 (Invocation.OverloadResolve): Don't consider 'override' functions
9616 during candidate selection. Store them in a lookaside list.
9617 If the selected method is a 'virtual' function, use the list to
9618 find any overrides that are closer to the LHS type.
9620 2005-02-14 Marek Safar <marek.safar@seznam.cz>
9622 * expression.cs (New.DoResolve): Add complex core type reduction.
9623 (New.Constantify): Converts complex core type syntax like 'new int ()'
9626 2005-02-14 Raja R Harinath <rharinath@novell.com>
9628 * decl.cs (EntryType.EntryType): New constructor to create an
9629 updated copy of a cache entry.
9630 (MemberCache.AddMethods): Use it.
9631 (MemberCache.ClearDeclaredOnly): Remove.
9632 (MemberCache.MemberCache): Update.
9634 2005-02-11 Miguel de Icaza <miguel@novell.com>
9636 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
9637 variable. This one is represents the actual low-level declaration
9638 of the method, as opposed to the semantic level `IsStatic'.
9640 An anonymous method which is hosted into a static method might be
9641 actually an instance method. IsStatic would reflect the
9642 container, while MethodIsStatic represents the actual code
9645 * expression.cs (ParameterReference): Use the new MethodIsStatic
9646 instead of IsStatic.
9648 * anonymous.cs (AnonymousMethod.Compatible): Pass the
9649 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
9650 set on the current EmitContext.
9652 * expression.cs (Cast): Overload DoResolveLValue so we can pass
9653 resolve our casted expression as an LValue. This triggers the
9654 proper LValue processing that is later required by Assign.
9658 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
9660 2005-02-11 Marek Safar <marek.safar@seznam.cz>
9662 C# 2.0 Fixed buffer implementation
9664 * anonymous.cs: Update after RegisterHelperClass renaming.
9666 * attribute.cs (AttributeTester.fixed_buffer_cache):
9667 Cache of external fixed buffers.
9668 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
9669 implementation if field is fixed buffer else null.
9672 (TypeContainer.AddField): Accept FieldMember instead of Field.
9673 (FieldBase.IsFieldClsCompliant): Extracted code from
9674 VerifyClsCompliance descendant customization.
9675 (FixedField): New class handles fixed buffer fields.
9676 (FixedFieldExternal): Keeps information about imported fixed
9678 (IFixedField): Make access to internal or external fixed buffer
9681 * cs-parser.jay: Add fixed buffer parsing.
9683 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
9686 * expression.cs (Indirection): Extended implementation to accept
9688 (PointerArithmetic.Emit): Get element from fixed buffer as well.
9689 (ElementAccess.MakePointerAccess): Get type as parameter.
9690 (DoResolve): Add fixed buffer field expression conversion.
9691 (DoResolveLValue): Ditto.
9692 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
9693 (ArrayPtr): Derives from FixedBufferPtr.
9694 (ArrayPtr.Emit): Add extra emit for array elements.
9696 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
9698 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
9699 for compiler generated types.
9700 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
9702 * statement.cs (Fixed): Refactored to be easier add fixed buffer
9703 and consume less memory.
9704 (Fixed.Resolve): Add fixed buffer case.
9706 * typemanager.cs (compiler_generated_attr_ctor,
9707 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
9708 (HasElementType): Add our own implementation to work on every
9711 2005-02-11 Miguel de Icaza <miguel@novell.com>
9713 * anonymous.cs (CaptureContext): Track whether `this' has been
9716 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
9717 only captured `this' if it was implicitly done (instance
9718 methods/variables were used).
9720 * codegen.cs (EmitContext.CaptureThis): New method to flag that
9721 `this' must be captured.
9723 2005-01-30 Miguel de Icaza <miguel@novell.com>
9725 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
9726 is null it means that there has been no need to capture anything,
9727 so we just create a sibling.
9729 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
9731 Just a partial fix. The other half is fairly elusive.
9733 2005-02-10 Raja R Harinath <rharinath@novell.com>
9735 Fix #52586, cs0121-4.cs.
9736 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
9737 and return a hashtable.
9738 (MemberCache.ClearDeclaredOnly): New.
9739 (MemberCache.MemberCache): Update to change. Make a deep copy of
9740 the method_hash of a base type too.
9741 (MemberCache.AddMethods): Adapt to having a deep copy of the base
9742 type methods. Overwrite entries with the same MethodHandle so
9743 that the ReflectedType is correct. The process leaves in base
9744 virtual functions and their overrides as distinct entries.
9745 (CacheEntry): Now a class instead of a struct. It shouldn't alter
9746 matters since it was boxed in a ArrayList before.
9747 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
9749 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
9750 case of a virtual function and its override (choose the overload
9752 (Invocation.OverloadResolve): Avoid 'override' members during
9753 'applicable_type' calculation.
9755 2005-02-09 Raja R Harinath <rharinath@novell.com>
9757 Combine two near-redundant caches.
9758 * typemanager.cs (method_params): Rename from method_internal_params.
9759 (TypeManager.GetParameterData): New. Replace
9760 Invocation.GetParameterData.
9761 (TypeManager.LookupParametersByBuilder): Remove.
9762 * expression.cs (Invocation.method_parameter_cache): Remove.
9763 (Invocation.GetParameterData): Remove.
9765 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
9768 2005-02-08 Raja R Harinath <rharinath@novell.com>
9771 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
9772 TypeManager.multicast_delegate_type is null, resolve it by looking
9773 up "System.MulticastDelegate".
9774 * rootcontext.cs (RootContext.ResolveCore): Simplify.
9776 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
9777 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
9778 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
9781 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
9782 (LabeledStatement.AddReference): New. Set 'referenced'.
9783 (Goto.Resolve): Use it.
9785 2005-02-05 John Luke <john.luke@gmail.com>
9787 * driver.cs: remove duplicate -doc line in Usage ()
9789 2005-02-04 Raja R Harinath <rharinath@novell.com>
9791 * location.cs (Location.AddFile): Fix CS2002 error report.
9793 2005-02-02 Martin Baulig <martin@ximian.com>
9795 * delegate.cs (Delegate.DefineType): Report an internal error if
9796 TypeManager.multicast_delegate_type is null. See bug #72015 for
9799 2005-02-02 Raja R Harinath <rharinath@novell.com>
9801 Fix a crasher in a variant of #31984.
9802 * const.cs (Constant.CheckBase): New override that defers the
9803 new-or-override check in case the base type hasn't been populated
9805 (Constant.Define): Ensure the new-or-override check is performed.
9807 2005-02-01 Duncan Mak <duncan@ximian.com>
9809 * const.cs (LookupConstantValue): Check that `ce' is not null
9810 before calling GetValue ().
9812 2005-02-01 Raja R Harinath <rharinath@novell.com>
9814 Fix test-334.cs (#69519).
9815 * cs-parser.jay (using_alias_directive): Pass in an expression to
9816 NamespaceEntry.UsingAlias.
9817 (using_namespace_directive): Pass in an expression to
9818 NamespaceEntry.Using.
9819 (namespace_name): Don't flatten to a string.
9820 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
9821 (NamespaceEntry.AliasEntry.Resolve): Lookup using
9823 (NamespaceEntry.UsingEntry): Likewise.
9824 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
9826 (NamespaceEntry.LookupForUsing): Remove.
9827 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
9829 (NamespaceEntry.Lookup): Remove support for dotted names.
9831 2005-02-01 Raja R Harinath <rharinath@novell.com>
9833 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
9835 (NamespaceEntry.ImplicitParent): Compute on demand.
9836 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
9837 parallels the current.
9838 (NamespaceEntry.LookupForUsing): Use it.
9839 (NamespaceEntry.Lookup): If the current namespace-entry is
9840 implicit, don't search aliases and using tables.
9842 2005-02-01 Raja R Harinath <rharinath@novell.com>
9845 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
9847 (TypeContainer.BaseCache): Compute on demand.
9848 (TypeContainer.FindMembers): Define constants and types if they're
9849 not already created.
9850 (FieldMember.Define): Move resetting of ec.InUnsafe before error
9852 * const.cs (Constant.Define): Make idempotent.
9854 2005-01-29 Miguel de Icaza <miguel@novell.com>
9856 * pending.cs: Produce better code (no nops produced by using Ldarg
9859 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
9860 i - 1' it should be arg + 1.
9864 2005-01-28 Raja R Harinath <rharinath@novell.com>
9866 * attribute.cs (Attribute.CheckAttributeType): Make private
9868 (Attribute.ResolveType): Make virtual.
9869 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
9870 handling of RootContext.Tree.Types.
9872 2005-01-27 Raja R Harinath <rharinath@novell.com>
9874 Update attribute-handling to use the SimpleName/MemberAccess
9876 * cs-parser.jay (attribute): Pass in an expression to the
9877 constructors of Attribute and GlobalAttribute.
9878 * attribute.cs (Attribute): Take an expression for the name.
9879 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
9880 passed in attribute name expression.
9881 (Attribute.CheckAttributeType): Use it.
9882 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
9883 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
9884 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
9885 argument to prevent error messages if the lookup fails.
9887 2005-01-27 Marek Safar <marek.safar@seznam.cz>
9889 * expression.cs (Indirection): Implemented IVariable interface
9890 to support indirection in AddressOf operator.
9891 (PointerArithmetic.Emit): Add optimalization for case where
9892 result can be precomputed.
9894 2005-01-26 Martin Baulig <martin@ximian.com>
9896 * class.cs (TypeContainer.AttributeTargets): Return the correct
9897 AttributeTargets depending on our `Kind' instead of throwing an
9898 exception; fixes #71632.
9900 2005-01-26 Marek Safar <marek.safar@seznam.cz>
9903 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
9906 2005-01-25 Raja R Harinath <rharinath@novell.com>
9909 * expression.cs (MemberAccess.DoResolve): Don't complain with
9910 cs0572 when the LHS of a member access has identical name and type
9913 2005-01-25 Marek Safar <marek.safar@seznam.cz>
9916 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
9918 Create custom PermissionSet only for PermissionSetAttribute.
9920 2005-01-24 Marek Safar <marek.safar@seznam.cz>
9923 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
9924 delegates in static class.
9926 2005-01-24 Martin Baulig <martin@ximian.com>
9928 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9929 merging an implicit block, just use its reachability.
9931 * statement.cs (Block.Resolve): Make the unreachable code check
9932 work wrt. implicit blocks; see test-337 from #63842.
9934 2005-01-21 Alp Toker <alp@atoker.com>
9936 * cs-parser.jay: destructor_declaration's container is PartialContainer
9937 not Class when partial types are used, so use Kind prop instead of
9940 2005-01-22 Miguel de Icaza <miguel@ximian.com>
9942 * cs-parser.jay: Improve error reporting when an interface
9945 2005-01-20 Dick Porter <dick@ximian.com>
9947 * support.cs: SeekableStreamReader fix from Sandor Dobos
9948 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
9949 chars are read. Fixes bug 70369.
9951 2005-01-20 Raja R Harinath <rharinath@novell.com>
9953 * cs-parser.jay (catch_clause): Simplify current_block handling
9956 2005-01-17 Miguel de Icaza <miguel@ximian.com>
9958 * convert.cs (ImplicitStandardConversionExists): Synchronize the
9959 code with ImplicitStandardConversion to handle the implicit
9960 conversion of method groups into valid delegate invocations.
9962 The problem is that in parameter handling we were using this code
9963 path. Fixes bug #64698
9965 2005-01-19 Raja R Harinath <rharinath@novell.com>
9967 * cs-parser.jay: Fix several infelicities.
9968 - Avoid assigning to the parser value stack. Code like
9969 '$3 = null' is unclean. Synthesize a value for the code block
9971 - Avoid using oob_stack for storing location information. Use ...
9972 (_mark_): ... this. New (empty) rule. Saves the current location
9974 (foreach_statement): Avoid using oob_stack for current_block
9975 handling. Use technique used in for_statement and
9976 using_statement. Synthesize a value for the code block to store
9977 additional intermediate information.
9979 2005-01-13 Miguel de Icaza <miguel@ximian.com>
9981 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
9982 of a different type is only allowed to private fields of a
9983 containing type, not on fields of a base class.
9985 See test-174.cs and error cs0122-9.cs
9987 2005-01-13 Raja R Harinath <rharinath@novell.com>
9989 Fix test-335.cs (bug #58126).
9990 * cs-parser.jay (argument): Split out non-expression parts of the
9991 rule into 'non_simple_argument'.
9992 (invocation_expression): Support parenthesized invocations with
9993 multiple arguments, and with single non-simple arguments.
9995 2005-01-13 Raja R Harinath <rharinath@novell.com>
9997 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
10000 2005-01-12 Raja R Harinath <rharinath@novell.com>
10002 Fix cs0038-1.cs, cs1640-6.cs.
10003 * ecore.cs (Expression.Resolve): Remove special-case for
10004 SimpleName in error-handling.
10005 (Expression.almostMatchedMembers): Relax access permission to
10007 (Expression.MemberLookupFailed): Handle duplicates in
10008 almostMatchedMembers list.
10009 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
10010 * expression.cs (New.DoResolve): Report CS1540 for more cases.
10011 * typemanager.cs (GetFullNameSignature): Use the MethodBase
10012 overload if the passed in MemberInfo is a MethodBase.
10014 2005-01-12 Marek Safar <marek.safar@seznam.cz>
10017 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
10018 for non-CAS & merge permission sets properly.
10020 2005-01-11 Raja R Harinath <rharinath@novell.com>
10022 Improve standard-compliance of simple name and member access
10023 resolution. Fixes bugs #52697, #57200, #67520, #69519.
10024 * ecore.cs (FullNamedExpression): New abstract base class
10025 for Namespaces and TypeExpressions.
10026 (ResolveFlags.SimpleName): Remove.
10027 (SimpleName): Remove support for dotted names.
10028 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
10029 DeclSpace.FindType and DeclSpace.LookupType.
10030 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
10031 (Expression.ExprClassName): Make member function.
10032 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
10033 a namespace. Remove creation of dotted "SimpleName"s.
10034 (MemberAccess.DoResolve): Likewise.
10035 * decl.cs (DeclSpace.Cache): Make private.
10036 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
10037 (DeclSpace.FindType): Update.
10038 (DeclSpace.LookupType): Move here from RootContext. Return a
10039 FullNamedExpression.
10040 * namespace.cs (Namespace): Derive from FullNamedExpression
10041 so that it can be part of expression resolution.
10042 (Namespace.Lookup): Return an FullNamedExpression.
10043 (NamespaceEntry.LookupAlias): Lookup aliases only in current
10045 * rootcontext.cs (NamespaceLookup): Remove.
10046 (LookupType): Move to DeclSpace.
10047 * attribute.cs (CheckAttributeType): Update.
10048 * doc.cs (FindDocumentedType): Remove allowAlias argument.
10049 (FindDocumentedTypeNonArray): Likewise.
10051 2005-01-11 Raja R Harinath <rharinath@novell.com>
10053 Fix cs0509.cs, cs1632.cs.
10054 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
10055 is the same as IsInterface.
10056 (TypeContainer.GetClassBases): Likewise.
10057 * statement.cs (LabeledStatement.ig): New field.
10058 (LabeledStatement.LabelTarget): Save ILGenerator which created the
10060 (LabeledStatement.DoEmit): Check that the label was created with
10061 the same ILGenerator.
10063 2005-01-10 Marek Safar <marek.safar@seznam.cz>
10066 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
10067 accessors to its properties.
10069 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
10070 from accessors to property.
10072 2005-01-10 Marek Safar <marek.safar@seznam.cz>
10075 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
10076 only for overrides.
10078 2005-01-08 Miguel de Icaza <miguel@ximian.com>
10080 * attribute.cs: Check for null and empty strings.
10082 I have lost another battle to Paolo.
10084 2005-01-07 Marek Safar <marek.safar@seznam.cz>
10087 * class.cs (PropertyMethod): Set Parent field in ctors.
10088 (SetMethod.InternalParameters): Add unsafe switch hack.
10089 Override MarkForDuplicationCheck where it is appropriate.
10091 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
10092 It says whether container allows members with the same name.
10093 Base default is no.
10094 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
10095 Removed is_method parameter.
10097 2005-01-06 Duncan Mak <duncan@ximian.com>
10099 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
10100 because the previous change led to incorrect reporting of CS1032
10101 ("Cannot define/undefine preprocessor symbols after first token in
10102 file"). Instead of using `tokens_seen' as the only flag that
10103 triggers CS1040, introduce `comments_seen'. This new flag is used
10104 to signify having seen comments on the current line, so it is
10105 unset after a newline.
10107 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
10109 * doc.cs : When searching for a type, find nested type too.
10110 This fixes bug #71040.
10112 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
10115 - Warn missing member comment on those classes which also does not
10116 have doc comments. Fixed bug #71041.
10117 - Don't warn missing doc comment on default constructor.
10120 2005-01-06 Duncan Mak <duncan@ximian.com>
10122 * cs-tokenizer.cs (xtoken): After handling traditional C-style
10123 comments, set `tokens_seen' to true. This allows us to detect
10124 misplaced preprocessor directives (i.e. not at the beginning of
10125 the a line, nor after whitespaces). In that case, report error
10126 CS1040. This fixes bug #56460.
10128 * cs-parser.jay (interface_member_declaration): Add checks for
10129 IsExplicitImpl, and report CS0541 error if an interface member is
10130 defined as an explicit interface declaration.
10132 2005-01-06 Marek Safar <marek.safar@seznam.cz>
10135 * class.cs (PropertyMethod): Set Parent field in ctors.
10136 (SetMethod.InternalParameters): Add unsafe switch hack.
10138 * decl.cs (MemberCore.Parent): Cannot be readonly.
10140 2005-01-06 Raja R Harinath <rharinath@novell.com>
10142 * decl.cs (DeclSpace.ResolveType): Remove.
10143 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
10144 Merge in code from ...
10145 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
10146 * class.cs, enum.cs: Update to changes.
10148 2005-01-06 Miguel de Icaza <miguel@ximian.com>
10150 * anonymous.cs: Ensure that we init the scope of our parent if it
10151 has not been initialized yet.
10153 2004-12-30 Duncan Mak <duncan@ximian.com>
10155 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
10156 if field.FieldBuilder is null. Fixes #70758.
10158 * convert.cs: Fixed some typos and updated some of the comments.
10159 (ImplicitStandardConversionExists):
10160 (TryImplicitIntConversion): If `target_type' is an interface and
10161 the type of `ic' implements this interface, return true or a new
10162 BoxedCast instead of null. This fixes #70468.
10164 2004-12-29 Duncan Mak <duncan@ximian.com>
10166 * expression.cs (Argument.Emit): Check that Expr is
10167 IMemoryLocation before casting to it, and report CS1510 otherwise.
10171 2004-12-21 Ben Maurer <bmaurer@ximian.com>
10173 * statement.cs (Block.ThisVariable): remove the recursion here, to
10174 make the --profile more sane.
10176 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
10178 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
10179 assembly, by JB Evain.
10181 2004-12-17 Raja R Harinath <rharinath@novell.com>
10183 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
10184 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
10185 "parent" refers to enclosing type/class. "base" refers to superclass.
10187 2004-12-17 Raja R Harinath <rharinath@novell.com>
10189 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10190 Ensure that we only have GlobalAttributes.
10191 * attribute.cs (Attribute.Emit): Make non-virtual.
10192 (GlobalAttribute.Emit): Remove.
10193 (Attribute.Resolve): Make virtual.
10194 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
10195 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
10196 the argument. Don't create one.
10197 (Attribute.GetObsoleteAttribute): Likewise.
10198 (Attribute.GetClsCompliantAttributeValue): Likewise.
10199 * class.cs, decl.cs: Update to changes.
10201 2004-12-17 Marek Safar <marek.safar@seznam.cz>
10203 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
10205 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
10207 * statement.cs (Foreach.Resolve): Add error 186 report.
10209 2004-12-16 Marek Safar <marek.safar@seznam.cz>
10211 * expression.cs (Conditional.DoResolve): Add warning 429.
10213 * statement.cs (If.Resolve): Add warning 665.
10215 2004-12-16 Raja R Harinath <rharinath@novell.com>
10217 New invariant: RootContext.Tree.Types.NamespaceEntry == null
10218 except when in the parser, and in GlobalAttribute.
10219 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
10220 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
10221 RootContext.Tree.Types.NamespaceEntry once work is done.
10222 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
10223 and resets RootContext.Tree.Types.NamespaceEntry.
10225 2004-12-15 Marek Safar <marek.safar@seznam.cz>
10227 * cs-parser.jay: Don't create a block for every variable.
10229 2004-12-14 Miguel de Icaza <miguel@ximian.com>
10231 * location.cs: Provide extra information.
10233 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
10234 variables from the captured environment, it is the ldarg_0.
10236 2004-12-14 Marek Safar <marek.safar@seznam.cz>
10238 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
10241 * class.cs: Changed warning level for 169 to avoid developer
10242 displeasure from warning flooding. It will be changed back when they
10243 fix most of current BCL warnings.
10245 * RootContext.cs: Pushed default WarningLevel to 3.
10247 * statement.cs: Removed unused variable.
10249 2004-12-14 Marek Safar <marek.safar@seznam.cz>
10251 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
10252 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
10253 Add error 502 report.
10254 (StaticClass.DefineType): Add error 441 report.
10255 (Class.AllowedModifiersProp): New virtual property as temporary
10256 extension to AllowedModifiers.
10257 (Class.DefineType): Add error 418 report. Moved ModFlags check here
10258 to share implementation with StaticClass and don't call virtual
10261 * driver.cs (MainDriver): Add error 1558 test.
10263 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
10264 report. Moved error 36 test here.
10266 * statement.cs (Throw.Resolve): Add error 724 report.
10268 * typemanager.cs: Add out_attribute_type core type.
10270 2004-12-13 Marek Safar <marek.safar@seznam.cz>
10272 * class.cs (TypeContainer.VerifyClsCompliance): Add error
10274 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
10276 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
10279 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
10281 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
10282 Add error 3023 report.
10283 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
10285 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
10288 2004-12-12 John Luke <john.luke@gmail.com>
10290 * driver.cs (AddArgs): take -- into account when
10291 adding arguments, fixes bug 65710
10293 2004-12-12 Martin Baulig <martin@ximian.com>
10295 * expression.cs (Unary.TryReduceNegative): Added support for
10296 SByteConstant and ByteConstant.
10297 (Unary.Reduce): Check error values from TryReduceNegative().
10299 2004-12-10 Marek Safar <marek.safar@seznam.cz>
10301 * attributes.cs (Attribute.Resolve): Avoid multiple error report
10302 and report exception as error 182.
10304 2004-12-10 Raja R Harinath <rharinath@novell.com>
10306 * driver.cs (Main): Fix message when there are warnings.
10308 2004-12-09 Miguel de Icaza <miguel@ximian.com>
10310 * delegate.cs: Fixed my fix from yesterday, sorry about that.
10312 2004-12-09 Marek Safar <marek.safar@seznam.cz>
10314 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
10315 Reduced number of warnings.
10317 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
10319 2004-12-08 Miguel de Icaza <miguel@ximian.com>
10321 * driver.cs: Removed message.
10323 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
10325 2004-12-08 <vargaz@freemail.hu>
10327 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
10329 2004-12-08 Martin Baulig <martin@ximian.com>
10331 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
10332 instead of a CS3002 for properties and indexer.
10334 2004-12-08 Martin Baulig <martin@ximian.com>
10336 * decl.cs (MemberName.ToString): Make this work again.
10338 2004-12-08 Marek Safar <marek.safar@seznam.cz>
10340 * attribute.cs (Resolve): Add error 591 detection.
10342 * class.cs (FieldMember.Define): Add error 1547 detection.
10343 (Indexer.Define): Add error 620 detection.
10344 (Operator.Define): Add error 590 detection.
10346 * ecore.cs: Missing argument for error 79.
10348 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
10351 2004-12-07 Marek Safar <marek.safar@seznam.cz>
10354 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
10357 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
10359 * cs-parser.jay : handle doc comments on implicit/explicit operators.
10360 Some operator comments were suppressed.
10361 * doc.cs : Implicit/explicit operator name in doc comments are like
10362 "op_Explicit(type)~returnType", so added suffix handling.
10364 2004-12-07 Martin Baulig <martin@ximian.com>
10367 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
10368 (MemberCore.GetClsCompliantAttributeValue): Likewise.
10369 (DeclSpace.ec): New protected field; store the EmitContext here.
10370 (DeclSpace.EmitContext): New public property; moved here from
10372 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
10375 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
10376 (Enum.Emit): Don't create a new EmitContext.
10378 * delegate.cs (Delegate.DefineType): Always create the
10381 * iterators.cs (Iterators.DefineIterator): Create a new
10382 EmitContext and store it in `ec'.
10384 2004-08-24 Martin Baulig <martin@ximian.com>
10387 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
10388 this for accessibility checks.
10389 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
10390 IsNestedFamilyAccessible.
10391 (TypeManager.IsSubclassOf): New method, do what the name actually
10394 2004-12-06 Raja R Harinath <rharinath@novell.com>
10396 Fix crash on cs0657-17.cs.
10397 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10398 Use RootContext.Tree.Types, not 'new RootTypes ()'.
10399 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
10400 the case where the NamespaceEntry gets overwritten.
10402 2004-12-06 Marek Safar <marek.safar@seznam.cz>
10404 Fixed #69195, #56821
10405 * ecore.cs (ResolveBoolean): Tiny refactoring.
10407 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
10408 of right expression resolving when left is false constant and
10409 operator is LogicalAnd OR true constant and operator is LogicalOr.
10411 * statement.cs (ResolveUnreachable): Always reports warning.
10413 2004-12-05 Miguel de Icaza <miguel@ximian.com>
10415 * class.cs: Distinguish between 1721 and 1722 (just a little help
10416 for the programmer).
10418 2004-12-03 Miguel de Icaza <miguel@ximian.com>
10420 * delegate.cs: Only allow this on new versions of the language.
10422 2004-12-02 Duncan Mak <duncan@ximian.com>
10424 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
10426 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
10427 here as a static method. Take an additional bool out parameter
10428 `must_do_cs1540_check' for signaling to InstanceResolve.
10429 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
10430 member field from PropertyExpr class and made it an argument of
10431 the method instead.
10432 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
10433 check for MarshalByRefObject, and report CS0122 instead of CS1540.
10434 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
10435 and `remove_accessor' as well as InstanceResolve: report CS0122
10440 2004-12-03 Raja R Harinath <rharinath@novell.com>
10442 Fix test-327.cs, test-328.cs, and put in early infrastructure
10443 for eventually fixing #52697.
10444 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
10445 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
10446 from other methods.
10447 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
10448 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
10449 (VerifyUsing, error246): Update.
10450 * rootcontext.cs (RootContext.NamespaceLookup): Just use
10451 'NamespaceEntry.LookupNamespaceOrType'.
10453 2004-12-03 Martin Baulig <martin@ximian.com>
10455 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10456 method as our child, call AnonymousMethod.Compatible() on it.
10458 2004-12-03 Raja R Harinath <rharinath@novell.com>
10460 Disable XML documentation support in 'basic' profile.
10461 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
10462 Redirect XmlElement to System.Object.
10463 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
10464 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
10465 * mcs.exe.sources: Add doc-bootstrap.cs.
10466 * doc-bootstrap.cs: New file. Contains empty stub implementation
10469 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
10471 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
10472 comments are allowed.
10474 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10476 * delegate.cs: Add checks for subtypes in paramaters and return values
10477 in VerifyMethod () to add support for Covariance/Contravariance
10480 2004-12-02 Miguel de Icaza <miguel@ximian.com>
10482 * report.cs: Remove extra closing parenthesis.
10484 * convert.cs (Error_CannotImplicitConversion): If the name of the
10485 types are the same, provide some extra information.
10487 * class.cs (FieldBase): Use an unused bit field from the field to
10488 encode the `has_offset' property from the FieldMember. This saves
10489 a couple of Ks on bootstrap compilation.
10491 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10492 method as our child, return the AnonymousMethod resolved
10495 * expression.cs (New.DoResolve): Allow return values from
10496 NewDelegate to also include AnonymousMethods.
10500 2004-12-02 Marek Safar <marek.safar@seznam.cz>
10503 * attribute.cs (Resolve): Improved implementation of params
10504 attribute arguments.
10506 * support.cs (ParameterData): Add HasParams to be faster.
10508 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
10510 all things are for /doc support:
10512 * doc.cs: new file that supports XML documentation generation.
10513 * mcs.exe.sources: added doc.cs.
10515 Handle /doc command line option.
10516 Report error 2006 instead of 5 for missing file name for /doc.
10517 Generate XML documentation when required, after type resolution.
10519 Added support for picking up documentation (/// and /** ... */),
10520 including a new XmlCommentState enumeration.
10522 Added lines to fill Documentation element for field, constant,
10523 property, indexer, method, constructor, destructor, operator, event
10524 and class, struct, interface, delegate, enum.
10525 Added lines to warn incorrect comment.
10527 Added Documentation field (passed only when /doc was specified).
10529 Added DocComment, DocCommentHeader, GenerateDocComment() and
10530 OnGenerateDocComment() and some supporting private members for
10531 /doc feature to MemberCore.
10533 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
10535 Added overriden DocCommentHeader.
10537 Added overriden DocCommentHeader and GenerateDocComment().
10539 2004-12-01 Miguel de Icaza <miguel@ximian.com>
10541 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
10542 unwrapping the enumeration values, chain to
10543 DoConstantNumericPromotions again, so we can promote things to the
10544 fundamental types (takes care of enums that are bytes, sbytes).
10548 2004-12-01 Raja R Harinath <rharinath@novell.com>
10550 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
10551 Fix long-standing bug in type-lookup. Use FindType instead of
10552 LookupType when ec.ResolvingTypeTree.
10553 (Attribute.ResolveType, Attribute.Resolve)
10554 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
10556 (Attributes.Search): Remove internal version. Update.
10557 (Attributes.SearchMulti): Update.
10558 (Attributes.GetClsCompliantAttribute): Remove.
10559 (Attributes.GetIndexerNameAttribute): Remove.
10560 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
10561 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
10562 * class.cs (Indexer.Define): Likewise.
10564 2004-12-01 Marek Safar <marek.safar@seznam.cz>
10567 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
10568 MarshallByReference members access.
10570 * expression.cs: Use CheckMarshallByRefAccess;
10571 Better error CS0197 message.
10573 * report.cs: Print whole related error message.
10575 2004-11-30 Raja R Harinath <rharinath@novell.com>
10577 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
10578 the current directory to help debugging.
10580 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10582 * class (GetClassBases): Better error 60 report.
10583 (EventProperty): Disabled warning 67 detection.
10585 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10588 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
10590 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
10593 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10596 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
10598 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
10600 2004-11-26 Miguel de Icaza <miguel@ximian.com>
10602 * attribute.cs (Attribute.Resolve): Refine error reporting and
10603 report a cs0117 if the identifier does not exist, to distinguish
10604 from 0617 which is a miss-use of the actual identifier.
10606 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
10607 between cs0070 and cs0079.
10609 * class.cs (MemberBase.DoDefine): When reporting a wrong
10610 accessibility level, we use MethodCore to compare instead of
10611 Method (this was a regression in some refactoring effort).
10613 So now we correctly report cs0056 again.
10615 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
10616 testing the target_type (which was known to be object_type) and
10617 not the source type (which is anonymous_method).
10619 Fixed reporting of error cs1660.
10621 * expression.cs (UserCast.Source): Expose the underlying cast.
10623 * statement.cs (Switch.SwitchGoverningType): Sort the list of
10624 allowed types to find a match to int32 first (most common).
10626 In addition, it ignores any ImplicitUserConversions that did an
10627 internal implicit conversion (as the switch statement allows only
10628 one integral conversion to exist).
10630 * class.cs (PartialContainer.Create): rename `name' to
10631 `member_name' for clarity. Then replace the string calls with a
10632 call to MemberName.GetPartialName, as now using
10633 MemberName.ToString is an error (this is due to the side effects
10634 it had, that were fixed in the past).
10636 This will restore the error reporting on a number of partial class
10637 errors that were missusing this (and getting an exception as a
10638 results, which is now just a plain textual warning, because
10639 yyparse debug output would crash otherwise).
10641 2004-11-26 Raja R Harinath <rharinath@novell.com>
10643 * Makefile (PROGRAM_INSTALL_DIR): Remove.
10645 2004-11-25 Ben Maurer <bmaurer@ximian.com>
10647 * rootcontext.cs (LookupType): Make sure to cache lookups that
10648 don't give us a negative result. This saves about 5% of corlib
10651 2004-11-25 Miguel de Icaza <miguel@ximian.com>
10653 * report.cs (AbstractMessage.Print): messages are sent to stderr
10655 * class.cs (TypeContainer.GetClassBases): It is an error to have a
10656 non-interface in the list of interfaces (at this point, either
10657 parent was properly set, or a base class is being listed in the
10658 interfaces section).
10660 This flags error 1722, and resolves the crash from bug 69259.
10662 2004-11-25 Ben Maurer <bmaurer@ximian.com>
10664 * statement.cs (Using.EmitExpressionFinally): make this work right
10665 for valuetypes. Fixes 69926.
10667 2004-11-25 Miguel de Icaza <miguel@ximian.com>
10669 * const.cs (Const.ChangeType): Cope with the "0 literal can be
10670 converted to an enum" here, before we try to change the underlying
10671 type. This code exists, but it is a different code path than the
10672 one used while encoding constants.
10674 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
10675 old bug: when converting from the null literal to a pointer,
10676 return an EmptyCast, not the NullLiteral.
10678 This fixes #69921, the recent null_type changes probably made this
10679 bug more prominent.
10681 (ImplicitReferenceConversionExists): In addition, resynchronized
10682 the code here, so it matches the same code in
10683 ImplicitReferenceConversionExists for the `from any class-type S
10684 to any interface-type T'.
10687 2004-11-25 Marek Safar <marek.safar@seznam.cz>
10689 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
10691 2004-11-24 Miguel de Icaza <miguel@ximian.com>
10693 * cs-parser.jay: Use verbosity accordingly.
10695 2004-11-24 Marek Safar <marek.safar@seznam.cz>
10697 * expression.cs (Unary.ResolveOperator): Do not report warning;
10698 AddressOf reads from variable.
10700 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
10702 2004-11-24 Marek Safar <marek.safar@seznam.cz>
10706 * attribute.cs (Attributable): Removed CheckTargets.
10707 (Attributes.Emit): Explicit attribute targets are tested here.
10709 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
10710 not enabled for interfaces.
10712 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
10713 (GetAssemblyName): Ouch next bug there.
10715 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10717 * expression.cs: Error 275 added.
10719 2004-11-23 Marek Safar <marek.safar@seznam.cz>
10721 Fix bug #69177 (Implemented decimal constant support)
10723 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
10724 (BinaryFold): Add DecimalConstant.
10726 * const.cs (Define): Decimal constant
10728 (ChangeType): Add decimal type handling.
10729 (LookupConstantValue): Don't set value for decimal type but
10730 emit DecimalConstantAttribute. Needed for constant optimization.
10732 * constant.cs (ToDecimal): New method.
10733 (ConvertToDecimal): New method.
10734 (IntConstant): Implemented ConvertToDecimal.
10735 (DecimalConstant.Emit): Emit optimized version for decimals in
10738 * expression.cs (ResolveOperator): Changed order of constant
10739 reduction to work correctly with native types which have
10740 overloaded operators.
10741 (ResolveMemberAccess): Extract constant value from attribute
10744 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
10746 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
10747 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
10748 (ChangeType): Decimal is special.
10749 (TypeToCoreType): Add decimal type.
10751 2004-11-22 Marek Safar <marek.safar@seznam.cz>
10753 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
10756 2004-11-22 Marek Safar <marek.safar@seznam.cz>
10758 * class.cs (EventField.ApplyAttributeBuilder): Fix error
10761 2004-11-19 Marek Safar <marek.safar@seznam.cz>
10763 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
10765 * pending.cs (PendingImplementation): Grab only interfaces.
10767 2004-11-19 Marek Safar <marek.safar@seznam.cz>
10769 * statement.cs (ForeachHelperMethods): Add location member and
10770 error 202 detection.
10772 2004-11-19 Raja R Harinath <rharinath@novell.com>
10774 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
10775 automatically handled by executable.make.
10776 (PROGRAM): Make profile-specific.
10778 2004-11-18 Marek Safar <marek.safar@seznam.cz>
10780 * expression.cs (DoResolveBase): Fixed wrong warning for out
10783 2004-11-18 Martin Baulig <martin@ximian.com>
10785 Merged latest changes into gmcs. Please keep this comment in
10786 here, it makes it easier for me to see what changed in MCS since
10787 the last time I merged.
10789 2004-11-17 Raja R Harinath <rharinath@novell.com>
10791 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
10792 (TypeHandle.GetMemberCache): New.
10793 (TypeHandle.TypeHandle): Update.
10794 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
10795 (TypeManager.LookupParentInterfacesCache):
10796 Rename from LookupInterfaceCache. Optimize slightly.
10797 (TypeManager.MemberLookup_FindMembers): Update.
10798 * decl.cs (MemberCache.MemberCache): Set Container to null in the
10799 multi-type variant.
10800 (AddCacheContents): Rename from AddHashtable.
10801 * class.cs (TypeContainer.parent_container): Remove.
10802 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
10803 (TypeContainer.DoDefineMembers): Don't initialize it.
10804 Update to name changes.
10806 2004-11-17 Miguel de Icaza <miguel@ximian.com>
10808 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
10809 that factors the code to check access modifiers on override.
10811 (PropertyBase): Use the code here.
10813 Patch from Lluis S'anchez, fixes bug #69361.
10815 2004-11-15 Miguel de Icaza <miguel@ximian.com>
10817 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
10818 routine that is used to report the use of a captured variable
10819 whose address has been taken.
10821 There are two checks: one when variables are being captured and
10822 the other check is when the address of a variable is taken.
10824 (because an anonymous methods might be resolved before *or* after
10825 the address has been taken) and
10827 * expression.cs (Conditional.DoResolve): Remove the special
10828 casing that Martin added to trueExpr and falseExpr being both
10829 NullLiteral. We get the right behavior now just by introducing
10830 the null_type into the compiler.
10832 * convert.cs (ExplicitConversion): Change the code to use
10833 null_type instead of testing `expr is NullLiteral'.
10834 (ImplicitConversionStandard): use null_type too.
10835 (ImplicitReferenceConversionExists): use null_type too.
10836 (ImplicitReferenceConversion): use null_type too.
10838 * literal.cs: The type of `NullLiteral' is now null_type instead
10840 (Resolve): Set the type here.
10842 * typemanager.cs: Introduce null_type.
10844 2004-11-17 Martin Baulig <martin@ximian.com>
10846 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
10847 direction, like FindMembers() does. Fixes #69546, testcase is in
10850 2004-11-16 Martin Baulig <martin@ximian.com>
10852 This is based on a patch from Marek Safar, see bug #69082.
10853 Fixes bugs #63705 and #67130.
10855 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
10856 method; create a MemberCache for an interface type and cache the
10859 * decl.cs (IMemberContainer.ParentContainer): Removed.
10860 (IMemberContainer.ParentCache): New property.
10861 (MemberCache.SetupCacheForInterface): Removed.
10862 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
10863 to create a cache for an interface's "parent".
10865 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
10868 2004-11-16 Martin Baulig <martin@ximian.com>
10870 Merged back from gmcs; these changes already went into gmcs a
10871 couple of weeks ago.
10874 (TypeManager.AddUserType): Removed the `ifaces' argument.
10875 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
10877 (TypeManager.AddUserInterface): Removed.
10878 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
10880 (TypeManager.GetInterfaces): Likewise.
10881 (TypeManager.GetExplicitInterfaces): Likewise.
10883 * ecore.cs (TypeExpr.GetInterfaces): Removed.
10885 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
10886 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
10888 2004-11-14 Ben Maurer <bmaurer@ximian.com>
10890 * statement.cs: Avoid adding bools to a hashtable.
10892 2004-11-07 Miguel de Icaza <miguel@ximian.com>
10894 * expression.cs (Invocation.OverloadResolve): Flag error if we are
10895 calling an unsafe method from a safe location.
10897 2004-11-06 Marek Safar <marek.safar@seznam.cz>
10900 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
10902 2004-11-06 Miguel de Icaza <miguel@ximian.com>
10904 * namespace.cs (VerifyUsing): use GetPartialName instead of
10907 2004-11-05 Miguel de Icaza <miguel@ximian.com>
10909 * statement.cs (Return.Resolve): Fix regression in typo: if
10910 `in_exc', we have to request a NeedReturnLabel, this was a typo
10911 introduced in the anonymous method check-in. Fixes #69131.
10913 * Indexers were using the ShortName when defining themselves,
10914 causing a regression in the compiler bootstrap when applying the
10915 patch from 2004-11-02 (first part), now they use their full name
10916 and the bug is gone.
10918 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
10920 * driver.cs: Strip the path from the names of embedded resources. Fixes
10923 2004-11-04 Raja R Harinath <rharinath@novell.com>
10925 Fix error message regression: cs0104-2.cs.
10926 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
10927 (AliasEntry.Resolve): Update.
10928 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
10930 (RootContext.LookupType): Update.
10932 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
10934 * cs-parser.jay: Add support for handling accessor modifiers
10935 * class: Add support port accessor modifiers and error checking,
10936 define PropertyMethod.Define as virtual (not abstract anymore)
10937 * ecore.cs: Add checking for proeprties access with access modifiers
10938 * iterators.cs: Modify Accessor constructor call based in the modified
10940 2004-11-02 Ben Maurer <bmaurer@ximian.com>
10942 * expression.cs (StringConcat): Handle being called twice,
10943 as when we have a concat in a field init with more than two
10946 2004-11-02 Miguel de Icaza <miguel@ximian.com>
10948 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
10949 special case explicit implementations, we should always produce
10950 the .property or .event declaration.
10952 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
10953 since it will not return correct data if people use this
10954 unresolved in the presence of using statements (see test-313).
10956 * class.cs (MethodData.Define): If we are an explicit interface
10957 implementation, set the method name to the full name of the
10958 interface plus the name of the method.
10960 Notice that using the method.MethodName.GetFullName() does not
10961 work, as it will only contain the name as declared on the source
10962 file (it can be a shorthand in the presence of using statements)
10963 and not the fully qualifed type name, for example:
10967 class D : ICloneable {
10968 object ICloneable.Clone () {
10972 Would produce a method called `ICloneable.Clone' instead of
10973 `System.ICloneable.Clone'.
10975 * namespace.cs (Alias.Resolve): Use GetPartialName.
10977 2004-11-01 Marek Safar <marek.safar@seznam.cz>
10979 * cs-parser.jay: Add error 1055 report.
10981 2004-11-01 Miguel de Icaza <miguel@ximian.com>
10983 * assign.cs (Assign.DoResolve): Only do the transform of
10984 assignment into a New if the types are compatible, if not, fall
10985 through and let the implicit code deal with the errors and with
10986 the necessary conversions.
10988 2004-11-01 Marek Safar <marek.safar@seznam.cz>
10990 * cs-parser.jay: Add error 1031 report.
10992 * cs-tokenizer.cs: Add location for error 1038.
10994 2004-10-31 Marek Safar <marek.safar@seznam.cz>
10996 * cs-parser.jay: Add error 1016 report.
10998 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11000 * cs-parser.jay: Add errors 1575,1611 report.
11002 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11004 * cs-parser.jay: Add error 1001 report.
11006 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11009 * attribute.cs (GetMarshal): Add method argument for
11010 caller identification.
11012 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
11013 agument for GetMarshal and RuntimeMissingSupport.
11015 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11017 * attribute.cs (ExtractSecurityPermissionSet): Removed
11018 TypeManager.code_access_permission_type.
11020 * typemanager.cs: Removed TypeManager.code_access_permission_type.
11022 2004-10-27 Miguel de Icaza <miguel@ximian.com>
11024 * expression.cs (LocalVariableReference.DoResolveLValue): Check
11025 for obsolete use of a variable here. Fixes regression on errors
11026 cs0619-25 and cs0619-26.
11028 2004-10-27 Marek Safar <marek.safar@seznam.cz>
11030 Fix #62358, implemented security attribute encoding.
11032 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
11033 Tests permitted SecurityAction for assembly or other types.
11034 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
11035 data from SecurityPermissionAttribute to PermisionSet class.
11037 * class.cs (ApplyAttributeBuilder): Added special handling
11038 for System.Security.Permissions.SecurityAttribute based types.
11040 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
11041 special handling for System.Security.Permissions.SecurityAttribute
11044 * enum.cs (ApplyAttributeBuilder): Added special handling
11045 for System.Security.Permissions.SecurityAttribute based types.
11047 * parameter.cs (ApplyAttributeBuilder): Added special handling
11048 for System.Security.Permissions.SecurityAttribute based types.
11050 * rootcontext.cs: Next 2 core types.
11052 * typemanager.cs (TypeManager.security_permission_attr_type):
11053 Built in type for the SecurityPermission Attribute.
11054 (code_access_permission_type): Build in type.
11056 2004-10-17 Miguel de Icaza <miguel@ximian.com>
11058 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
11059 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
11060 all of this information into
11061 EmitContext.EmitCapturedVariableInstance.
11063 * codegen.cs (EmitCapturedVariableInstance): move here the
11064 funcionality of emitting an ldarg.0 in the presence of a
11065 remapping. This centralizes the instance emit code.
11067 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
11068 then emit a load of this: it means that we have reached the
11069 topmost ScopeInfo: the one that contains the pointer to the
11070 instance of the class hosting the anonymous method.
11072 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
11073 captures to the topmost CaptureContext.
11075 2004-10-12 Miguel de Icaza <miguel@ximian.com>
11077 * expression.cs (LocalVariableReference): Move the knowledge about
11078 the iterators into codegen's EmitCapturedVariableInstance.
11080 2004-10-11 Miguel de Icaza <miguel@ximian.com>
11082 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
11083 all code paths return a value from an anonymous method (it is the
11084 same as the 161 error, but for anonymous methods).
11086 2004-10-08 Miguel de Icaza <miguel@ximian.com>
11088 The introduction of anonymous methods in the compiler changed
11089 various ways of doing things in the compiler. The most
11090 significant one is the hard split between the resolution phase
11091 and the emission phases of the compiler.
11093 For instance, routines that referenced local variables no
11094 longer can safely create temporary variables during the
11095 resolution phase: they must do so from the emission phase,
11096 since the variable might have been "captured", hence access to
11097 it can not be done with the local-variable operations from the runtime.
11101 (Block.Flags): New flag `IsTopLevel' to indicate that this block
11102 is a toplevel block.
11104 (ToplevelBlock): A new kind of Block, these are the blocks that
11105 are created by the parser for all toplevel method bodies. These
11106 include methods, accessors and anonymous methods.
11108 These contain some extra information not found in regular blocks:
11109 A pointer to an optional CaptureContext (for tracking captured
11110 local variables and parameters). A pointer to the parent
11113 (Return.Resolve): Catch missmatches when returning a value from an
11114 anonymous method (error 1662).
11115 Invoke NeedReturnLabel from the Resolve phase instead of the emit
11118 (Break.Resolve): ditto.
11120 (SwitchLabel): instead of defining the labels during the
11121 resolution phase, we now turned the public ILLabel and ILLabelCode
11122 labels into methods called GetILLabelCode() and GetILLabel() that
11123 only define the label during the Emit phase.
11125 (GotoCase): Track the SwitchLabel instead of the computed label
11126 (its contained therein). Emit the code by using
11127 SwitchLabel.GetILLabelCode ().
11129 (LocalInfo.Flags.Captured): A new flag has been introduce to track
11130 whether the Local has been captured or not.
11132 (LocalInfo.IsCaptured): New property, used to tell whether the
11133 local has been captured.
11135 * anonymous.cs: Vastly updated to contain the anonymous method
11138 The main classes here are: CaptureContext which tracks any
11139 captured information for a toplevel block and ScopeInfo used to
11140 track the activation frames for various local variables.
11142 Each toplevel block has an optional capture context associated
11143 with it. When a method contains an anonymous method both the
11144 toplevel method and the anonymous method will create a capture
11145 context. When variables or parameters are captured, they are
11146 recorded on the CaptureContext that owns them, for example:
11150 MyDelegate d = delegate {
11155 Here `a' will be recorded as captured on the toplevel
11156 CapturedContext, the inner captured context will not have anything
11157 (it will only have data if local variables or parameters from it
11158 are captured in a nested anonymous method.
11160 The ScopeInfo is used to track the activation frames for local
11161 variables, for example:
11163 for (int i = 0; i < 10; i++)
11164 for (int j = 0; j < 10; j++){
11165 MyDelegate d = delegate {
11170 At runtime this captures a single captured variable `i', but it
11171 captures 10 different versions of the variable `j'. The variable
11172 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
11173 recorded on a child.
11175 The toplevel ScopeInfo will also track information like the `this'
11176 pointer if instance variables were referenced (this is necessary
11177 as the anonymous method lives inside a nested class in the host
11178 type of the method).
11180 (AnonymousMethod): Expanded to track the Toplevel, implement
11181 `AnonymousMethod.Compatible' to tell whether an anonymous method
11182 can be converted to a target delegate type.
11184 The routine now also produces the anonymous method content
11186 (AnonymousDelegate): A helper class that derives from
11187 DelegateCreation, this is used to generate the code necessary to
11188 produce the delegate for the anonymous method that was created.
11190 * assign.cs: API adjustments for new changes in
11191 Convert.ImplicitStandardConversionExists.
11193 * class.cs: Adjustments to cope with the fact that now toplevel
11194 blocks are of type `ToplevelBlock'.
11196 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
11197 insteda of standard blocks.
11199 Flag errors if params arguments are passed to anonymous methods.
11201 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
11202 `CurrentAnonymousMethod' which points to the current Anonymous
11203 Method. The variable points to the AnonymousMethod class that
11204 holds the code being compiled. It is set in the new EmitContext
11205 created for the anonymous method.
11207 (EmitContext.Phase): Introduce a variable and an enumeration to
11208 assist in enforcing some rules about when and where we are allowed
11209 to invoke certain methods (EmitContext.NeedsReturnLabel is the
11210 only one that enfonces this right now).
11212 (EmitContext.HaveCaptureInfo): new helper method that returns
11213 whether we have a CapturedContext initialized.
11215 (EmitContext.CaptureVariable): New method used to register that a
11216 LocalInfo must be flagged for capturing.
11218 (EmitContext.CapturedParameter): New method used to register that a
11219 parameters must be flagged for capturing.
11221 (EmitContext.CapturedField): New method used to register that a
11222 field must be flagged for capturing.
11224 (EmitContext.HaveCapturedVariables,
11225 EmitContext.HaveCapturedFields): Return whether there are captured
11226 variables or fields.
11228 (EmitContext.EmitMethodHostInstance): This is used to emit the
11229 instance for the anonymous method. The instance might be null
11230 (static methods), this (for anonymous methods that capture nothing
11231 and happen to live side-by-side with the current method body) or a
11232 more complicated expression if the method has a CaptureContext.
11234 (EmitContext.EmitTopBlock): Routine that drives the emission of
11235 code: it will first resolve the top block, then emit any metadata
11236 and then emit the code. The split is done so that we can extract
11237 any anonymous methods and flag any captured variables/parameters.
11239 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
11240 during this phase, the ILGenerator should not be used as labels
11241 and local variables declared here might not be accessible to any
11242 code that is part of an anonymous method.
11244 Exceptions to this include the temporary variables that are
11245 created by some statements internally for holding temporary
11248 (EmitContext.EmitMeta): New routine, in charge of emitting all the
11251 (EmitContext.TemporaryReturn): This method is typically called
11252 from the Emit phase, and its the only place where we allow the
11253 ReturnLabel to be defined other than the EmitMeta. The reason is
11254 that otherwise we would have to duplicate a lot of logic in the
11255 Resolve phases of various methods that today is on the Emit
11258 (EmitContext.NeedReturnLabel): This no longer creates the label,
11259 as the ILGenerator is not valid during the resolve phase.
11261 (EmitContext.EmitThis): Extended the knowledge in this class to
11262 work in anonymous methods in addition to iterators.
11264 (EmitContext.EmitCapturedVariableInstance): This emits whatever
11265 code is necessary on the stack to access the instance to a local
11266 variable (the variable will be accessed as a field).
11268 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
11269 EmitContext.EmitAddressOfParameter): Routines to support
11270 parameters (not completed at this point).
11272 Removals: Removed RemapLocal and RemapLocalLValue. We probably
11273 will also remove the parameters.
11275 * convert.cs (Convert): Define a `ConstantEC' which points to a
11276 null. This is just to prefity some code that uses
11277 ImplicitStandardConversion code and do not have an EmitContext
11280 The idea is to flag explicitly that at that point in time, it is
11281 known that the conversion will not trigger the delegate checking
11282 code in implicit conversions (which requires a valid
11285 Everywhere: pass new EmitContext parameter since
11286 ImplicitStandardConversionExists now requires it to check for
11287 anonymous method conversions.
11289 (Convert.ImplicitStandardConversionExists): If the type of an
11290 expression is the anonymous_method_type, and the type is a
11291 delegate, we invoke the AnonymousMethod.Compatible method to check
11292 whether an implicit conversion is possible.
11294 (Convert.ImplicitConversionStandard): Only do implicit method
11295 group conversions if the language level is not ISO_1.
11297 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
11298 MethodInfo for the Invoke method. used by Delegate and
11301 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
11302 method conversions if the target type is a delegate.
11304 Removed extra debugging nops.
11306 (LocalVariableReference): Turn the `local_info' into a public
11309 Add `prepared' field, the same hack used for FieldExprs to cope
11310 with composed assignments, as Local variables do not necessarily
11311 operate purely on the stack as they used to: they can be captured
11314 Add `temp' for a temporary result, like fields.
11316 Refactor DoResolve and DoResolveLValue into DoResolveBase.
11318 It now copes with Local variables that are captured and emits the
11319 proper instance variable to load it from a field in the captured
11322 (ParameterReference.DoResolveBase): During the resolve phase,
11323 capture parameters if we are in an anonymous method.
11325 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
11326 anonymous method, use the EmitContext helper routines to emit the
11327 parameter reference.
11329 * iterators.cs: Set RemapToProxy to true/false during the
11332 * parameters.cs (GetParameterByName): New helper method.
11334 * typemanager.cs (anonymous_method_type) a new type that
11335 represents an anonyous method. This is always an internal type,
11336 used as a fencepost to test against the anonymous-methodness of an
11339 2004-10-20 Marek Safar <marek.safar@seznam.cz>
11341 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
11343 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
11345 2004-10-18 Martin Baulig <martin@ximian.com>
11347 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
11348 `Type' directly, but call ResolveType() on it.
11349 (Catch.Resolve): Likewise.
11350 (Foreach.Resolve): Likewise.
11352 2004-10-18 Martin Baulig <martin@ximian.com>
11354 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
11355 `Type' directly, but call ResolveType() on it.
11356 (Probe.DoResolve): Likewise.
11357 (ArrayCreation.LookupType): Likewise.
11358 (TypeOf.DoResolve): Likewise.
11359 (SizeOf.DoResolve): Likewise.
11361 2004-10-18 Martin Baulig <martin@ximian.com>
11363 * expression.cs (Invocation.BetterFunction): Put back
11364 TypeManager.TypeToCoreType().
11366 2004-10-18 Raja R Harinath <rharinath@novell.com>
11368 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
11371 2004-10-18 Martin Baulig <martin@ximian.com>
11373 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
11374 `Type' directly, but call ResolveType() on it.
11376 2004-10-18 Martin Baulig <martin@ximian.com>
11378 * class.cs (FieldMember.Define): Don't access the TypeExpr's
11379 `Type' directly, but call ResolveType() on it.
11380 (MemberBase.DoDefine): Likewise.
11382 * expression.cs (New.DoResolve): Don't access the TypeExpr's
11383 `Type' directly, but call ResolveType() on it.
11384 (ComposedCast.DoResolveAsTypeStep): Likewise.
11386 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
11387 `Type' directly, but call ResolveType() on it.
11389 2004-10-17 John Luke <john.luke@gmail.com>
11391 * class.cs (Operator.GetSignatureForError): use CSharpName
11393 * parameter.cs (Parameter.GetSignatureForError): Returns
11394 correct name even if was not defined.
11396 2004-10-13 Raja R Harinath <rharinath@novell.com>
11399 * class.cs (TypeContainer.EmitContext): New property.
11400 (DefineNestedTypes): Create an emitcontext for each part.
11401 (MethodCore.DoDefineParameters): Use container's emitcontext.
11402 Pass type array to InternalParameters.
11403 (MemberBase.DoDefine): Use container's emitcontext.
11404 (FieldMember.Define): Likewise.
11405 (Event.Define): Likewise.
11406 (SetMethod.GetParameterInfo): Change argument to EmitContext.
11407 Pass type array to InternalParameters.
11408 (SetIndexerMethod.GetParameterInfo): Likewise.
11409 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
11410 * delegate.cs (Define): Pass emitcontext to
11411 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
11412 array to InternalParameters.
11413 * expression.cs (ParameterReference.DoResolveBase): Pass
11414 emitcontext to GetParameterInfo.
11415 (ComposedCast.DoResolveAsTypeStep): Remove check on
11416 ec.ResolvingTypeTree.
11417 * parameter.cs (Parameter.Resolve): Change argument to
11418 EmitContext. Use ResolveAsTypeTerminal.
11419 (Parameter.GetSignature): Change argument to EmitContext.
11420 (Parameters.ComputeSignature): Likewise.
11421 (Parameters.ComputeParameterTypes): Likewise.
11422 (Parameters.GetParameterInfo): Likewise.
11423 (Parameters.ComputeAndDefineParameterTypes): Likewise.
11424 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
11425 * support.cs (InternalParameters..ctor): Remove variant that takes
11427 * typemanager.cs (system_intptr_expr): New.
11428 (InitExpressionTypes): Initialize it.
11430 2004-10-12 Chris Toshok <toshok@ximian.com>
11432 * cs-parser.jay: fix location for try_statement and catch_clause.
11434 2004-10-11 Martin Baulig <martin@ximian.com>
11436 * report.cs: Don't make --fatal abort on warnings, we have
11437 -warnaserror for that.
11439 2004-10-07 Raja R Harinath <rharinath@novell.com>
11441 More DeclSpace.ResolveType avoidance.
11442 * decl.cs (MemberCore.InUnsafe): New property.
11443 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
11444 with newly created EmitContext.
11445 (FieldMember.Define): Likewise.
11446 * delegate.cs (Delegate.Define): Likewise.
11447 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
11448 only if normal name-lookup fails.
11449 (TypeExpr.DoResolve): Enable error-checking.
11450 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
11451 (SizeOf.DoResolve): Likewise.
11452 (ComposedCast.DoResolveAsTypeStep): Likewise.
11453 (StackAlloc.DoResolve): Likewise.
11454 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
11455 (Block.Unsafe): New property.
11456 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
11457 (Unsafe): Set 'unsafe' flag of contained block.
11458 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
11459 (Fixed.Resolve): Likewise.
11460 (Catch.Resolve): Likewise.
11461 (Using.ResolveLocalVariableDecls): Likewise.
11462 (Foreach.Resolve): Likewise.
11464 2004-10-05 John Luke <john.luke@gmail.com>
11466 * cs-parser.jay: add location to error CS0175
11468 2004-10-04 Miguel de Icaza <miguel@ximian.com>
11470 * ecore.cs (Expression.Constantity): Add support for turning null
11473 * const.cs (Const.Define): Allow constants to be reference types
11474 as long as the value is Null.
11476 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
11478 * namespace.cs (NamespaceEntry.Using): No matter which warning
11479 level is set, check if this namespace name has already been added.
11481 2004-10-03 Ben Maurer <bmaurer@ximian.com>
11483 * expression.cs: reftype [!=]= null should always use br[true,false].
11486 2004-10-03 Marek Safar <marek.safar@seznam.cz>
11489 * attribute.cs: Enum conversion moved to
11490 GetAttributeArgumentExpression to be applied to the all
11493 2004-10-01 Raja R Harinath <rharinath@novell.com>
11495 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
11496 * class.c (TypeContainer.DefineType): Flag error if
11497 base types aren't accessible due to access permissions.
11498 * decl.cs (DeclSpace.ResolveType): Move logic to
11499 Expression.ResolveAsTypeTerminal.
11500 (DeclSpace.ResolveTypeExpr): Thin layer over
11501 Expression.ResolveAsTypeTerminal.
11502 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
11503 Refactor code into NestedAccess. Use it.
11504 (DeclSpace.NestedAccess): New.
11505 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
11506 argument to silence errors. Check access permissions.
11507 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
11508 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
11509 (Cast.DoResolve): Likewise.
11510 (New.DoResolve): Likewise.
11511 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
11512 (TypeOf.DoResolve): Likewise.
11514 * expression.cs (Invocation.BetterConversion): Return the Type of
11515 the better conversion. Implement section 14.4.2.3 more faithfully.
11516 (Invocation.BetterFunction): Make boolean. Make correspondence to
11517 section 14.4.2.2 explicit.
11518 (Invocation.OverloadResolve): Update.
11519 (Invocation): Remove is_base field.
11520 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
11521 (Invocation.Emit): Likewise.
11523 2004-09-27 Raja R Harinath <rharinath@novell.com>
11525 * README: Update to changes.
11527 2004-09-24 Marek Safar <marek.safar@seznam.cz>
11529 * cs-parser.jay: Reverted 642 warning fix.
11531 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11534 * decl.cs (FindMemberWithSameName): Indexer can have more than
11537 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11539 * expression.cs (LocalVariableReference.DoResolveLValue):
11540 Do not report warning 219 for out values.
11541 (EmptyExpression.Null): New member to avoid extra allocations.
11543 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11545 * cs-parser.jay: Fix wrong warning 642 report.
11547 * cs-tokenizer.cs (CheckNextToken): New helper;
11548 Inspect next character if is same as expected.
11550 2004-09-23 Martin Baulig <martin@ximian.com>
11552 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
11553 (Convert.ImplicitReferenceConversionExists): Likewise.
11555 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11557 * class.cs (Operator.Define): Add error 448 and 559 report.
11559 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11561 * class.cs (MemberBase.IsTypePermitted): New protected
11562 method for checking error CS0610.
11564 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11566 * class.cs (TypeContainer.HasExplicitLayout): New property
11567 Returns whether container has StructLayout attribute set Explicit.
11568 (FieldMember): New abstract class for consts and fields.
11569 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
11570 (Field): Reuse FieldMember.
11572 * const.cs (Const): Reuse FieldMember.
11574 * rootcontext.cs: EmitConstants call moved to class.
11576 2004-09-22 Martin Baulig <martin@ximian.com>
11578 Thanks to Peter Sestoft for this bug report.
11580 * expression.cs (Conditional): If both the `trueExpr' and the
11581 `falseExpr' is a NullLiteral, return a NullLiteral.
11583 2004-09-22 Martin Baulig <martin@ximian.com>
11585 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
11586 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
11587 for the "get_Current" call.
11589 2004-09-22 Martin Baulig <martin@ximian.com>
11591 Marek and me just fixed one of our oldest bugs: #28562 :-)
11593 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
11595 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
11596 we're an EnumConstant, just return that.
11597 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
11598 an EnumConstant. In this case, we need to use GetValueAsEnumType()
11599 to get the value which'll actually be written into the attribute.
11600 However, we have to use GetValue() to access the attribute's value
11603 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11605 * constant.cs (Constant.IsNegative): New abstract property
11608 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
11609 (StackAlloc.DoResolve): Reused IsNegative.
11611 2004-09-21 Martin Baulig <martin@ximian.com>
11613 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
11614 if we're used in an iterator, we may be called from different
11617 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
11618 we actually have an exception block.
11620 2004-09-20 John Luke <jluke@cfl.rr.com>
11622 * class.cs, cs-parser.jay: Improve the error report for 1520:
11623 report the actual line where the error happens, not where the
11624 class was declared.
11626 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
11627 Pass location information that was available elsewhere.
11629 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
11631 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
11632 runtime to delay sign assemblies.
11634 2004-09-19 Miguel de Icaza <miguel@ximian.com>
11636 * cs-parser.jay: Do not report the stack trace, this is barely
11639 2004-08-22 John Luke <john.luke@gmail.com>
11641 * driver.cs : check that a resource id is not already used
11642 before adding it, report CS1508 if it is, bug #63637
11644 2004-09-19 Miguel de Icaza <miguel@ximian.com>
11646 * ecore.cs: Removed dead code.
11648 2004-09-18 Marek Safar <marek.safar@seznam.cz>
11650 * class.cs: Do not report warning CS0067 on the interfaces.
11652 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11654 * cs-parser.jay: Add error 504 report.
11656 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11658 * rootcontext.cs: WarningLevel is 4 by default now.
11660 * statement.cs (Fixed.Resolve): Do not null
11663 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11666 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
11667 deep search when property is not virtual.
11668 (PropertyExpr.ResolveAccessors): Make one call for both
11671 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11674 * statement.cs: Error 152 report constains also location.
11676 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11679 * const.cs: Explicitly set constant as static.
11681 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11684 * cs-parser.jay: Add error 1017 report.
11686 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11688 Fixed bug #59980, #64224
11689 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
11691 * typemanager.cs (IsSpecialMethod): Simplified
11693 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11695 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
11696 condition with better params.
11698 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11701 * attribute.cs (Resolve): Property has to have both
11704 2004-09-14 Martin Baulig <martin@ximian.com>
11706 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
11708 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11711 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
11712 called and is obsolete then this member suppress message
11713 when call is inside next [Obsolete] method or type.
11715 * expression.cs: Use TestObsoleteMethodUsage member.
11717 2004-09-14 Martin Baulig <martin@ximian.com>
11719 * cs-parser.jay: Sync a bit with the GMCS version.
11721 2004-09-14 Martin Baulig <martin@ximian.com>
11723 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
11724 (CSharpParser.yacc_verbose_flag): New public field.
11726 * genericparser.cs: Removed.
11728 2004-09-14 Raja R Harinath <rharinath@novell.com>
11730 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
11732 2004-09-13 Marek Safar <marek.safar@seznam.cz>
11734 * class.cs (MethodCore.CheckBase): Fix bug #65757.
11736 2004-09-10 Martin Baulig <martin@ximian.com>
11738 Backported my MemberName changes from GMCS into MCS.
11740 - we are now using a special `MemberName' class instead of using
11741 strings; in GMCS, the `MemberName' also contains the type
11744 - changed the grammar rules a bit:
11745 * the old `member_name' is now a `namespace_or_type_name':
11746 The rule is that we use `namespace_or_type_name' everywhere
11747 where we expect either a "member name" (GetEnumerator) or a
11748 "member name" with an explicit interface name
11749 (IEnumerable.GetEnumerator).
11750 In GMCS, the explicit interface name may include type arguments
11751 (IEnumerable<T>.GetEnumerator).
11752 * we use `member_name' instead of just `IDENTIFIER' for
11754 The rule is that we use `member_name' wherever a member may
11755 have type parameters in GMCS.
11757 * decl.cs (MemberName): New public class.
11758 (MemberCore.MemberName): New public readonly field.
11759 (MemberCore.ctor): Take a `MemberName' argument, not a string.
11760 (DeclSpace): Likewise.
11762 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
11763 * enum.cs (Enum.ctor): Likewise.
11765 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
11767 (AliasEntry.ctor): Take a MemberName, not an Expression.
11768 (AliasEntry.UsingAlias): Likewise.
11770 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
11771 (IMethodData.MemberName): Changed type from string to MemberName.
11772 (MemberBase.ExplicitInterfaceName): Likewise.
11773 (AbstractPropertyEventMethod.SetupName): Make this private.
11774 (AbstractPropertyEventMethod.ctor): Added `string prefix'
11775 argument; compute the member name here.
11776 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
11777 on the `member.MemberName' and the `prefix'.
11779 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
11781 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
11782 thus, we get a `MemberName' instead of a `string'. These
11783 declarations may have type parameters in GMCS.
11784 (interface_method_declaration, delegate_declaration): Likewise.
11785 (class_declaration, interface_declaration): Likewise.
11786 (method_header): Use `namespace_or_type_name' instead of
11787 `member_name'. We may be an explicit interface implementation.
11788 (property_declaration, event_declaration): Likewise.
11789 (member_name): This is now just an `IDENTIFIER', not a
11790 `namespace_or_type_name'.
11791 (type_name, interface_type): Removed.
11792 (namespace_or_type_name): Return a MemberName, not an Expression.
11793 (primary_expression): Use `member_name' instead of `IDENTIFIER';
11794 call GetTypeExpression() on the MemberName to get an expression.
11795 (IndexerDeclaration.interface_type): Changed type from string to
11797 (MakeName): Operate on MemberName's instead of string's.
11799 2004-09-13 Raja R Harinath <rharinath@novell.com>
11802 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
11803 (NamespaceEntry.Lookup): Add new argument to flag if we want the
11804 lookup to avoid symbols introduced by 'using'.
11805 * rootcontext.cs (NamespaceLookup): Update.
11807 2004-09-12 Marek Safar <marek.safar@seznam.cz>
11809 * class.cs (TypeContainer.DoDefineMembers): Do not call
11810 DefineDefaultConstructor for static classes.
11812 2004-09-12 Marek Safar <marek.safar@seznam.cz>
11814 * attribute.cs (Attribute.Resolve): Add error 653 report.
11816 * class.cs (Class.ApplyAttributeBuilder): Add error 641
11818 (Method.ApplyAttributeBuilder): Add error 685 report.
11819 (Operator.Define): Add error 564 report.
11821 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
11823 * expression.cs (Invocation.DoResolve): Add error
11824 245 and 250 report.
11826 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
11829 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11831 * class.cs (ConstructorInitializer.Resolve):
11832 Wrong error number (515->516).
11834 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11836 * class.cs (Indexer.Define): Add error 631 report.
11838 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11840 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
11842 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11844 * expression.cs (Probe.DoResolve): Add error CS0241 report.
11846 2004-09-10 Marek Safar <marek.safar@seznam.cz>
11848 * cs-parser.jay: Added error CS0241 report.
11850 2004-09-10 Raja R Harinath <rharinath@novell.com>
11852 * cs-parser.jay (fixed_statement): Introduce a scope for the
11853 declaration in the 'fixed' statement.
11855 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11857 * cs-parser.jay: Added CS0230 error report.
11859 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11861 * cs-parser.jay: Added errors CS0231 and CS0257 report.
11863 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11865 * expression.cs (Argument.Resolve): Added error CS0192 and
11868 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11870 C# 2.0 #pragma warning feature
11872 * cs-tokenizer.cs (PreProcessPragma): New method;
11873 Handles #pragma directive.
11875 * report.cs (WarningRegions): New class; Support
11876 class for #pragma warning directive. It tests whether
11877 warning is enabled for a given line.
11879 2004-09-08 Miguel de Icaza <miguel@ximian.com>
11881 * const.cs: Add more descriptive error report, tahnks to
11884 2004-09-08 Marek Safar <marek.safar@seznam.cz>
11886 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
11888 2004-09-07 Miguel de Icaza <miguel@ximian.com>
11890 * expression.cs: Apply patch from Ben: Remove dead code from
11891 ArrayCreation, and remove the TurnintoConstant call in const.cs,
11892 as that code just threw an exception anwyays.
11894 * const.cs: Remove the call to the turnintoconstant, for details
11897 * literal.cs: The type of the null-literal is the null type; So
11898 we use a placeholder type (literal.cs:System.Null, defined here)
11901 * expression.cs (Conditional.DoResolve): Remove some old code that
11902 is no longer needed, conversions have been fixed.
11904 (ArrayCreationExpression.DoResolve): Return false if we fail to
11905 resolve the inner expression.
11907 2004-09-07 Raja R Harinath <rharinath@novell.com>
11910 * cs-parser.jay (delegate_declaration): Record a delegate
11911 declaration as a type declaration.
11912 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
11914 2004-09-06 Miguel de Icaza <miguel@ximian.com>
11916 * parameter.cs: Do not crash if the type can not be resolved.
11918 * expression.cs: Report errors with unsafe pointers, fixes #64896
11920 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
11922 * expression.cs: Pointer arith always needs to do a conv.i
11923 if the operand is a long. fix 65320
11925 2004-09-04 Marek Safar <marek.safar@seznam.cz>
11927 Fixed cs0619-37.cs, cs0619-38.cs
11929 * enum.cs (GetObsoleteAttribute): Removed.
11931 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
11932 on Enum member is double staged. The first is tested member
11935 2004-09-04 Marek Safar <marek.safar@seznam.cz>
11937 Fixed #56986, #63631, #65231
11939 * class.cs: (TypeContainer.AddToMemberContainer): New method,
11940 adds member to name container.
11941 (TypeContainer.AddToTypeContainer): New method, adds type to
11943 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
11944 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
11945 AddOperator): Simplified by reusing AddToMemberContainer.
11946 (TypeContainer.UserDefinedStaticConstructor): Changed to property
11948 (Method.CheckForDuplications): Fixed implementation to test all
11950 (MemberBase): Detection whether member is explicit interface
11951 implementation is now in constructor.
11952 (MemberBase.UpdateMemberName): Handles IndexerName.
11953 (Accessor): Changed to keep also location information.
11954 (AbstractPropertyEventMethod): Is derived from MemberCore.
11955 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
11956 will be emited or not.
11957 (PropertyBase.AreAccessorsDuplicateImplementation):
11958 Tests whether accessors are not in collision with some method.
11959 (Operator): Is derived from MethodCore to simplify common
11962 * decl.cs (Flags.TestMethodDuplication): Test for duplication
11964 (DeclSpace.AddToContainer): Adds the member to defined_names
11965 table. It tests for duplications and enclosing name conflicts.
11967 * enum.cs (EnumMember): Clean up to reuse the base structures
11969 2004-09-03 Martin Baulig <martin@ximian.com>
11971 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
11972 into TypeContainer, to make partial classes work again.
11974 2004-09-03 Martin Baulig <martin@ximian.com>
11976 * rootcontext.cs (RootContext.V2): Removed.
11978 2004-03-23 Martin Baulig <martin@ximian.com>
11980 * expression.cs (Invocation.OverloadResolve): Added `bool
11981 may_fail' argument and use it instead of the Location.IsNull() hack.
11983 2004-09-03 Martin Baulig <martin@ximian.com>
11985 Merged latest changes into gmcs. Please keep this comment in
11986 here, it makes it easier for me to see what changed in MCS since
11987 the last time I merged.
11989 2004-09-03 Raja R Harinath <rharinath@novell.com>
11992 * expression.cs (BetterConversion): Don't allow either conversion
11993 to be null. Remove redundant implicit conversion test when 'q ==
11994 null' -- when this function is invoked, we already know that the
11995 implicit conversion exists.
11996 (BetterFunction): Assume that 'best' is non-null. Remove
11997 redundant reimplementation of IsApplicable when 'best' is null.
11998 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
11999 number of arguments.
12000 (IsAncestralType): Extract from OverloadResolve.
12001 (OverloadResolve): Make robust to the MethodGroupExpr being
12002 unsorted. Implement all the logic of Section 14.5.5.1, and
12003 support overloading of methods from multiple applicable types.
12004 Clean up logic somewhat. Don't pass null methods to BetterFunction.
12006 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
12007 (RealError, Warning): Append type of report to related symbol.
12009 2004-09-03 Marek Safar <marek.safar@seznam.cz>
12011 * enum.cs: Fixed CLS-Compliance checks for enum members.
12012 Error tests cs3008-8.cs, cs3014-8.cs
12014 2004-09-02 Marek Safar <marek.safar@seznam.cz>
12016 Fixed bug #62342, #63102
12017 * class.cs: ImplementIndexer uses member.IsExplicitImpl
12018 like ImplementMethod.
12020 2004-09-02 Marek Safar <marek.safar@seznam.cz>
12022 * attribute.cs (Attribute.GetAttributeArgumentExpression):
12025 2004-09-02 Martin Baulig <martin@ximian.com>
12027 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
12028 TypeManager.GetArgumentTypes() rather than calling GetParameters()
12031 2004-09-01 Marek Safar <marek.safar@seznam.cz>
12033 C# 2.0 Static classes implemented
12035 * class.cs (TypeContainer): instance_constructors,
12036 initialized_fields, initialized_static_fields,
12037 default_constructor, base_inteface_types are protected to be
12038 accessible from StaticClass.
12039 (TypeContainer.DefineDefaultConstructor): New virtual method
12040 for custom default constructor generating
12041 (StaticClass): New class to handle "Static classes" feature.
12043 * cs-parser.jay: Handle static keyword on class like instance
12046 * driver.cs: Added "/langversion" command line switch with two
12047 options (iso-1, default).
12049 2004-08-31 Marek Safar <marek.safar@seznam.cz>
12051 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
12053 2004-08-31 Miguel de Icaza <miguel@ximian.com>
12055 * delegate.cs: Style.
12057 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
12059 * delegate.cs: Add seperate instance expr field for miguel.
12061 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
12063 * PointerArithmetic (Resolve): make sure we are not doing
12064 pointer arith on void*. Also, make sure we are resolved
12065 by not setting eclass until resolve.
12067 All callers: Make sure that PointerArithmetic gets resolved.
12069 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
12071 * ArrayCreation (LookupType): If the type does not resolve
12072 to an array, give an error.
12074 2004-08-27 Marek Safar <marek.safar@seznam.cz>
12076 * statement.cs (Try.Resolve): Fixed bug #64222
12078 2004-08-27 Martin Baulig <martin@ximian.com>
12081 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
12084 2004-08-26 Marek Safar <marek.safar@seznam.cz>
12086 * ecore.cs (Constantify): Get underlying type via
12087 System.Enum.GetUnderlyingType to avoid StackOverflow on the
12088 Windows in special cases.
12090 2004-08-26 Marek Safar <marek.safar@seznam.cz>
12092 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
12093 for obtaining also private methods.
12094 (GetRemoveMethod): Used GetRemoveMethod (true)
12095 for obtaining also private methods.
12097 2004-08-24 Martin Baulig <martin@ximian.com>
12099 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
12100 MethodAttributes.HideBySig for operators.
12102 2004-08-23 Martin Baulig <martin@ximian.com>
12104 Back to the old error reporting system :-)
12106 * report.cs (Message): Removed.
12107 (Report.MessageData, ErrorData, WarningData): Removed.
12108 (Report.Error, Warning): Back to the old system.
12110 2004-08-23 Martin Baulig <martin@ximian.com>
12112 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
12114 * class.cs (TypeContainer.ParentContainer): New public virtual
12115 method; replaces the explicit interface implementation.
12116 (ClassPart.ParentContainer): Override.
12118 2004-08-23 Martin Baulig <martin@ximian.com>
12120 * statement.cs (Switch): Added support for constant switches; see
12121 #59428 or test-285.cs.
12123 2004-08-22 Marek Safar <marek.safar@seznam.cz>
12126 * statement.cs (GetEnumeratorFilter): Removed useless
12127 logic because C# specs is strict. GetEnumerator must be
12130 2004-08-22 Martin Baulig <martin@ximian.com>
12132 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12133 a switch and may break, reset the barrier. Fixes #59867.
12135 2004-08-22 Marek Safar <marek.safar@seznam.cz>
12137 CLS-Compliance speed up (~5% for corlib)
12139 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
12140 New method. Tests container for CLS-Compliant names
12142 * class.cs (TypeContainer.VerifyClsName): New method.
12143 Checks whether container name is CLS Compliant.
12144 (Constructor): Implements IMethodData.
12146 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
12147 low-case table for CLS Compliance test.
12148 (MemberCache.VerifyClsParameterConflict): New method.
12149 Checks method parameters for CS3006 error.
12151 * enum.cs (EnumMember): Is derived from MemberCore.
12152 (Enum.VerifyClsName): Optimized for better performance.
12154 2004-08-06 Marek Safar <marek.safar@seznam.cz>
12156 * report.cs: Renamed Error_T to Error and changed all
12159 2004-08-06 Marek Safar <marek.safar@seznam.cz>
12161 * class.cs (TypeContainer.IndexerArrayList): New inner class
12162 container for indexers.
12163 (TypeContainer.DefaultIndexerName): New constant for default
12164 indexer name. Replaced all "Item" with this constant.
12165 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
12167 * typemanager.cs (TypeManager.default_member_ctor): Cache here
12168 DefaultMemberAttribute constructor.
12170 2004-08-05 Martin Baulig <martin@ximian.com>
12172 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12175 2004-08-05 Marek Safar <marek.safar@seznam.cz>
12177 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
12178 multi platforms problem.
12180 * compiler.csproj: Included shared files.
12182 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12184 Fix bug 60333, 55971 in the more general way
12185 * attribute.cs (Attribute.GetAttributeArgumentExpression):
12186 Added arg_type argument for constant conversion.
12187 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
12189 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12192 * class.cs (TypeContainer ): New inner classes MethodArrayList,
12193 OperatorArrayList, MethodCoreArrayList for typecontainer
12194 containers. Changed class member types to these new types.
12195 (MethodArrayList.DefineMembers): Added test for CS0659.
12197 2004-08-04 Miguel de Icaza <miguel@ximian.com>
12199 * cfold.cs: Synchronize the folding with the code in expression.cs
12200 Binary.DoNumericPromotions for uint operands.
12202 * attribute.cs: Revert patch from Raja, it introduced a regression
12203 while building Blam-1.2.1 (hard to isolate a test case).
12205 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12209 (TypeContainer.Define): Renamed to DefineContainerMembers because of
12211 (MethodCore.parent_method): New member. The method we're overriding
12212 if this is an override method.
12213 (MethodCore.CheckBase): Moved from Method class and made common.
12214 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
12216 (MethodCore.CheckForDuplications): New abstract method. For custom
12217 member duplication search in a container
12218 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
12219 method and its return type.
12220 (Event.conflict_symbol): New member. Symbol with same name in the
12224 (MemberCache.FindMemberWithSameName): New method. The method
12225 is looking for conflict with inherited symbols.
12227 2004-08-04 Martin Baulig <martin@ximian.com>
12229 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
12231 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
12233 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12235 * report.cs (Message): New enum for better error, warning reference in
12237 (MessageData): New inner abstract class. It generally handles printing of
12238 error and warning messages.
12239 Removed unused Error, Warning, Message methods.
12241 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12243 Fix for cs0592-8.cs test
12245 (Attributable.ValidAttributeTargets): Made public.
12246 (Attribute.ExplicitTarget): New member for explicit target value.
12247 (Attribute.CheckTargets): Now we translate explicit attribute
12248 target to Target here.
12250 2004-08-03 Ben Maurer <bmaurer@ximian.com>
12252 * ecore.cs (MethodGroupExpr): new IsBase property.
12254 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
12256 * delegate.cs (DelegateCreation): store a MethodGroupExpr
12257 rather than an instance expr.
12259 (DelegateCreation.Emit): Use the method group rather than
12260 the instance expression. Also, if you have base.Foo as the
12261 method for a delegate, make sure to emit ldftn, not ldftnvirt.
12263 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
12265 (NewDelegate.DoResolve): Only check for the existance of Invoke
12266 if the method is going to be needed. Use MethodGroupExpr.
12268 (NewDelegate.Emit): Remove, DelegateCreation implements this.
12270 * expression.cs: For pointer arith., make sure to use
12271 the size of the type, not the size of the pointer to
12274 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12277 * class.cs (Class): Added error CS0502 test.
12279 2004-08-03 John Luke <jluke@cfl.rr.com>
12280 Raja R Harinath <rharinath@novell.com>
12283 * attribute.cs (Attribute.complained_before): New flag.
12284 (Attribute.ResolveType, Attribute.Resolve),
12285 (Attribute.DefinePInvokeMethod): Set it.
12286 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
12288 2004-08-03 Martin Baulig <martin@ximian.com>
12290 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
12291 use a user-defined operator; we still need to do numeric
12292 promotions in case one argument is a builtin type and the other
12293 one has an implicit conversion to that type. Fixes #62322.
12295 2004-08-02 Martin Baulig <martin@ximian.com>
12297 * statement.cs (LocalInfo.Flags): Added `IsThis'.
12298 (LocalInfo.IsThis): New public property.
12299 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
12301 2004-08-01 Martin Baulig <martin@ximian.com>
12303 * class.cs (TypeContainer.GetClassBases): Don't set the default
12304 here since we may get called from GetPartialBases().
12305 (TypeContainer.DefineType): If GetClassBases() didn't return a
12306 parent, use the default one.
12308 2004-07-30 Duncan Mak <duncan@ximian.com>
12310 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
12312 2004-07-30 Martin Baulig <martin@ximian.com>
12314 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
12316 * class.cs (SourceMethod): New public class, derive from the
12317 symbol writer's ISourceMethod.
12318 (Method): Use the new symbol writer API.
12320 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
12321 as argument and use the new symbol writer.
12324 (SourceFile): Implement the symbol writer's ISourceFile.
12325 (Location.SymbolDocument): Removed.
12326 (Location.SourceFile): New public property.
12328 * symbolwriter.cs: Use the new symbol writer API.
12330 2004-07-30 Raja R Harinath <rharinath@novell.com>
12332 * Makefile (install-local): Remove. Functionality moved to
12335 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
12337 * Makefile: Install mcs.exe.config file together with mcs.exe.
12338 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
12339 correct runtime version.
12341 2004-07-25 Martin Baulig <martin@ximian.com>
12344 (TypeContainer.RegisterOrder): Removed, this was unused.
12345 (TypeContainer, interface_order): Removed.
12346 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
12347 TypeContainer as argument since we can also be called with a
12348 `PartialContainer' for a partial class/struct/interface.
12349 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
12350 of checking whether we're an `Interface' - we could be a
12351 `PartialContainer'.
12352 (PartialContainer.Register): Override; call
12353 AddClass()/AddStruct()/AddInterface() on our parent.
12355 * cs-parser.jay (interface_member_declaration): Add things to the
12356 `current_container', not the `current_class'.
12358 * rootcontext.cs (RegisterOrder): The overloaded version which
12359 takes an `Interface' was unused, removed.
12361 * typemanager.cs (TypeManager.LookupInterface): Return a
12362 `TypeContainer', not an `Interface'.
12363 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
12364 contain a `PartialContainer' for an interface, so check it's
12365 `Kind' to figure out what it is.
12367 2004-07-25 Martin Baulig <martin@ximian.com>
12369 * class.cs (Class.DefaultTypeAttributes): New public constant.
12370 (Struct.DefaultTypeAttributes): Likewise.
12371 (Interface.DefaultTypeAttributes): Likewise.
12372 (PartialContainer.TypeAttr): Override this and add the
12373 DefaultTypeAttributes.
12375 2004-07-25 Martin Baulig <martin@ximian.com>
12377 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
12378 we can just use the `Parent' field instead.
12380 2004-07-25 Martin Baulig <martin@ximian.com>
12382 * class.cs (TypeContainer.Emit): Renamed to EmitType().
12384 2004-07-25 Martin Baulig <martin@ximian.com>
12386 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
12387 our parts before defining any methods.
12388 (TypeContainer.VerifyImplements): Make this virtual.
12389 (ClassPart.VerifyImplements): Override and call VerifyImplements()
12390 on our PartialContainer.
12392 2004-07-25 Martin Baulig <martin@ximian.com>
12394 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
12396 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
12397 argument, we can just use the `Parent' field instead.
12400 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
12401 (MemberBase.DoDefine): Likewise.
12403 2004-07-24 Martin Baulig <martin@ximian.com>
12405 * decl.cs (MemberCore.Parent): New public field.
12406 (DeclSpace.Parent): Moved to MemberCore.
12408 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
12409 (MemberBase.ctor): Added TypeContainer argument, pass it to our
12411 (FieldBase, Field, Operator): Likewise.
12412 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
12413 (EventField, Event): Likewise.
12415 2004-07-23 Martin Baulig <martin@ximian.com>
12417 * class.cs (PartialContainer): New public class.
12418 (ClassPart): New public class.
12419 (TypeContainer): Added support for partial classes.
12420 (TypeContainer.GetClassBases): Splitted some of the functionality
12421 out into GetNormalBases() and GetPartialBases().
12423 * cs-tokenizer.cs (Token.PARTIAL): New token.
12424 (Tokenizer.consume_identifier): Added some hacks to recognize
12425 `partial', but only if it's immediately followed by `class',
12426 `struct' or `interface'.
12428 * cs-parser.jay: Added support for partial clases.
12430 2004-07-23 Martin Baulig <martin@ximian.com>
12432 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
12433 a `DeclSpace' and also made it readonly.
12434 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
12435 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
12436 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
12438 * cs-parser.jay: Pass the `current_class', not the
12439 `current_container' (at the moment, this is still the same thing)
12440 to a new Method, Property, Event, Indexer or Constructor.
12442 2004-07-23 Martin Baulig <martin@ximian.com>
12444 * cs-parser.jay (CSharpParser): Added a new `current_class' field
12445 and removed the `current_interface' one.
12446 (struct_declaration, class_declaration, interface_declaration):
12447 Set `current_class' to the newly created class/struct/interface;
12448 set their `Bases' and call Register() before parsing their body.
12450 2004-07-23 Martin Baulig <martin@ximian.com>
12452 * class.cs (Kind): New public enum.
12453 (TypeContainer): Made this class abstract.
12454 (TypeContainer.Kind): New public readonly field.
12455 (TypeContainer.CheckDef): New public method; moved here from
12457 (TypeContainer.Register): New public abstract method.
12458 (TypeContainer.GetPendingImplementations): New public abstract
12460 (TypeContainer.GetClassBases): Removed the `is_class' and
12461 `is_iface' parameters.
12462 (TypeContainer.DefineNestedTypes): Formerly known as
12464 (ClassOrStruct): Made this class abstract.
12466 * tree.cs (RootTypes): New public type.
12468 2004-07-20 Martin Baulig <martin@ximian.com>
12470 * tree.cs (Tree.RecordNamespace): Removed.
12471 (Tree.Namespaces): Removed.
12473 * rootcontext.cs (RootContext.IsNamespace): Removed.
12475 * cs-parser.jay (namespace_declaration): Just create a new
12476 NamespaceEntry here.
12478 2004-07-20 Martin Baulig <martin@ximian.com>
12480 * statement.cs (ExceptionStatement): New abstract class. This is
12481 now used as a base class for everyone who's using `finally'.
12482 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
12483 our local variables before using them.
12485 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
12486 virtual method. This is used by Yield.Resolve() to "steal" an
12487 outer block's `finally' clauses.
12488 (FlowBranchingException): The .ctor now takes an ExceptionStatement
12491 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
12492 version which takes an ExceptionStatement. This version must be
12493 used to create exception branchings.
12496 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
12497 (Iterator.EmitMoveNext): Added exception support; protect the
12498 block with a `fault' clause, properly handle 'finally' clauses.
12499 (Iterator.EmitDispose): Run all the `finally' clauses here.
12501 2004-07-20 Martin Baulig <martin@ximian.com>
12503 * iterator.cs: This is the first of a set of changes in the
12504 iterator code. Match the spec more closely: if we're an
12505 IEnumerable, then GetEnumerator() must be called. The first time
12506 GetEnumerator() is called, it returns the current instance; all
12507 subsequent invocations (if any) must create a copy.
12509 2004-07-19 Miguel de Icaza <miguel@ximian.com>
12511 * expression.cs: Resolve the constant expression before returning
12514 2004-07-19 Martin Baulig <martin@ximian.com>
12516 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
12517 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
12518 the return type of the new EmitContext.
12520 2004-07-18 Martin Baulig <martin@ximian.com>
12522 * class.cs (Property.Define): Fix iterators.
12524 * iterators.cs (Iterator.Define): Moved the
12525 `container.AddInterator (this)' call here from the .ctor; only do
12526 it if we resolved successfully.
12528 2004-07-17 Miguel de Icaza <miguel@ximian.com>
12530 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
12531 `true' for preprocessing directives that we parse. The return
12532 value indicates whether we should return to regular tokenizing or
12533 not, not whether it was parsed successfully.
12535 In the past if we were in: #if false ... #line #endif, we would
12536 resume parsing after `#line'. See bug 61604.
12538 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
12539 building: IsEnumType should return true only for enums, not for
12540 enums or System.Enum itself. This fixes #61593.
12542 Likely what happened is that corlib was wrong: mcs depended on
12543 this bug in some places. The bug got fixed, we had to add the
12544 hack, which caused bug 61593.
12546 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
12547 that was a workaround for the older conditions.
12549 2004-07-16 Ben Maurer <bmaurer@ximian.com>
12551 * assign.cs: IAssignMethod has a new interface, as documented
12552 inline. All assignment code now uses this new api.
12554 * ecore.cs, expression.cs: All classes which implement
12555 IAssignMethod now use the new interface.
12557 * expression.cs (Invocation): add a hack to EmitCall so that
12558 IndexerAccess can be the target of a compound assignment without
12559 evaluating its arguments twice.
12561 * statement.cs: Handle changes in Invocation api.
12563 2004-07-16 Martin Baulig <martin@ximian.com>
12565 * iterators.cs: Rewrote this. We're now using one single Proxy
12566 class for both the IEnumerable and the IEnumerator interface and
12567 `Iterator' derives from Class so we can use the high-level API.
12569 * class.cs (TypeContainer.AddIterator): New method.
12570 (TypeContainer.DoDefineType): New protected virtual method, which
12571 is called from DefineType().
12572 (TypeContainer.DoDefineMembers): Call DefineType() and
12573 DefineMembers() on all our iterators.
12574 (TypeContainer.Emit): Call Emit() on all our iterators.
12575 (TypeContainer.CloseType): Call CloseType() on all our iterators.
12577 * codegen.cs (EmitContext.CurrentIterator): New public field.
12579 2004-07-15 Martin Baulig <martin@ximian.com>
12582 (TypeManager.not_supported_exception_type): New type.
12584 2004-07-14 Martin Baulig <martin@ximian.com>
12586 * iterators.cs: Use real error numbers.
12588 2004-07-14 Martin Baulig <martin@ximian.com>
12590 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
12591 requires this to be a System.Collection.IEnumerable and not a
12592 class implementing that interface.
12593 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
12595 2004-07-13 Marek Safar <marek.safar@seznam.cz>
12597 * class.cs: Fixed previous fix, it broke some error tests.
12599 2004-07-12 Martin Baulig <martin@ximian.com>
12601 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
12604 2004-07-09 Miguel de Icaza <miguel@ximian.com>
12606 * assign.cs (LocalTemporary): Add new argument: is_address,If
12607 `is_address' is true, then the value that we store is the address
12608 to the real value, and not the value itself.
12610 * ecore.cs (PropertyExpr): use the new local temporary
12611 stuff to allow us to handle X.Y += z (where X is a struct)
12613 2004-07-08 Martin Baulig <martin@ximian.com>
12615 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
12616 not always return, just like we're doing in Using.Resolve().
12618 2004-07-07 Miguel de Icaza <miguel@ximian.com>
12620 * cs-parser.jay (fixed_statement): flag this as Pinned.
12622 2004-07-06 Miguel de Icaza <miguel@ximian.com>
12624 * typemanager.cs (TypeManager): Removed MakePinned method, this
12625 mechanism is replaced with the .NET 2.x compatible mechanism of
12626 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
12628 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
12629 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
12630 `IsFixed' property which has a different meaning.
12632 2004-07-02 Raja R Harinath <rharinath@novell.com>
12634 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
12635 visible from inside a nested class, not just the names of the
12636 immediately enclosing class.
12637 Fix for bug #60730.
12639 2004-06-24 Raja R Harinath <rharinath@novell.com>
12641 * expression.cs (BetterConversion): Remove buggy special-case
12642 handling of "implicit constant expression conversions". At this
12643 point, we already know that the conversion is possible -- we're
12644 only checking to see which is better.
12646 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12648 * cs-parser.jay: Added error CS0210 test.
12650 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12652 * cs-parser.jay: Added error CS0134 test.
12654 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12657 * cs-parser.jay: Added error CS0145 test.
12659 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12661 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
12663 2004-06-23 Ben Maurer <bmaurer@ximian.com>
12665 * expression.cs (StackAlloc.Resolve): The argument may not
12666 be a constant; deal with this case.
12668 2004-06-23 Marek Safar <marek.safar@seznam.cz>
12670 * attribute.cs (IndexerName_GetIndexerName): Renamed to
12671 GetIndexerAttributeValue.
12672 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
12674 * class.cs (Indexer.Define): Added error tests for CS0415,
12677 2004-06-23 Miguel de Icaza <miguel@ximian.com>
12679 * attribute.cs (Attribute.Resolve): Keep field code in sync with
12682 2004-06-23 Martin Baulig <martin@ximian.com>
12684 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
12685 neither return nor throw, reset the barrier as well. Fixes #60457.
12687 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
12689 * class.cs : EventAttributes is now set to None by default.
12690 This fixes bug #60459.
12692 2004-06-18 Marek Safar <marek.safar@seznam.cz>
12695 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12696 Don't throw exception but return null (it's sufficient now).
12698 2004-06-18 Marek Safar <marek.safar@seznam.cz>
12700 * typemanager.cs (GetArgumentTypes): Faster implementation.
12702 2004-06-18 Martin Baulig <martin@ximian.com>
12704 * attribute.cs (Attribute.Resolve): Check whether we're an
12705 EmptyCast which a Constant child. Fixes #60333.
12707 2004-06-17 Ben Maurer <bmaurer@ximian.com>
12709 * statement.cs (EmitCollectionForeach): Account for the fact that
12710 not all valuetypes are in areas which we can take the address of.
12711 For these variables, we store to a temporary variable. Also, make
12712 sure that we dont emit a `callvirt' on a valuetype method.
12714 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12716 * expression.cs (StackAlloc.DoReSolve): Added test for
12717 negative parameter (CS0247).
12719 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12722 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
12724 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12727 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
12730 2004-06-14 Marek Safar <marek.safar@seznam.cz>
12732 Fix bug #58254 & cs1555.cs, cs1556.cs
12733 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
12735 2004-06-14 Marek Safar <marek.safar@seznam.cz>
12737 * cs-parser.jay: Added error CS1669 test for indexers.
12739 2004-06-11 Martin Baulig <martin@ximian.com>
12741 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
12742 call this twice: for params and varargs methods.
12744 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12747 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
12749 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12751 * attribute.cs (Attribute.GetValidTargets): Made public.
12754 (AbstractPropertyEventMethod): New class for better code sharing.
12755 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
12757 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
12759 2004-06-11 Raja R Harinath <rharinath@novell.com>
12762 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
12763 that the call to Resolve is part of a MemberAccess.
12764 (Expression.Resolve): Use it for SimpleName resolution.
12765 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
12766 Add 'intermediate' boolean argument.
12767 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
12768 error message when the SimpleName can be resolved ambiguously
12769 between an expression and a type.
12770 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
12772 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
12773 call on the left-side.
12775 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12778 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
12780 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12782 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
12784 2004-06-11 Martin Baulig <martin@ximian.com>
12786 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
12787 varargs methods if applicable.
12789 2004-06-11 Martin Baulig <martin@ximian.com>
12791 * expression.cs (Invocation.EmitCall): Don't use
12792 `method.CallingConvention == CallingConventions.VarArgs' since the
12793 method could also have `CallingConventions.HasThis'.
12795 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12797 * class.cs (Event.GetSignatureForError): Implemented.
12798 Fixed crash in error test cs3010.cs
12800 2004-06-10 Miguel de Icaza <miguel@ximian.com>
12802 * cs-tokenizer.cs: Change the way we track __arglist to be
12803 consistent with the other keywords.
12805 2004-06-09 Miguel de Icaza <miguel@ximian.com>
12807 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
12810 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
12812 * codegen.cs: Check that all referenced assemblies have a strongname
12813 before strongnaming the compiled assembly. If not report error CS1577.
12814 Fix bug #56563. Patch by Jackson Harper.
12815 * typemanager.cs: Added a method to return all referenced assemblies.
12816 Fix bug #56563. Patch by Jackson Harper.
12818 2004-06-08 Marek Safar <marek.safar@seznam.cz>
12821 (Method.ApplyAttributeBuilder): Moved and added conditional
12822 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
12825 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
12827 2004-06-08 Marek Safar <marek.safar@seznam.cz>
12830 * class.cs: (EventField.attribute_targets): Changed default target.
12832 2004-06-08 Martin Baulig <martin@ximian.com>
12834 * expression.cs (Invocation.EmitCall): Enable varargs methods.
12836 2004-06-08 Martin Baulig <martin@ximian.com>
12838 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
12840 2004-06-07 Martin Baulig <martin@ximian.com>
12842 Added support for varargs methods.
12844 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
12847 * cs-parser.jay: Added support for `__arglist'.
12849 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
12851 * expression.cs (Argument.AType): Added `ArgList'.
12852 (Invocation): Added support for varargs methods.
12853 (ArglistAccess): New public class.
12854 (Arglist): New public class.
12856 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
12858 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
12859 a method's top-level block if the method has varargs.
12861 * support.cs (ReflectionParameters, InternalParameters): Added
12862 support for varargs methods.
12864 2004-06-07 Miguel de Icaza <miguel@ximian.com>
12866 * class.cs: Provide location in indexer error report.
12868 * driver.cs: Use standard names.
12870 * namespace.cs: Catch the use of using after a namespace has been
12871 declared also on using aliases.
12873 2004-06-03 Raja R Harinath <rharinath@novell.com>
12876 * typemanager.cs (closure_private_ok, closure_invocation_type)
12877 (closure_qualifier_type, closure_invocation_assembly)
12878 (FilterWithClosure): Move to ...
12879 (Closure): New internal nested class.
12880 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
12881 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
12882 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
12883 (MemberLookup, MemberLookupFailed): Use it.
12884 * expression.cs (New.DoResolve): Treat the lookup for the
12885 constructor as being qualified by the 'new'ed type.
12886 (Indexers.GetIndexersForTypeOrInterface): Update.
12888 2004-06-03 Marek Safar <marek.safar@seznam.cz>
12891 (GetConditionalAttributeValue): New method. Returns
12892 condition of ConditionalAttribute.
12893 (SearchMulti): New method. Returns all attributes of type 't'.
12894 Use it when attribute is AllowMultiple = true.
12895 (IsConditionalMethodExcluded): New method.
12898 (Method.IsExcluded): Implemented. Returns true if method has conditional
12899 attribute and the conditions is not defined (method is excluded).
12900 (IMethodData): Extended interface for ConditionalAttribute support.
12901 (PropertyMethod.IsExcluded): Implemented.
12904 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
12907 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
12910 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
12912 * expression.cs (ArrayCreationExpression): Make this just an
12913 `expression'. It can't be a statement, so the code here was
12916 2004-06-02 Marek Safar <marek.safar@seznam.cz>
12919 * typemanager.cs (GetFullNameSignature): New method for
12922 2004-06-02 Marek Safar <marek.safar@seznam.cz>
12925 * class.cs (MemberBase.GetSignatureForError): New virtual method.
12926 Use this method when MethodBuilder is null.
12927 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
12928 Added test for error CS0626 (MONO reports error for this situation).
12929 (IMethodData.GetSignatureForError): Extended interface.
12931 2004-06-01 Marek Safar <marek.safar@seznam.cz>
12934 (AttributeTester.GetObsoleteAttribute): Returns instance of
12935 ObsoleteAttribute when type is obsolete.
12938 (TypeContainer.VerifyObsoleteAttribute): Override.
12939 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
12940 (MethodCode.VerifyObsoleteAttribute): Override.
12941 (MemberBase.VerifyObsoleteAttribute): Override.
12944 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
12945 and report proper error.
12948 Delegate.VerifyObsoleteAttribute): Override.
12951 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
12952 and report proper error.
12953 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
12956 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
12960 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
12961 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
12962 Added test for ObsoleteAttribute.
12965 (Catch): Derived from Statement.
12967 2004-06-01 Marek Safar <marek.safar@seznam.cz>
12969 Fixed bug #59071 & cs0160.cs
12971 * statement.cs (Try.Resolve): Check here whether order of catch
12972 clauses matches their dependencies.
12974 2004-05-31 Miguel de Icaza <miguel@ximian.com>
12976 * Reverted patch to namespace.cs (Use lookuptypedirect). This
12977 caused a regression: #59343. Referencing nested classes from an
12978 assembly stopped working.
12980 2004-05-31 Martin Baulig <martin@ximian.com>
12982 MCS is now frozen for beta 2.
12984 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
12986 * convert.cs: add a trivial cache for overload operator resolution.
12988 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
12990 * decl.cs: If possible, use lookuptypedirect here. We can only do
12991 this if there is no `.' after the namespace. Avoids using
12992 LookupType, which does lots of slow processing.
12993 (FindNestedType) New method, does what it says :-).
12994 * namespace.cs: use LookupTypeDirect.
12995 * rootcontext.cs: use membercache, if possible.
12996 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
12998 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
13001 According to the spec,
13003 In a member access of the form E.I, if E is a single identifier,
13004 and if the meaning of E as a simple-name (§7.5.2) is a constant,
13005 field, property, localvariable, or parameter with the same type as
13006 the meaning of E as a type-name (§3.8), then both possible
13007 meanings of E are permitted.
13009 We did not check that E as a simple-name had the same type as E as
13012 This trivial check gives us 5-7% on bootstrap time.
13014 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
13016 * expression.cs (Invocation.OverloadResolve): Avoid the
13017 use of hashtables and boxing here by allocating on demand.
13019 2004-05-30 Martin Baulig <martin@ximian.com>
13021 * rootcontext.cs (RootContext.LookupType): Don't cache things if
13022 we're doing a silent lookup. Don't try to lookup nested types in
13023 TypeManager.object_type (thanks to Ben Maurer).
13025 2004-05-30 Martin Baulig <martin@ximian.com>
13027 Committing a patch from Ben Maurer.
13029 * rootcontext.cs (RootContext.LookupType): Cache negative results.
13031 2004-05-29 Martin Baulig <martin@ximian.com>
13033 * class.cs (IMethodData.ShouldIgnore): New method.
13035 * typemanager.cs (TypeManager.MethodFlags): Don't take a
13036 `Location' argument, we don't need it anywhere. Use
13037 `IMethodData.ShouldIgnore ()' instead of
13038 `MethodData.GetMethodFlags ()'.
13039 (TypeManager.AddMethod): Removed.
13040 (TypeManager.AddMethod2): Renamed to AddMethod.
13042 2004-05-29 Martin Baulig <martin@ximian.com>
13044 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
13046 * convert.cs (Convert.ImplicitReferenceConversion): If we're
13047 converting from a class type S to an interface type and we already
13048 have an object on the stack, don't box it again. Fixes #52578.
13050 2004-05-29 Martin Baulig <martin@ximian.com>
13052 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
13053 Added support for `params' parameters. Fixes #59267.
13055 2004-05-29 Martin Baulig <martin@ximian.com>
13057 * literal.cs (NullPointer): Provide a private .ctor which sets
13058 `type' to TypeManager.object_type. Fixes #59048.
13060 2004-05-29 Martin Baulig <martin@ximian.com>
13062 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
13063 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
13065 * ecore.cs (EventExpr.instance_expr): Make the field private.
13067 2004-05-26 Marek Safar <marek.safar@seznam.cz>
13069 Fixed bug #50080 & cs0214-2.cs
13070 * expression.cs (Cast.DoResolve): Check unsafe context here.
13072 * statement.cs (Resolve.DoResolve): Likewise.
13074 2004-05-26 Martin Baulig <martin@ximian.com>
13076 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
13078 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
13079 (RootContext.LookupType): Pass down the `silent' flag.
13081 2004-05-25 Martin Baulig <martin@ximian.com>
13084 (MethodGroupExpr.IdenticalTypeName): New public property.
13085 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
13086 expression actually refers to a type.
13088 2004-05-25 Martin Baulig <martin@ximian.com>
13090 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
13091 for #56176 and made it actually work.
13093 2004-05-25 Martin Baulig <martin@ximian.com>
13095 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
13096 (FieldExpr, PropertyExpr): Override and implement
13097 CacheTemporaries. Fixes #52279.
13099 2004-05-25 Miguel de Icaza <miguel@ximian.com>
13101 * location.cs: In the new compiler listing a file twice is a
13102 warning, not an error.
13104 2004-05-24 Martin Baulig <martin@ximian.com>
13106 * enum.cs (Enum.DefineType): For the `BaseType' to be a
13107 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
13109 2004-05-24 Martin Baulig <martin@ximian.com>
13111 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
13112 walking the `using' list. Fixes #53921.
13114 2004-05-24 Martin Baulig <martin@ximian.com>
13116 * const.cs (Const.LookupConstantValue): Added support for
13117 EmptyCast's; fixes #55251.
13119 2004-05-24 Martin Baulig <martin@ximian.com>
13121 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
13122 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
13123 which does the CS0135 check. The reason is that we first need to
13124 check whether the variable actually exists.
13126 2004-05-24 Martin Baulig <martin@ximian.com>
13128 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
13129 than RootContext.LookupType() to find the explicit interface
13130 type. Fixes #58584.
13132 2004-05-24 Raja R Harinath <rharinath@novell.com>
13134 * Makefile: Simplify. Use executable.make.
13135 * mcs.exe.sources: New file. List of sources of mcs.exe.
13137 2004-05-24 Anders Carlsson <andersca@gnome.org>
13141 Use the invariant culture when doing String.Compare for CLS case
13144 2004-05-23 Martin Baulig <martin@ximian.com>
13146 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
13147 don't have any dots. Fixes #52622, added cs0246-8.cs.
13149 * namespace.cs (NamespaceEntry.Lookup): Likewise.
13151 2004-05-23 Marek Safar <marek.safar@seznam.cz>
13153 * class.cs (MemberBase.Define): Reuse MemberType member for
13154 resolved type. Other methods can use it too.
13156 2004-05-23 Martin Baulig <martin@ximian.com>
13158 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
13159 the variable also exists in the current block (otherwise, we need
13160 to report a CS0103). Fixes #58670.
13162 2004-05-23 Martin Baulig <martin@ximian.com>
13164 * flowanalysis.cs (Reachability.Reachable): Compute this
13165 on-the-fly rather than storing it as a field.
13167 2004-05-23 Martin Baulig <martin@ximian.com>
13169 * flowanalysis.cs (Reachability.And): Manually compute the
13170 resulting `barrier' from the reachability.
13172 2004-05-23 Marek Safar <marek.safar@seznam.cz>
13175 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
13176 instance of ObsoleteAttribute when symbol is obsolete.
13179 (IMethodData): Extended interface for ObsoleteAttribute support.
13181 2004-05-22 Marek Safar <marek.safar@seznam.cz>
13183 * attribute.cs: Fix bug #55970
13185 2004-05-22 Marek Safar <marek.safar@seznam.cz>
13189 (GetObsoleteAttribute): New method. Creates the instance of
13191 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
13192 ObsoleteAttribute when member is obsolete.
13193 (AttributeTester.Report_ObsoleteMessage): Common method for
13194 Obsolete error/warning reporting.
13197 (TypeContainer.base_classs_type): New member for storing parent type.
13200 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
13201 for this MemberCore.
13203 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13205 * attribute.cs, const.cs: Fix bug #58590
13207 2004-05-21 Martin Baulig <martin@ximian.com>
13209 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
13210 out parameters if the end of the method is unreachable. Fixes
13213 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13215 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
13216 Hari was right, why extra method.
13218 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13220 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
13222 2004-05-20 Martin Baulig <martin@ximian.com>
13224 Merged this back from gmcs to keep the differences to a minumum.
13226 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
13227 instead of a Declspace.
13228 (Attribute.ResolveType): Likewise.
13229 (Attributes.Search): Likewise.
13230 (Attributes.Contains): Likewise.
13231 (Attributes.GetClsCompliantAttribute): Likewise.
13233 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
13235 (MethodData.ApplyAttributes): Take an EmitContext instead of a
13238 2004-05-19 Marek Safar <marek.safar@seznam.cz>
13240 Fix bug #58688 (MCS does not report error when the same attribute
13243 * attribute.cs (Attribute.Emit): Distinction between null and default.
13245 2004-05-19 Raja R Harinath <rharinath@novell.com>
13247 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
13248 of a top-level attribute without an attribute target.
13249 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
13251 (Attribute.Conditional_GetConditionName),
13252 (Attribute.Obsolete_GetObsoleteMessage): Update.
13253 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
13254 part of ScanForIndexerName.
13255 (Attribute.CanIgnoreInvalidAttribute): New function.
13256 (Attribute.ScanForIndexerName): Move to ...
13257 (Attributes.ScanForIndexerName): ... here.
13258 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
13259 (Attributes.Search): New internal variant that can choose not to
13260 complain if types aren't resolved. The original signature now
13262 (Attributes.GetClsCompliantAttribute): Use internal variant, with
13263 complaints suppressed.
13264 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
13265 only if it not useful.
13266 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
13267 top-level for attributes that are shared between the assembly
13268 and a top-level class.
13269 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
13270 * class.cs: Update to reflect changes.
13271 (DefineIndexers): Fuse loops.
13272 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
13273 a couple more variants of attribute names.
13275 2004-05-18 Marek Safar <marek.safar@seznam.cz>
13277 Fix bug #52585 (Implemented explicit attribute declaration)
13280 (Attributable.ValidAttributeTargets): New abstract method. It gets
13281 list of valid attribute targets for explicit target declaration.
13282 (Attribute.Target): It holds target itself.
13283 (AttributeSection): Removed.
13284 (Attribute.CheckTargets): New method. It checks whether attribute
13285 target is valid for the current element.
13288 (EventProperty): New class. For events that are declared like
13289 property (with add and remove accessors).
13290 (EventField): New class. For events that are declared like field.
13293 * cs-parser.jay: Implemented explicit attribute target declaration.
13295 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
13296 Override ValidAttributeTargets.
13299 (ReturnParameter): Class for applying custom attributes on
13301 (ParameterAtribute): New class. Class for applying custom
13302 attributes on the parameter type.
13304 2004-05-17 Miguel de Icaza <miguel@ximian.com>
13306 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
13309 (Method): Allow UNSAFE here.
13311 * modifiers.cs: Support unsafe reporting.
13313 2004-05-17 Marek Safar <marek.safar@seznam.cz>
13315 * decl.cs: Fix bug #58478.
13317 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13319 * statement.cs: When checking for unreachable code on an EmptyStatement,
13320 set the location. Fixes bug #58488.
13322 2004-05-13 Miguel de Icaza <miguel@ximian.com>
13324 * driver.cs: Add -pkg handling.
13326 From Gonzalo: UseShelLExecute=false
13328 2004-05-12 Marek Safar <marek.safar@seznam.cz>
13331 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
13333 (Attribute.IsClsCompliaceRequired): Moved to base for better
13335 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
13336 when attribute is AttributeUsageAttribute.
13337 (Attribute.GetValidTargets): Simplified.
13338 (Attribute.GetAttributeUsage): New method returns AttributeUsage
13339 attribute for this type.
13340 (Attribute.ApplyAttributes): Method renamed to Emit and make
13342 (GlobalAttributeSection): New class for special handling of global
13343 attributes (assembly, module).
13344 (AttributeSection.Emit): New method.
13346 * class.cs: Implemented Attributable abstract methods.
13347 (MethodCore.LabelParameters): Moved to Parameter class.
13348 (Accessor): Is back simple class.
13349 (PropertyMethod): Implemented Attributable abstract class.
13350 (DelegateMethod): Implemented Attributable abstract class.
13351 (Event): New constructor for disctintion between normal Event
13352 and Event with accessors.
13354 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
13356 * codegen.cs, const.cs, decl.cs, delegate.cs:
13357 (CommonAssemblyModulClass): Implemented Attributable abstract class
13360 * enum.cs: Implement IAttributeSupport interface.
13361 (EnumMember): New class for emum members. Implemented Attributable
13365 (ParameterBase): Is abstract.
13366 (ReturnParameter): New class for easier [return:] attribute handling.
13368 * typemanager.cs: Removed builder_to_attr.
13370 2004-05-11 Raja R Harinath <rharinath@novell.com>
13373 * attribute.cs (Attribute.GetPositionalValue): New function.
13374 * class.cs (TypeContainer.VerifyMembers): New function.
13375 (TypeContainer.Emit): Use it.
13376 (ClassOrStruct): New base class for Class and Struct.
13377 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
13378 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
13380 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
13381 then each non-static field should have a FieldOffset attribute.
13382 Otherwise, none of the fields should have a FieldOffset attribute.
13383 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
13384 and FieldOffset attributes.
13385 * typemanager.cs (TypeManager.struct_layout_attribute_type)
13386 (TypeManager.field_offset_attribute_type): New core types.
13387 (TypeManager.InitCoreTypes): Initialize them.
13389 2004-05-11 Michal Moskal <malekith@pld-linux.org>
13391 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
13392 Return correct type.
13395 2004-05-09 Miguel de Icaza <miguel@ximian.com>
13397 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
13398 be implicitly converted to ulong.
13400 * expression.cs: The logic for allowing operator &, | and ^ worked
13401 was wrong, it worked before because we did not report an error in
13402 an else branch. Fixes 57895.
13404 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
13405 allow volatile fields to be reference types.
13407 2004-05-07 Miguel de Icaza <miguel@ximian.com>
13409 * driver.cs: Add support for /debug-
13411 2004-05-07 Raja R Harinath <rharinath@novell.com>
13413 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
13414 Add a 'complain' parameter to silence errors.
13415 (Attribute.Resolve): Update to changes. Put in sanity check to catch
13416 silently overlooked type-resolutions.
13417 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
13418 to reflect changes.
13419 (Attributes.Search): New function.
13420 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
13421 (Attributes.GetAttributeFullName): Remove hack.
13422 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
13423 Update to reflect changes.
13424 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13425 Use Attributes.Search instead of nested loops.
13427 2004-05-07 Marek Safar <marek.safar@seznam.cz>
13430 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
13431 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
13432 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
13434 * report.cs: (Report.Warning): Renamed to Warning_T because of
13435 parameter collision.
13437 2004-05-05 Raja R Harinath <rharinath@novell.com>
13439 * expression.cs (MemberAccess.ResolveMemberAccess):
13440 Exit with non-zero status after Report.Error.
13441 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
13443 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
13445 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
13447 * support.cs: Don't hang when the file is empty.
13449 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
13451 * support.cs: In SeekableStreamReader, compute the preamble size of the
13452 underlying stream. Position changes should take into account that initial
13455 2004-05-03 Todd Berman <tberman@sevenl.net>
13457 * driver.cs: remove unused GetSysVersion function.
13459 2004-05-03 Todd Berman <tberman@sevenl.net>
13461 * driver.cs: Remove the hack from saturday, as well as the hack
13462 from jackson (LoadAssemblyFromGac), also adds the CWD to the
13463 link_paths to get that bit proper.
13465 2004-05-01 Todd Berman <tberman@sevenl.net>
13467 * driver.cs: Try a LoadFrom before a Load, this checks the current
13468 path. This is currently a bug in mono that is be fixed, however, this
13469 provides a workaround for now. This will be removed when the bug
13472 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
13474 * CryptoConvert.cs: Updated to latest version. Fix issue with
13475 incomplete key pairs (#57941).
13477 2004-05-01 Todd Berman <tberman@sevenl.net>
13479 * driver.cs: Remove '.' from path_chars, now System.* loads properly
13482 2004-04-30 Jackson Harper <jackson@ximian.com>
13484 * codegen.cs: Open keys readonly.
13486 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13488 * typemanager.cs: don't report cyclic struct layout when a struct
13489 contains 2 or more fields of the same type. Failed for Pango.AttrShape
13490 which has 2 Pango.Rectangle fields.
13492 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
13494 * expression.cs: Handle IntPtr comparisons with IL code
13495 rather than a method call.
13497 2004-04-29 Martin Baulig <martin@ximian.com>
13499 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
13500 the list of PropertyInfo's in class hierarchy and find the
13501 accessor. Fixes #56013.
13503 2004-04-29 Martin Baulig <martin@ximian.com>
13505 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
13507 2004-04-29 Martin Baulig <martin@ximian.com>
13509 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13511 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
13513 2004-04-29 Martin Baulig <martin@ximian.com>
13515 * class.cs (ConstructorInitializer.Resolve): Check whether the
13516 parent .ctor is accessible. Fixes #52146.
13518 2004-04-29 Martin Baulig <martin@ximian.com>
13520 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13522 * statement.cs (Using.EmitLocalVariableDecls): Use
13523 TypeManager.idisposable_type, not typeof (IDisposable).
13524 (Foreach.EmitCollectionForeach): Added support for valuetypes.
13526 2004-04-29 Martin Baulig <martin@ximian.com>
13528 * class.cs (Event.Define): Don't emit the field and don't set
13529 RTSpecialName and SpecialName for events on interfaces. Fixes
13532 2004-04-29 Raja R Harinath <rharinath@novell.com>
13534 Refactor Attribute.ApplyAttributes.
13535 * attribute.cs (Attributable): New base class for objects that can
13536 have Attributes applied on them.
13537 (Attribute): Make AttributeUsage fields public.
13538 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
13539 (Attribute.IsInternalCall): New property.
13540 (Attribute.UsageAttr): Convert to a public read-only property.
13541 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
13542 (Attribute.ResolveType, Attribute.Resolve)
13543 (Attribute.ScanForIndexerName): Update to reflect changes.
13544 (Attribute.CheckAttributeTarget): Re-format.
13545 (Attribute.ApplyAttributes): Refactor, to various
13546 Attributable.ApplyAttributeBuilder methods.
13547 * decl.cs (MemberCore): Make Attributable.
13548 * class.cs (Accessor): Make Attributable.
13549 (MethodData.ApplyAttributes): Use proper attribute types, not
13551 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
13552 (TypeContainer.ApplyAttributeBuilder)
13553 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
13554 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
13555 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
13556 (Operator.ApplyAttributeBuilder): New factored-out methods.
13557 * const.cs (Const.ApplyAttributeBuilder): Likewise.
13558 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
13559 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
13560 * parameter.cs (ParameterBase): New Attributable base class
13561 that can also represent Return types.
13562 (Parameter): Update to the changes.
13564 2004-04-29 Jackson Harper <jackson@ximian.com>
13566 * driver.cs: Prefer the corlib system version when looking for
13567 assemblies in the GAC. This is still a hack, but its a better hack
13570 2004-04-29 Marek Safar <marek.safar@seznam.cz>
13572 * decl.cs, enum.cs: Improved error 3005 reporting.
13574 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
13575 (related_symbols): New private member for list of symbols
13576 related to reported error/warning.
13578 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
13580 2004-04-29 Martin Baulig <martin@ximian.com>
13582 * ecore.cs (Expression.Constantify): If we're an enum and
13583 TypeManager.TypeToCoreType() doesn't give us another type, use
13584 t.UnderlyingSystemType. Fixes #56178.
13586 2004-04-29 Martin Baulig <martin@ximian.com>
13588 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
13589 interfaces and for each interface, only add members directly
13590 declared in that interface. Fixes #53255.
13592 2004-04-28 Martin Baulig <martin@ximian.com>
13594 * expression.cs (ConditionalLogicalOperator): Use a temporary
13595 variable for `left' to avoid that we evaluate it more than once;
13598 2004-04-28 Martin Baulig <martin@ximian.com>
13600 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
13603 2004-04-28 Martin Baulig <martin@ximian.com>
13605 * statement.cs (LocalInfo.Resolve): Check whether the type is not
13608 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
13609 whether the type is not void (CS1547).
13611 2004-04-28 Martin Baulig <martin@ximian.com>
13613 * expression.cs (Unary.DoResolveLValue): Override this and report
13614 CS0131 for anything but Operator.Indirection.
13616 2004-04-28 Martin Baulig <martin@ximian.com>
13618 Committing a patch from Ben Maurer; see bug #50820.
13620 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13623 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13626 2004-04-28 Martin Baulig <martin@ximian.com>
13628 Committing a patch from Ben Maurer; see bug #50820.
13630 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13633 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13636 2004-04-28 Martin Baulig <martin@ximian.com>
13638 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
13639 (Block.AddLabel): Call DoLookupLabel() to only search in the
13642 2004-04-28 Martin Baulig <martin@ximian.com>
13644 * cfold.cs (ConstantFold.BinaryFold): Added special support for
13645 comparing StringConstants and NullLiterals in Equality and Inequality.
13647 2004-04-28 Jackson Harper <jackson@ximian.com>
13649 * driver.cs: Attempt to load referenced assemblies from the
13650 GAC. This is the quick and dirty version of this method that
13651 doesnt take into account versions and just takes the first
13652 canidate found. Will be good enough for now as we will not have more
13653 then one version installed into the GAC until I update this method.
13655 2004-04-28 Martin Baulig <martin@ximian.com>
13657 * typemanager.cs (TypeManager.CheckStructCycles): New public
13658 static method to check for cycles in the struct layout.
13660 * rootcontext.cs (RootContext.PopulateTypes): Call
13661 TypeManager.CheckStructCycles() for each TypeContainer.
13662 [Note: We only need to visit each type once.]
13664 2004-04-28 Martin Baulig <martin@ximian.com>
13666 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
13668 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
13669 success and added `out object value'. Use a `bool resolved' field
13670 to check whether we've already been called rather than
13671 `ConstantValue != null' since this breaks for NullLiterals.
13673 2004-04-28 Raja R Harinath <rharinath@novell.com>
13675 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
13676 setting of this flag, since the 'set' method may be non-public.
13678 2004-04-28 Raja R Harinath <rharinath@novell.com>
13680 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
13681 check on current_vector.Block.
13683 2004-04-27 Martin Baulig <martin@ximian.com>
13685 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
13686 a field initializer. Fixes #56459.
13688 2004-04-27 Martin Baulig <martin@ximian.com>
13690 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
13691 we're not attempting to use an indexer. Fixes #52154.
13693 2004-04-27 Martin Baulig <martin@ximian.com>
13695 * statement.cs (Return): Don't create a return label if we don't
13696 need it; reverts my change from January 20th. Thanks to Ben
13699 2004-04-27 Martin Baulig <martin@ximian.com>
13701 According to the spec, `goto' can only leave a nested scope, but
13704 * statement.cs (Block.LookupLabel): Only lookup in the current
13705 block, don't recurse into parent or child blocks.
13706 (Block.AddLabel): Check in parent and child blocks, report
13707 CS0140/CS0158 if we find a duplicate.
13708 (Block): Removed this indexer for label lookups.
13709 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
13710 this already does the error reporting for us.
13713 (FlowBranching.UsageVector.Block): New public variable; may be null.
13714 (FlowBranching.CreateSibling): Added `Block' argument.
13715 (FlowBranching.LookupLabel): New public virtual method. Lookup a
13716 label for the target of a `goto' and check whether we're not
13717 leaving a `finally'.
13719 2004-04-27 Martin Baulig <martin@ximian.com>
13721 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13722 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
13725 2004-04-27 Martin Baulig <martin@ximian.com>
13727 * statement.cs (Block.AddLabel): Also check for implicit blocks
13728 and added a CS0158 check.
13730 2004-04-27 Martin Baulig <martin@ximian.com>
13732 * flowanalysis.cs (FlowBranchingLoop): New class.
13733 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
13734 UsageVector's instead of an ArrayList.
13735 (FlowBranching.Label): Likewise.
13736 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
13737 (FlowBranching.AddBreakVector): New method.
13739 2004-04-27 Miguel de Icaza <miguel@ximian.com>
13741 * attribute.cs: Small regression fix: only convert the type if we
13742 the type is different, fixes System.Drawing build.
13744 2004-04-27 Martin Baulig <martin@ximian.com>
13746 * attribute.cs (Attribute.Resolve): If we have a constant value
13747 for a named field or property, implicity convert it to the correct
13750 2004-04-27 Raja R Harinath <rharinath@novell.com>
13752 * statement.cs (Block.Block): Implicit blocks share
13753 'child_variable_names' fields with parent blocks.
13754 (Block.AddChildVariableNames): Remove.
13755 (Block.AddVariable): Mark variable as "used by a child block" in
13756 every surrounding block.
13757 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
13758 been used in a child block, complain about violation of "Invariant
13759 meaning in blocks" rule.
13760 * cs-parser.jay (declare_local_variables): Don't use
13761 AddChildVariableNames.
13762 (foreach_statement): Don't create an implicit block: 'foreach'
13763 introduces a scope.
13765 2004-04-23 Miguel de Icaza <miguel@ximian.com>
13767 * convert.cs (ImplicitNumericConversion): 0 is also positive when
13768 converting from 0L to ulong. Fixes 57522.
13770 2004-04-22 Marek Safar <marek.safar@seznam.cz>
13772 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
13773 derived class hides via 'new' keyword field from base class (test-242.cs).
13774 TODO: Handle this in the more general way.
13776 * class.cs (CheckBase): Ditto.
13778 2004-04-22 Marek Safar <marek.safar@seznam.cz>
13780 * decl.cs (caching_flags): New member for storing cached values
13782 (MemberCore.Flags): New enum where bit flags for caching_flags
13784 (MemberCore.cls_compliance): Moved to caching_flags.
13785 (DeclSpace.Created): Moved to caching_flags.
13787 * class.cs: Use caching_flags instead of DeclSpace.Created
13789 2004-04-21 Miguel de Icaza <miguel@ximian.com>
13791 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
13792 if we are only a derived class, not a nested class.
13794 * typemanager.cs: Same as above, but do this at the MemberLookup
13795 level (used by field and methods, properties are handled in
13796 PropertyExpr). Allow for the qualified access if we are a nested
13799 2004-04-21 Marek Safar <marek.safar@seznam.cz>
13801 * class.cs: Refactoring.
13802 (IMethodData): New inteface; Holds links to parent members
13803 to avoid member duplication (reduced memory allocation).
13804 (Method): Implemented IMethodData interface.
13805 (PropertyBase): New inner classes for get/set methods.
13806 (PropertyBase.PropertyMethod): Implemented IMethodData interface
13807 (Event): New inner classes for add/remove methods.
13808 (Event.DelegateMethod): Implemented IMethodData interface.
13810 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
13811 EmitContext (related to class.cs refactoring).
13813 2004-04-21 Raja R Harinath <rharinath@novell.com>
13815 * delegate.cs (Delegate.VerifyApplicability): If the number of
13816 arguments are the same as the number of parameters, first try to
13817 verify applicability ignoring any 'params' modifier on the last
13821 2004-04-16 Raja R Harinath <rharinath@novell.com>
13823 * class.cs (TypeContainer.AddIndexer): Use
13824 'ExplicitInterfaceName' to determine if interface name was
13825 explicitly specified. 'InterfaceType' is not initialized at this time.
13826 (TypeContainer.DefineIndexers): Remove use of temporary list. The
13827 Indexers array is already in the required order. Initialize
13828 'IndexerName' only if there are normal indexers.
13829 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
13830 (TypeContainer.Emit): Emit DefaultMember attribute only if
13831 IndexerName is initialized.
13834 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
13836 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
13839 2004-04-15 Raja R Harinath <rharinath@novell.com>
13841 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
13845 * attribute.cs (Attribute.Resolve): Check for duplicate named
13849 2004-04-15 Miguel de Icaza <miguel@ximian.com>
13851 * iterators.cs (MarkYield): track whether we are in an exception,
13852 and generate code accordingly. Use a temporary value to store the
13853 result for our state.
13855 I had ignored a bit the interaction of try/catch with iterators
13856 since their behavior was not entirely obvious, but now it is
13857 possible to verify that our behavior is the same as MS .NET 2.0
13861 2004-04-14 Miguel de Icaza <miguel@ximian.com>
13863 * iterators.cs: Avoid creating temporaries if there is no work to
13866 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
13867 Enumerations, use TypeManager.EnumToUnderlying and call
13870 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
13873 (This.Emit): Use EmitContext.EmitThis to emit our
13876 (This.EmitAssign): Ditto.
13878 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
13879 codepaths, we will move all the functionality into
13882 (FieldExpr.EmitAssign): Ditto.
13884 This fixes several hidden bugs that I uncovered while doing a code
13885 review of this today.
13887 * codegen.cs (EmitThis): reworked so the semantics are more clear
13888 and also support value types "this" instances.
13890 * iterators.cs: Changed so that for iterators in value types, we
13891 do not pass the value type as a parameter.
13893 Initialization of the enumerator helpers is now done in the caller
13894 instead of passing the parameters to the constructors and having
13895 the constructor set the fields.
13897 The fields have now `assembly' visibility instead of private.
13899 2004-04-11 Miguel de Icaza <miguel@ximian.com>
13901 * expression.cs (Argument.Resolve): Check if fields passed as ref
13902 or out are contained in a MarshalByRefObject.
13904 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
13905 another compiler type.
13907 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
13909 * class.cs (Indexer.Define): use the new name checking method.
13910 Also, return false on an error.
13911 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
13912 (is_identifier_[start/part]_character): make static.
13914 2004-04-10 Miguel de Icaza <miguel@ximian.com>
13916 * expression.cs (Binary.ResolveOperator): Do no append strings
13917 twice: since we can be invoked more than once (array evaluation)
13918 on the same concatenation, take care of this here. Based on a fix
13919 from Ben (bug #56454)
13921 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
13923 * codegen.cs: Fix another case where CS1548 must be reported (when
13924 delay-sign isn't specified and no private is available #56564). Fix
13925 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
13926 error when MCS is used on the MS runtime and we need to delay-sign
13927 (which seems unsupported by AssemblyBuilder - see #56621).
13929 2004-04-08 Marek Safar <marek.safar@seznam.cz>
13931 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
13932 (TypeManager.ComputeNamespaces): Faster implementation for
13935 * compiler.csproj: Updated AssemblyName to mcs.
13937 2004-04-07 Miguel de Icaza <miguel@ximian.com>
13939 * rootcontext.cs: Add new types to the boot resolution.
13941 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
13942 MulticastDelegate is not allowed.
13944 * typemanager.cs: Add new types to lookup: System.TypedReference
13947 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
13948 check for TypedReference or ArgIterator, they are not allowed.
13950 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
13951 makes us properly catch 1510 in some conditions (see bug 56016 for
13954 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
13956 * CryptoConvert.cs: update from corlib version
13959 2004-04-05 Miguel de Icaza <miguel@ximian.com>
13961 * class.cs (Indexer.Define): Check indexername declaration
13963 2004-04-05 Marek Safar <marek.safar@seznam.cz>
13965 * attribute.cs (IsClsCompliant): Fixed problem with handling
13966 all three states (compliant, not-compliant, undetected).
13968 2004-03-30 Marek Safar <marek.safar@seznam.cz>
13970 * attribute.cs (Attribute): Location is now public.
13971 (Resolve): Store resolved arguments (pos_values) in attribute class.
13972 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
13973 (GetClsCompliantAttributeValue): New method that gets
13974 CLSCompliantAttribute value.
13975 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
13976 if exists else null.
13977 (AttributeTester): New class for CLS-Compliant verification routines.
13979 * class.cs (Emit): Add CLS-Compliant verification.
13980 (Method.GetSignatureForError): Implemented.
13981 (Constructor.GetSignatureForError): Implemented
13982 (Constructor.HasCompliantArgs): Returns if constructor has
13983 CLS-Compliant arguments.
13984 (Constructor.Emit): Override.
13985 (Construcor.IsIdentifierClsCompliant): New method; For constructors
13986 is needed to test only parameters.
13987 (FieldBase.GetSignatureForError): Implemented.
13988 (TypeContainer): New member for storing base interfaces.
13989 (TypeContainer.FindMembers): Search in base interfaces too.
13991 * codegen.cs (GetClsComplianceAttribute): New method that gets
13992 assembly or module CLSCompliantAttribute value.
13993 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
13995 (ModuleClass.Emit): Add error 3012 test.
13997 * const.cs (Emit): Override and call base for CLS-Compliant tests.
13999 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
14000 state for all decl types.
14001 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
14002 if CLS-Compliant tests are required.
14003 (IsClsCompliaceRequired): New method. Analyze whether code
14004 must be CLS-Compliant.
14005 (IsExposedFromAssembly): New method. Returns true when MemberCore
14006 is exposed from assembly.
14007 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
14008 value or gets cached value.
14009 (HasClsCompliantAttribute): New method. Returns true if MemberCore
14010 is explicitly marked with CLSCompliantAttribute.
14011 (IsIdentifierClsCompliant): New abstract method. This method is
14012 used to testing error 3005.
14013 (IsIdentifierAndParamClsCompliant): New method. Common helper method
14014 for identifier and parameters CLS-Compliant testing.
14015 (VerifyClsCompliance): New method. The main virtual method for
14016 CLS-Compliant verifications.
14017 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
14018 null. I don't know why is null (too many public members !).
14019 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
14020 and get value of first CLSCompliantAttribute that found.
14022 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
14023 (VerifyClsCompliance): Override and add extra tests.
14025 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
14026 clscheck- disable CLS-Compliant verification event if assembly is has
14027 CLSCompliantAttribute(true).
14029 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
14030 ApllyAttribute is now called in emit section as in the other cases.
14031 Possible future Emit integration.
14032 (IsIdentifierClsCompliant): New override.
14033 (VerifyClsCompliance): New override.
14034 (GetEnumeratorName): Returns full enum name.
14036 * parameter.cs (GetSignatureForError): Implemented.
14038 * report.cs (WarningData): New struct for Warning message information.
14039 (LocationOfPreviousError): New method.
14040 (Warning): New method. Reports warning based on the warning table.
14041 (Error_T): New method. Reports error based on the error table.
14043 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
14044 verifications are done here.
14046 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
14048 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
14049 CLSCompliantAttribute.
14050 (all_imported_types): New member holds all imported types from other
14052 (LoadAllImportedTypes): New method fills static table with exported types
14053 from all referenced assemblies.
14054 (Modules): New property returns all assembly modules.
14056 2004-03-30 Miguel de Icaza <miguel@ximian.com>
14058 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
14059 throwing a parser error.
14061 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
14062 which removes the hardcoded get_/set_ prefixes for properties, as
14063 IL allows for the properties to be named something else.
14067 * expression.cs: Do not override operand before we know if it is
14068 non-null. Fix 56207
14070 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
14072 * typemanager.cs: support for pinned variables.
14074 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
14076 * decl.cs, typemanager.cs: Avoid using an arraylist
14077 as a buffer if there is only one result set.
14079 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
14081 * expression.cs: Make sure you cant call a static method
14082 with an instance expression, bug #56174.
14084 2004-03-29 Miguel de Icaza <miguel@ximian.com>
14086 * class.cs (IsDuplicateImplementation): Improve error reporting to
14087 flag 663 (method only differs in parameter modifier).
14089 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
14090 in preprocessor directives.
14092 * location.cs (LookupFile): Allow for the empty path.
14094 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
14095 better approach for some of that patch, but its failing with the
14096 CharSet enumeration. For now try/catch will do.
14098 * typemanager.cs: Do not crash if a struct does not have fields.
14101 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
14103 * expression.cs: cs0213, cant fix a fixed expression.
14106 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
14108 * cs-parser.jay: detect invalid embeded statements gracefully.
14111 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
14113 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
14116 the invocation type may not be a subclass of the tye of the item/
14117 The type of the item must be a subclass of the invocation item.
14122 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
14124 * attribute.cs: Added methods to get a string and a bool from an
14125 attribute. Required to information from AssemblyKeyFileAttribute,
14126 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
14127 * codegen.cs: Modified AssemblyName creation to include support for
14128 strongnames. Catch additional exceptions to report them as CS1548.
14129 * compiler.csproj: Updated include CryptoConvert.cs.
14130 * compiler.csproj.user: Removed file - user specific configuration.
14131 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
14132 Mono.Security assembly. The original class is maintained and tested in
14133 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
14134 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
14135 like CSC 8.0 (C# v2) supports.
14136 * Makefile: Added CryptoConvert.cs to mcs sources.
14137 * rootcontext.cs: Added new options for strongnames.
14139 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
14141 * driver.cs: For --expect-error, report error code `2'
14142 if the program compiled with no errors, error code `1' if
14143 it compiled with an error other than the one expected.
14145 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
14147 * compiler.csproj: Updated for Visual Studio .NET 2003.
14148 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
14149 * compiler.sln: Updated for Visual Studio .NET 2003.
14151 2004-03-24 Ravi Pratap M <ravi@ximian.com>
14153 * expression.cs: Fix bug #47234. We basically need to apply the
14154 rule that we prefer the conversion of null to a reference type
14155 when faced with a conversion to 'object' (csc behaviour).
14157 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14159 * statement.cs: Shorter form for foreach, eliminates
14160 a local variable. r=Martin.
14162 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14164 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
14165 checks if we can use brtrue/brfalse to test for 0.
14166 * expression.cs: use the above in the test for using brtrue/brfalse.
14167 cleanup code a bit.
14169 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14171 * expression.cs: Rewrite string concat stuff. Benefits:
14173 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
14174 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
14175 rather than a concat chain.
14177 * typemanager.cs: Add lookups for more concat overloads.
14179 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14181 * expression.cs: Emit shorter il code for array init.
14198 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
14200 * statement.cs: Before, two switch blocks would be merged if the
14201 total size of the blocks (end_item - begin_item + 1) was less than
14202 two times the combined sizes of the blocks.
14204 Now, it will only merge if after the merge at least half of the
14209 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
14211 * class.cs : csc build fix for GetMethods(). See bug #52503.
14213 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
14215 * expression.cs: Make sure fp comparisons work with NaN.
14216 This fixes bug #54303. Mig approved this patch a long
14217 time ago, but we were not able to test b/c the runtime
14220 2004-03-19 Miguel de Icaza <miguel@ximian.com>
14222 * ecore.cs (TypExpr.GetHashCode): implement this overload.
14224 2004-03-19 Martin Baulig <martin@ximian.com>
14226 * class.cs (MemberCore.IsDuplicateImplementation): Report the
14227 error here and not in our caller.
14229 2004-03-19 Martin Baulig <martin@ximian.com>
14231 * interface.cs: Completely killed this file.
14232 (Interface): We're now a TypeContainer and live in class.cs.
14234 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
14235 argument; we're now also called for interfaces.
14236 (TypeContainer.DefineMembers): Allow this method being called
14238 (TypeContainer.GetMethods): New public method; formerly known as
14239 Interface.GetMethod(). This is used by PendingImplementation.
14240 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
14241 it's now private and non-static.
14242 (Interface): Moved this here; it's now implemented similar to
14244 (Method, Property, Event, Indexer): Added `bool is_interface'
14245 argument to their .ctor's.
14246 (MemberBase.IsInterface): New public field.
14248 * cs-parser.jay: Create normal Method, Property, Event, Indexer
14249 instances instead of InterfaceMethod, InterfaceProperty, etc.
14250 (opt_interface_base): Removed; we now use `opt_class_base' instead.
14251 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
14253 2004-03-19 Martin Baulig <martin@ximian.com>
14255 * class.cs (MethodCore.IsDuplicateImplementation): New private
14256 method which does the CS0111 checking.
14257 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
14258 Use IsDuplicateImplementation().
14260 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
14262 * decl.cs (FindMemberToOverride): New method to find the correct
14263 method or property to override in the base class.
14265 - Make Method/Property use the above method to find the
14266 version in the base class.
14267 - Remove the InheritableMemberSignatureCompare as it is now
14270 This patch makes large code bases much faster to compile, as it is
14271 O(n) rather than O(n^2) to do this validation.
14273 Also, it fixes bug 52458 which is that nested classes are not
14274 taken into account when finding the base class member.
14276 Reviewed/Approved by Martin.
14278 2004-03-17 Marek Safar <marek.safar@seznam.cz>
14280 * interface.cs: In all interface classes removed redundant
14281 member initialization.
14283 2004-03-16 Martin Baulig <martin@ximian.com>
14285 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
14287 2004-03-15 Miguel de Icaza <miguel@ximian.com>
14289 * decl.cs (DefineTypeAndParents): New helper method to define a
14290 type's containers before the type itself is defined; This is a
14291 bug exposed by the recent changes to Windows.Forms when an
14292 implemented interface was defined inside a class that had not been
14295 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
14297 (Check): Loop correctly to report errors modifiers
14298 (UNSAFE was not in the loop, since it was the same as TOP).
14300 * interface.cs: Every interface member now takes a ModFlags,
14301 instead of a "is_new" bool, which we set on the base MemberCore.
14303 Every place where we called "UnsafeOk" in the interface, now we
14304 call the proper member (InterfaceMethod.UnsafeOK) instead to get
14305 the unsafe settings from the member declaration instead of the
14306 container interface.
14308 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
14310 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
14311 `set_indexer_name' to the pending bits (one per type).
14313 We fixed a bug today that was picking the wrong method to
14314 override, since for properties the existing InterfaceMethod code
14315 basically ignored the method name. Now we make sure that the
14316 method name is one of the valid indexer names.
14318 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
14320 * support.cs (SeekableStreamReader): Keep track of stream byte
14321 positions and don't mix them with character offsets to the buffer.
14323 Patch from Gustavo Giráldez
14325 2004-03-15 Marek Safar <marek.safar@seznam.cz>
14327 * interface.cs (InterfaceSetGetBase): Removed double member
14328 initialization, base class does it as well.
14330 2004-03-13 Martin Baulig <martin@ximian.com>
14332 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
14333 when compiling corlib.
14335 2004-03-13 Miguel de Icaza <miguel@ximian.com>
14337 * convert.cs (ExplicitConversion): We were reporting an error on
14338 certain conversions (object_type source to a value type, when the
14339 expression was `null') before we had a chance to pass it through
14340 the user defined conversions.
14342 * driver.cs: Replace / and \ in resource specifications to dots.
14345 * class.cs: Add check for duplicate operators. Fixes 52477
14347 2004-03-11 Miguel de Icaza <miguel@ximian.com>
14349 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
14350 that are in the middle of the statements, not only at the end.
14353 * class.cs (TypeContainer.AddField): No longer set the
14354 `HaveStaticConstructor' flag, now we call it
14355 `UserDefineStaticConstructor' to diferentiate the slightly
14356 semantic difference.
14358 The situation is that we were not adding BeforeFieldInit (from
14359 Modifiers.TypeAttr) to classes that could have it.
14360 BeforeFieldInit should be set to classes that have no static
14365 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
14367 And most importantly Zoltan's comment:
14369 http://bugzilla.ximian.com/show_bug.cgi?id=44229
14371 "I think beforefieldinit means 'it's ok to initialize the type sometime
14372 before its static fields are used', i.e. initialization does not need
14373 to be triggered by the first access to the type. Setting this flag
14374 helps the JIT to compile better code, since it can run the static
14375 constructor at JIT time, and does not need to generate code to call it
14376 (possibly lots of times) at runtime. Unfortunately, mcs does not set
14377 this flag for lots of classes like String.
14379 csc sets this flag if the type does not have an explicit static
14380 constructor. The reasoning seems to be that if there are only static
14381 initalizers for a type, and no static constructor, then the programmer
14382 does not care when this initialization happens, so beforefieldinit
14385 This bug prevents the AOT compiler from being usable, since it
14386 generates so many calls to mono_runtime_class_init that the AOT code
14387 is much slower than the JITted code. The JITted code is faster,
14388 because it does not generate these calls if the vtable is type is
14389 already initialized, which is true in the majority of cases. But the
14390 AOT compiler can't do this."
14392 2004-03-10 Miguel de Icaza <miguel@ximian.com>
14394 * class.cs (MethodData.Emit): Refactor the code so symbolic
14395 information is generated for destructors; For some reasons we
14396 were taking a code path that did not generate symbolic information
14399 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
14401 * class.cs: Create a Constructor.CheckBase method that
14402 takes care of all validation type code. The method
14403 contains some code that was moved from Define.
14405 It also includes new code that checks for duplicate ctors.
14406 This fixes bug #55148.
14408 2004-03-09 Joshua Tauberer <tauberer@for.net>
14410 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
14411 a { ... }-style array creation invokes EmitStaticInitializers
14412 which is not good for reference-type arrays. String, decimal
14413 and now null constants (NullCast) are not counted toward
14414 static initializers.
14416 2004-03-05 Martin Baulig <martin@ximian.com>
14418 * location.cs (SourceFile.HasLineDirective): New public field;
14419 specifies whether the file contains or is referenced by a "#line"
14421 (Location.DefineSymbolDocuments): Ignore source files which
14422 either contain or are referenced by a "#line" directive.
14424 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
14426 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
14427 direct access to our parent, so check the method inline there.
14429 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
14431 * expression.cs (Invocation.EmitCall): Miguel's last commit
14432 caused a regression. If you had:
14437 In Foo the implict this would be null.
14439 2004-02-27 Miguel de Icaza <miguel@ximian.com>
14441 * expression.cs (Invocation.EmitCall): If the method is not
14442 virtual, do not emit a CallVirt to it, use Call.
14444 * typemanager.cs (GetFullNameSignature): Improve the method to
14445 cope with ".ctor" and replace it with the type name.
14447 * class.cs (ConstructorInitializer.Resolve): Now the method takes
14448 as an argument the ConstructorBuilder where it is being defined,
14449 to catch the recursive constructor invocations.
14451 2004-02-26 Miguel de Icaza <miguel@ximian.com>
14453 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
14454 routines to check if a type is an enumerable/enumerator allow
14455 classes that implement the IEnumerable or IEnumerator interfaces.
14457 * class.cs (Property, Operator): Implement IIteratorContainer, and
14458 implement SetYields.
14460 (Property.Define): Do the block swapping for get_methods in the
14461 context of iterators. We need to check if Properties also
14462 include indexers or not.
14464 (Operator): Assign the Block before invoking the
14465 OperatorMethod.Define, so we can trigger the Iterator code
14468 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
14469 Property and Operator classes are not created when we parse the
14470 declarator but until we have the block completed, so we use a
14471 singleton SimpleIteratorContainer.Simple to flag whether the
14472 SetYields has been invoked.
14474 We propagate this setting then to the Property or the Operator to
14475 allow the `yield' to function.
14477 2004-02-25 Marek Safar <marek.safar@seznam.cz>
14479 * codegen.cs: Implemented attribute support for modules.
14480 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
14481 Assembly/Module functionality.
14483 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
14484 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
14485 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
14487 2004-02-16 Marek Safar <marek.safar@seznam.cz>
14489 * interface.cs (FindMembers): The operation is performed on all base
14490 interfaces and not only on the first. It is required for future CLS Compliance patch.
14492 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
14494 * statement.cs, codegen.cs:
14495 This patch deals with patterns such as:
14497 public class List : IEnumerable {
14499 public MyEnumerator GetEnumerator () {
14500 return new MyEnumerator(this);
14503 IEnumerator IEnumerable.GetEnumerator () {
14507 public struct MyEnumerator : IEnumerator {
14512 Before, there were a few things we did wrong:
14513 1) we would emit callvirt on a struct, which is illegal
14514 2) we emited ldarg when we needed to emit ldarga
14515 3) we would mistakenly call the interface methods on an enumerator
14516 type that derived from IEnumerator and was in another assembly. For example:
14518 public class MyEnumerator : IEnumerator
14520 Would have the interface methods called, even if there were public impls of the
14521 method. In a struct, this lead to invalid IL code.
14523 2004-02-11 Marek Safar <marek.safar@seznam.cz>
14525 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
14528 * delegate.cs (Define): Fixed crash when delegate type is undefined.
14530 2004-02-11 Miguel de Icaza <miguel@ximian.com>
14532 * cs-parser.jay: Fix small regression: we were not testing V2
14533 compiler features correctly.
14535 * interface.cs: If the emit context is null, then create one
14537 2004-02-09 Marek Safar <marek.safar@seznam.cz>
14539 * decl.cs (GetSignatureForError): New virtual method to get full name
14540 for error messages.
14542 * attribute.cs (IAttributeSupport): New interface for attribute setting.
14543 Now it is possible to rewrite ApplyAttributes method to be less if/else.
14545 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
14546 Duplicated members and code in these classes has been removed.
14547 Better encapsulation in these classes.
14549 2004-02-07 Miguel de Icaza <miguel@ximian.com>
14551 * assign.cs (Assign.DoResolve): When dealing with compound
14552 assignments, there is a new rule in ECMA C# 2.4 (might have been
14553 there before, but it is documented here) that states that in:
14557 If b is of type int, and the `op' is a shift-operator, then the
14558 above is evaluated as:
14562 * expression.cs (Binary.ResolveOperator): Instead of testing for
14563 int/uint/long/ulong, try to implicitly convert to any of those
14564 types and use that in pointer arithmetic.
14566 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
14567 method to print information for from the type, not from the
14568 null-method we were given.
14570 2004-02-01 Duncan Mak <duncan@ximian.com>
14572 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
14573 parsing for cmd, fixes bug #53694.
14575 2004-02-04 Marek Safar <marek.safar@seznam.cz>
14577 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
14578 in the member name duplication tests. Property and operator name duplication
14579 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
14581 2004-02-03 Marek Safar <marek.safar@seznam.cz>
14583 * interface.cs (PopulateMethod): Fixed crash when interface method
14584 returns not existing type (error test cs0246-3.cs).
14586 2004-02-02 Ravi Pratap M <ravi@ximian.com>
14588 * cs-parser.jay (interface_accessors): Re-write actions to also
14589 store attributes attached to get and set methods. Fix spelling
14592 (inteface_property_declaration): Modify accordingly.
14594 (InterfaceAccessorInfo): New helper class to store information to pass
14595 around between rules that use interface_accessors.
14597 * interface.cs (Emit): Apply attributes on the get and set
14598 accessors of properties and indexers too.
14600 * attribute.cs (ApplyAttributes): Modify accordingly to use the
14601 right MethodBuilder when applying attributes to the get and set accessors.
14603 2004-01-31 Miguel de Icaza <miguel@ximian.com>
14605 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
14607 2004-01-26 Miguel de Icaza <miguel@ximian.com>
14609 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
14611 2004-01-25 Miguel de Icaza <miguel@ximian.com>
14613 * cs-parser.jay: Remove YIELD token, instead use the new grammar
14614 changes that treat `yield' specially when present before `break'
14615 or `return' tokens.
14617 * cs-tokenizer.cs: yield is no longer a keyword.
14619 2004-01-23 Marek Safar <marek.safar@seznam.cz>
14621 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
14622 setting for default constructors.
14623 For default constructors are almost every time set wrong Modifier. The
14624 generated IL code has been alright. But inside mcs this values was
14625 wrong and this was reason why several of my CLS Compliance tests
14628 2004-01-22 Martin Baulig <martin@ximian.com>
14630 * cs-parser.jay (namespace_or_type_name): Return an Expression,
14631 not a QualifiedIdentifier. This is what `type_name_expression'
14632 was previously doing.
14633 (type_name_expression): Removed; the code is now in
14634 `namespace_or_type_name'.
14635 (qualified_identifier): Removed, use `namespace_or_type_name'
14637 (QualifiedIdentifier): Removed this class.
14639 2004-01-22 Martin Baulig <martin@ximian.com>
14641 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
14642 not a string as alias name.
14644 2004-01-21 Miguel de Icaza <miguel@ximian.com>
14646 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
14647 #52730 bug, and instead compute correctly the need to use a
14648 temporary variable when requesting an address based on the
14649 static/instace modified of the field and the constructor.
14651 2004-01-21 Martin Baulig <martin@ximian.com>
14653 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
14654 class and namespace before looking up aliases. Fixes #52517.
14656 2004-01-21 Martin Baulig <martin@ximian.com>
14658 * flowanalysis.cs (UsageVector.Merge): Allow variables being
14659 assinged in a 'try'; fixes exception4.cs.
14661 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14662 * class.cs : Implemented parameter-less constructor for TypeContainer
14664 * decl.cs: Attributes are now stored here. New property OptAttributes
14666 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
14668 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
14670 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14672 * typemanager.cs (CSharpSignature): Now reports also inner class name.
14673 (CSharpSignature): New method for indexer and property signature.
14675 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14677 * pending.cs (IsVirtualFilter): Faster implementation.
14679 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14681 * typemanager.cs: Avoid inclusion of same assembly more than once.
14683 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14685 * cs-parser.jay: Fixed problem where the last assembly attribute
14686 has been applied also to following declaration (class, struct, etc.)
14688 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14690 * class.cs: Added error CS0538, CS0539 reporting.
14691 Fixed crash on Microsoft runtime when field type is void.
14693 * cs-parser.jay: Added error CS0537 reporting.
14695 * pending.cs: Added error CS0535 reporting.
14696 Improved error report for errors CS0536, CS0534.
14698 2004-01-20 Miguel de Icaza <miguel@ximian.com>
14700 Merge a few bits from the Anonymous Method MCS tree.
14702 * statement.cs (ToplevelBlock): New class for toplevel methods,
14703 will hold anonymous methods, lifted variables.
14705 * cs-parser.jay: Create toplevel blocks for delegates and for
14706 regular blocks of code.
14708 2004-01-20 Martin Baulig <martin@ximian.com>
14710 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
14711 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
14712 and `NeedExplicitReturn'; added `IsLastStatement'.
14713 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
14714 have a `ReturnLabel' or we're not unreachable.
14716 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
14717 child's reachability; don't just override ours with it. Fixes
14718 #58058 (lluis's example).
14719 (FlowBranching): Added public InTryOrCatch(), InCatch(),
14720 InFinally(), InLoop(), InSwitch() and
14721 BreakCrossesTryCatchBoundary() methods.
14723 * statement.cs (Return): Do all error checking in Resolve().
14724 Unless we are the last statement in a top-level block, always
14725 create a return label and jump to it.
14726 (Break, Continue): Do all error checking in Resolve(); also make
14727 sure we aren't leaving a `finally'.
14728 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
14729 statement in a top-level block.
14730 (Block.Flags): Added `IsDestructor'.
14731 (Block.IsDestructor): New public property.
14733 2004-01-20 Martin Baulig <martin@ximian.com>
14735 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
14737 2004-01-20 Martin Baulig <martin@ximian.com>
14739 * statement.cs (Statement.ResolveUnreachable): New public method.
14740 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
14741 (Block.Resolve): Resolve unreachable statements.
14743 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
14745 * expression.cs: We need to fix the case where we do
14746 not have a temp variable here.
14748 * assign.cs: Only expression compound assignments need
14749 temporary variables.
14751 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
14753 * flowanalysis.cs: Reduce memory allocation in a few ways:
14754 - A block with no variables should not allocate a bit
14756 - A method with no out parameters does not need any tracking
14757 for assignment of the parameters, so we need not allocate
14760 public readonly Type[] VariableTypes;
14761 public readonly string[] VariableNames;
14762 Are redundant. The data is already stored in the variable
14763 map, so we need not allocate another array for it.
14764 - We need to add alot of checks for if (params | locals) == null
14765 due to the first two changes.
14767 2004-01-18 Miguel de Icaza <miguel@ximian.com>
14769 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
14770 implement IMemoryLocation, we store a copy on a local variable and
14771 take the address of it. Patch from Benjamin Jemlich
14773 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
14774 to use a special "type_name_expression" rule which reduces the
14775 number of "QualifiedIdentifier" classes created, and instead
14776 directly creates MemberAccess expressions.
14778 2004-01-17 Miguel de Icaza <miguel@ximian.com>
14780 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
14781 that fixes #52853. Null literal assignment to ValueType
14783 * class.cs (MethodData.Emit): Instead of checking the name of the
14784 method to determine if its a destructor, create a new derived
14785 class from Method called Destructor, and test for that.
14787 * cs-parser.jay: Create a Destructor object instead of a Method.
14789 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
14793 2004-01-16 Miguel de Icaza <miguel@ximian.com>
14795 * expression.cs (Binary.ResolveOperator): Perform an implicit
14796 conversion from MethodGroups to their delegate types on the
14797 Addition operation.
14799 * delegate.cs: Introduce a new class DelegateCreation that is the
14800 base class for `NewDelegate' and `ImplicitDelegateCreation',
14801 factor some code in here.
14803 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
14804 conversion from MethodGroups to compatible delegate types.
14806 * ecore.cs (Expression.Resolve): Do not flag error 654
14807 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
14808 we allow conversions from MethodGroups to delegate types now.
14810 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
14811 assignments in v2 either.
14813 2004-01-10 Miguel de Icaza <miguel@ximian.com>
14815 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
14816 static read-only fields in ctors.
14818 Applied patch from Benjamin Jemlich
14820 * expression.cs (UnaryMutator): Avoid leaking local variables.
14822 2004-01-09 Miguel de Icaza <miguel@ximian.com>
14824 * cs-tokenizer.cs (IsCastToken): Allow the various native types
14825 here to return true, as they can be used like this:
14827 (XXX) int.MEMBER ()
14829 Fixed 49836 and all the other dups
14831 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
14833 * driver.cs: Implement /win32res and /win32icon.
14835 2004-01-08 Miguel de Icaza <miguel@ximian.com>
14837 * cs-parser.jay: Add a rule to improve error handling for the
14838 common mistake of placing modifiers after the type.
14840 2004-01-07 Miguel de Icaza <miguel@ximian.com>
14842 * cs-parser.jay (interface_event_declaration): Catch
14843 initialization of events on interfaces, and report cs0068
14845 * cs-parser.jay (interface_event_declaration): Catch
14846 initialization of events.
14848 * ecore.cs: Better report missing constructors.
14850 * expression.cs (Binary.ResolveOperator): My previous bug fix had
14851 the error reporting done in the wrong place. Fix.
14853 * expression.cs (Binary.ResolveOperator): Catch the
14854 operator + (E x, E y) error earlier, and later allow for implicit
14855 conversions in operator +/- (E e, U x) from U to the underlying
14858 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
14859 52596, if the container class is abstract, the default constructor
14860 is protected otherwise its public (before, we were always public).
14862 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
14865 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
14866 Jemlich that fixes bug #52597, MCS was generating invalid code for
14867 idisposable structs. Thanks to Ben for following up with this
14870 2004-01-06 Miguel de Icaza <miguel@ximian.com>
14872 * driver.cs: Allow assemblies without code to be generated, fixes
14875 2004-01-07 Nick Drochak <ndrochak@gol.com>
14877 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
14879 2004-01-05 Miguel de Icaza <miguel@ximian.com>
14881 * cs-parser.jay: Add rules to improve error reporting if fields or
14882 methods are declared at the namespace level (error 116)
14884 * Add rules to catch event add/remove
14886 2004-01-04 David Sheldon <dave-mono@earth.li>
14888 * expression.cs: Added matching ")" to error message for
14891 2004-01-03 Todd Berman <tberman@gentoo.org>
14893 * ecore.cs, attribute.cs:
14894 Applying fix from #52429.
14896 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
14898 * ecore.cs, expression.cs, statement.cs:
14899 Total rewrite of how we handle branching. We
14900 now handle complex boolean expressions with fewer
14901 jumps. As well if (x == 0) no longer emits a ceq.
14903 if (x is Foo) is much faster now, because we generate
14906 Overall, we get a pretty big improvement on our benchmark
14907 tests. The code we generate is smaller and more readable.
14909 I did a full two-stage bootstrap. The patch was reviewed
14910 by Martin and Miguel.
14912 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
14914 * cs-parser.jay: Make primary_expression not take a QI.
14915 we dont need this because the member_access rule covers
14916 us here. So we replace the rule with just IDENTIFIER.
14918 This has two good effects. First, we remove a s/r conflict.
14919 Second, we allocate many fewer QualifiedIdentifier objects.
14921 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
14923 * attribute.cs: Handle MarshalAs attributes as pseudo, and
14924 set the correct information via SRE. This prevents
14925 hanging on the MS runtime. Fixes #29374.
14927 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
14929 * convert.cs: correctly handle conversions to value types
14930 from Enum and ValueType as unboxing conversions.
14932 Fixes bug #52569. Patch by Benjamin Jemlich.
14934 2004-01-02 Ravi Pratap <ravi@ximian.com>
14936 * expression.cs (BetterConversion): Prefer int -> uint
14937 over int -> ulong (csc's behaviour). This fixed bug #52046.
14939 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
14941 * decl.cs (MemberCache.FindMembers): now returns a
14944 * typemanager.cs: In general, go with with ^^.
14945 (CopyNewMethods): take an IList.
14946 (RealMemberLookup): Only allocate an arraylist
14947 if we copy from two sets of methods.
14949 This change basically does two things:
14950 1) Fewer array lists allocated due to CopyNewMethods.
14951 2) the explicit cast in MemberList costed ALOT.
14953 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
14955 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
14956 a hashtable to avoid needless string allocations when an identifier is
14957 used more than once (the common case).
14959 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
14961 * pending.cs: MS's TypeBuilder.GetInterfaces ()
14962 is broken, it will not return anything. So, we
14963 have to use the information we have in mcs to
14966 * typemanager.cs: Add a cache for GetInterfaces,
14967 since this will now be used more often (due to ^^)
14969 (GetExplicitInterfaces) New method that gets the
14970 declared, not effective, interfaces on a type
14971 builder (eg, if you have interface IFoo, interface
14972 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
14975 This patch makes MCS able to bootstrap itself on
14978 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
14980 * expression.cs: Remove the Nop's that Miguel put
14983 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
14985 * report.cs, codegen.cs: Give the real stack trace to
14986 the error when an exception is thrown.
14988 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
14990 * decl.cs: only allocate hashtables for ifaces if
14993 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
14995 * expression.cs: fix the error from cs0121-2.cs
14996 (a parent interface has two child interfaces that
14997 have a function with the same name and 0 params
14998 and the function is called through the parent).
15000 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
15002 * class.cs, rootcontext.cs, typmanager.cs: do not
15005 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
15007 * codegen.cs: remove stack for the ec flow branching.
15008 It is already a linked list, so no need.
15010 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
15012 * Makefile: Allow custom profiler here.
15014 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
15016 * typemanager.cs (LookupType):
15017 - Use a static char [], because split takes
15018 a param array for args, so it was allocating
15020 - Do not store true in a hashtable, it boxes.
15022 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
15024 * flowanalysis.cs: bytify common enums.
15026 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
15028 * modifiers.cs: Add a new set of flags for the
15029 flags allowed on explicit interface impls.
15030 * cs-parser.jay: catch the use of modifiers in
15031 interfaces correctly.
15032 * class.cs: catch private void IFoo.Blah ().
15034 All related to bug #50572.
15036 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
15038 * decl.cs: Rewrite the consistant accessability checking.
15039 Accessability is not linear, it must be implemented in
15040 a tableish way. Fixes #49704.
15042 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
15044 * expression.cs: Handle negation in a checked context.
15045 We must use subtraction from zero. Fixes #38674.
15047 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
15049 * class.cs: Ignore static void main in DLLs.
15050 * rootcontext.cs: Handle the target type here,
15051 since we are have to access it from class.cs
15052 * driver.cs: account for the above.
15054 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
15056 * report.cs: Give line numbers and files if available.
15058 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
15060 * driver.cs: Implement /addmodule.
15062 * typemanager.cs: Change 'modules' field so it now contains Modules not
15065 2003-12-20 Martin Baulig <martin@ximian.com>
15067 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
15068 (FieldBase.IsAssigned): Removed this field.
15069 (FieldBase.SetAssigned): New public method.
15070 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
15072 2003-12-20 Martin Baulig <martin@ximian.com>
15074 * expression.cs (LocalVariableReference.DoResolve): Don't set
15075 `vi.Used' if we're called from DoResolveLValue().
15077 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
15078 returns the usage vector it just merged into the current one -
15079 pass this one to UsageWarning().
15080 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
15081 of the `EmitContext', don't call this recursively on our children.
15083 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
15085 * driver.cs: Implement /target:module.
15087 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
15089 * support.cs (CharArrayHashtable): New helper class.
15091 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
15092 char arrays, not strings, so we can avoid creating a string in
15093 consume_identifier if the identifier is a keyword.
15095 2003-12-16 Martin Baulig <martin@ximian.com>
15097 * statement.cs (LocalInfo.Assigned): Removed this property.
15098 (LocalInfo.Flags): Removed `Assigned'.
15099 (LocalInfo.IsAssigned): New public method; takes the EmitContext
15100 and uses flow analysis.
15101 (Block.UsageWarning): Made this method private.
15102 (Block.Resolve): Call UsageWarning() if appropriate.
15104 * expression.cs (LocalVariableReference.DoResolve): Always set
15105 LocalInfo.Used here.
15107 2003-12-13 Martin Baulig <martin@ximian.com>
15109 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
15110 any value here; we're now using flow analysis to figure out
15111 whether a statement/block returns a value.
15113 2003-12-13 Martin Baulig <martin@ximian.com>
15115 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
15117 (FlowBranching.MergeFinally): Don't call
15118 `branching.CheckOutParameters()' here, this is called in
15120 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
15121 when adding the `finally' vector.
15123 2003-12-13 Martin Baulig <martin@ximian.com>
15126 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
15127 actually work and also fix #48962.
15129 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
15131 * decl.cs: Do not check System.Object for nested types,
15132 since we know it does not have any. Big bang for buck:
15135 Run 1: 8.35 seconds
15136 Run 2: 8.32 seconds
15137 corlib: 17.99 seconds
15139 Run 1: 8.17 seconds
15140 Run 2: 8.17 seconds
15141 corlib: 17.39 seconds
15143 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
15145 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
15146 time we are returning 0 members, so we save alot here.
15148 2003-12-11 Martin Baulig <martin@ximian.com>
15150 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
15151 `MergeChild()', also just take the `FlowBranching' as argument;
15152 call Merge() on it and return the result.
15153 (FlowBranching.Merge): We don't need to do anything if we just
15156 2003-12-11 Martin Baulig <martin@ximian.com>
15158 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
15159 them in an `ArrayList' to reduce memory usage. Thanks to Ben
15160 Maurer for this idea.
15162 2003-12-11 Martin Baulig <martin@ximian.com>
15164 * flowanalysis.cs (MergeResult): This class is now gone; we now
15165 use the `UsageVector' for this. The reason for this is that if a
15166 branching just has one sibling, we don't need to "merge" them at
15167 all - that's the next step to do.
15168 (FlowBranching.Merge): We now return a `UsageVector' instead of a
15171 2003-12-11 Martin Baulig <martin@ximian.com>
15173 Reworked flow analyis and made it more precise and bug-free. The
15174 most important change is that we're now using a special `Reachability'
15175 class instead of having "magic" meanings of `FlowReturns'. I'll
15176 do some more cleanups and optimizations and also add some more
15177 documentation this week.
15179 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
15180 largely reworked this class.
15181 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
15182 the new `Reachability' class instead of having "magic" values here.
15183 (FlowBranching): We're now using an instance of `Reachability'
15184 instead of having separate `Returns', `Breaks' etc. fields.
15186 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
15187 based on flow analysis; ignore the return value of block.Emit ().
15189 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
15191 * driver.cs typemanager.cs: Find the mono extensions to corlib even
15192 if they are private.
15194 2003-12-09 Martin Baulig <martin@ximian.com>
15196 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
15197 call them directly on the UsageVector.
15199 2003-12-09 Martin Baulig <martin@ximian.com>
15201 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
15202 Changed return type from `FlowReturns' to `Reachability'.
15204 2003-12-09 Martin Baulig <martin@ximian.com>
15206 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
15207 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
15208 `Reachable' fields with a single `Reachability' one.
15210 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15212 * class.cs (FindMembers): Remove foreach's.
15217 Run 1: 8.74 seconds
15218 Run 2: 8.71 seconds
15221 Run 1: 8.64 seconds
15222 Run 2: 8.58 seconds
15225 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15230 This patch does a few things:
15231 1. EmptyStatement is now a singleton, so it is never reallocated.
15232 2. All blah is EmptyStatement constructs have been changed to
15233 blah == EmptyStatement.Value, which is much faster and valid
15234 now that EmptyStatement is a singleton.
15235 3. When resolving a block, rather than allocating a new array for
15236 the non-empty statements, empty statements are replaced with
15237 EmptyStatement.Value
15238 4. Some recursive functions have been made non-recursive.
15239 Mainly the performance impact is from (3), however (1) and (2) are needed for
15240 this to work. (4) does not make a big difference in normal situations, however
15241 it makes the profile look saner.
15246 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15247 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15248 Total memory allocated: 56397 KB
15251 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
15252 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
15253 Total memory allocated: 55666 KB
15255 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15257 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
15258 than the hashtable in a hashtable version
15260 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
15261 we always end up concating a string. This results in a huge perf
15262 loss, because many strings have to be tracked by the GC. In this
15263 patch, we first use a hashtable that works with two keys, so that
15264 the strings do not need to be concat'ed.
15268 Run 1: 8.74 seconds
15269 Run 2: 8.71 seconds
15272 Run 1: 8.65 seconds
15273 Run 2: 8.56 seconds
15275 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15277 * Makefile: Add a new target `do-time' that does a quick and simple
15278 profile, leaving easy to parse output.
15280 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
15282 * codegen.cs (Init): Create the dynamic assembly with
15283 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
15285 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
15287 * support.cs: Make the PtrHashtable use only one
15288 instance of its comparer.
15290 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
15292 * typemanager.cs: Fix lookup of GetNamespaces.
15294 2003-11-29 Miguel de Icaza <miguel@ximian.com>
15296 * expression.cs: Removed redundant line.
15298 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
15299 ArrayLists, use for loops with bounds.
15301 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
15304 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
15305 arraylists, use for loop with bounds.
15307 The above three changes give us a 0.071 second performance
15308 improvement out of 3.294 seconds down to 3.223. On my machine
15309 the above changes reduced the memory usage by 1,387 KB during
15310 compiler bootstrap.
15312 * cs-parser.jay (QualifiedIdentifier): New class used to represent
15313 QualifiedIdentifiers. Before we created a new string through
15314 concatenation, and mostly later on, the result would be
15315 manipulated by DecomposeQI through string manipulation.
15317 This reduced the compiler memory usage for bootstrapping from
15318 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
15319 compile times in 0.05 seconds.
15321 2003-11-28 Dick Porter <dick@ximian.com>
15323 * support.cs: Do string compares with the Invariant culture.
15331 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
15332 the comparison is done with the Invariant culture.
15334 2003-11-27 Miguel de Icaza <miguel@ximian.com>
15336 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
15337 GetEnumerator method.
15339 (ProbeCollectionType): Iterate starting at the most specific type
15340 upwards looking for a GetEnumerator
15342 * expression.cs: Shift count can be up to 31 for int/uint and 63
15345 2003-11-26 Miguel de Icaza <miguel@ximian.com>
15347 * statement.cs (Block.LookupLabel): Also look for the label on the
15348 children blocks. Use a hash table to keep track of visited
15351 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
15352 we actually did transform the other operand, otherwise fall back
15353 to the common codepath that casts to long.
15355 * cs-tokenizer.cs: Use the same code pattern as the int case.
15356 Maybe I should do the parsing myself, and avoid depending on the
15357 Parse routines to get this done.
15359 2003-11-25 Miguel de Icaza <miguel@ximian.com>
15361 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
15362 which fixes bug 51347. This time test it.
15364 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
15365 attributes for example can not tell the difference between these.
15366 The difference was only a syntax feature of the language.
15368 * attribute.cs: Apply attributes to delegates.
15370 * delegate.cs: Call the apply attributes method.
15372 2003-11-24 Miguel de Icaza <miguel@ximian.com>
15374 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
15375 comparing 0 vs Byte.MinValue, not the value
15377 (ImplicitConversionRequired): When reporting a conversion error,
15378 use error 31 to print out the constant error instead of the
15381 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
15382 which fixes bug 51347.
15384 2003-11-22 Miguel de Icaza <miguel@ximian.com>
15386 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
15387 which fixes the -warnaserror command line option.
15389 2003-11-21 Miguel de Icaza <miguel@ximian.com>
15391 * cfold.cs (DoNumericPromotions): During constant folding of
15392 additions on UIntConstant, special case intconstants with
15393 IntConstants like we do on the expression binary operator.
15395 2003-11-12 Miguel de Icaza <miguel@ximian.com>
15397 * convert.cs (ImplicitReferenceConversion): We were missing a case
15398 (System.Enum are not value types or class types, so we need to
15399 classify them separatedly).
15401 * driver.cs: We do not support error 2007.
15403 2003-11-12 Jackson Harper <jackson@ximian.com>
15405 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
15406 system directory. Also use the full file name so users can
15407 libraries names mscorlib-o-tron.dll in a non system dir.
15409 2003-11-10 Martin Baulig <martin@ximian.com>
15411 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
15412 (TypeManager.InitCoreTypes): Initialize them here, but instead of
15413 calling `ResolveType()' on them, directly assign their `Type'.
15415 2003-11-08 Martin Baulig <martin@ximian.com>
15417 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
15418 return value and the `out parent' parameter.
15419 (TypeContainer.DefineType): Moved the CS0644 check into
15420 GetClassBases(). Don't pass the interface types to the
15421 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
15422 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
15424 * ecore.cs (TypeExpr.IsAttribute): New property.
15425 (TypeExpr.GetInterfaces): New method.
15427 * interface.cs (Interface.GetInterfaceTypeByName): Return a
15428 TypeExpr instead of a Type.
15429 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
15430 (Interface.DefineType): Don't pass the interface types to the
15431 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
15432 them later and then call `TypeBulider.AddInterfaceImplementation()'.
15434 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
15435 instead of a `Type[]'.
15436 (TypeManager.RegisterBuilder): Likewise.
15437 (TypeManager.AddUserInterface): Likewise.
15438 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
15439 `Type[]' and also return a `TypeExpr[]'.
15440 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
15442 2003-11-08 Martin Baulig <martin@ximian.com>
15444 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
15447 2003-11-08 Martin Baulig <martin@ximian.com>
15449 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
15450 TypeManager.ResolveExpressionTypes().
15452 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
15453 instead of an Expression.
15454 (TypeExpr): This is now an abstract base class for `TypeExpression'.
15455 (TypeExpression): New public class; formerly known as `TypeExpr'.
15457 * expression.cs (ComposedCast): Derive from TypeExpr.
15459 * typemanager.cs (TypeManager.system_*_expr): These are now
15460 TypExpr's instead of Expression's.
15461 (TypeManager.ResolveExpressionTypes): New public static function;
15462 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
15465 2003-11-06 Miguel de Icaza <miguel@ximian.com>
15467 * expression.cs (New.DoResolve): Do not dereference value that
15468 might be a null return.
15470 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
15471 sure that the constant value has the right type. Fixes an
15472 unreported bug, similar to 50425.
15474 * const.cs (Const.LookupConstantValue): Call
15475 ImplicitStandardConversionExists before doing a conversion to
15476 avoid havng the TypeManager.ChangeType do conversions.
15478 Reduced the number of casts used
15480 (Const.ChangeType): New routine to enable reuse of the constant
15481 type changing code from statement.
15483 * typemanager.cs (ChangeType): Move common initialization to
15484 static global variables.
15488 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
15489 every value type to go through, even if it was void. Fix that.
15491 * cs-tokenizer.cs: Use is_identifier_start_character on the start
15492 character of the define, and the is_identifier_part_character for
15493 the rest of the string.
15495 2003-11-05 Miguel de Icaza <miguel@ximian.com>
15497 * expression.cs (UnaryMutator.EmitCode): When I updated
15498 LocalVariableReference.DoResolve, I overdid it, and dropped an
15499 optimization done on local variable references.
15501 2003-11-04 Miguel de Icaza <miguel@ximian.com>
15503 * ecore.cs: Convert the return from Ldlen into an int.
15505 2003-10-20 Miguel de Icaza <miguel@ximian.com>
15507 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
15508 the accessibility, this is a special case for toplevel non-public
15509 classes (internal for instance).
15511 2003-10-20 Nick Drochak <ndrochak@gol.com>
15513 * ecore.cs: Fix typo and build. Needed another right paren.
15515 2003-10-19 Miguel de Icaza <miguel@ximian.com>
15517 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
15518 `internal' case regular and protected, but not allowing protected
15519 to be evaluated later. Bug 49840
15521 2003-10-15 Miguel de Icaza <miguel@ximian.com>
15523 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
15524 to kb.Nlast, and not the kb.nFirst to isolate the switch
15527 Extract the underlying type, so enumerations of long/ulong are
15528 treated like long/ulong.
15530 2003-10-14 Miguel de Icaza <miguel@ximian.com>
15532 * expression.cs (New): Overload the meaning of RequestedType to
15533 track the possible creation of the NewDelegate type, since
15534 DoResolve is invoked more than once for new constructors on field
15537 See bugs: #48800 and #37014
15539 * cs-parser.jay (declare_local_constants): Take an arraylist
15540 instead of a single constant.
15542 (local_constant_declaration): It should take a
15543 constant_declarators, not a constant_declarator. Fixes 49487
15545 * convert.cs: Fix error report.
15547 2003-10-13 Jackson Harper <jackson@ximian.com>
15549 * typemanager.cs (TypeToCoreType): Add float and double this fixes
15552 2003-10-09 Martin Baulig <martin@ximian.com>
15554 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
15556 (MethodCore.DoDefineParameters): Removed the TypeContainer
15557 argument; use the DeclSpace which was passed to the .ctor instead.
15558 (MethodCore.CheckParameter): Take a DeclSpace instead of a
15559 TypeContainer; we only need a DeclSpace here.
15561 2003-10-09 Martin Baulig <martin@ximian.com>
15563 * class.cs (MethodData): Added additional `DeclSpace ds' argument
15565 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
15566 EmitContext's .ctor.
15568 2003-10-09 Martin Baulig <martin@ximian.com>
15570 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
15571 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
15572 AsAccessible(), moved them as well.
15574 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
15576 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
15578 * cs-parser.jay : Renamed yyName to yyNames related to jay.
15580 2003-10-07 Miguel de Icaza <miguel@ximian.com>
15582 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
15583 generation for >=, as spotted by Paolo, bug 48679.
15584 Patch from David Waite.
15586 * cs-tokenizer.cs: Add handling for #pragma.
15588 * cs-parser.jay: Allow for both yield and yield return in the
15589 syntax. The anti-cobolization of C# fight will go on!
15591 * class.cs (TypeBuilder.DefineType): Catch error condition here
15592 (Parent.DefineType erroring out and returning null).
15594 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15595 coping with enumerations variables, we were mistakenly processing
15596 them as a regular value type instead of built-in types. Fixes the
15599 * typemanager.cs (IsBuiltinOrEnum): New method.
15601 2003-09-30 Miguel de Icaza <miguel@ximian.com>
15603 * cs-parser.jay: Upgrade: yield now needs the return clause.
15605 2003-09-19 Martin Baulig <martin@ximian.com>
15607 * decl.cs (MemberCache.SetupCacheForInterface): Take a
15608 `MemberCache parent' argument. Normally, an interface doesn't
15609 have a parent type except System.Object, but we use this in gmcs
15610 for generic type parameters.
15612 2003-09-18 Martin Baulig <martin@ximian.com>
15614 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
15615 on `type.IsInterface'; don't check whether the type has a parent
15616 to determine whether it's an interface.
15618 2003-09-15 Martin Baulig <martin@ximian.com>
15620 * class.cs (TypeContainer.DefineType): Added an error flag to
15621 avoid reporting duplicate CS0146's ("class definition is
15624 * driver.cs (Driver.MainDriver): Abort if
15625 RootContext.ResolveTree() reported any errors.
15627 2003-09-07 Martin Baulig <martin@ximian.com>
15629 * report.cs (Error, Warning): Added overloaded versions which take
15630 a `params object[] args' and call String.Format().
15632 2003-09-07 Martin Baulig <martin@ximian.com>
15634 * decl.cs (DeclSpace..ctor): Don't call
15635 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
15636 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
15637 (DeclSpace.RecordDecl): New method.
15639 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
15641 2003-09-02 Ravi Pratap <ravi@ximian.com>
15643 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
15644 value attributes to be applied to ParameterBuilders.
15646 * class.cs (MethodCore.LabelParameters): Make static and more
15647 generic so that it can be used from other places - like interface
15648 methods, for instance.
15650 * interface.cs (Interface.Emit): Call LabelParameters before
15651 emitting attributes on the InterfaceMethod.
15653 2003-08-26 Martin Baulig <martin@ximian.com>
15655 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
15656 resolving aliases; fixes #47927.
15658 2003-08-26 Martin Baulig <martin@ximian.com>
15660 * statement.cs (Using.DoResolve): This is internally emitting a
15661 try/finally clause, so we need to set ec.NeedExplicitReturn if we
15662 do not always return. Fixes #47681.
15664 2003-08-26 Martin Baulig <martin@ximian.com>
15666 * decl.cs (MemberCore): Moved WarningNotHiding(),
15667 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
15669 (AdditionResult): Make this nested in DeclSpace.
15670 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
15671 argument; call NamespaceEntry.Define() unless we're nested in a
15674 * namespace.cs (Namespace.DefineName): New public function. This
15675 is called from DeclSpace's .ctor to add
15676 (Namespace.Lookup): Include DeclSpaces in the lookup.
15678 * class.cs (Operator): Derive from MemberBase, not MemberCore.
15680 * const.cs (Const): Derive from MemberBase, not MemberCore.
15682 2003-08-25 Martin Baulig <martin@ximian.com>
15684 * convert.cs (Convert.ExplicitReferenceConversion): When
15685 converting from an interface type to a class, unbox if the target
15686 type is a struct type. Fixes #47822.
15688 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15690 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
15693 2003-08-22 Martin Baulig <martin@ximian.com>
15695 * class.cs (TypeManager.DefineType): When defining a nested type,
15696 call DefineType() on our parent; fixes #47801.
15698 2003-08-22 Martin Baulig <martin@ximian.com>
15700 * class.cs (MethodData.Define): While checking if a method is an
15701 interface implementation, improve the test a bit more to fix #47654.
15703 2003-08-22 Martin Baulig <martin@ximian.com>
15705 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
15706 correctly; fixes #47722.
15708 2003-08-22 Martin Baulig <martin@ximian.com>
15710 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
15711 LocalVariableReference, ensure it's not read-only. Fixes #47536.
15713 * statement.cs (Fixed.DoResolve): Make all variables read-only.
15715 2003-08-22 Martin Baulig <martin@ximian.com>
15717 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
15718 can only be assigned in static constructors. Fixes #47161.
15720 2003-08-22 Martin Baulig <martin@ximian.com>
15722 Rewrote and improved the flow analysis code.
15724 * flowbranching.cs (FlowBranching): Make this class abstract.
15725 (FlowBranching.CreateBranching): New static function to create a
15726 new flow branching.
15727 (FlowBranchingBlock, FlowBranchingException): New classes.
15728 (FlowBranching.UsageVector.Type): New public readonly field.
15729 (FlowBranching.UsageVector.Breaks): Removed the setter.
15730 (FlowBranching.UsageVector.Returns): Removed the setter.
15731 (FlowBranching.UsageVector): Added Break(), Return(),
15732 NeverReachable() and Throw() methods to modify the reachability.
15733 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
15734 done by FlowBranching.Merge().
15735 (FlowBranching.UsageVector.MergeChild): New method; merges the
15736 merge result into the current vector.
15737 (FlowBranching.Merge): New abstract method to merge a branching.
15739 2003-08-12 Martin Baulig <martin@ximian.com>
15741 * expression.cs (Indirection.CacheTemporaries): Create the
15742 LocalTemporary with the pointer type, not its element type.
15744 2003-08-10 Miguel de Icaza <miguel@ximian.com>
15746 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
15747 token was a keyword or not.
15749 Add `error' options where an IDENTIFIER was expected; Provide
15750 CheckToken and CheckIdentifierToken convenience error reporting
15753 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
15755 * decl.cs: Rename `NamespaceEntry Namespace' public field into
15756 NameSpaceEntry NameSpaceEntry.
15758 (LookupInterfaceOrClass): Avoid creating a full qualified name
15759 from namespace and name: avoid doing lookups when we know the
15760 namespace is non-existant. Use new Tree.LookupByNamespace which
15761 looks up DeclSpaces based on their namespace, name pair.
15763 * driver.cs: Provide a new `parser verbose' to display the
15764 exception thrown during parsing. This is turned off by default
15765 now, so the output of a failure from mcs is more graceful.
15767 * namespace.cs: Track all the namespaces defined in a hashtable
15770 (IsNamespace): New method
15772 2003-08-09 Miguel de Icaza <miguel@ximian.com>
15774 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
15775 we know that we need to concatenate (full typename can never be
15780 * statement.cs: Use a bitfield; Do not initialize to null things
15781 which are done by the constructor by default.
15783 * cs-parser.jay: bug fix, parameter was 4, not 3.
15785 * expression.cs: Just use the property;
15787 * statement.cs: No need for GetVariableInfo method.
15789 2003-08-08 Martin Baulig <martin@ximian.com>
15791 * flowanalysis.cs (FlowReturns): This is now nested in the
15792 `FlowBranching' class.
15793 (MyBitVector): Moved this here from statement.cs.
15794 (FlowBranching.SiblingType): New enum type.
15795 (FlowBranching.CreateSibling): Added `SiblingType' argument.
15797 2003-08-07 Martin Baulig <martin@ximian.com>
15799 * flowanalysis.cs (FlowBranchingType): This is now nested in the
15800 `FlowBranching' class and called `BranchingType'.
15802 2003-08-07 Martin Baulig <martin@ximian.com>
15804 * flowanalysis.cs: Moved all the control flow analysis code into
15807 2003-08-07 Martin Baulig <martin@ximian.com>
15809 * assign.cs (Assign.DoResolve): `target' must either be an
15810 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
15813 2003-08-07 Miguel de Icaza <miguel@ximian.com>
15815 * expression.cs (BinaryMethod): This kind of expression is created by the
15816 Binary class if it determines that the operator has to be handled
15819 (BinaryDelegate): This kind of expression is created if we are
15820 dealing with a + or - operator on delegates.
15822 (Binary): remove method, argumetns, and DelegateOperator: when
15823 dealing with methods,
15825 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
15827 * statement.cs (Block): use bitfields for the three extra booleans
15828 we had in use. Remove unused topblock parameter.
15830 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
15832 * assign.cs: Drop extra unneeded tests.
15834 2003-08-06 Miguel de Icaza <miguel@ximian.com>
15836 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
15838 * statement.cs (Foreach): Use VariableStorage instead of
15841 * codegen.cs (VariableStorage): New class used by clients that
15842 require a variable stored: locals or fields for variables that
15843 need to live across yield.
15845 Maybe provide a convenience api for EmitThis+EmitLoad?
15847 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
15850 2003-08-05 Miguel de Icaza <miguel@ximian.com>
15852 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
15853 RemapParameterLValue): New methods that are used to turn a
15854 precomputed FieldInfo into an expression like this:
15858 The idea is to use this instead of making LocalVariableReference
15859 have more than one meaning.
15861 * cs-parser.jay: Add error production to BASE.
15863 * ecore.cs: Deal with TypeManager.GetField returning null, which
15864 is now a valid return value.
15866 (FieldExprNoAddress): New expression for Fields whose address can
15869 * expression.cs (LocalVariableReference): During the resolve
15870 phases, create new expressions if we are in a remapping context.
15871 Remove code that dealt with remapping here.
15873 (ParameterReference): same.
15875 (ProxyInstance): New expression, like the `This' expression, but
15876 it is born fully resolved. We know what we are doing, so remove
15877 the errors that are targeted to user-provided uses of `this'.
15879 * statement.cs (Foreach): our variable is now stored as an
15880 Expression; During resolution, follow the protocol, dont just
15881 assume it will return this.
15883 2003-08-06 Martin Baulig <martin@ximian.com>
15885 * support.cs (SeekableStreamReader.cs): New public class.
15887 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
15888 SeekableStreamReader instead of the normal StreamReader.
15890 2003-08-04 Martin Baulig <martin@ximian.com>
15892 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
15893 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
15894 deambiguate casts and delegate invocations.
15895 (parenthesized_expression): Use the new tokens to ensure this is
15896 not a cast of method invocation.
15898 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
15899 when reading a `)' and Deambiguate_CloseParens () was previously
15902 * expression.cs (ParenthesizedExpression): New class. This is
15903 just used for the CS0075 test.
15904 (Binary.DoResolve): Check for CS0075.
15906 2003-07-29 Ravi Pratap <ravi@ximian.com>
15908 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
15909 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
15910 reference comparison.
15912 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
15913 examine the ReturnType for equality - this is necessary in the
15914 cases of implicit and explicit operators whose signature also
15915 includes the return type.
15917 2003-07-26 Miguel de Icaza <miguel@ximian.com>
15919 * namespace.cs: Cache the result of the namespace computation,
15920 instead of computing it every time.
15922 2003-07-24 Miguel de Icaza <miguel@ximian.com>
15924 * decl.cs: Use a global arraylist that we reuse over invocations
15925 to avoid excesive memory consumption. Reduces memory usage on an
15926 mcs compile by one meg (45 average).
15928 * typemanager.cs (LookupTypeReflection): In .NET pointers are
15929 private, work around that.
15931 2003-07-23 Miguel de Icaza <miguel@ximian.com>
15933 * literal.cs (IntLiteral): Define Zero and One static literals.
15935 * cs-parser.jay (integer_literal): use static literals to reduce
15936 memory usage for the most used literals (0, 1 and -1). 211kb
15937 reduced in memory usage.
15939 Replace all calls to `new ArrayList' with `new
15940 ArrayList(4)' which is a good average number for most allocations,
15941 and also requires only 16 bytes of memory for its buffer by
15944 This reduced MCS memory usage in seven megabytes for the RSS after
15947 2003-07-28 Ravi Pratap <ravi@ximian.com>
15949 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
15950 handle params methods the correct way by forming only one
15951 applicable set with params and normal methods in them. Earlier we
15952 were looking at params methods only if we found no normal methods
15953 which was not the correct thing to do.
15955 (Invocation.BetterFunction): Take separate arguments indicating
15956 when candidate and the best method are params methods in their
15959 This fixes bugs #43367 and #46199.
15961 * attribute.cs: Documentation updates.
15963 (CheckAttribute): Rename to CheckAttributeTarget.
15964 (GetValidPlaces): Rename to GetValidTargets.
15966 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
15967 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
15971 2003-07-28 Martin Baulig <martin@ximian.com>
15973 * class.cs (TypeContainer.DefineMembers): Use the base type's full
15974 name when looking up the base class of a nested class. Fixes #46977.
15976 2003-07-26 Martin Baulig <martin@ximian.com>
15978 * expression.cs (Indexers.Indexer): New nested struct; contains
15979 getter, setter and the indexer's type.
15980 (Indexers.Properties): This is now an ArrayList of
15981 Indexers.Indexer's.
15982 (IndexerAccess.DoResolveLValue): Correctly set the type if the
15983 indexer doesn't have any getters.
15985 * assign.cs (Assign.DoResolve): Also do the implicit conversions
15986 for embedded property and indexer assignments.
15988 2003-07-26 Martin Baulig <martin@ximian.com>
15990 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
15991 preprocessor directive is not the first non-whitespace character
15994 2003-07-26 Martin Baulig <martin@ximian.com>
15996 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
15997 namespace parsing, follow the spec more closely.
15999 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
16000 NamespaceEntry.Lookup().
16002 2003-07-25 Martin Baulig <martin@ximian.com>
16004 * MethodCore.cs (OverridesSomething): New public field; it's set
16005 from TypeContainer.DefineMembers if this method overrides
16006 something (which doesn't need to be a method). Fix #39462.
16008 2003-07-25 Ravi Pratap <ravi@ximian.com>
16010 * typemanager.cs (GetMembers): Ensure that the list of members is
16011 reversed. This keeps things in sync.
16013 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
16014 find an AttributeUsage attribute.
16016 * expression.cs (Invocation.OverloadResolve): Perform the check
16017 which disallows Invoke to be directly called on a Delegate.
16019 (Error_InvokeOnDelegate): Report error cs1533.
16021 2003-07-25 Martin Baulig <martin@ximian.com>
16023 * expression.cs (Indexers.GetIndexersForType): Only look in the
16024 interface hierarchy if the requested type is already an
16025 interface. Fixes #46788 while keeping #46502 fixed.
16027 2003-07-25 Martin Baulig <martin@ximian.com>
16029 * class.cs (TypeContainer.DefineMembers): Check whether all
16030 readonly fields have been assigned and report warning CS0649 if
16033 * statement.cs (LocalInfo.IsFixed): Always return true if this is
16036 2003-07-24 Ravi Pratap <ravi@ximian.com>
16038 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
16039 returned from GetMethods to make things consistent with the
16040 assumptions MCS makes about ordering of methods.
16042 This should comprehensively fix bug #45127 and it does :-)
16044 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
16045 ordering is actually reverse.
16047 * Clean up some debug messages I left lying around.
16049 * interface.cs (Populate*): Get rid of code which emits attributes
16050 since the stage in which we emit attributes is the 'Emit' stage,
16051 not the define stage.
16053 (Emit): Move attribute emission for interface members here.
16055 2003-07-22 Ravi Pratap <ravi@ximian.com>
16057 * expression.cs (Invocation.OverloadResolve): Follow the spec more
16058 closely: we eliminate methods in base types when we have an
16059 applicable method in a top-level type.
16061 Please see section 14.5.5.1 for an exact description of what goes
16064 This fixes bug #45127 and a host of other related to corlib compilation.
16066 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
16067 array is the method corresponding to the top-level type (this is
16068 because of the changes made to icall.c) so we change this
16071 (MethodGroupExpr.Name): This too.
16073 * typemanager.cs (GetElementType): New method which does the right
16074 thing when compiling corlib.
16076 * everywhere: Make use of the above in the relevant places.
16078 2003-07-22 Martin Baulig <martin@ximian.com>
16080 * cs-parser.jay (invocation_expression): Moved
16081 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
16082 `cast_expression', but create a InvocationOrCast which later
16083 resolves to either an Invocation or a Cast.
16085 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
16086 method; call this before EmitStatement() to make sure that this
16087 expression can be used as a statement.
16089 * expression.cs (InvocationOrCast): New class; resolves to either
16090 an Invocation or a Cast.
16092 * statement.cs (StatementExpression): Call ResolveStatement() on
16093 the ExpressionStatement before emitting it.
16095 2003-07-21 Martin Baulig <martin@ximian.com>
16097 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
16098 `ref' and `out' attributes match; fixes #46220.
16099 (MemberAccess.ResolveMemberAccess): You can't reference a type
16100 through an expression; fixes #33180.
16101 (Indexers.GetIndexersForType): Don't return the indexers from
16102 interfaces the class implements; fixes #46502.
16104 2003-07-21 Martin Baulig <martin@ximian.com>
16106 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
16107 CS0661 checks; fixes bug #30442.
16109 2003-07-21 Martin Baulig <martin@ximian.com>
16111 * decl.cs (AdditionResult): Added `Error'.
16113 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
16115 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
16116 makes cs0031.cs actually work.
16118 2003-07-20 Martin Baulig <martin@ximian.com>
16120 * namespace.cs: Fixed that bug which caused a crash when compiling
16121 the debugger's GUI.
16123 2003-07-20 Miguel de Icaza <miguel@ximian.com>
16125 * typemanager.cs (LookupTypeReflection): Never expose types which
16126 are NotPublic, NestedPrivate, NestedAssembly, or
16127 NestedFamANDAssem. We used to return these, and later do a check
16128 that would report a meaningful error, but the problem is that we
16129 would not get the real match, if there was a name override.
16131 2003-07-18 Miguel de Icaza <miguel@ximian.com>
16133 * namespace.cs (Namespace, Name): Do not compute the namespace
16134 name dynamically, compute it in the constructor. This reduced
16135 memory usage by 1697 KB.
16137 * driver.cs: Use --pause to pause at the end.
16139 2003-07-17 Peter Williams <peter@newton.cx>
16141 * Makefile: Change the name of the test target so that it doesn't
16142 conflict with the recursive test target.
16144 2003-07-17 Miguel de Icaza <miguel@ximian.com>
16146 * expression.cs (LocalVariableReference.Emit, EmitAssign,
16147 AddressOf): Do not use EmitThis, that was wrong, use the actual
16150 2003-07-15 Miguel de Icaza <miguel@ximian.com>
16152 * class.cs (MethodData.Define): While checking if a method is an
16153 interface implementation, improve the test: If we are not public
16154 (use new test here: use the computed MethodAttributes directly,
16155 instead of the parsed modifier flags) check if the `implementing'
16156 method comes from an interface or not.
16158 * pending.cs (VerifyPendingMethods): Slightly better error
16161 * makefile: add test target that does the mcs bootstrap.
16163 2003-07-16 Ravi Pratap <ravi@ximian.com>
16165 * interface.cs (Define): Do nothing here since there are no
16166 members to populate etc. Move the attribute emission out of here
16167 since this was just totally the wrong place to put it. Attribute
16168 application happens during the 'Emit' phase, not in the 'Define'
16171 (Emit): Add this method and move the attribute emission here
16173 * rootcontext.cs (EmitCode): Call the Emit method on interface
16176 2003-07-14 Ravi Pratap M <ravi@ximian.com>
16178 * expression.cs (OverloadResolve): Report error only if Location
16179 is not 'Null' which means that there was a probe going on.
16181 2003-07-14 Martin Baulig <martin@ximian.com>
16183 * expression.cs (ConditionalLogicalOperator): New public class to
16184 implement user defined conditional logical operators.
16185 This is section 14.11.2 in the spec and bug #40505.
16187 2003-07-14 Martin Baulig <martin@ximian.com>
16189 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
16191 2003-07-14 Martin Baulig <martin@ximian.com>
16193 * codegen.cs (EmitContext.InFixedInitializer): New public field.
16195 * ecore.cs (IVariable.VerifyFixed): New interface method.
16197 * expression.cs (Unary.ResolveOperator): When resolving the `&'
16198 operator, check whether the variable is actually fixed. Fixes bug
16199 #36055. Set a variable definitely assigned when taking its
16200 address as required by the spec.
16202 * statement.cs (LocalInfo.IsFixed): New field.
16203 (LocalInfo.MakePinned): Set `IsFixed' to true.
16205 2003-07-14 Ravi Pratap M <ravi@ximian.com>
16207 * attribute.cs (Attribute.Resolve): While doing a Member lookup
16208 for .ctors, ensure that we only ask for members declared in the
16209 attribute type (BindingFlags.DeclaredOnly).
16213 * expression.cs (Error_WrongNumArguments): Report error 1501
16214 correctly the way CSC does.
16216 2003-07-13 Martin Baulig <martin@ximian.com>
16218 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
16219 lookup on the fully qualified name, to make things like "X.X" work
16220 where "X.X" is a fully qualified type name, but we also have a
16221 namespace "X" in the using list. Fixes #41975.
16223 2003-07-13 Martin Baulig <martin@ximian.com>
16225 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
16226 function. If we're a CompoundAssign, we need to create an embedded
16227 CompoundAssign, not an embedded Assign.
16228 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
16231 2003-07-13 Martin Baulig <martin@ximian.com>
16233 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
16234 work to fix bug #46088.
16236 2003-07-13 Ravi Pratap <ravi@ximian.com>
16238 * class.cs (Operator.Emit): Do not emit attributes here - it is
16239 taken care of by the Method class that we delegate too. This takes
16240 care of bug #45876.
16242 2003-07-10 Martin Baulig <martin@ximian.com>
16244 * expression.cs (TypeOfVoid): New class.
16245 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
16247 2003-07-10 Martin Baulig <martin@ximian.com>
16249 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
16252 2003-07-10 Martin Baulig <martin@ximian.com>
16254 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
16255 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
16257 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
16259 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
16261 2003-07-10 Martin Baulig <martin@ximian.com>
16263 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
16264 of decimal. Fixes #42850.
16266 NOTE: I also fixed the created byte blob, but this doesn't work on
16267 the MS runtime and csc never produces any byte blobs for decimal
16270 2003-07-10 Martin Baulig <martin@ximian.com>
16272 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
16273 structs; fixes #32068.
16274 (Block.AddChildVariableNames): Fixed #44302.
16276 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16278 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
16280 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16282 * attribute.cs: And this test is onger needed.
16284 2003-07-08 Martin Baulig <martin@ximian.com>
16286 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
16287 inaccessible types. Fixes #36313.
16289 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
16291 * namespace.cs (NamespaceEntry): Create implicit entries for all
16292 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
16293 implicit entries for N1.N2 and N1.
16295 2003-07-08 Martin Baulig <martin@ximian.com>
16297 Rewrote the handling of namespaces to fix a lot of the issues
16298 wrt. `using' aliases etc.
16300 * namespace.cs (Namespace): Splitted this class into a
16301 per-assembly `Namespace' and a per-file `NamespaceEntry'.
16303 * typemanager.cs (TypeManager.IsNamespace): Removed.
16304 (TypeManager.ComputeNamespaces): Only compute namespaces from
16305 loaded assemblies here, not the namespaces from the assembly we're
16306 currently compiling.
16308 2003-07-08 Martin Baulig <martin@ximian.com>
16310 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
16312 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16314 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
16317 I thought about the memory savings here, but LookupTypeReflection
16318 is used under already very constrained scenarios. Compiling
16319 corlib or mcs only exposes one hit, so it would not really reduce
16320 any memory consumption.
16322 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16324 * typemanager.cs: fixes bug #45889 by only adding public types from
16325 other assemblies to the list of known types.
16327 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16329 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
16330 on the type we resolved.
16332 2003-07-05 Martin Baulig <martin@ximian.com>
16334 * pending.cs (PendingImplementation.ParentImplements): Don't
16335 create the proxy if the parent is abstract.
16337 * class.cs (TypeContainer.DefineIndexers): Process explicit
16338 interface implementations first. Fixes #37714.
16340 2003-07-04 Miguel de Icaza <miguel@ximian.com>
16342 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
16343 defined recursively; but since we modify the input parameters
16344 (left is set to `this' temporarily), we reset this value if the
16345 left_is_explicit is false, which gives the original semantics to
16348 * literal.cs (NullPointer): new class used to represent a null
16349 literal in a pointer context.
16351 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
16352 type is a pointer, use a NullPointer object instead of a
16353 NullLiteral. Closes 43687
16355 (ExplicitConversion): Convert pointer values using
16356 the conv opcode to the proper type.
16358 * ecore.cs (New): change ValueTypeVariable property into a method,
16359 that returns whether the valuetype is suitable for being used.
16361 * expression.cs (Binary.DoNumericPromotions): Only return if we
16362 the int constant was a valid uint, and we can return both left and
16363 right as uints. If not, we continue processing, to trigger the
16364 type conversion. This fixes 39018.
16366 * statement.cs (Block.EmitMeta): During constant resolution, set
16367 the CurrentBlock property on the emitcontext, so that we resolve
16368 constants propertly.
16370 2003-07-02 Martin Baulig <martin@ximian.com>
16372 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
16373 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
16375 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
16376 than emitting it here.
16378 * statement.cs: Fixed some more flow analysis bugs.
16380 2003-07-02 Martin Baulig <martin@ximian.com>
16382 * class.cs (MethodData.Define): When implementing interface
16383 methods, set Final unless we're Virtual.
16385 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
16386 check work for interface methods.
16388 2003-07-01 Martin Baulig <martin@ximian.com>
16390 * ecore.cs (EmitContext.This): Replaced this property with a
16391 GetThis() method which takes a Location argument. This ensures
16392 that we get the correct error location for a CS0188.
16394 2003-07-01 Miguel de Icaza <miguel@ximian.com>
16396 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
16397 ImplicitStandardConversion.
16399 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
16401 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
16403 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
16406 2003-06-30 Miguel de Icaza <miguel@ximian.com>
16408 * class.cs (Constructor.Define): Turn off initlocals for unsafe
16411 (MethodData.Define): Turn off initlocals for unsafe methods.
16413 2003-06-29 Miguel de Icaza <miguel@ximian.com>
16415 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
16416 complete; Fixes #37521.
16418 * delegate.cs: Use Modifiers.TypeAttr to compute the
16419 TypeAttributes, instead of rolling our own. This makes the flags
16420 correct for the delegates.
16422 2003-06-28 Miguel de Icaza <miguel@ximian.com>
16424 * class.cs (Constructor.Define): Set the private flag for static
16425 constructors as well.
16427 * cs-parser.jay (statement_expression): Set the return value to
16428 null, to avoid a crash when we catch an error.
16430 2003-06-24 Miguel de Icaza <miguel@ximian.com>
16432 * cs-parser.jay: Applied patch from Jackson that adds support for
16433 extern and unsafe modifiers to destructor declarations.
16435 * expression.cs: Report error 21 if the user is trying to index a
16438 * driver.cs: Add an error message, suggested by the bug report.
16440 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
16441 if we do not have a ": this ()" constructor initializer. Fixes 45149
16443 2003-06-14 Miguel de Icaza <miguel@ximian.com>
16445 * namespace.cs: Add some information to reduce FAQs.
16447 2003-06-13 Miguel de Icaza <miguel@ximian.com>
16449 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
16450 underlying enumeration types. Fixes #43915.
16452 * expression.cs: Treat ushort/short as legal values to be used in
16453 bitwise operations.
16455 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
16457 * delegate.cs: transfer custom attributes for paramenters from
16458 the delegate declaration to Invoke and BeginInvoke.
16460 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
16462 * attribute.cs: handle custom marshalers and emit marshal info
16465 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
16467 * makefile.gnu: Added anonymous.cs to the compiler sources.
16469 2003-05-28 Miguel de Icaza <miguel@ximian.com>
16471 * iterators.cs: Change the name of the proxy class to include two
16474 * cs-parser.jay: Update grammar to include anonymous methods.
16476 * anonymous.cs: new file.
16478 2003-05-27 Miguel de Icaza <miguel@ximian.com>
16480 * class.cs (Field.Define): Add missing test for pointers and
16483 2003-05-27 Ravi Pratap <ravi@ximian.com>
16485 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
16486 we use the stobj opcode.
16488 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
16489 since it wasn't the correct fix.
16491 It still is puzzling that we are required to use stobj for IntPtr
16492 which seems to be a ValueType.
16494 2003-05-26 Miguel de Icaza <miguel@ximian.com>
16496 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
16497 during regular simple name resolution. Now, the trick is that
16498 instead of returning for processing the simplename, we do a
16499 TypeManager.LookupType (ie, a rooted lookup as opposed to a
16500 contextual lookup type). If a match is found, return that, if
16501 not, return for further composition.
16503 This fixes long-standing 30485.
16505 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16506 using the address to initialize an object, do an Stobj instead of
16507 using the regular Stelem.
16509 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
16510 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
16511 Because if we are a BaseIndexerAccess that value will be true.
16514 * statement.cs (GotoCase.Resolve): Return after reporting an
16515 error, do not attempt to continue.
16517 * expression.cs (PointerArithmetic.Emit): If our operand is a
16518 long, convert our constants to match the operand before
16519 multiplying. Convert to I type before adding. Fixes 43670.
16521 2003-05-14 Ravi Pratap <ravi@ximian.com>
16523 * enum.cs (ImplicitConversionExists) : Rename to
16524 ImplicitEnumConversionExists to remove ambiguity.
16526 * ecore.cs (NullCast): New type of cast expression class which
16527 basically is very similar to EmptyCast with the difference being
16528 it still is a constant since it is used only to cast a null to
16530 (eg. (string) null)
16532 * convert.cs (ImplicitReferenceConversion): When casting a null
16533 literal, we return a NullCast.
16535 * literal.cs (NullLiteralTyped): Remove - I don't see why this
16536 should be around anymore.
16538 The renaming (reported was slightly wrong). Corrections:
16540 ConvertImplicitStandard -> ImplicitConversionStandard
16541 ConvertExplicitStandard -> ExplicitConversionStandard
16543 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
16544 before passing them in !
16546 * convert.cs (ImplicitConversionStandard): When comparing for
16547 equal expr and target types, ensure that expr is not a
16550 In general, we must not be checking (expr_type ==
16551 target_type) in the top level conversion methods
16552 (ImplicitConversion, ExplicitConversion etc). This checking is
16553 done in the methods that they delegate to.
16555 2003-05-20 Miguel de Icaza <miguel@ximian.com>
16557 * convert.cs: Move Error_CannotConvertType,
16558 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
16559 ImplicitNumericConversion, ImplicitConversionExists,
16560 ImplicitUserConversionExists, StandardConversionExists,
16561 FindMostEncompassedType, FindMostSpecificSource,
16562 FindMostSpecificTarget, ImplicitUserConversion,
16563 ExplicitUserConversion, GetConversionOperators,
16564 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
16565 TryImplicitIntConversion, Error_CannotConvertImplicit,
16566 ConvertImplicitRequired, ConvertNumericExplicit,
16567 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
16568 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
16571 Perform the following renames:
16573 StandardConversionExists -> ImplicitStandardConversionExists
16574 ConvertImplicit -> ImplicitConversion
16575 ConvertImplicitStandard -> ImplicitStandardConversion
16576 TryImplicitIntConversion -> ImplicitIntConversion
16577 ConvertImplicitRequired -> ImplicitConversionRequired
16578 ConvertNumericExplicit -> ExplicitNumericConversion
16579 ConvertReferenceExplicit -> ExplicitReferenceConversion
16580 ConvertExplicit -> ExplicitConversion
16581 ConvertExplicitStandard -> ExplicitStandardConversion
16583 2003-05-19 Martin Baulig <martin@ximian.com>
16585 * statement.cs (TypeInfo.StructInfo): Made this type protected.
16586 (TypeInfo): Added support for structs having structs as fields.
16588 * ecore.cs (FieldExpr): Implement IVariable.
16589 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
16590 VariableInfo for the field.
16592 2003-05-18 Martin Baulig <martin@ximian.com>
16594 * expression.cs (This.DoResolve): Report a CS0027 if we're
16595 emitting a field initializer.
16597 2003-05-18 Martin Baulig <martin@ximian.com>
16599 * expression.cs (This.ResolveBase): New public function.
16600 (This.DoResolve): Check for CS0188.
16602 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
16605 * ecore.cs (MethodGroupExpr.DoResolve): Set the
16606 `instance_expression' to null if we don't have any non-static
16609 2003-05-18 Martin Baulig <martin@ximian.com>
16611 Reworked the way how local variables and parameters are handled by
16612 the flow analysis code.
16614 * statement.cs (TypeInfo, VariableMap): New public classes.
16615 (VariableInfo): New public class. This is now responsible for
16616 checking whether a variable has been assigned. It is used for
16617 parameters and local variables.
16618 (Block.EmitMeta): Take the InternalParameters as argument; compute
16619 the layout of the flow vectors here.
16620 (Block.LocalMap, Block.ParameterMap): New public properties.
16621 (FlowBranching): The .ctor doesn't get the InternalParameters
16622 anymore since Block.EmitMeta() now computes the layout of the flow
16624 (MyStructInfo): This class is now known as `StructInfo' and nested
16625 in `TypeInfo'; we don't access this directly anymore.
16627 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
16628 property and removed IsAssigned(), IsFieldAssigned(),
16629 SetAssigned() and SetFieldAssigned(); we now call them on the
16630 VariableInfo so we don't need to duplicate this code everywhere.
16632 * expression.cs (ParameterReference): Added `Block block' argument
16634 (LocalVariableReference, ParameterReference, This): The new
16635 VariableInfo class is now responsible for all the definite
16638 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
16639 IsParameterAssigned, SetParameterAssigned): Removed.
16641 2003-05-18 Martin Baulig <martin@ximian.com>
16643 * typemanager.cs (InitCoreTypes): Try calling
16644 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
16645 the 3-args-version. Corlib now also needs our `void_type'.
16646 (GetMethod): Added overloaded version which takes an optional
16647 `bool report_errors' to allow lookups of optional methods.
16649 2003-05-12 Martin Baulig <martin@ximian.com>
16651 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
16652 only used for locals and not for parameters.
16654 2003-05-12 Miguel de Icaza <miguel@ximian.com>
16656 * support.cs (InternalParameters.ParameterType): Return the
16657 ExternalType of the parameter.
16659 * parameter.cs (Parameter.ExternalType): drop the two arguments,
16662 2003-05-11 Miguel de Icaza <miguel@ximian.com>
16664 * class.cs (MethodData.Define): Do not set the `newslot' on
16665 interface members, if they are also flagged as "override".
16667 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
16668 better code for ++i and i++. This only works for static fields
16669 and local variables.
16671 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
16672 want to pull the DeclSpace out of the builder_to_declspace instead
16673 of the TypeBuilder (like in TypeContainer.FindMembers).
16675 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
16676 instead of LookupTypeContainer. Fixes the crash on .NET for
16677 looking up interface members.
16679 * const.cs: Create our own emit context during the Definition
16680 stage, so that constants are evaluated in the proper context, when
16681 a recursive definition happens.
16683 2003-05-11 Martin Baulig <martin@ximian.com>
16685 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
16686 new block for a switch section.
16687 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
16688 the adding/lookup in the switch block. Fixes #39828.
16690 2003-05-09 Miguel de Icaza <miguel@ximian.com>
16692 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
16693 functionality: I needed to convert the data after I had performed
16694 the add/sub operation into the operands type size.
16696 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
16697 pass the type for the box operation, otherwise the resulting
16698 object would have been of type object.
16700 (BoxedCast): Add constructor to specify the type to box as.
16702 2003-05-07 Miguel de Icaza <miguel@ximian.com>
16704 * iterators.cs: I was reusing the `count' variable inadvertently,
16705 take steps to not allow this to happen.
16707 2003-05-06 Miguel de Icaza <miguel@ximian.com>
16709 * attribute.cs (Attribute.Resolve): Params attributes are encoded
16710 by creating an array at the point where the params starts and
16711 putting all those arguments there, then adjusting the size of the
16714 2003-05-05 Miguel de Icaza <miguel@ximian.com>
16716 * expression.cs (New.AddressOf): Implement interface
16717 IMemoryLocation. This is used when the `new' operator is used in
16718 the context of an invocation to a method on a value type.
16720 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
16723 * namespace.cs: Also check the using aliases here.
16725 * driver.cs: Move the test for using validity after the types have
16726 been entered, so we do a single pass that also includes the using
16729 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
16730 in the regular case. CreateSiblingForFinally is doing extra
16733 * attribute.cs (GetAttributeArgumentExpression): Store the result
16734 on an out value, and use the return value to indicate failure
16735 instead of using null (which is a valid return for Constant.GetValue).
16737 * statement.cs: Perform the analysis flow for the increment
16738 portion after the statement, because this will be the real flow of
16739 execution. Fixes #42385
16741 * codegen.cs (EmitContext.EmitArgument,
16742 EmitContext.EmitStoreArgument): New helper functions when the
16743 RemapToProxy flag is set.
16745 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
16748 Add support for remapping parameters.
16750 * iterators.cs: Propagate parameter values; Store parameter
16751 values in the proxy classes.
16753 2003-05-04 Miguel de Icaza <miguel@ximian.com>
16755 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
16756 need a proxy reference; I do not know what I was thinking
16758 * cs-parser.jay (constructor_initializer): catch another error,
16759 and display nice message.
16761 (field_declaration): catch void field declaration
16762 to flag a better error.
16764 * class.cs (MemberBase.CheckBase): Report an error instead of a
16765 warning if a new protected member is declared in a struct.
16766 (Field.Define): catch the error of readonly/volatile.
16768 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
16770 (FieldExpr.AddressOf): ditto. Catch error where the address of a
16771 volatile variable is taken
16773 2003-05-02 Miguel de Icaza <miguel@ximian.com>
16775 * statement.cs (Fixed.Resolve): Report an error if we are not in
16778 2003-05-01 Miguel de Icaza <miguel@ximian.com>
16780 * typemanager.cs: reuse the code that handles type clashes for
16781 delegates and enumerations.
16783 * class.cs (Report28): Always report.
16785 * expression.cs (EncodeAsAttribute): Allow nulls here.
16787 2003-04-28 Miguel de Icaza <miguel@ximian.com>
16789 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
16790 the functionality for testing whether an expression is valid for
16791 an attribute here. Also handle the case of arrays of elements
16794 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
16795 encoding a linear array into an array of objects that are suitable
16796 to be passed to an CustomAttributeBuilder.
16798 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
16800 * ecore.cs: (FieldExpr): Handle field remapping here.
16802 * iteratators.cs: Pass the instance variable (if the method is an
16803 instance method) to the constructors, so we can access the field
16804 variables on the class.
16806 TODO: Test this with structs. I think the THIS variable on
16807 structs might have to be a pointer, and not a refenrece
16809 2003-04-27 Miguel de Icaza <miguel@ximian.com>
16811 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
16812 local variables to fields in a proxy class.
16814 * iterators.cs (PopulateProxy): Rename our internal fields to
16816 Create a <THIS> field if we are an instance method, so we can
16817 reference our parent container variables.
16818 (MapVariable): Called back from the EmitContext code to enter a
16819 new variable to field mapping into the proxy class (we just create
16823 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
16824 for using the remapped locals to fields.
16826 I placed the code here, because that gives the same semantics to
16827 local variables, and only changes the Emit code.
16829 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
16830 statements inside iterators.
16831 (VariableInfo): Add a FieldBuilder for the cases when we are
16832 remapping local variables to fields in a proxy class
16834 * ecore.cs (SimpleNameResolve): Avoid testing two times for
16835 current_block != null.
16837 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
16838 not cope with strings, as it has been moved to the
16839 TableSwitchEmit. Fixed bug in switch generation.
16841 * expression.cs (New.DoResolve): Provide more context for the user
16842 when reporting an error.
16844 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
16847 * expression.cs (MemberAccess.DoResolve): When we get a type back,
16848 check the permissions for it. Note than in a type-resolution
16849 context the check was already present in DeclSpace.ResolveType,
16850 but was missing from the MemberAccess.
16852 (ArrayCreation.CheckIndices): warn if the user has
16853 more nested levels of expressions, but there are no more
16854 dimensions specified. Avoids crash on bug 41906.
16856 2003-04-26 Miguel de Icaza <miguel@ximian.com>
16858 * statement.cs (Block): replace Implicit bool, for a generic
16860 New flag: `Unchecked'. This is used during the EmitMeta phase
16861 (which is out-of-line with the regular Resolve/Emit process for a
16862 statement, as this is done ahead of time, but still gets a chance
16863 to call constant resolve).
16865 (Block.Flags): new enum for adding a new flag.
16867 (Block.EmitMeta): track the state of unchecked.
16869 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
16870 to enable constant resolution to work there as well.
16872 2003-04-22 Miguel de Icaza <miguel@ximian.com>
16874 * typemanager.cs (ienumerable_type): Also look up
16875 System.Collections.IEnumerable.
16877 2003-04-21 Miguel de Icaza <miguel@ximian.com>
16879 TODO: Test more than one conditional per method.
16881 * class.cs (Indexer.Define): Report the location where the user is
16882 referencing the unsupported feature.
16884 (MethodData): Overload the use of `conditionals' to
16885 minimize the creation of needless ArrayLists. This saves roughly
16886 212kb on my machine.
16888 (Method): Implement the new IIteratorContainer interface.
16889 (Method.SetYields): Implement the method by setting the ModFlags
16890 to contain METHOD_YIELDS.
16892 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
16893 which just got set to null.
16895 * iterators.cs: New file.
16897 (Yield, YieldBreak): New statements.
16899 * statement.cs (Return.Resolve): Flag an error if we are used in
16900 an iterator method.
16902 * codegen.cs (InIterator): New flag set if the code is being
16903 compiled in an iterator method.
16905 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
16906 internal modifier, and we just use it to avoid adding extra
16907 fields, as this is seldom used.
16909 * cs-parser.jay: Add yield_statement (yield and yield break).
16911 * driver.cs: New flag -v2 to turn on version 2 features.
16913 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
16914 hashtable when v2 is enabled.
16916 2003-04-20 Miguel de Icaza <miguel@ximian.com>
16918 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
16919 there is already a namespace defined with this name.
16921 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
16922 people upgraded their corlibs.
16924 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
16925 always use fully qualified types, no need to use the compiler
16928 (TypeManager.IsNamespace): Use binarysearch.
16930 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
16931 AddDelegate): I did not quite use the new IsValid API properly: I
16932 have to pass the short-name and the fullname. I was passing only
16933 the basename instead of the fullname sometimes.
16935 (TypeContainer.DefineType): call NamespaceClash.
16937 * interface.cs (Interface.DefineType): use NamespaceClash before
16940 * delegate.cs (Delegate.DefineType): use NamespaceClash before
16943 * enum.cs: (Enum.DefineType): use NamespaceClash before
16946 * typemanager.cs (: 3-line patch that gives us some tasty 11%
16947 speed increase. First, use the negative_hits cache when we get a
16948 negative. Second, add the type with its full original name
16949 instead of the new . and + encoded name (reflection uses + to
16950 separate type from a nested type). Use LookupTypeReflection
16951 directly which bypasses the type->name hashtable (that we already
16952 know does not contain the type.
16954 * decl.cs (DeclSpace.ResolveTypeExpr): track the
16955 location/container type.
16957 * driver.cs: When passing utf8, use directly the UTF8Encoding.
16959 2003-04-19 Miguel de Icaza <miguel@ximian.com>
16961 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
16963 * delegate.cs (NewDelegate.Resolve): Test whether an instance
16964 method is being referenced in the method group from a static
16965 context, and report error 120 if so.
16967 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
16970 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
16971 is created, we create the A namespace).
16973 * cs-parser.jay: A namespace also introduces a DeclarationFound.
16976 2003-04-18 Miguel de Icaza <miguel@ximian.com>
16978 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
16979 invocation to ModuleBuilder.GetType with the same values will
16980 return a new type instance, so we need to cache its return
16983 * expression.cs (Binary.ResolveOperator): Only allow the compare
16984 operators on enums if they are of the same type.
16986 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
16987 types of ValueType on their own case. Before we were giving them
16988 the same treatment as objects.
16990 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
16991 fullname. Short name is used to compare against container name.
16992 Fullname is used to check against defined namespace names.
16994 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
16995 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
16997 (Method.CheckBase): Call parent.
16998 (MemberBase.CheckBase): Check for protected members on sealed
17000 (PropertyBase.CheckBase): Call parent.
17001 (Field.Define): Call parent.
17003 * report.cs: Negative error codes are now mapped to 8000 - code,
17004 so that the display is render more nicely.
17006 * typemanager.cs: Do not use try/catch, instead report a regular
17009 (GetPointerType, GetReferenceType): These methods provide
17010 mechanisms to obtain the T* and T& from a T. We had the code
17011 previously scattered around the code base, and it also used
17012 TypeManager.LookupType that would go through plenty of caches.
17013 This one goes directly to the type source.
17015 In some places we did the Type.GetType followed by
17016 ModuleBuilder.GetType, but not in others, so this unifies the
17017 processing as well.
17019 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
17020 statements now that we have namespace information.
17022 * typemanager.cs (IsNamespace): New method, returns whether the
17023 string presented is a namespace or not.
17025 (ComputeNamespaces): New public entry point, computes the list of
17026 available namespaces, using the GetNamespaces API call in Mono, or
17027 the slower version in MS.NET.
17029 Now before we start the semantic analysis phase, we have a
17030 complete list of namespaces including everything that the user has
17033 Deleted old code to cache namespaces in .nsc files.
17035 2003-04-17 Miguel de Icaza <miguel@ximian.com>
17037 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
17038 class/struct location definition Location for the implicit
17039 constructor location.
17041 (Operator.Define): Use the location of the operator for the
17042 implicit Method definition.
17044 (Constructor.Emit): use the constructor location for the implicit
17045 base initializer constructor.
17047 * ecore.cs: Remove ITypeExpression. This interface is now gone,
17048 and the Expression class now contains two new methods:
17050 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
17051 isolate type lookup from the rest of the resolution process.
17053 Since we use Expressions to hold type definitions due to the way
17054 we parse the input we have historically overloaded Resolve to
17055 perform the Type lookups if a special flag is passed. Now this is
17056 eliminated and two methods take their place.
17058 The differences in the two methods between xStep and xTerminal is
17059 that xStep is involved in our current lookup system that uses
17060 SimpleNames to compose a name, while xTerminal is used just to
17061 catch the case where the simplename lookup failed.
17063 2003-04-16 Miguel de Icaza <miguel@ximian.com>
17065 * expression.cs (ResolveMemberAccess): Remove redundant code.
17066 TypeExpr expressions are always born fully resolved.
17068 * interface.cs (PopulateMethod): Do not lookup the types twice.
17069 We were doing it once during SemanticAnalysis and once during
17072 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
17073 in local variable type definitions, were being returned as a
17074 SimpleName (we decomposed everything into a string), that is
17075 because primary_expression was being used instead of a type in the
17076 grammar (reduce/reduce conflicts).
17078 The part that was wrong is that we converted the expression into a
17079 string (an oversimplification in one hand, compounded with primary
17080 expressions doing string concatenation).
17086 Would return "A.B.C[]" as a SimpleName. This stopped things like
17087 using clauses from working on this particular context. And a type
17088 was being matched directly against "A.B.C[]".
17090 We now use the correct approach, and allow for ComposedCast to be
17091 part of the unary expression. So the "A.B.C []" become a composed
17092 cast of "A.B.C" (as a nested group of MemberAccess with a
17093 SimpleName at the end) plus the rank composition "[]".
17097 2003-04-10 Miguel de Icaza <miguel@ximian.com>
17099 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
17100 for the access level checking.
17102 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
17103 `TypeContainer container', because I kept getting confused when I
17104 was debugging this code.
17106 * expression.cs (Indexers): Instead of tracking getters/setters,
17107 we now track them in parallel. We create one arraylist less, but
17108 most importantly it is possible now for the LValue code to find a
17109 matching get for a set.
17111 (IndexerAccess.DoResolveLValue): Update the code.
17112 GetIndexersForType has been modified already to extract all the
17113 indexers from a type. The code assumed it did not.
17115 Also make the code set the correct return type for the indexer.
17116 This was fixed a long time ago for properties, but was missing for
17117 indexers. It used to be void_type.
17119 (Binary.Emit): Test first for doubles instead of
17120 floats, as they are more common.
17122 (Binary.EmitBranchable): Use the .un version of the branch opcodes
17123 when dealing with floats and the <=, >= operators. This fixes bug
17126 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
17127 to load the array value by emitting a load on the foreach variable
17128 type. This was incorrect.
17130 We now emit the code to load an element using the the array
17131 variable type, and then we emit the conversion operator.
17135 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
17137 * attribute.cs: Avoid allocation of ArrayLists in the common case.
17139 2003-04-09 Miguel de Icaza <miguel@ximian.com>
17141 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
17142 test for protection before we test for signatures.
17144 (MethodSignature.ToString): implement.
17146 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
17147 to the case where we reduced into a LongConstant.
17149 * decl.cs (CheckAccessLevel): If the type is an array, we can not
17150 depend on whether the information is acurrate, because the
17151 Microsoft runtime will always claim that the array type is public,
17152 regardless of the real state.
17154 If the type is a pointer, another problem happens: the type is
17155 reported as non-public in Microsoft.
17157 In both cases we have to call CheckAccessLevel recursively with
17158 the underlying type as the argument to be tested.
17160 2003-04-08 Miguel de Icaza <miguel@ximian.com>
17162 * assign.cs (Assign.Emit): If we are dealing with a compound
17163 assignment expression, we should use the code path that stores the
17164 intermediate result in a temporary value. This fixes #40903.
17166 *expression.cs (Indirection.ToString): Provide ToString method for
17169 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
17171 * class.cs: Null out fields holding references to Block objects so
17172 they can be garbage collected.
17174 * expression.cs (OverloadResolve): Remove unused local.
17176 2003-04-07 Martin Baulig <martin@ximian.com>
17178 * codegen.cs (EmitContext.CurrentFile): New public field.
17179 (EmitContext.Mark): Use the CurrentFile to check whether the
17180 location is in the correct file.
17181 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
17183 2003-04-07 Martin Baulig <martin@ximian.com>
17185 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
17187 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
17188 location. [FIXME: The location argument which gets passed to this
17189 method is sometimes wrong!]
17191 2003-04-07 Nick Drochak <ndrochak@gol.com>
17193 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
17195 2003-04-07 Miguel de Icaza <miguel@ximian.com>
17197 * expression.cs (Indirection.EmitAssign): We were using the
17198 temporary, but returning immediately instead of continuing the
17201 2003-04-06 Martin Baulig <martin@ximian.com>
17203 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
17204 if it's a nested child, but also deriving from the outer class.
17207 * typemanager.cs (IsNestedChildOf): Make this work if it's a
17208 nested child, but also deriving from the outer class. See
17210 (FilterWithClosure): We may access private members of the outer
17211 class if we're a nested child and deriving from the outer class.
17212 (RealMemberLookup): Only set `closure_private_ok' if the
17213 `original_bf' contained BindingFlags.NonPublic.
17215 2003-04-05 Martin Baulig <martin@ximian.com>
17217 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
17219 2003-04-02 Miguel de Icaza <miguel@ximian.com>
17221 * class.cs (Event.Define): Do not allow abstract events to have
17224 2003-04-01 Miguel de Icaza <miguel@ximian.com>
17226 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
17227 block in event declarations.
17229 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
17230 value type, get its address.
17232 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
17233 leaving a class on the stack instead of a boolean value (int
17234 0/1). Change the code so we compare against null, and then the
17235 result against zero.
17237 * class.cs (TypeContainer.GetClassBases): We were checking for the
17238 parent class being sealed too late.
17240 * expression.cs (Binary.Emit): For <= and >= when dealing with
17241 floating point values, use cgt.un and clt.un instead of cgt and
17244 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
17246 * statement.cs: Apply the same optimization as MS: skip the
17247 GetEnumerator returning an IEnumerator, and use the one returning a
17248 CharEnumerator instead. This allows us to avoid the try-finally block
17251 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
17253 * cs-parser.jay: Attributes cannot be applied to
17254 namespaces. Fixes #40473
17256 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17259 (Add*): check if the name is valid using the full name for constants,
17260 fields, properties and events.
17262 2003-03-28 Miguel de Icaza <miguel@ximian.com>
17264 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
17265 char constants to be part of the enumeration.
17267 * expression.cs (Conditional.DoResolve): Add support for operator
17268 true. Implements the missing functionality from 14.12
17270 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
17271 operator true/false as required by the spec.
17273 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
17274 implicit conversion to boolean.
17276 * statement.cs (Statement.ResolveBoolean): A boolean expression is
17277 also one where the type implements `operator true'.
17279 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
17280 get an expression that will invoke operator true based on an
17283 (GetConversionOperators): Removed the hack that called op_True
17286 (Expression.ResolveBoolean): Move this from Statement.
17288 2003-03-17 Miguel de Icaza <miguel@ximian.com>
17290 * ecore.cs (FieldExpr): do not allow initialization of initonly
17291 fields on derived classes
17293 2003-03-13 Martin Baulig <martin@ximian.com>
17295 * statement.cs (Block.Emit): Call ig.BeginScope() and
17296 ig.EndScope() when compiling with debugging info; call
17297 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
17299 2003-03-08 Miguel de Icaza <miguel@ximian.com>
17301 * expression.cs (Indexers): Do not construct immediately, allow
17302 for new members to be appended as we go. Fixes 38143
17304 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17306 * expression.cs: save/restore context when resolving an unchecked
17309 2003-03-05 Miguel de Icaza <miguel@ximian.com>
17311 * cfold.cs: Catch division by zero in modulus operator during
17314 2003-03-03 Miguel de Icaza <miguel@ximian.com>
17316 * interface.cs (Interface.DefineMembers): Avoid defining members
17319 2003-02-27 Miguel de Icaza <miguel@ximian.com>
17321 * driver.cs: handle the +/- options for -noconfig
17323 * statement.cs (Unckeched.Resolve): Also track the state of
17324 unchecked in the Resolve phase.
17326 2003-02-27 Martin Baulig <martin@ximian.com>
17328 * ecore.cs (Expression.MemberLookup): Don't create a
17329 MethodGroupExpr for something which is not a method. Fixes #38291.
17331 2003-02-25 Miguel de Icaza <miguel@ximian.com>
17333 * class.cs (MemberBase.CheckParameters): Also check that the type
17334 is unmanaged if it is a pointer.
17336 * expression.cs (SizeOf.Resolve): Add location information.
17338 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
17339 a managed type is declared.
17341 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
17342 parameter modifiers as well. Fixes bug 38606
17344 * class.cs: Very sad. Am backing out the speed up changes
17345 introduced by the ArrayList -> Array in the TypeContainer, as they
17346 were not actually that much faster, and introduced a bug (no error
17347 reports on duplicated methods).
17349 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
17350 source first, this will guarantee that we have a valid expression
17351 before calling in lower levels functions that will require a
17352 resolved object. Then use this original_source in the
17353 target.ResolveLValue instead of the original source that was
17356 Another change. Use target.Resolve instead of LValueResolve.
17357 Although we are resolving for LValues, we will let the Assign code
17358 take care of that (it will be called again from Resolve). This
17359 basically allows code like this:
17361 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
17362 class Y { void A (X x) { x [0] += o; }
17364 The problem was that the indexer was trying to resolve for
17365 set_Item (idx, object o) and never finding one. The real set_Item
17366 was set_Item (idx, X). By delaying the process we get the right
17371 2003-02-23 Martin Baulig <martin@ximian.com>
17373 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
17374 while calling DoEmit ().
17376 * codegen.cs (EmitContext.Mark): Don't mark locations in other
17377 source files; if you use the #line directive inside a method, the
17378 compiler stops emitting line numbers for the debugger until it
17379 reaches the end of the method or another #line directive which
17380 restores the original file.
17382 2003-02-23 Martin Baulig <martin@ximian.com>
17384 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
17386 2003-02-23 Martin Baulig <martin@ximian.com>
17388 * statement.cs (Block.AddChildVariableNames): We need to call this
17389 recursively, not just for our immediate children.
17391 2003-02-23 Martin Baulig <martin@ximian.com>
17393 * class.cs (Event.Define): Always make the field private, like csc does.
17395 * typemanager.cs (TypeManager.RealMemberLookup): Make events
17396 actually work, fixes bug #37521.
17398 2003-02-23 Miguel de Icaza <miguel@ximian.com>
17400 * delegate.cs: When creating the various temporary "Parameters"
17401 classes, make sure that we call the ComputeAndDefineParameterTypes
17402 on those new parameters (just like we do with the formal ones), to
17403 allow them to be resolved in the context of the DeclSpace.
17405 This fixes the bug that Dick observed in Bugzilla #38530.
17407 2003-02-22 Miguel de Icaza <miguel@ximian.com>
17409 * expression.cs (ResolveMemberAccess): When resolving a constant,
17410 do not attempt to pull a constant if the value was not able to
17411 generate a valid constant.
17413 * const.cs (LookupConstantValue): Do not report more errors than required.
17415 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17417 * expression.cs: fixes bug #38328.
17419 2003-02-18 Miguel de Icaza <miguel@ximian.com>
17421 * class.cs: Changed all the various members that can be part of a
17422 class from being an ArrayList to be an Array of the right type.
17423 During the DefineType type_list, interface_list, delegate_list and
17424 enum_list are turned into types, interfaces, delegates and enums
17427 And during the member population, indexer_list, event_list,
17428 constant_list, field_list, instance_constructor_list, method_list,
17429 operator_list and property_list are turned into their real arrays.
17431 Although we could probably perform this operation earlier, for
17432 good error reporting we need to keep the lists and remove the
17433 lists for longer than required.
17435 This optimization was triggered by Paolo profiling the compiler
17436 speed on the output of `gen-sample-program.pl' perl script.
17438 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
17439 not crash in methods like MemberLookupFailed that use this field.
17441 This problem arises when the compiler fails to resolve a type
17442 during interface type definition for example.
17444 2003-02-18 Miguel de Icaza <miguel@ximian.com>
17446 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
17447 inherit from System.Object, so we have to stop at null, not only
17448 when reaching System.Object.
17450 2003-02-17 Miguel de Icaza <miguel@ximian.com>
17452 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
17453 DeclaredOnly because the parent indexer might have had a different
17454 name, but did not loop until the top of the hierarchy was reached.
17456 The problem this one fixes is 35492: when a class implemented an
17457 indexer from an interface, we were getting the interface method
17458 (which was abstract) and we were flagging an error (can not invoke
17461 This also keeps bug 33089 functioning, and test-148 functioning.
17463 * typemanager.cs (IsSpecialMethod): The correct way of figuring
17464 out if a method is special is to see if it is declared in a
17465 property or event, or whether it is one of the predefined operator
17466 names. This should fix correctly #36804.
17468 2003-02-15 Miguel de Icaza <miguel@ximian.com>
17470 The goal here is to remove the dependency on EmptyCast.Peel ().
17471 Killing it completely.
17473 The problem is that currently in a number of places where
17474 constants are expected, we have to "probe" for an EmptyCast, and
17475 Peel, which is not the correct thing to do, as this will be
17476 repetitive and will likely lead to errors.
17478 The idea is to remove any EmptyCasts that are used in casts that
17479 can be reduced to constants, so we only have to cope with
17482 This bug hunt was triggered by Bug 37363 and the desire to remove
17483 the duplicate pattern where we were "peeling" emptycasts to check
17484 whether they were constants. Now constants will always be
17487 * ecore.cs: Use an enumconstant here instead of wrapping with
17490 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
17491 throwing me off. By handling this we can get rid of a few hacks.
17493 * statement.cs (Switch): Removed Peel() code.
17495 2003-02-14 Miguel de Icaza <miguel@ximian.com>
17497 * class.cs: Location information for error 508
17499 * expression.cs (New.DoResolve): Add a guard against double
17500 resolution of an expression.
17502 The New DoResolve might be called twice when initializing field
17503 expressions (see EmitFieldInitializers, the call to
17504 GetInitializerExpression will perform a resolve on the expression,
17505 and later the assign will trigger another resolution
17507 This leads to bugs (#37014)
17509 * delegate.cs: The signature for EndInvoke should contain any ref
17510 or out parameters as well. We were not doing this in the past.
17512 * class.cs (Field.Define): Do not overwrite the type definition
17513 inside the `volatile' group. Turns out that volatile enumerations
17514 were changing the type here to perform a validity test, which
17517 2003-02-12 Miguel de Icaza <miguel@ximian.com>
17519 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
17520 and structs, we do not want to load the instance variable
17522 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
17523 enum_type has to be handled like an object reference (implicit
17524 conversions exists from this to object), but the regular IsClass
17525 and IsValueType tests will never return true for this one.
17527 Also we use TypeManager.IsValueType instead of type.IsValueType,
17528 just for consistency with the rest of the code (this is only
17529 needed if we ever use the construct exposed by test-180.cs inside
17530 corlib, which we dont today).
17532 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
17534 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
17537 2003-02-09 Martin Baulig <martin@ximian.com>
17539 * namespace.cs (Namespace..ctor): Added SourceFile argument.
17540 (Namespace.DefineNamespaces): New static public method; this is
17541 called when we're compiling with debugging to add all namespaces
17542 to the symbol file.
17544 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
17545 pass it to the Namespace's .ctor.
17547 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
17548 and MethodBase arguments; pass the namespace ID to the symwriter;
17549 pass the MethodBase instead of the token to the symwriter.
17550 (SymbolWriter.DefineNamespace): New method to add a namespace to
17553 2003-02-09 Martin Baulig <martin@ximian.com>
17555 * symbolwriter.cs: New file. This is a wrapper around
17556 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
17557 methods here in near future.
17559 2003-02-09 Martin Baulig <martin@ximian.com>
17561 * codegen.cs (EmitContext.Mark): Just pass the arguments to
17562 ILGenerator.MarkSequencePoint() which are actually used by the
17565 2003-02-09 Martin Baulig <martin@ximian.com>
17567 * location.cs (SourceFile): New public sealed class. This
17568 contains the name and an index which is used in the location's token.
17569 (Location): Reserve an appropriate number of bits in the token for
17570 the source file instead of walking over that list, this gives us a
17571 really huge performance improvement when compiling with debugging.
17573 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
17574 `SourceFile' argument instead of a string.
17575 (Driver.ProcessFile): Add all the files via Location.AddFile(),
17576 but don't parse/tokenize here, we need to generate the list of all
17577 source files before we do that.
17578 (Driver.ProcessFiles): New static function. Parses/tokenizes all
17581 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
17582 instead of a string.
17584 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
17587 2003-02-09 Martin Baulig <martin@ximian.com>
17589 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
17590 filename on `#line default'.
17592 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
17594 * statement.cs: don't clear the pinned var when the fixed statement
17595 returns from the method (fixes bug#37752).
17597 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
17599 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
17602 2003-02-07 Martin Baulig <martin@ximian.com>
17604 * driver.cs: Removed the `--debug-args' command line argument.
17606 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
17607 automatically by the AsssemblyBuilder.
17608 (CodeGen.InitializeSymbolWriter): We don't need to call any
17609 initialization function on the symbol writer anymore. This method
17610 doesn't take any arguments.
17612 2003-02-03 Miguel de Icaza <miguel@ximian.com>
17614 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
17615 from referenced assemblies as well.
17617 2003-02-02 Martin Baulig <martin@ximian.com>
17619 * class.cs (MethodData.Emit): Generate debugging info for external methods.
17621 2003-02-02 Martin Baulig <martin@ximian.com>
17623 * class.cs (Constructor.Emit): Open the symbol writer before
17624 emitting the constructor initializer.
17625 (ConstructorInitializer.Emit): Call ec.Mark() to allow
17626 single-stepping through constructor initializers.
17628 2003-01-30 Miguel de Icaza <miguel@ximian.com>
17630 * class.cs: Handle error 549: do not allow virtual methods in
17633 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
17635 * decl.cs: Check access levels when resolving types
17637 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
17639 * statement.cs: Add parameters and locals set in catch blocks that might
17640 return to set vector
17642 2003-01-29 Miguel de Icaza <miguel@ximian.com>
17644 * class.cs (Operator): Set the SpecialName flags for operators.
17646 * expression.cs (Invocation.DoResolve): Only block calls to
17647 accessors and operators on SpecialName methods.
17649 (Cast.TryReduce): Handle conversions from char constants.
17652 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
17654 * statement.cs: small memory and time optimization in FlowBranching.
17656 2003-01-28 Pedro Mart <yoros@wanadoo.es>
17658 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
17659 problem that the last fix but in the other sid (Set).
17661 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
17662 access when there is no indexer in the hierarchy.
17664 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
17666 * class.cs: Combine some if statements.
17668 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17670 * driver.cs: fixed bug #37187.
17672 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
17674 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
17675 any indexer, it's needed to build a list with all the indexers in the
17676 hierarchy (AllGetters), else we have problems. Fixes #35653.
17678 2003-01-23 Miguel de Icaza <miguel@ximian.com>
17680 * class.cs (MethodData.Define): It is wrong for an interface
17681 implementation to be static in both cases: explicit and implicit.
17682 We were only handling this in one case.
17684 Improve the if situation there to not have negations.
17686 * class.cs (Field.Define): Turns out that we do not need to check
17687 the unsafe bit on field definition, only on usage. Remove the test.
17689 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17691 * driver.cs: use assembly.Location instead of Codebase (the latest
17692 patch made mcs fail when using MS assemblies).
17694 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
17696 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
17697 get the path to *corlib.dll.
17699 2003-01-21 Nick Drochak <ndrochak@gol.com>
17703 * typemanager.cs: Remove compiler warnings
17705 2003-01-20 Duncan Mak <duncan@ximian.com>
17707 * AssemblyInfo.cs: Bump the version number to 0.19.
17709 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17711 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
17713 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
17715 * class.cs (Constructor::Emit): Emit debugging info for constructors.
17717 2003-01-17 Miguel de Icaza <miguel@ximian.com>
17719 * cs-parser.jay: Small fix: we were not comparing the constructor
17720 name correctly. Thanks to Zoltan for the initial pointer.
17722 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
17724 * cs-tokenizer.cs: Set file name when specified with #line
17726 2003-01-15 Miguel de Icaza <miguel@ximian.com>
17728 * cs-parser.jay: Only perform the constructor checks here if we
17729 are named like the class; This will help provider a better
17730 error. The constructor path is taken when a type definition is
17731 not found, but most likely the user forgot to add the type, so
17732 report that rather than the constructor error.
17734 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
17736 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
17739 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17741 * cs-parser.jay: Add cleanup call.
17743 2003-01-13 Duncan Mak <duncan@ximian.com>
17745 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
17746 consistent with other methods.
17748 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17750 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
17752 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
17754 * attribute.cs: only set GuidAttr to true when we have a
17757 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17761 * typemanager.cs: fixes to allow mcs compile corlib with the new
17762 Type.IsSubclassOf fix.
17764 2003-01-08 Miguel de Icaza <miguel@ximian.com>
17766 * expression.cs (LocalVariableReference.DoResolve): Classify a
17767 constant as a value, not as a variable. Also, set the type for
17770 * cs-parser.jay (fixed_statement): take a type instead of a
17771 pointer_type, so we can produce a better error message later.
17773 * statement.cs (Fixed.Resolve): Flag types that are not pointers
17776 (For.DoEmit): Make inifinite loops have a
17777 non-conditional branch back.
17779 (Fixed.DoEmit): First populate the pinned variables, then emit the
17780 statement, then clear the variables. Before I was emitting the
17781 code once for each fixed piece.
17784 2003-01-08 Martin Baulig <martin@ximian.com>
17786 * statement.cs (FlowBranching.MergeChild): A break in a
17787 SWITCH_SECTION does not leave a loop. Fixes #36155.
17789 2003-01-08 Martin Baulig <martin@ximian.com>
17791 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
17792 lives in the same number space than `param_map'. Fixes #36154.
17794 2003-01-07 Miguel de Icaza <miguel@ximian.com>
17796 * cs-parser.jay (constructor_declaration): Set the
17797 Constructor.ModFlags before probing for it. This makes the
17798 compiler report 514, 515 and 132 (the code was there, but got
17801 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
17802 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
17803 (GotoCase.Resolve): Set `Returns' to ALWAYS.
17805 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
17807 * enum.cs: create the enum static fields using the enum type.
17809 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
17811 * class.cs: don't try to create the ParamBuilder for the return
17812 type if it's not needed (and handle it breaking for the ms runtime
17815 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
17817 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
17819 2002-12-29 Miguel de Icaza <miguel@ximian.com>
17821 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
17822 the command. This showed up while compiling the JANET source
17823 code, which used \r as its only newline separator.
17825 2002-12-28 Miguel de Icaza <miguel@ximian.com>
17827 * class.cs (Method.Define): If we are an operator (because it
17828 reuses our code), then set the SpecialName and HideBySig. #36128
17830 2002-12-22 Miguel de Icaza <miguel@ximian.com>
17832 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
17833 exception, report error 120 `object reference required'.
17835 * driver.cs: Add --pause option, used during to measure the size
17836 of the process as it goes with --timestamp.
17838 * expression.cs (Invocation.DoResolve): Do not allow methods with
17839 SpecialName to be invoked.
17841 2002-12-21 Miguel de Icaza <miguel@ximian.com>
17843 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
17844 number before adding it.
17846 2002-12-21 Ravi Pratap <ravi@ximian.com>
17848 * ecore.cs (StandardImplicitConversion): When in an unsafe
17849 context, we allow conversion between void * to any other pointer
17850 type. This fixes bug #35973.
17852 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
17854 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
17855 is not thrown when extensionless outputs are used
17857 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17859 * rootcontext.cs: fixed compilation of corlib.
17861 2002-12-19 Miguel de Icaza <miguel@ximian.com>
17863 * attribute.cs (Attributes.Contains): Add new method.
17865 * class.cs (MethodCore.LabelParameters): if the parameter is an
17866 `out' parameter, check that no attribute `[In]' has been passed.
17868 * enum.cs: Handle the `value__' name in an enumeration.
17870 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
17872 * decl.cs: Added special case to allow overrides on "protected
17875 2002-12-18 Ravi Pratap <ravi@ximian.com>
17877 * attribute.cs (Attributes.AddAttributeSection): Rename to this
17878 since it makes much more sense.
17880 (Attributes.ctor): Don't require a Location parameter.
17882 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
17884 * attribute.cs (ApplyAttributes): Remove extra Location parameters
17885 since we already have that information per attribute.
17887 * everywhere : make appropriate changes.
17889 * class.cs (LabelParameters): Write the code which actually
17890 applies attributes to the return type. We can't do this on the MS
17891 .NET runtime so we flag a warning in the case an exception is
17894 2002-12-18 Miguel de Icaza <miguel@ximian.com>
17896 * const.cs: Handle implicit null conversions here too.
17898 2002-12-17 Ravi Pratap <ravi@ximian.com>
17900 * class.cs (MethodCore.LabelParameters): Remove the extra
17901 Type [] parameter since it is completely unnecessary. Instead
17902 pass in the method's attributes so that we can extract
17903 the "return" attribute.
17905 2002-12-17 Miguel de Icaza <miguel@ximian.com>
17907 * cs-parser.jay (parse): Use Report.Error to flag errors instead
17908 of ignoring it and letting the compile continue.
17910 * typemanager.cs (ChangeType): use an extra argument to return an
17911 error condition instead of throwing an exception.
17913 2002-12-15 Miguel de Icaza <miguel@ximian.com>
17915 * expression.cs (Unary.TryReduce): mimic the code for the regular
17916 code path. Perform an implicit cast in the cases where we can
17917 implicitly convert to one of the integral types, and then reduce
17918 based on that constant. This fixes bug #35483.
17920 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17922 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
17924 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17926 * namespace.cs: fixed bug #35489.
17928 2002-12-12 Miguel de Icaza <miguel@ximian.com>
17930 * class.cs: Remove some dead code.
17932 * cs-parser.jay: Estimate the number of methods needed
17933 (RootContext.MethodCount);
17935 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
17936 numbers instead of StringBuilders.
17938 * support.cs (PtrHashtable): Add constructor with initial size;
17939 We can now reduce reallocations of the method table.
17941 2002-12-10 Ravi Pratap <ravi@ximian.com>
17943 * attribute.cs (ApplyAttributes): Keep track of the emitted
17944 attributes on a per-target basis. This fixes bug #35413.
17946 2002-12-10 Miguel de Icaza <miguel@ximian.com>
17948 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
17949 default to the Windows 1252 encoding.
17951 (UnixParseOption): Support version, thanks to Alp for the missing
17954 * AssemblyInfo.cs: Add nice assembly information.
17956 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
17959 * cs-parser.jay: Allow a trailing comma before the close bracked
17960 in the attribute_section production.
17962 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
17963 address of the instance was being taken, I will take this out,
17964 because we take the address of the object immediately here.
17966 2002-12-09 Ravi Pratap <ravi@ximian.com>
17968 * typemanager.cs (AreMultipleAllowed): Take care of the most
17969 obvious case where attribute type is not in the current assembly -
17972 2002-12-08 Miguel de Icaza <miguel@ximian.com>
17974 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
17975 definitions, instead of doing that afterwards.
17977 Also we use a nice little hack, depending on the constructor, we
17978 know if we are a "composed" name or a simple name. Hence, we
17979 avoid the IndexOf test, and we avoid
17981 * codegen.cs: Add code to assist in a bug reporter to track down
17982 the source of a compiler crash.
17984 2002-12-07 Ravi Pratap <ravi@ximian.com>
17986 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
17987 types have been emitted for a given element and flag an error
17988 if something which does not have AllowMultiple set is used more
17991 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
17992 attribute types and their corresponding AllowMultiple properties
17994 (AreMultipleAllowed): Check the property for a given type.
17996 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
17997 property in the case we have a TypeContainer.
17999 (Attributes.AddAttribute): Detect duplicates and just skip on
18000 adding them. This trivial fix catches a pretty gross error in our
18001 attribute emission - global attributes were being emitted twice!
18003 Bugzilla bug #33187 is now fixed.
18005 2002-12-06 Miguel de Icaza <miguel@ximian.com>
18007 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
18008 instead of pp_and).
18010 * expression.cs (Binary.ResolveOperator): I can only use the
18011 Concat (string, string, string) and Concat (string, string,
18012 string, string) if the child is actually a concatenation of
18015 2002-12-04 Miguel de Icaza <miguel@ximian.com>
18017 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
18018 context where we need a 2-character lookahead.
18020 * pending.cs (PendingImplementation): Rework so we can keep track
18021 of interface types all the time, and flag those which were
18022 implemented by parents as optional.
18024 2002-12-03 Miguel de Icaza <miguel@ximian.com>
18026 * expression.cs (Binary.ResolveOperator): Use
18027 String.Concat(string,string,string) or
18028 String.Concat(string,string,string,string) when possible.
18030 * typemanager: More helper methods.
18033 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
18035 * pending.cs: remove the bogus return from GetMissingInterfaces()
18036 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
18038 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18040 * namespace.cs: avoid duplicated 'using xxx' being added to
18041 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
18042 when we get more than one 'using' statement for the same namespace.
18043 Report a CS0105 warning for it.
18045 2002-11-30 Miguel de Icaza <miguel@ximian.com>
18047 * cs-tokenizer.cs (consume_identifier): use read directly, instead
18048 of calling getChar/putback, uses internal knowledge of it.
18050 (xtoken): Reorder tokenizer so most common patterns are checked
18051 first. This reduces the compilation time in another 5% (from 8.11s
18052 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
18054 The parsing time is 22% of the compilation in mcs, and from that
18055 64% is spent on the tokenization process.
18057 I tried using a binary search for keywords, but this is slower
18058 than the hashtable. Another option would be to do a couple of
18061 * Not use a StringBuilder, instead use an array of chars,
18062 with a set value. Notice that this way we could catch
18063 the 645 error without having to do it *afterwards*.
18065 * We could write a hand-parser to avoid the hashtable
18066 compares altogether.
18068 The identifier consumption process takes 37% of the tokenization
18069 time. Another 15% is spent on is_number. 56% of the time spent
18070 on is_number is spent on Int64.Parse:
18072 * We could probably choose based on the string length to
18073 use Int32.Parse or Int64.Parse and avoid all the 64-bit
18076 Another 3% is spend on wrapping `xtoken' in the `token' function.
18078 Handle 0xa0 as whitespace (#34752)
18080 2002-11-26 Miguel de Icaza <miguel@ximian.com>
18082 * typemanager.cs (IsCLRType): New routine to tell whether a type
18083 is one of the builtin types.
18085 Maybe it needs to use TypeCodes to be faster. Maybe we could use
18086 typecode in more places instead of doing pointer comparissions.
18087 We could leverage some knowledge about the way the typecodes are
18090 New code to cache namespaces in assemblies, it is currently not
18091 invoked, to be used soon.
18093 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
18095 * expression.cs (Binary.ResolveOperator): specially handle
18096 strings, and do not perform user-defined operator overloading for
18099 2002-11-24 Miguel de Icaza <miguel@ximian.com>
18101 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
18102 internalcall as it is a pretty simple operation; Avoid whenever
18103 possible to call Char.IsLetter.
18105 (consume_identifier): Cut by half the number of
18106 hashtable calls by merging the is_keyword and GetKeyword behavior.
18108 Do not short-circuit, because if we do, we
18109 report errors (ie, #if false && true would produce an invalid
18113 2002-11-24 Martin Baulig <martin@ximian.com>
18115 * expression.cs (Cast.TryReduce): If we're in checked syntax,
18116 check constant ranges and report a CS0221. Fixes #33186.
18118 2002-11-24 Martin Baulig <martin@ximian.com>
18120 * cs-parser.jay: Make this work for uninitialized variable
18121 declarations in the `for' initializer. Fixes #32416.
18123 2002-11-24 Martin Baulig <martin@ximian.com>
18125 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
18126 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
18128 2002-11-24 Martin Baulig <martin@ximian.com>
18130 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
18131 argument; if true, we also check for user-defined conversions.
18132 This is only needed if both arguments are of a user-defined type.
18133 Fixes #30443, added test-175.cs.
18134 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
18136 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
18138 2002-11-24 Martin Baulig <martin@ximian.com>
18140 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
18141 function to get the store opcode.
18142 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
18143 only emit the Ldelema if the store opcode is Stobj. You must run
18144 both test-34 and test-167 to test this. Fixes #34529.
18146 2002-11-23 Martin Baulig <martin@ximian.com>
18148 * ecore.cs (Expression.MemberLookup): Added additional
18149 `qualifier_type' argument which is used when we're being called
18150 from MemberAccess.DoResolve() and null if we're called from a
18152 (Expression.MemberLookupFailed): New method to report errors; this
18153 does the CS1540 check and reports the correct error message.
18155 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
18156 argument for the CS1540 check and redone the way how we're dealing
18157 with private members. See the comment in the source code for details.
18158 (FilterWithClosure): Reverted this back to revision 1.197; renamed
18159 `closure_start_type' to `closure_qualifier_type' and check whether
18160 it's not null. It was not this filter being broken, it was just
18161 being called with the wrong arguments.
18163 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
18164 and pass it the correct `qualifier_type'; this also does the error
18167 2002-11-22 Miguel de Icaza <miguel@ximian.com>
18169 * expression.cs (Invocation.EmitParams): If the we are dealing
18170 with a non-built-in value type, load its address as well.
18172 (ArrayCreation): Use a a pretty constant instead
18173 of the hardcoded value 2. Use 6 instead of 2 for the number of
18174 static initializers.
18176 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
18177 because they are not really value types, just glorified integers.
18179 * driver.cs: Do not append .exe, the CSC compiler does not do it.
18181 * ecore.cs: Remove redundant code for enumerations, make them use
18182 the same code path as everything else, fixes the casting issue
18183 with enumerations in Windows.Forms.
18185 * attribute.cs: Do only cast to string if it is a string, the
18186 validation happens later.
18188 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
18189 people upgrade their corlibs.
18191 * ecore.cs: Oops, enumerations were not following the entire code path
18193 2002-11-21 Miguel de Icaza <miguel@ximian.com>
18195 * typemanager.cs (FilterWithClosure): Commented out the test for
18196 1540 in typemanager.cs, as it has problems when accessing
18197 protected methods from a parent class (see test-174.cs).
18199 * attribute.cs (Attribute.ValidateGuid): new method.
18200 (Attribute.Resolve): Use above.
18202 2002-11-19 Miguel de Icaza <miguel@ximian.com>
18204 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
18206 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
18207 handling for enumerations, as we only needed the TypeContainer
18208 functionality to begin with (this is required for the fix below to
18209 work for enums that reference constants in a container class for
18212 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
18214 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
18215 a valid TypeBuilder to perform lookups on.o
18217 * class.cs (InheritableMemberSignatureCompare): Use true in the
18218 call to GetGetMethod and GetSetMethod, because we are comparing
18219 the signature, and we need to get the methods *even* if they are
18222 (PropertyBase.CheckBase): ditto.
18224 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
18225 GotoCase.Resolve): Use Peel on EmpytCasts.
18227 * ecore.cs (EmptyCast): drop child, add Peel method.
18229 2002-11-17 Martin Baulig <martin@ximian.com>
18231 * ecore.cs (EmptyCast.Child): New public property.
18233 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
18234 label resolved to an EmptyCast. Fixes #34162.
18235 (GotoCase.Resolve): Likewise.
18236 (Block.EmitMeta): Likewise.
18238 2002-11-17 Martin Baulig <martin@ximian.com>
18240 * expression.cs (Invocation.BetterConversion): Prefer int over
18241 uint; short over ushort; long over ulong for integer literals.
18242 Use ImplicitConversionExists instead of StandardConversionExists
18243 since we also need to check for user-defined implicit conversions.
18244 Fixes #34165. Added test-173.cs.
18246 2002-11-16 Martin Baulig <martin@ximian.com>
18248 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
18249 with the `true' and `false' literals. Fixes #33151.
18251 2002-11-16 Martin Baulig <martin@ximian.com>
18253 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
18254 October 22nd; don't do the cs1540 check for static members.
18256 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
18257 now using our own filter here and doing the cs1540 check again.
18259 2002-11-16 Martin Baulig <martin@ximian.com>
18261 * support.cs (InternalParameters): Don't crash if we don't have
18262 any fixed parameters. Fixes #33532.
18264 2002-11-16 Martin Baulig <martin@ximian.com>
18266 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
18267 when looking up static methods to make this work on Windows.
18270 2002-11-16 Martin Baulig <martin@ximian.com>
18272 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
18273 a setter rather than using PropertyInfo.CanWrite.
18275 2002-11-15 Nick Drochak <ndrochak@gol.com>
18277 * class.cs: Allow acces to block member by subclasses. Fixes build
18280 2002-11-14 Martin Baulig <martin@ximian.com>
18282 * class.cs (Constructor.Emit): Added the extern/block check.
18285 2002-11-14 Martin Baulig <martin@ximian.com>
18287 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
18288 iteration while looking for indexers, this is needed because the
18289 indexer may have a different name in our base classes. Fixed the
18290 error reporting (no indexers at all, not get accessor, no
18291 overloaded match). Fixes bug #33089.
18292 (IndexerAccess.DoResolveLValue): Likewise.
18294 2002-11-14 Martin Baulig <martin@ximian.com>
18296 * class.cs (PropertyBase.CheckBase): Make this work for multiple
18297 indexers. Fixes the first part of bug #33089.
18298 (MethodSignature.InheritableMemberSignatureCompare): Added support
18301 2002-11-13 Ravi Pratap <ravi@ximian.com>
18303 * attribute.cs (Attribute.Resolve): Catch the
18304 NullReferenceException and report it since it isn't supposed to
18307 2002-11-12 Miguel de Icaza <miguel@ximian.com>
18309 * expression.cs (Binary.EmitBranchable): Also handle the cases for
18310 LogicalOr and LogicalAnd that can benefit from recursively
18311 handling EmitBranchable. The code now should be nice for Paolo.
18313 2002-11-08 Miguel de Icaza <miguel@ximian.com>
18315 * typemanager.cs (LookupType): Added a negative-hit hashtable for
18316 the Type lookups, as we perform quite a number of lookups on
18317 non-Types. This can be removed once we can deterministically tell
18318 whether we have a type or a namespace in advance.
18320 But this might require special hacks from our corlib.
18324 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
18325 and double which avoids a conversion from an integer to a double.
18327 * expression.cs: tiny optimization, avoid calling IsConstant,
18328 because it effectively performs the lookup twice.
18330 2002-11-06 Miguel de Icaza <miguel@ximian.com>
18332 But a bogus return here to keep the semantics of the old code
18333 until the Mono runtime is fixed.
18335 * pending.cs (GetMissingInterfaces): New method used to remove all
18336 the interfaces that are already implemented by our parent
18337 classes from the list of pending methods.
18339 * interface.cs: Add checks for calls after ResolveTypeExpr.
18341 2002-11-05 Miguel de Icaza <miguel@ximian.com>
18343 * class.cs (Class.Emit): Report warning 67: event not used if the
18344 warning level is beyond 3.
18346 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
18347 being a NullLiteral.
18349 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
18352 * class.cs (TypeContainer.GetClassBases): Cover a missing code
18353 path that might fail if a type can not be resolved.
18355 * expression.cs (Binary.Emit): Emit unsigned versions of the
18358 * driver.cs: use error 5.
18360 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
18362 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
18364 2002-11-01 Miguel de Icaza <miguel@ximian.com>
18366 * cs-parser.jay (switch_section): A beautiful patch from Martin
18367 Baulig that fixed 33094.
18369 2002-10-31 Miguel de Icaza <miguel@ximian.com>
18371 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
18372 Check whether the base is abstract and report an error if so.
18374 * expression.cs (IndexerAccess.DoResolveLValue,
18375 IndexerAccess.DoResolve): ditto.
18377 (Invocation.DoResolve): ditto.
18379 (Invocation.FullMethodDesc): Improve the report string.
18381 * statement.cs (Block): Eliminate IsVariableDefined as it is
18382 basically just a wrapper for GetVariableInfo.
18384 * ecore.cs (SimpleName): Use new
18386 * support.cs (ReflectionParamter.ParameterType): We unwrap the
18387 type, as we return the actual parameter ref/unref state on a
18390 2002-10-30 Miguel de Icaza <miguel@ximian.com>
18392 * support.cs: Return proper flags REF/OUT fixing the previous
18395 * expression.cs: Reverted last patch, that was wrong. Is_ref is
18396 not used to mean `ref' but `ref or out' in ParameterReference
18398 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
18399 full type signature instead of calling TypeManger.CSharpName
18402 * support.cs (InternalParameters.ParameterDesc): Do not compare
18403 directly to the modflags, because REF/OUT will actually be bitsets
18406 * delegate.cs (VerifyMethod): Check also the modifiers.
18408 * cs-tokenizer.cs: Fix bug where floating point values with an
18409 exponent where a sign was missing was ignored.
18411 * driver.cs: Allow multiple assemblies to be specified in a single
18414 2002-10-28 Miguel de Icaza <miguel@ximian.com>
18416 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
18417 because identifiers after a parenthesis would end up in this kind
18418 of production, and we needed to desamiguate it for having casts
18421 (UserDefinedType *) xxx
18423 2002-10-24 Miguel de Icaza <miguel@ximian.com>
18425 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
18426 we should set on the Bindingflags.NonPublic, but not turn on
18427 private_ok. private_ok controls whether a Private member is
18428 returned (this is chekced on the filter routine), while the
18429 BindingFlags.NonPublic just controls whether private/protected
18430 will be allowed. This fixes the problem part of the problem of
18431 private properties being allowed to be used in derived classes.
18433 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
18434 so we can call the children DoResolveLValue method (this will
18435 properly signal errors on lvalue assignments to base properties)
18437 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
18438 getter are null, and we have a property info, we know that this
18439 happened because the lookup failed, so we report an error 122 for
18440 protection level violation.
18442 We also silently return if setter and getter are null in the
18443 resolve functions, this condition only happens if we have flagged
18444 the error before. This is the other half of the problem.
18446 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
18447 not have accessibility information, that is why we were returning
18448 true in the filter function in typemanager.cs.
18450 To properly report 122 (property is inaccessible because of its
18451 protection level) correctly, we report this error in ResolveAccess
18452 by failing if both the setter and the getter are lacking (ie, the
18455 DoResolve and DoLResolve have been modified to check for both
18456 setter/getter being null and returning silently, the reason being
18457 that I did not want to put the knowledge about this error in upper
18460 int old = Report.Errors;
18461 x = new PropertyExpr (...);
18462 if (old != Report.Errors)
18467 So the property expr is returned, but it is invalid, so the error
18468 will be flagged during the resolve process.
18470 * class.cs: Remove InheritablePropertySignatureCompare from the
18471 class, as we no longer depend on the property signature to compute
18472 whether it is possible to implement a method or not.
18474 The reason is that calling PropertyInfo.GetGetMethod will return
18475 null (in .NET, in Mono it works, and we should change this), in
18476 cases where the Get Method does not exist in that particular
18481 class X { public virtual int A { get { return 1; } } }
18483 class Z : Y { public override int A { get { return 2; } } }
18485 Would fail in Z because the parent (Y) would not have the property
18486 defined. So we avoid this completely now (because the alternative
18487 fix was ugly and slow), and we now depend exclusively on the
18490 (PropertyBase.CheckBase): Use a method-base mechanism to find our
18491 reference method, instead of using the property.
18493 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
18494 routines are gone now.
18496 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
18497 names, they were incorrectly named.
18499 * cs-tokenizer.cs: Return are more gentle token on failure.
18501 * pending.cs (PendingImplementation.InterfaceMethod): This routine
18502 had an out-of-sync index variable, which caused it to remove from
18503 the list of pending methods the wrong method sometimes.
18505 2002-10-22 Miguel de Icaza <miguel@ximian.com>
18507 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
18508 CanWrite, because those refer to this particular instance of the
18509 property, and do not take into account the fact that we can
18510 override single members of a property.
18512 Constructor requires an EmitContext. The resolution process does
18513 not happen here, but we need to compute the accessors before,
18514 because the resolution does not always happen for properties.
18516 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
18517 subclass, before we did not update this flag, but we did update
18520 (GetAccessors): Drop this routine, as it did not work in the
18521 presence of partially overwritten set/get methods.
18523 Notice that this broke the cs1540 detection, but that will require
18526 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18530 * driver.cs: issue a warning instead of an error if we don't support
18531 debugging for the platform. Also ignore a couple of errors that may
18532 arise when trying to write the symbols. Undo my previous patch.
18534 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18536 * driver.cs: ignore /debug switch except for Unix platforms.
18538 2002-10-23 Nick Drochak <ndrochak@gol.com>
18540 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
18542 2002-10-21 Miguel de Icaza <miguel@ximian.com>
18544 * driver.cs: Do not make mcs-debug conditional, so we do not break
18545 builds that use it.
18547 * statement.cs (UsageVector.MergeChildren): I would like Martin to
18548 review this patch. But basically after all the children variables
18549 have been merged, the value of "Breaks" was not being set to
18550 new_breaks for Switch blocks. I think that it should be set after
18551 it has executed. Currently I set this to the value of new_breaks,
18552 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
18553 conservative, but I do not understand this code very well.
18555 I did not break anything in the build, so that is good ;-)
18557 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
18559 2002-10-20 Mark Crichton <crichton@gimp.org>
18561 * cfold.cs: Fixed compile blocker. Really fixed it this time.
18563 2002-10-20 Nick Drochak <ndrochak@gol.com>
18565 * cfold.cs: Fixed compile blocker.
18567 2002-10-20 Miguel de Icaza <miguel@ximian.com>
18569 * driver.cs: I was chekcing the key, not the file.
18571 2002-10-19 Ravi Pratap <ravi@ximian.com>
18573 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
18574 message that we were generating - we just need to silently return
18577 2002-10-19 Miguel de Icaza <miguel@ximian.com>
18579 * class.cs (Event.Define): Change my previous commit, as this
18580 breaks the debugger. This is a temporary hack, as it seems like
18581 the compiler is generating events incorrectly to begin with.
18583 * expression.cs (Binary.ResolveOperator): Added support for
18584 "U operator - (E x, E y)"
18586 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
18589 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
18590 init-only variables, but this path did not take into account that
18591 there might be also instance readonly variables. Correct this
18594 This fixes bug 32253
18596 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
18599 * driver.cs: Change the extension for modules to `netmodule'
18601 * cs-parser.jay: Improved slightly the location tracking for
18602 the debugger symbols.
18604 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
18605 modifiers that were specified instead of the hardcoded value
18606 (FamAndAssem). This was basically ignoring the static modifier,
18607 and others. Fixes 32429.
18609 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
18610 fixed a bug in the process (32476)
18612 * expression.cs (ArrayAccess.EmitAssign): Patch from
18613 hwang_rob@yahoo.ca that fixes bug 31834.3
18615 2002-10-18 Miguel de Icaza <miguel@ximian.com>
18617 * driver.cs: Make the module extension .netmodule.
18619 2002-10-16 Miguel de Icaza <miguel@ximian.com>
18621 * driver.cs: Report an error if the resource file is not found
18622 instead of crashing.
18624 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
18625 false, like Emit does.
18627 2002-10-16 Nick Drochak <ndrochak@gol.com>
18629 * typemanager.cs: Remove unused private member. Also reported mcs
18630 bug to report this as a warning like csc.
18632 2002-10-15 Martin Baulig <martin@gnome.org>
18634 * statement.cs (Statement.Emit): Made this a virtual method; emits
18635 the line number info and calls DoEmit().
18636 (Statement.DoEmit): New protected abstract method, formerly knows
18637 as Statement.Emit().
18639 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
18641 2002-10-11 Miguel de Icaza <miguel@ximian.com>
18643 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
18644 have fixed a remaining problem: not every AddXXXX was adding a
18645 fully qualified name.
18647 Now everyone registers a fully qualified name in the DeclSpace as
18648 being defined instead of the partial name.
18650 Downsides: we are slower than we need to be due to the excess
18651 copies and the names being registered this way.
18653 The reason for this is that we currently depend (on the corlib
18654 bootstrap for instance) that types are fully qualified, because
18655 we dump all the types in the namespace, and we should really have
18656 types inserted into the proper namespace, so we can only store the
18657 basenames in the defined_names array.
18659 2002-10-10 Martin Baulig <martin@gnome.org>
18661 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
18662 from bug #31834, see the bug report for a testcase which is
18665 2002-10-10 Martin Baulig <martin@gnome.org>
18667 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
18668 flow analysis code for this.
18670 * statement.cs (Do, While, For): Tell the flow analysis code about
18672 (FlowBranching.UsageVector): Added support for infinite loops.
18673 (Block.Resolve): Moved the dead code elimination here and use flow
18676 2002-10-09 Miguel de Icaza <miguel@ximian.com>
18678 * class.cs (Field.Define): Catch cycles on struct type
18681 * typemanager.cs (IsUnmanagedtype): Do not recursively check
18682 fields if the fields are static. We only need to check instance
18685 * expression.cs (As.DoResolve): Test for reference type.
18687 * statement.cs (Using.ResolveExpression): Use
18688 ConvertImplicitRequired, not ConvertImplicit which reports an
18690 (Using.ResolveLocalVariableDecls): ditto.
18692 * expression.cs (Binary.ResolveOperator): Report errors in a few
18693 places where we had to.
18695 * typemanager.cs (IsUnmanagedtype): Finish implementation.
18697 2002-10-08 Miguel de Icaza <miguel@ximian.com>
18699 * expression.cs: Use StoreFromPtr instead of extracting the type
18700 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
18702 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
18703 an enumeration value to a System.Enum, but System.Enum is not a
18704 value type, but an class type, so we need to box.
18706 (Expression.ConvertExplicit): One codepath could return
18707 errors but not flag them. Fix this. Fixes #31853
18709 * parameter.cs (Resolve): Do not allow void as a parameter type.
18711 2002-10-06 Martin Baulig <martin@gnome.org>
18713 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
18714 if it's a class type and not a struct. Fixes #31815.
18716 2002-10-06 Martin Baulig <martin@gnome.org>
18718 * statement.cs: Reworked the flow analysis code a bit to make it
18719 usable for dead code elimination.
18721 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18723 * cs-parser.jay: allow empty source files. Fixes bug #31781.
18725 2002-10-04 Miguel de Icaza <miguel@ximian.com>
18727 * expression.cs (ComposedCast.DoResolveType): A quick workaround
18728 to fix the test 165, will investigate deeper.
18730 2002-10-04 Martin Baulig <martin@gnome.org>
18732 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
18733 finally blocks actually work.
18734 (Try.Resolve): We don't need to create a sibling for `finally' if
18735 there is no finally block.
18737 2002-10-04 Martin Baulig <martin@gnome.org>
18739 * class.cs (Constructor.Define): The default accessibility for a
18740 non-default constructor is private, not public.
18742 2002-10-04 Miguel de Icaza <miguel@ximian.com>
18744 * class.cs (Constructor): Make AllowedModifiers public, add
18747 * cs-parser.jay: Perform the modifiers test here, as the
18748 constructor for the Constructor class usually receives a zero
18749 because of the way we create it (first we create, later we
18750 customize, and we were never checking the modifiers).
18752 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
18753 is a version of LookupTypeReflection that includes the type-name
18754 cache. This can be used as a fast path for functions that know
18755 the fully qualified name and are only calling into *.GetType() to
18756 obtain a composed type.
18758 This is also used by TypeManager.LookupType during its type
18761 (LookupType): We now also track the real type name, as sometimes
18762 we can get a quey for the real type name from things like
18763 ComposedCast. This fixes bug 31422.
18765 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
18766 complete type fullname, it does not have to go through the type
18767 resolution system to obtain the composed version of the type (for
18768 obtaining arrays or pointers).
18770 (Conditional.Emit): Use the EmitBoolExpression to
18771 generate nicer code, as requested by Paolo.
18773 (ArrayCreation.CheckIndices): Use the patch from
18774 hwang_rob@yahoo.ca to validate the array initializers.
18776 2002-10-03 Miguel de Icaza <miguel@ximian.com>
18778 * class.cs (ConstructorInitializer.Emit): simplify code by using
18779 Invocation.EmitCall, and at the same time, fix the bugs in calling
18780 parent constructors that took variable arguments.
18782 * ecore.cs (Expression.ConvertNumericExplicit,
18783 Expression.ImplicitNumericConversion): Remove the code that
18784 manually wrapped decimal (InternalTypeConstructor call is now gone
18787 * expression.cs (Cast.TryReduce): Also handle decimal types when
18788 trying to perform a constant fold on the type.
18790 * typemanager.cs (IsUnmanagedtype): Partially implemented.
18792 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
18793 that only turned off an error report, and did nothing else.
18795 2002-10-02 Miguel de Icaza <miguel@ximian.com>
18797 * driver.cs: Handle and ignore /fullpaths
18799 2002-10-01 Miguel de Icaza <miguel@ximian.com>
18801 * expression.cs (Binary.ResolveOperator): Catch the case where
18802 DoNumericPromotions returns true,
18804 (Binary.DoNumericPromotions): Simplify the code, and the tests.
18806 2002-09-27 Miguel de Icaza <miguel@ximian.com>
18808 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
18811 2002-09-26 Miguel de Icaza <miguel@ximian.com>
18813 * ecore.cs (ConvertNumericExplicit): It is not enough that the
18814 conversion exists, but it is also required that the conversion be
18815 performed. This manifested in "(Type64Enum) 2".
18817 * class.cs (TypeManager.AddMethod): The fix is not to change
18818 AddEnum, because that one was using a fully qualified name (every
18819 DeclSpace derivative does), but to change the AddMethod routine
18820 that was using an un-namespaced name. This now correctly reports
18821 the duplicated name.
18823 Revert patch until I can properly fix it. The issue
18824 is that we have a shared Type space across all namespaces
18825 currently, which is wrong.
18827 Options include making the Namespace a DeclSpace, and merge
18828 current_namespace/current_container in the parser.
18830 2002-09-25 Miguel de Icaza <miguel@ximian.com>
18832 * cs-parser.jay: Improve error reporting when we get a different
18833 kind of expression in local_variable_type and
18834 local_variable_pointer_type.
18836 Propagate this to avoid missleading errors being reported.
18838 * ecore.cs (ImplicitReferenceConversion): treat
18839 TypeManager.value_type as a target just like object_type. As
18844 Is valid, and needs to result in the int 1 being boxed before it
18845 is assigned to the value type v.
18847 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
18848 to validate the enumeration name.
18850 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
18851 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
18852 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
18854 * ecore.cs (TryImplicitIntConversion): When doing an
18855 implicit-enumeration-conversion, check if the type is 64-bits and
18856 perform a conversion before passing to EnumConstant.
18858 2002-09-23 Miguel de Icaza <miguel@ximian.com>
18860 * decl.cs (Error_AmbiguousTypeReference); New routine used to
18861 report ambiguous type references. Unlike the MS version, we
18862 report what the ambiguity is. Innovation at work ;-)
18864 (DeclSpace.FindType): Require a location argument to
18865 display when we display an ambiguous error.
18867 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
18869 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
18871 * expression.cs (EmitDynamicInitializers): Apply patch from
18872 hwang_rob@yahoo.ca that fixes the order in which we emit our
18875 2002-09-21 Martin Baulig <martin@gnome.org>
18877 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
18878 delegate takes no arguments.
18880 2002-09-20 Miguel de Icaza <miguel@ximian.com>
18882 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
18885 * expression.cs: Extract the underlying type.
18887 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
18889 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
18891 2002-09-19 Miguel de Icaza <miguel@ximian.com>
18893 * class.cs (TypeContainer.DefineType): We can not use the nice
18894 PackingSize with the size set to 1 DefineType method, because it
18895 will not allow us to define the interfaces that the struct
18898 This completes the fixing of bug 27287
18900 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
18901 means also structs. This fixes part of the problem.
18902 (Expresion.ImplicitReferenceConversionExists): ditto.
18904 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
18905 error if there were no errors reported during the type lookup
18906 process, to avoid duplicates or redundant errors. Without this
18907 you would get an ambiguous errors plus a type not found. We have
18908 beaten the user enough with the first error.
18910 (DeclSparce.FindType): Emit a warning if we have an ambiguous
18913 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
18914 during the resolution process, stop the lookup, this avoids
18915 repeated error reports (same error twice).
18917 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
18919 * typemanager.cs (LookupType): Redo the type lookup code to match
18920 the needs of System.Reflection.
18922 The issue is that System.Reflection requires references to nested
18923 types to begin with a "+" sign instead of a dot. So toplevel
18924 types look like: "NameSpace.TopLevelClass", and nested ones look
18925 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
18928 2002-09-19 Martin Baulig <martin@gnome.org>
18930 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
18931 says that a method always returns or always throws an exception,
18932 don't report the CS0161.
18934 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
18935 set `Returns = new_returns'.
18937 2002-09-19 Martin Baulig <martin@gnome.org>
18939 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
18940 to an enum constant, check for a CS0176.
18942 2002-09-18 Miguel de Icaza <miguel@ximian.com>
18944 * class.cs (TypeContainer.CheckPairedOperators): Now we check
18945 for operators that must be in pairs and report errors.
18947 * ecore.cs (SimpleName.DoResolveType): During the initial type
18948 resolution process, when we define types recursively, we must
18949 check first for types in our current scope before we perform
18950 lookups in the enclosing scopes.
18952 * expression.cs (MakeByteBlob): Handle Decimal blobs.
18954 (Invocation.VerifyArgumentsCompat): Call
18955 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
18956 I thought we were supposed to always call this, but there are a
18957 few places in the code where we dont do it.
18959 2002-09-17 Miguel de Icaza <miguel@ximian.com>
18961 * driver.cs: Add support in -linkres and -resource to specify the
18962 name of the identifier.
18964 2002-09-16 Miguel de Icaza <miguel@ximian.com>
18966 * ecore.cs (StandardConversionExists): Sync with the conversion
18967 code: allow anything-* to void* conversions.
18969 (FindMostSpecificSource): Use an Expression argument
18970 instead of a Type, because we might be handed over a Literal which
18971 gets a few more implicit conversions that plain types do not. So
18972 this information was being lost.
18974 Also, we drop the temporary type-holder expression when not
18977 2002-09-17 Martin Baulig <martin@gnome.org>
18979 * class.cs (PropertyBase.CheckBase): Don't check the base class if
18980 this is an explicit interface implementation.
18982 2002-09-17 Martin Baulig <martin@gnome.org>
18984 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
18985 different `IndexerName' attributes.
18987 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
18988 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
18989 virtual CommonResolve().
18991 2002-09-16 Miguel de Icaza <miguel@ximian.com>
18993 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
18994 and convert that to the UnderlyingType.
18996 * statement.cs (Foreach.Resolve): Indexers are just like variables
18997 or PropertyAccesses.
18999 * cs-tokenizer.cs (consume_string): Track line numbers and columns
19000 inside quoted strings, we were not doing this before.
19002 2002-09-16 Martin Baulig <martin@gnome.org>
19004 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
19005 resolve it. This is needed for the definite assignment check of the
19006 instance expression, fixes bug #29846.
19007 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
19009 2002-09-16 Nick Drochak <ndrochak@gol.com>
19011 * parameter.cs: Fix compile error. Cannot reference static member
19012 from an instance object. Is this an mcs bug?
19014 2002-09-14 Martin Baulig <martin@gnome.org>
19016 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
19017 multiple times. Fixes bug #30295, added test-166.cs.
19019 2002-09-14 Martin Baulig <martin@gnome.org>
19021 * statement.cs (Block.Emit): Don't emit unreachable code.
19022 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
19023 `break' statements.
19024 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
19026 2002-09-14 Martin Baulig <martin@gnome.org>
19028 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
19031 2002-09-14 Martin Baulig <martin@gnome.org>
19033 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
19034 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
19035 be false on the ms runtime.
19037 2002-09-13 Martin Baulig <martin@gnome.org>
19039 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
19040 the CS0038 error message.
19042 2002-09-12 Miguel de Icaza <miguel@ximian.com>
19044 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
19045 constant inside, return it.
19047 2002-09-12 Martin Baulig <martin@gnome.org>
19049 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
19050 implicit conversion can be done between enum types.
19052 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
19053 check whether an implicit conversion to the current enum's UnderlyingType
19054 exists and report an error if not.
19056 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
19057 without debugging support.
19059 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
19060 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
19062 2002-09-12 Martin Baulig <martin@gnome.org>
19064 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
19066 * ecore.cs (IMemberExpr.DeclaringType): New property.
19067 (SimpleName.SimpleNameResolve): Check whether we're accessing a
19068 nonstatic member of an outer type (CS0038).
19070 2002-09-11 Miguel de Icaza <miguel@ximian.com>
19072 * driver.cs: Activate the using-error detector at warning level
19073 4 (at least for MS-compatible APIs).
19075 * namespace.cs (VerifyUsing): Small buglett fix.
19077 * pending.cs (PendingImplementation): pass the container pointer.
19079 * interface.cs (GetMethods): Allow for recursive definition. Long
19080 term, I would like to move every type to support recursive
19081 definitions, not the current ordering mechanism that we have right
19084 The situation is this: Attributes are handled before interfaces,
19085 so we can apply attributes to interfaces. But some attributes
19086 implement interfaces, we will now handle the simple cases
19087 (recursive definitions will just get an error).
19089 * parameter.cs: Only invalidate types at the end if we fail to
19092 2002-09-09 Martin Baulig <martin@gnome.org>
19094 * ecore.cs (PropertyExpr.Emit): Also check for
19095 TypeManager.system_int_array_get_length so this'll also work when
19096 compiling corlib. Fixes #30003.
19098 2002-09-09 Martin Baulig <martin@gnome.org>
19100 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
19101 and throw an exception if we can't get the type's size. Fixed #30040,
19104 2002-09-09 Martin Baulig <martin@gnome.org>
19106 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
19108 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
19109 context. Fixes bug #30027.
19111 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
19112 virtual functions. Fixes bug #30043, added test-164.cs.
19114 2002-09-08 Ravi Pratap <ravi@ximian.com>
19116 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
19118 2002-09-08 Nick Drochak <ndrochak@gol.com>
19120 * driver.cs: Use an object to get the windows codepage since it's not a
19123 2002-09-08 Miguel de Icaza <miguel@ximian.com>
19125 * statement.cs (For.Emit): for infinite loops (test == null)
19126 return whether there is a break inside, not always "true".
19128 * namespace.cs (UsingEntry): New struct to hold the name of the
19129 using definition, the location where it is defined, and whether it
19130 has been used in a successful type lookup.
19132 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
19137 2002-09-06 Ravi Pratap <ravi@ximian.com>
19139 * attribute.cs : Fix incorrect code which relied on catching
19140 a NullReferenceException to detect a null being passed in
19141 where an object was expected.
19143 2002-09-06 Miguel de Icaza <miguel@ximian.com>
19145 * statement.cs (Try): flag the catch variable as assigned
19147 * expression.cs (Cast): Simplified by using ResolveType instead of
19148 manually resolving.
19150 * statement.cs (Catch): Fix bug by using ResolveType.
19152 2002-09-06 Ravi Pratap <ravi@ximian.com>
19154 * expression.cs (BetterConversion): Special case for when we have
19155 a NullLiteral as the argument and we have to choose between string
19156 and object types - we choose string the way csc does.
19158 * attribute.cs (Attribute.Resolve): Catch the
19159 NullReferenceException and report error #182 since the Mono
19160 runtime no more has the bug and having this exception raised means
19161 we tried to select a constructor which takes an object and is
19164 2002-09-05 Ravi Pratap <ravi@ximian.com>
19166 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
19167 message (1502, 1503) when we can't locate a method after overload
19168 resolution. This is much more informative and closes the bug
19171 * interface.cs (PopulateMethod): Return if there are no argument
19172 types. Fixes a NullReferenceException bug.
19174 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
19175 expressions too. Previously we were checking only in one place for
19176 positional arguments leaving out named arguments.
19178 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
19179 type to the enum type is not allowed. Remove code corresponding to
19182 (ConvertNumericExplicit): Allow explicit conversions from
19183 the underlying type to enum type. This precisely follows the spec
19184 and closes a bug filed by Gonzalo.
19186 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19189 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
19191 2002-09-03 Miguel de Icaza <miguel@ximian.com>
19193 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
19194 it was important that we stored the right value after the
19195 reduction in `converted'.
19197 2002-09-04 Martin Baulig <martin@gnome.org>
19199 * location.cs (Location.SymbolDocument): Use full pathnames for the
19202 2002-08-30 Miguel de Icaza <miguel@ximian.com>
19204 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
19205 of the expression resolve mechanism, because that will catch the
19206 SimpleName error failures.
19208 (Conditional): If we can not resolve the
19209 expression, return, do not crash.
19211 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19214 (location): display token name instead of its number.
19216 2002-08-28 Martin Baulig <martin@gnome.org>
19218 * expression.cs (Binary.ResolveOperator): Don't silently return
19219 but return an error if an operator cannot be applied between two
19222 2002-08-28 Martin Baulig <martin@gnome.org>
19224 * class.cs (Constructor.Define): Set the permission attributes
19225 correctly instead of making all constructors public.
19227 2002-08-28 Martin Baulig <martin@gnome.org>
19229 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
19230 for private members before reporting a CS0103; if we find anything,
19233 2002-08-28 Martin Baulig <martin@gnome.org>
19235 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
19236 to check whether `closure_start_type == closure_invocation_type',
19237 we also need to check whether `m.DeclaringType == closure_invocation_type'
19238 before bypassing the permission checks. We might be accessing
19239 protected/private members from the base class.
19240 (TypeManager.RealMemberLookup): Only set private_ok if private
19241 members were requested via BindingFlags.NonPublic.
19243 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
19245 * expression.cs (MemberAccess.ResolveMemberAccess): Set
19246 MethodGroupExpr.IsExplicitImpl if appropriate.
19247 (Invocation.DoResolve): Don't report the CS0120 for explicit
19248 interface implementations.
19250 2002-08-27 Martin Baulig <martin@gnome.org>
19252 * expression.cs (Invocation.DoResolve): If this is a static
19253 method and we don't have an InstanceExpression, we must report
19256 2002-08-25 Martin Baulig <martin@gnome.org>
19258 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
19259 `==' between a valuetype and an object.
19261 2002-08-25 Miguel de Icaza <miguel@ximian.com>
19263 * ecore.cs (TypeExpr): Provide a ToString method.
19265 2002-08-24 Martin Baulig <martin@gnome.org>
19267 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
19268 now called proggie.dbg and it's a binary file.
19270 2002-08-23 Martin Baulig <martin@gnome.org>
19272 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
19274 2002-08-23 Martin Baulig <martin@gnome.org>
19276 * struct.cs (MyStructInfo.ctor): Make this work with empty
19277 structs; it's not allowed to use foreach() on null.
19279 2002-08-23 Martin Baulig <martin@gnome.org>
19281 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
19282 writer the full pathname of the generated assembly.
19284 2002-08-23 Martin Baulig <martin@gnome.org>
19286 * statements.cs (FlowBranching.UsageVector.MergeChildren):
19287 A `finally' block never returns or breaks; improved handling of
19290 2002-08-23 Martin Baulig <martin@gnome.org>
19292 * statement.cs (Throw.Resolve): Allow `throw null'.
19294 2002-08-23 Martin Baulig <martin@gnome.org>
19296 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
19297 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
19298 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
19299 MemberLookup would return a wrong event if this is an explicit
19300 interface implementation and the class has an event with the same
19303 2002-08-23 Martin Baulig <martin@gnome.org>
19305 * statement.cs (Block.AddChildVariableNames): New public method.
19306 (Block.AddChildVariableName): Likewise.
19307 (Block.IsVariableNameUsedInChildBlock): Likewise.
19308 (Block.AddVariable): Check whether a variable name has already
19309 been used in a child block.
19311 * cs-parser.jay (declare_local_variables): Mark all variable names
19312 from the current block as being used in a child block in the
19315 2002-08-23 Martin Baulig <martin@gnome.org>
19317 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
19318 find the symbol writer.
19320 * driver.cs: csc also allows the arguments to /define being
19321 separated by commas, not only by semicolons.
19323 2002-08-23 Martin Baulig <martin@gnome.org>
19325 * interface.cs (Interface.GetMembers): Added static check for events.
19327 2002-08-15 Martin Baulig <martin@gnome.org>
19329 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
19330 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
19332 * ecore.cs (Expression.MemberLookup): Added documentation and explained
19333 why the MethodData.EmitDestructor() change was necessary.
19335 2002-08-20 Martin Baulig <martin@gnome.org>
19337 * class.cs (TypeContainer.FindMembers): Added static check for events.
19339 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
19341 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
19342 use Type.GetEvents(), not Type.FindMembers().
19344 2002-08-20 Martin Baulig <martin@gnome.org>
19346 * decl.cs (MemberCache): Added a special method cache which will
19347 be used for method-only searched. This ensures that a method
19348 search will return a MethodInfo with the correct ReflectedType for
19351 2002-08-20 Martin Baulig <martin@gnome.org>
19353 * decl.cs (DeclSpace.FindMembers): Made this public.
19355 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19357 * delegate.cs: fixed build on windows.
19358 [FIXME: Filed as bug #29150: MCS must report these errors.]
19360 2002-08-19 Ravi Pratap <ravi@ximian.com>
19362 * ecore.cs (StandardConversionExists): Return a false
19363 if we are trying to convert the void type to anything else
19364 since that is not allowed.
19366 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
19367 we flag error 70 in the event an event is trying to be accessed
19368 directly from outside the declaring type.
19370 2002-08-20 Martin Baulig <martin@gnome.org>
19372 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
19373 MemberCache from typemanager.cs to decl.cs.
19375 2002-08-19 Martin Baulig <martin@gnome.org>
19377 * class.cs (TypeContainer): Implement IMemberContainer.
19378 (TypeContainer.DefineMembers): Create the MemberCache.
19379 (TypeContainer.FindMembers): Do better BindingFlags checking; only
19380 return public members if BindingFlags.Public was given, check
19381 whether members are static.
19383 2002-08-16 Martin Baulig <martin@gnome.org>
19385 * decl.cs (DeclSpace.Define): Splitted this in Define and
19386 DefineMembers. DefineMembers is called first and initializes the
19389 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
19390 DefineMembers() on all our DeclSpaces.
19392 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
19393 but call DefineMembers() on all nested interfaces. We call their
19394 Define() in our new Define() function.
19396 * interface.cs (Interface): Implement IMemberContainer.
19397 (Interface.Define): Moved all code except the attribute stuf to
19399 (Interface.DefineMembers): Initialize the member cache.
19401 * typemanager.cs (IMemberFinder): Removed this interface, we don't
19402 need this anymore since we can use MemberCache.FindMembers directly.
19404 2002-08-19 Martin Baulig <martin@gnome.org>
19406 * typemanager.cs (MemberCache): When creating the cache for an
19407 interface type, add all inherited members.
19408 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
19409 to `out bool used_cache' and documented it.
19410 (TypeManager.MemberLookup): If we already used the cache in the first
19411 iteration, we don't need to do the interfaces check.
19413 2002-08-19 Martin Baulig <martin@gnome.org>
19415 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
19416 here from IMemberFinder and don't implement this interface anymore.
19417 (DeclSpace.MemberCache): Moved here from IMemberFinder.
19419 * typemanager.cs (IMemberFinder): This interface is now only used by
19420 classes which actually support the member cache.
19421 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
19422 since we only put DeclSpaces into this Hashtable.
19423 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
19424 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
19426 2002-08-16 Martin Baulig <martin@gnome.org>
19428 * typemanager.cs (ICachingMemberFinder): Removed.
19429 (IMemberFinder.MemberCache): New property.
19430 (TypeManager.FindMembers): Merged this with RealFindMembers().
19431 This function will never be called from TypeManager.MemberLookup()
19432 so we can't use the cache here, just the IMemberFinder.
19433 (TypeManager.MemberLookup_FindMembers): Check whether the
19434 IMemberFinder has a MemberCache and call the cache's FindMembers
19436 (MemberCache): Rewrote larger parts of this yet another time and
19437 cleaned it up a bit.
19439 2002-08-15 Miguel de Icaza <miguel@ximian.com>
19441 * driver.cs (LoadArgs): Support quoting.
19443 (Usage): Show the CSC-like command line arguments.
19445 Improved a few error messages.
19447 2002-08-15 Martin Baulig <martin@gnome.org>
19449 * typemanager.cs (IMemberContainer.Type): New property.
19450 (IMemberContainer.IsInterface): New property.
19452 The following changes are conditional to BROKEN_RUNTIME, which is
19453 defined at the top of the file.
19455 * typemanager.cs (MemberCache.MemberCache): Don't add the base
19456 class'es members, but add all members from TypeHandle.ObjectType
19457 if we're an interface.
19458 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
19459 is the current type.
19460 (MemberCache.CacheEntry.Container): Removed this field.
19461 (TypeHandle.GetMembers): Include inherited members.
19463 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19465 * typemanager.cs: fixed compilation and added a comment on a field that
19468 2002-08-15 Martin Baulig <martin@gnome.org>
19470 * class.cs (ConstructorInitializer.Resolve): In the
19471 Expression.MemberLookup call, use the queried_type as
19474 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
19475 declared' attribute, it's always true.
19476 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
19477 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
19478 temporary wrapper for FindMembers which tells MemberLookup whether
19479 members from the base classes are included in the return value.
19480 This will go away soon.
19481 (TypeManager.MemberLookup): Use this temporary hack here; once the
19482 new MemberCache is completed, we don't need to do the DeclaredOnly
19483 looping here anymore since the MemberCache will take care of this.
19484 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
19485 (MemberCache): When creating the MemberCache for a class, get
19486 members from the current class and all its base classes.
19487 (MemberCache.CacheEntry.Container): New field. This is a
19488 temporary hack until the Mono runtime is fixed to distinguish
19489 between ReflectedType and DeclaringType. It allows us to use MCS
19490 with both the MS runtime and the unfixed Mono runtime without
19491 problems and without accecting performance.
19492 (MemberCache.SearchMembers): The DeclaredOnly looping from
19493 TypeManager.MemberLookup is now done here.
19495 2002-08-14 Martin Baulig <martin@gnome.org>
19497 * statement.cs (MyStructInfo.MyStructInfo): Don't call
19498 Type.GetFields on dynamic types but get the fields from the
19499 corresponding TypeContainer.
19500 (MyStructInfo.GetStructInfo): Added check for enum types.
19502 * typemanager.cs (MemberList.IsSynchronized): Implemented.
19503 (MemberList.SyncRoot): Implemented.
19504 (TypeManager.FilterWithClosure): No need to check permissions if
19505 closure_start_type == closure_invocation_type, don't crash if
19506 closure_invocation_type is null.
19508 2002-08-13 Martin Baulig <martin@gnome.org>
19510 Rewrote TypeContainer.FindMembers to use a member cache. This
19511 gives us a speed increase of about 35% for the self-hosting MCS
19512 build and of about 15-20% for the class libs (both on GNU/Linux).
19514 * report.cs (Timer): New class to get enhanced profiling. This
19515 whole class is "TIMER" conditional since it remarkably slows down
19518 * class.cs (MemberList): New class. This is an IList wrapper
19519 which we're now using instead of passing MemberInfo[]'s around to
19520 avoid copying this array unnecessarily.
19521 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
19522 (ICachingMemberFinder, IMemberContainer): New interface.
19523 (TypeManager.FilterWithClosure): If `criteria' is null, the name
19524 has already been checked, otherwise use it for the name comparision.
19525 (TypeManager.FindMembers): Renamed to RealMemberFinder and
19526 provided wrapper which tries to use ICachingMemberFinder.FindMembers
19527 if possible. Returns a MemberList, not a MemberInfo [].
19528 (TypeHandle): New class, implements IMemberContainer. We create
19529 one instance of this class per type, it contains a MemberCache
19530 which is used to do the member lookups.
19531 (MemberCache): New class. Each instance of this class contains
19532 all members of a type and a name-based hash table.
19533 (MemberCache.FindMembers): This is our new member lookup
19534 function. First, it looks up all members of the requested name in
19535 the hash table. Then, it walks this list and sorts out all
19536 applicable members and returns them.
19538 2002-08-13 Martin Baulig <martin@gnome.org>
19540 In addition to a nice code cleanup, this gives us a performance
19541 increase of about 1.4% on GNU/Linux - not much, but it's already
19542 half a second for the self-hosting MCS compilation.
19544 * typemanager.cs (IMemberFinder): New interface. It is used by
19545 TypeManager.FindMembers to call FindMembers on a TypeContainer,
19546 Enum, Delegate or Interface.
19547 (TypeManager.finder_to_member_finder): New PtrHashtable.
19548 (TypeManager.finder_to_container): Removed.
19549 (TypeManager.finder_to_delegate): Removed.
19550 (TypeManager.finder_to_interface): Removed.
19551 (TypeManager.finder_to_enum): Removed.
19553 * interface.cs (Interface): Implement IMemberFinder.
19555 * delegate.cs (Delegate): Implement IMemberFinder.
19557 * enum.cs (Enum): Implement IMemberFinder.
19559 * class.cs (TypeContainer): Implement IMemberFinder.
19561 2002-08-12 Martin Baulig <martin@gnome.org>
19563 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
19565 2002-08-12 Martin Baulig <martin@gnome.org>
19567 * ecore.cs (ITypeExpression): New interface for expressions which
19569 (TypeExpression): Renamed to TypeLookupExpression.
19570 (Expression.DoResolve): If we're doing a types-only lookup, the
19571 expression must implement the ITypeExpression interface and we
19572 call DoResolveType() on it.
19573 (SimpleName): Implement the new ITypeExpression interface.
19574 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
19575 hack, the situation that we're only looking up types can't happen
19576 anymore when this method is called. Moved the type lookup code to
19577 DoResolveType() and call it.
19578 (SimpleName.DoResolveType): This ITypeExpression interface method
19579 is now doing the types-only lookup.
19580 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
19581 (ResolveFlags): Added MaskExprClass.
19583 * expression.cs (MemberAccess): Implement the ITypeExpression
19585 (MemberAccess.DoResolve): Added support for a types-only lookup
19586 when we're called via ITypeExpression.DoResolveType().
19587 (ComposedCast): Implement the ITypeExpression interface.
19589 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
19590 Expression.Resolve() with ResolveFlags.Type instead.
19592 2002-08-12 Martin Baulig <martin@gnome.org>
19594 * interface.cs (Interface.Define): Apply attributes.
19596 * attribute.cs (Attribute.ApplyAttributes): Added support for
19597 interface attributes.
19599 2002-08-11 Martin Baulig <martin@gnome.org>
19601 * statement.cs (Block.Emit): Only check the "this" variable if we
19602 do not always throw an exception.
19604 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
19605 whether the property has a set accessor.
19607 2002-08-11 Martin Baulig <martin@gnome.org>
19609 Added control flow analysis support for structs.
19611 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
19612 with control flow analysis turned off.
19613 (IVariable): New interface.
19614 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
19615 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
19616 (FieldExpr.DoResolve): Resolve the instance expression with flow
19617 analysis turned off and do the definite assignment check after the
19618 resolving when we know what the expression will resolve to.
19620 * expression.cs (LocalVariableReference, ParameterReference):
19621 Implement the new IVariable interface, only call the flow analysis
19622 code if ec.DoFlowAnalysis is true.
19623 (This): Added constructor which takes a Block argument. Implement
19624 the new IVariable interface.
19625 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
19626 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
19627 This does the definite assignment checks for struct members.
19629 * class.cs (Constructor.Emit): If this is a non-static `struct'
19630 constructor which doesn't have any initializer, call
19631 Block.AddThisVariable() to tell the flow analysis code that all
19632 struct elements must be initialized before control returns from
19635 * statement.cs (MyStructInfo): New public class.
19636 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
19637 argument to this indexer. If non-zero, check an individual struct
19638 member, not the whole struct.
19639 (FlowBranching.CheckOutParameters): Check struct members.
19640 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
19641 overloaded versions of these methods which take an additional
19642 `int field_idx' argument to check struct members.
19643 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
19644 overloaded versions of these methods which take an additional
19645 `string field_name' argument to check struct member.s
19646 (VariableInfo): Implement the IVariable interface.
19647 (VariableInfo.StructInfo): New public property. Returns the
19648 MyStructInfo instance of the variable if it's a struct or null.
19649 (Block.AddThisVariable): New public method. This is called from
19650 Constructor.Emit() for non-static `struct' constructor which do
19651 not have any initializer. It creates a special variable for the
19652 "this" instance variable which will be checked by the flow
19653 analysis code to ensure that all of the struct's fields are
19654 initialized before control returns from the constructor.
19655 (UsageVector): Added support for struct members. If a
19656 variable/parameter is a struct with N members, we reserve a slot
19657 in the usage vector for each member. A struct is considered fully
19658 initialized if either the struct itself (slot 0) or all its
19659 members are initialized.
19661 2002-08-08 Martin Baulig <martin@gnome.org>
19663 * driver.cs (Driver.MainDriver): Only report an error CS5001
19664 if there were no compilation errors.
19666 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
19667 `UnsafeContext' property to determine whether the parent is in
19668 unsafe context rather than checking the parent's ModFlags:
19669 classes nested in an unsafe class are unsafe as well.
19671 2002-08-08 Martin Baulig <martin@gnome.org>
19673 * statement.cs (UsageVector.MergeChildren): Distinguish between
19674 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
19675 we return. Added test17() and test18() to test-154.cs.
19677 2002-08-08 Martin Baulig <martin@gnome.org>
19679 * typemanager.cs (TypeManager.FilterWithClosure): If we have
19680 Family access, make sure the invoking type isn't a subclass of the
19681 queried type (that'd be a CS1540).
19683 * ecore.cs (Expression.MemberLookup): Added overloaded version of
19684 this method which takes an additional `Type invocation_type'.
19686 * expression.cs (BaseAccess.DoResolve): Use the base type as
19687 invocation and query type.
19688 (MemberAccess.DoResolve): If the lookup failed and we're about to
19689 report a CS0122, try a lookup with the ec.ContainerType - if this
19690 succeeds, we must report a CS1540.
19692 2002-08-08 Martin Baulig <martin@gnome.org>
19694 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
19695 (MethodGroupExpr): Implement the IMemberExpr interface.
19697 * expression (MemberAccess.ResolveMemberAccess): No need to have
19698 any special code for MethodGroupExprs anymore, they're now
19701 2002-08-08 Martin Baulig <martin@gnome.org>
19703 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
19704 Family, FamANDAssem and FamORAssem permissions.
19705 (TypeManager.IsSubclassOrNestedChildOf): New public method.
19707 2002-08-08 Martin Baulig <martin@gnome.org>
19709 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
19710 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
19713 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
19715 * driver.cs: implemented /resource option to embed managed resources.
19717 2002-08-07 Martin Baulig <martin@gnome.org>
19719 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
19720 (FieldBase.HasFieldInitializer): New public property.
19721 (FieldBase.GetInitializerExpression): New public method. Resolves and
19722 returns the field initializer and makes sure it is only resolved once.
19723 (TypeContainer.EmitFieldInitializers): Call
19724 FieldBase.GetInitializerExpression to get the initializer, this ensures
19725 that it isn't resolved multiple times.
19727 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
19728 the resolving process (SimpleName/MemberLookup) that we're currently
19729 emitting a field initializer (which must not access any instance members,
19730 this is an error CS0236).
19732 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
19733 argument, if the `IsFieldInitializer' flag is set, we must report and
19734 error CS0236 and not an error CS0120.
19736 2002-08-07 Martin Baulig <martin@gnome.org>
19738 * ecore.cs (IMemberExpr): New public interface.
19739 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
19740 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
19741 if the expression is an IMemberExpr.
19743 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
19744 to be null, implicitly default to `this' if we're non-static in
19745 this case. Simplified the code a lot by using the new IMemberExpr
19746 interface. Also fixed bug #28176 here.
19748 2002-08-06 Martin Baulig <martin@gnome.org>
19750 * cs-parser.jay (SimpleLookup): Removed. We need to create
19751 ParameterReferences during semantic analysis so that we can do a
19752 type-only search when resolving Cast, TypeOf and SizeOf.
19753 (block): Pass the `current_local_parameters' to the Block's
19756 * class.cs (ConstructorInitializer): Added `Parameters parameters'
19757 argument to the constructor.
19758 (ConstructorInitializer.Resolve): Create a temporary implicit
19759 block with the parameters.
19761 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
19762 references here if we aren't doing a type-only search.
19764 * statement.cs (Block): Added constructor which takes a
19765 `Parameters parameters' argument.
19766 (Block.Parameters): New public property.
19768 * support.cs (InternalParameters.Parameters): Renamed `parameters'
19769 to `Parameters' and made it public readonly.
19771 2002-08-06 Martin Baulig <martin@gnome.org>
19773 * ecore.cs (Expression.Warning): Made this public as well.
19775 * report.cs (Report.Debug): Print the contents of collections.
19777 2002-08-06 Martin Baulig <martin@gnome.org>
19779 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
19780 used to tell Resolve() which kinds of expressions it may return.
19781 (Expression.Resolve): Added overloaded version of this method which
19782 takes a `ResolveFlags flags' argument. This can be used to tell
19783 Resolve() which kinds of expressions it may return. Reports a
19785 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
19786 ResolveFlags.SimpleName.
19787 (Expression.Error118): Added overloaded version of this method which
19788 takes a `ResolveFlags flags' argument. It uses the flags to determine
19789 which kinds of expressions are allowed.
19791 * expression.cs (Argument.ResolveMethodGroup): New public method.
19792 Resolves an argument, but allows a MethodGroup to be returned.
19793 This is used when invoking a delegate.
19795 * TODO: Updated a bit.
19797 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19799 Fixed compilation with csc.
19801 * ecore.cs: Expression.Error made public. Is this correct? Should
19802 Warning be made public too?
19804 * expression.cs: use ea.Location instead of ea.loc.
19805 [FIXME: Filed as bug #28607: MCS must report these errors.]
19807 2002-08-06 Martin Baulig <martin@gnome.org>
19809 * ecore.cs (Expression.loc): Moved the location here instead of
19810 duplicating it in all derived classes.
19811 (Expression.Location): New public property.
19812 (Expression.Error, Expression.Warning): Made them non-static and
19813 removed the location argument.
19814 (Expression.Warning): Added overloaded version which takes an
19815 `int level' argument.
19816 (Expression.Error118): Make this non-static and removed the
19817 expression and location arguments.
19818 (TypeExpr): Added location argument to the constructor.
19820 * expression.cs (StaticCallExpr): Added location argument to
19822 (Indirection, PointerArithmetic): Likewise.
19823 (CheckedExpr, UnCheckedExpr): Likewise.
19824 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
19825 (StringPtr): Likewise.
19828 2002-08-05 Martin Baulig <martin@gnome.org>
19830 * expression.cs (BaseAccess.DoResolve): Actually report errors.
19832 * assign.cs (Assign.DoResolve): Check whether the source
19833 expression is a value or variable.
19835 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
19836 while resolving the corresponding blocks.
19838 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
19839 an error, don't silently return null.
19841 * statement.cs (Block.AddVariable): Do the error reporting here
19842 and distinguish between CS0128 and CS0136.
19843 (Block.DoResolve): Report all unused labels (warning CS0164).
19844 (LabeledStatement): Pass the location to the constructor.
19845 (LabeledStatement.HasBeenReferenced): New property.
19846 (LabeledStatement.Resolve): Set it to true here.
19848 * statement.cs (Return.Emit): Return success even after reporting
19849 a type mismatch error (CS0126 or CS0127), this is what csc does and
19850 it avoids confusing the users with any consecutive errors.
19852 2002-08-05 Martin Baulig <martin@gnome.org>
19854 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
19856 * const.cs (Const.LookupConstantValue): Catch circular definitions.
19858 * expression.cs (MemberAccess.DoResolve): Silently return if an
19859 error has already been reported.
19861 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
19862 error has already been reported.
19864 2002-08-05 Martin Baulig <martin@gnome.org>
19866 * statement.cs (UsageVector): Only initialize the `parameters'
19867 vector if we actually have any "out" parameters.
19869 2002-08-05 Martin Baulig <martin@gnome.org>
19871 * expression.cs (Binary.ResolveOperator): When combining delegates,
19872 they must have the same type.
19874 2002-08-05 Martin Baulig <martin@gnome.org>
19876 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
19877 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
19878 work with the ms runtime and we also don't need it: if we're a
19879 PropertyBuilder and not in the `indexer_arguments' hash, then we
19880 are a property and not an indexer.
19882 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
19883 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
19884 since the latter one doesn't work with the ms runtime.
19886 2002-08-03 Martin Baulig <martin@gnome.org>
19888 Fixed bugs #27998 and #22735.
19890 * class.cs (Method.IsOperator): New public field.
19891 (Method.CheckBase): Report CS0111 if there's already a method
19892 with the same parameters in the current class. Report CS0508 when
19893 attempting to change the return type of an inherited method.
19894 (MethodData.Emit): Report CS0179 if a method doesn't have a body
19895 and it's not marked abstract or extern.
19896 (PropertyBase): New abstract base class for Property and Indexer.
19897 (PropertyBase.CheckBase): Moved here from Property and made it work
19899 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
19900 the same so we can reuse it there.
19901 (Property, Indexer): Derive from PropertyBase.
19902 (MethodSignature.inheritable_property_signature_filter): New delegate
19903 to find properties and indexers.
19905 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
19906 argument and improved error reporting.
19908 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
19909 EmptyReadOnlyParameters and made it a property.
19911 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
19912 version of this method which takes a `PropertyInfo indexer'.
19913 (TypeManager.RegisterIndexer): New method.
19915 * class.cs: Added myself as author of this file :-)
19917 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19919 * class.cs: fixed compilation on windoze.
19921 2002-08-03 Martin Baulig <martin@gnome.org>
19923 * interface.cs (Interface.GetInterfaceBases): Check whether all
19924 base interfaces are at least as accessible than the current one.
19926 * class.cs (TypeContainer.GetClassBases): Check whether base types
19927 are at least as accessible than the current type.
19928 (TypeContainer.AsAccessible): Implemented and made non-static.
19929 (MemberBase.CheckParameters): Report errors if the accessibility
19932 * delegate.cs (Delegate.Delegate): The default visibility is
19933 internal for top-level types and private for nested types.
19934 (Delegate.Define): Report errors if the accessibility checks fail.
19936 * enum.cs (Enum.Enum): The default visibility is internal for
19937 top-level types and private for nested types.
19938 (Enum.DefineType): Compute the correct visibility.
19940 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
19941 function which takes a `bool is_toplevel' instead of a TypeContainer.
19943 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
19946 2002-08-02 Martin Baulig <martin@gnome.org>
19948 * expression.cs (LocalVariableReferenc): Added constructor which
19949 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
19950 (LocalVariableReference.IsReadOnly): New property.
19951 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
19952 variable is readonly, use our own readonly flag to do this; you can
19953 use the new constructor to get a writable reference to a read-only
19956 * cs-parser.jay (foreach_statement, using_statement): Get a writable
19957 reference to the local variable.
19959 2002-08-01 Miguel de Icaza <miguel@ximian.com>
19961 * rootcontext.cs (ResolveCore): Also include System.Exception
19963 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
19964 we reach an EmptyStatement.
19966 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
19969 * expression.cs (Binary.ResolveOperator): Check error result in
19972 use brtrue/brfalse directly and avoid compares to null.
19974 2002-08-02 Martin Baulig <martin@gnome.org>
19976 * class.cs (TypeContainer.Define): Define all nested interfaces here.
19977 Fixes bug #28407, added test-155.cs.
19979 2002-08-01 Martin Baulig <martin@gnome.org>
19981 * class.cs (Event.EmitDefaultMethod): Make this work with static
19982 events. Fixes #28311, added verify-3.cs.
19984 2002-08-01 Martin Baulig <martin@gnome.org>
19986 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
19987 `is_disposable' fields.
19988 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
19989 `hm.is_disposable' if we're using the collection pattern.
19990 (Foreach.EmitCollectionForeach): Use the correct type for the
19991 enumerator's local variable, only emit the try/finally block if
19992 necessary (fixes #27713).
19994 2002-08-01 Martin Baulig <martin@gnome.org>
19996 * ecore.cs (Expression.report118): Renamed to Error118 and made
19999 * statement.cs (Throw.Resolve): Check whether the expression is of
20000 the correct type (CS0118) and whether the type derives from
20001 System.Exception (CS0155).
20002 (Catch.Resolve): New method. Do the type lookup here and check
20003 whether it derives from System.Exception (CS0155).
20004 (Catch.CatchType, Catch.IsGeneral): New public properties.
20006 * typemanager.cs (TypeManager.exception_type): Added.
20008 2002-07-31 Miguel de Icaza <miguel@ximian.com>
20010 * driver.cs: Updated About function.
20012 2002-07-31 Martin Baulig <martin@gnome.org>
20014 Implemented Control Flow Analysis.
20016 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
20017 (EmitContext.CurrentBranching): Added.
20018 (EmitContext.StartFlowBranching): Added.
20019 (EmitContext.EndFlowBranching): Added.
20020 (EmitContext.KillFlowBranching): Added.
20021 (EmitContext.IsVariableAssigned): Added.
20022 (EmitContext.SetVariableAssigned): Added.
20023 (EmitContext.IsParameterAssigned): Added.
20024 (EmitContext.SetParameterAssigned): Added.
20025 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
20026 Added control flow analysis stuff here.
20028 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
20029 resolve the expression as lvalue.
20030 (LocalVariableReference.DoResolve): Check whether the variable has
20031 already been assigned.
20032 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
20033 the parameter as assigned here.
20034 (ParameterReference.DoResolve): Check whether the parameter has already
20036 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
20037 expression as lvalue.
20039 * statement.cs (FlowBranching): New class for the flow analysis code.
20040 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
20041 (LabeledStatement.IsDefined): New public property.
20042 (LabeledStatement.AddUsageVector): New public method to tell flow
20043 analyis that the label may be reached via a forward jump.
20044 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
20046 (VariableInfo.Number): New public field. This is used by flow analysis
20047 to number all locals of a block.
20048 (Block.CountVariables): New public property. This is the number of
20049 local variables in this block (including the locals from all parent
20051 (Block.EmitMeta): Number all the variables.
20053 * statement.cs: Added flow analysis support to all classes.
20055 2002-07-31 Martin Baulig <martin@gnome.org>
20057 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
20058 To get debugging messages, compile mcs with /define:MCS_DEBUG and
20059 then use this argument.
20061 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
20063 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
20064 use this to specify /define options.
20066 2002-07-29 Martin Baulig <martin@gnome.org>
20068 * statement.cs (Fixed): Moved all code that does variable lookups
20069 and resolvings from Emit to Resolve.
20071 * statement.cs (For): Moved all code that does variable lookups
20072 and resolvings from Emit to Resolve.
20074 * statement.cs (Using): Moved all code that does variable lookups
20075 and resolvings from Emit to Resolve.
20077 2002-07-29 Martin Baulig <martin@gnome.org>
20079 * attribute.cs (Attribute.Resolve): Explicitly catch a
20080 System.NullReferenceException when creating the
20081 CustromAttributeBuilder and report a different warning message.
20083 2002-07-29 Martin Baulig <martin@gnome.org>
20085 * support.cs (ParameterData.ParameterName): Added method to
20086 get the name of a parameter.
20088 * typemanager.cs (TypeManager.IsValueType): New public method.
20090 2002-07-29 Martin Baulig <martin@gnome.org>
20092 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
20093 is a flag which specifies that it's either ref or out.
20094 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
20095 the out parameter to `out Parameter.Modifier mod', also set the
20096 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
20098 * support.cs (InternalParameters.ParameterModifier): Distinguish
20099 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20100 Parameter.Modifier.ISBYREF flag if it's either ref or out.
20102 * expression.cs (Argument.GetParameterModifier): Distinguish
20103 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20104 Parameter.Modifier.ISBYREF flag if it's either ref or out.
20106 2002-07-29 Martin Baulig <martin@gnome.org>
20108 * expression.cs (ParameterReference.ParameterReference): Added
20109 `Location loc' argument to the constructor.
20111 * cs-parser.jay: Pass location to ParameterReference.
20113 2002-07-28 Miguel de Icaza <miguel@ximian.com>
20115 * statement.cs (Try): Initialize the location.
20117 * cs-parser.jay: pass location to Try.
20119 * expression.cs (Unary.Reduce): Change the prototype to return
20120 whether a constant fold could be performed or not. The result is
20121 returned in an out parameters. In the case of Indirection and
20122 AddressOf, we want to perform the full tests.
20124 2002-07-26 Miguel de Icaza <miguel@ximian.com>
20126 * statement.cs (Statement.Emit): Flag dead code.
20128 2002-07-27 Andrew Birkett <andy@nobugs.org>
20130 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
20132 2002-07-27 Martin Baulig <martin@gnome.org>
20134 * class.cs (MethodData.Define): Put back call to
20135 TypeManager.AddMethod(), accidentally commented this out.
20137 * report.cs (Debug): New public method to print debugging information,
20138 this is `[Conditional ("DEBUG")]'.
20140 2002-07-26 Martin Baulig <martin@gnome.org>
20142 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
20143 (switch_statement): Push the current_block to the switch_stack and
20144 pop it again when we're done with the switch.
20145 (switch_section): The new block is a child of the current_block.
20146 Fixes bug #24007, added test-152.cs.
20148 2002-07-27 Martin Baulig <martin@gnome.org>
20150 * expression.cs (Invocation.EmitArguments): When calling a varargs
20151 function with only its fixed arguments, we need to pass an empty
20154 2002-07-27 Martin Baulig <martin@gnome.org>
20156 Mono 0.13 has been released.
20158 2002-07-25 Miguel de Icaza <miguel@ximian.com>
20160 * driver.cs: Rename --resource to --linkres, because that is what
20161 we do currently, we dont support --resource yet.
20163 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
20165 2002-07-25 Martin Baulig <martin@gnome.org>
20167 * class.cs (MethodData): New public class. This is a `method builder'
20168 class for a method or one accessor of a Property/Indexer/Event.
20169 (MethodData.GetMethodFlags): Moved here from MemberBase.
20170 (MethodData.ApplyAttributes): Likewise.
20171 (MethodData.ApplyObsoleteAttribute): Likewise.
20172 (MethodData.ApplyConditionalAttribute): Likewise.
20173 (MethodData.ApplyDllImportAttribute): Likewise.
20174 (MethodData.CheckAbstractAndExternal): Likewise.
20175 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
20176 (MethodData.Emit): Formerly known as Method.Emit().
20177 (MemberBase): Moved everything which was specific to a single
20178 accessor/method to MethodData.
20179 (Method): Create a new MethodData and call Define() and Emit() on it.
20180 (Property, Indexer, Event): Create a new MethodData objects for each
20181 accessor and call Define() and Emit() on them.
20183 2002-07-25 Martin Baulig <martin@gnome.org>
20185 Made MethodCore derive from MemberBase to reuse the code from there.
20186 MemberBase now also checks for attributes.
20188 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
20189 (MemberBase.GetMethodFlags): Moved here from class Method and marked
20191 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
20192 `CallingConventions cc' and `Attributes opt_attrs' arguments.
20193 (MemberBase.ApplyAttributes): New virtual method; applies the
20194 attributes to a method or accessor.
20195 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
20196 (MemberBase.ApplyConditionalAttribute): Likewise.
20197 (MemberBase.ApplyDllImportAttribute): Likewise.
20198 (MemberBase.CheckAbstractAndExternal): Likewise.
20199 (MethodCore.ParameterTypes): This is now a property instead of a
20200 method, it's initialized from DoDefineParameters().
20201 (MethodCore.ParameterInfo): Removed the set accessor.
20202 (MethodCore.DoDefineParameters): New protected virtual method to
20203 initialize ParameterTypes and ParameterInfo.
20204 (Method.GetReturnType): We can now simply return the MemberType.
20205 (Method.GetMethodFlags): Override the MemberBase version and add
20206 the conditional flags.
20207 (Method.CheckBase): Moved some code from Define() here, call
20208 DoDefineParameters() here.
20209 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
20210 here to avoid some larger code duplication.
20211 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
20212 ensure that abstract and external accessors don't declare a body.
20214 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
20215 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
20216 lookup in the attribute's parent classes, so we need to abort as soon
20217 as we found the first match.
20218 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
20219 the attribute has no arguments.
20221 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
20224 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20226 * cs-parser.jay: reverted previous patch.
20228 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20230 * cs-parser.jay: fixed bug #22119.
20232 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20234 * attribute.cs: fixed compilation. The error was:
20235 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
20236 be assigned to before control leaves the current method."
20237 [FIXME: Filed as bug #28186: MCS must report this error.]
20239 2002-07-25 Martin Baulig <martin@gnome.org>
20241 * attribute.cs (Attribute.Conditional_GetConditionName): New static
20242 method to pull the condition name ouf of a Conditional attribute.
20243 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
20244 the obsolete message and error flag out of an Obsolete attribute.
20246 * class.cs (Method.GetMethodFlags): New public method to get the
20247 TypeManager.MethodFlags for this method.
20248 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
20250 (Method.Define): Get and apply the Obsolete and Conditional attributes;
20251 if we're overriding a virtual function, set the new private variable
20252 `parent_method'; call the new TypeManager.AddMethod().
20254 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
20255 the MethodBuilder and the Method in a PtrHashtable.
20256 (TypeManager.builder_to_method): Added for this purpose.
20257 (TypeManager.MethodFlags): Added IsObsoleteError.
20258 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
20259 Obsolete and Conditional arguments in MethodBuilders. If we discover
20260 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
20261 the message from the attribute.
20263 2002-07-24 Martin Baulig <martin@gnome.org>
20265 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
20266 preprocessor directives, ensure that the argument to #define/#undef is
20267 exactly one identifier and that it's actually an identifier.
20269 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
20272 2002-07-24 Martin Baulig <martin@gnome.org>
20274 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
20275 initialize it to TypeManager.object_type in the constructor.
20276 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
20277 of the `hm.get_current' method if we're using the collection pattern.
20278 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
20279 for the explicit conversion to make it work when we're using the collection
20280 pattern and the `Current' property has a different return type than `object'.
20283 2002-07-24 Martin Baulig <martin@gnome.org>
20285 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
20286 does not match, but don't report any errors. This method is called in
20287 order for all methods in a MethodGroupExpr until a matching method is
20288 found, so we don't want to bail out if the first method doesn't match.
20289 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
20290 matches, report the 123. Fixes #28070.
20292 2002-07-24 Martin Baulig <martin@gnome.org>
20294 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
20295 TypeManager.TypeToCoreType() to the top of the method so the
20296 following equality checks will work. Fixes #28107.
20298 2002-07-24 Martin Baulig <martin@gnome.org>
20300 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
20301 operand is of type uint, and the other operand is of type sbyte,
20302 short or int, the operands are converted to type long." -
20303 Actually do what this comment already told us. Fixes bug #28106,
20306 2002-07-24 Martin Baulig <martin@gnome.org>
20308 * class.cs (MethodBase): New abstract class. This is now a base
20309 class for Property, Indexer and Event to avoid some code duplication
20310 in their Define() and DefineMethods() methods.
20311 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
20312 generic methods for Define() and DefineMethods().
20313 (FieldBase): Derive from MemberBase, not MemberCore.
20314 (Property): Derive from MemberBase, not MemberCore.
20315 (Property.DefineMethod): Moved all the code from this method to the
20316 new MethodBase.DefineAccessor(), just call it with appropriate
20318 (Property.Define): Call the new Property.DoDefine(), this does some
20319 sanity checks and we don't need to duplicate the code everywhere.
20320 (Event): Derive from MemberBase, not MemberCore.
20321 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
20322 accessors, this will also make them work with interface events.
20323 (Indexer): Derive from MemberBase, not MemberCore.
20324 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
20325 (Indexer.Define): Use the new MethodBase functions.
20327 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
20328 argument to the constructor.
20329 (Interface.FindMembers): Added support for interface events.
20330 (Interface.PopluateEvent): Implemented.
20332 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
20334 2002-07-22 Miguel de Icaza <miguel@ximian.com>
20336 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
20337 but this is required to check for a method name being the same as
20338 the containing class.
20342 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20344 * interface.cs: initialize variable.
20346 2002-07-23 Martin Baulig <martin@gnome.org>
20348 Implemented the IndexerName attribute in interfaces.
20350 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
20351 name if this is an explicit interface implementation.
20352 (Indexer.InterfaceIndexerName): New public variable. If we're
20353 implementing an interface indexer, this is the IndexerName in that
20354 interface. Otherwise, it's the IndexerName.
20355 (Indexer.DefineMethod): If we're implementing interface indexer,
20356 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
20357 and Pending.ImplementIndexer methods.
20358 (Indexer.Define): Also define the PropertyBuilder if we're
20359 implementing an interface indexer and this is neither an explicit
20360 interface implementation nor do the IndexerName match the one in
20363 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
20364 If a method is defined here, then we always need to create a proxy
20365 for it. This is used when implementing interface indexers.
20366 (Pending.IsInterfaceIndexer): New public method.
20367 (Pending.ImplementIndexer): New public method.
20368 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
20369 This is used when implementing interface indexers to define a proxy
20371 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
20372 define a proxy if necessary.
20374 * interface.cs (Interface.IndexerName): New public variable.
20375 (Interface.PopulateIndexer): Set the IndexerName.
20376 (Interface.DefineIndexers): New private method. Populate all the
20377 indexers and make sure their IndexerNames match.
20379 * typemanager.cs (IndexerPropertyName): Added support for interface
20382 2002-07-22 Martin Baulig <martin@gnome.org>
20384 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
20385 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
20386 ret if HasReturnLabel.
20387 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
20390 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
20391 and set the ec.LoopBeginTryCatchLevel.
20392 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
20393 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
20394 the current ec.TryCatchLevel, the branch goes out of an exception
20395 block. In this case, we need to use Leave and not Br.
20397 2002-07-22 Martin Baulig <martin@gnome.org>
20399 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
20400 block unless the block does not always return or it is contained in
20401 another try { ... } catch { ... } block. Fixes bug #26506.
20402 Added verify-1.cs to the test suite.
20404 2002-07-22 Martin Baulig <martin@gnome.org>
20406 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
20407 then we do not always return. Fixes bug #24985.
20409 2002-07-22 Martin Baulig <martin@gnome.org>
20411 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
20412 lookup on a per-class level; ie. walk up the class hierarchy until we
20413 found at least one applicable method, then choose the best among them.
20414 Fixes bug #24463 and test-29.cs.
20416 2002-07-22 Martin Baulig <martin@gnome.org>
20418 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
20419 return types of the methods. The return type is not part of the
20420 signature and we must not check it to make the `new' modifier work.
20421 Fixes bug #27999, also added test-147.cs.
20422 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
20424 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
20425 on the method's return type.
20427 2002-07-21 Martin Baulig <martin@gnome.org>
20429 * assign.cs: Make this work if the rightmost source is a constant and
20430 we need to do an implicit type conversion. Also adding a few more tests
20431 to test-38.cs which should have caught this.
20433 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
20434 target in the makefile for this. The makefile.gnu is primarily intended
20435 for end-users who don't want to debug the compiler.
20437 2002-07-21 Martin Baulig <martin@gnome.org>
20439 * assign.cs: Improved the Assign class so it can now handle embedded
20440 assignments (X = Y = Z = something). As a side-effect this'll now also
20441 consume less local variables. test-38.cs now passes with MCS, added
20442 a few new test cases to that test.
20444 2002-07-20 Martin Baulig <martin@gnome.org>
20446 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
20447 instructions. Fixes bug #27977, also added test-146.cs.
20449 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20451 * cs-tokenizer.cs: fixed getHex ().
20453 2002-07-19 Martin Baulig <martin@gnome.org>
20455 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
20456 not Type.GetType() to lookup the array type. This is needed when
20457 we're constructing an array of a user-defined type.
20458 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
20459 single-dimensional arrays, but also for single-dimensial arrays of
20462 2002-07-19 Martin Baulig <martin@gnome.org>
20464 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
20465 this function is called, it's not allowed to share LocalBuilders
20466 among ILGenerators.
20468 2002-07-19 Martin Baulig <martin@gnome.org>
20470 * expression.cs (Argument.Resolve): Report an error 118 when trying
20471 to pass a type as argument.
20473 2002-07-18 Martin Baulig <martin@gnome.org>
20475 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
20476 Conv_R_Un for the signed `long' type.
20478 2002-07-15 Miguel de Icaza <miguel@ximian.com>
20480 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
20481 `expr' for the temporary result, as that will fail if we do
20482 multiple resolves on the same expression.
20484 2002-07-05 Miguel de Icaza <miguel@ximian.com>
20486 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
20487 ec.TypeContainer for looking up aliases.
20489 * class.cs (TypeContainer): Remove LookupAlias from here.
20491 * decl.cs (DeclSpace); Move here.
20493 2002-07-01 Miguel de Icaza <miguel@ximian.com>
20495 * class.cs (FindMembers): Only call filter if the constructor
20496 bulider is not null.
20498 Also handle delegates in `NestedTypes' now. Now we will perform
20499 type lookups using the standard resolution process. This also
20502 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
20503 This uses Expressions (the limited kind that can be parsed by the
20504 tree) instead of strings.
20506 * expression.cs (ComposedCast.ToString): Implement, used to flag
20507 errors since now we have to render expressions.
20509 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
20512 * ecore.cs (SimpleName.ToString): ditto.
20514 * cs-parser.jay: Instead of using strings to assemble types, use
20515 Expressions to assemble the type (using SimpleName, ComposedCast,
20516 MemberAccess). This should fix the type lookups in declarations,
20517 because we were using a different code path for this.
20519 * statement.cs (Block.Resolve): Continue processing statements
20520 even when there is an error.
20522 2002-07-17 Miguel de Icaza <miguel@ximian.com>
20524 * class.cs (Event.Define): Also remove the `remove' method from
20525 the list of pending items.
20527 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
20528 generate more compact code.
20530 2002-07-17 Martin Baulig <martin@gnome.org>
20532 * const.cs (Const.LookupConstantValue): Add support for constant
20533 `unchecked' and `checked' expressions.
20534 Also adding test case test-140.cs for this.
20536 2002-07-17 Martin Baulig <martin@gnome.org>
20538 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
20539 check whether mi.ReturnType implements the IEnumerator interface; the
20540 `==' and the IsAssignableFrom() will fail in this situation.
20542 2002-07-16 Ravi Pratap <ravi@ximian.com>
20544 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
20547 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20549 * expression.cs: fixed bug #27811.
20551 2002-07-14 Miguel de Icaza <miguel@ximian.com>
20553 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
20554 Molaro: when we are a ref, the value already contains a pointer
20555 value, do not take the address of it.
20557 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
20558 * removed mb-parser.jay and mb-tokenizer.cs
20560 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20562 * expression.cs: check against the building corlib void type.
20564 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
20566 * ecore.cs: fix for valuetype static readonly fields: when
20567 initializing them, we need their address, not the address of a copy.
20569 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
20571 * typemanager.cs: register also enum_type in corlib.
20573 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20575 * class.cs: allow calling this (but not base) initializers in structs.
20577 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
20579 * ecore.cs: make sure we compare against the building base types
20582 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
20584 * typemanager.cs: fix TypeToCoreType() to handle void and object
20585 (corlib gets no more typerefs after this change).
20587 2002-07-12 Miguel de Icaza <miguel@ximian.com>
20589 * expression.cs (ArrayCreation.EmitArrayArguments): use
20590 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
20592 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
20593 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
20594 array indexes, the runtime actually forbids them.
20596 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
20597 for array arguments here.
20599 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
20600 instead of the default for ValueTypes.
20602 (New.DoEmit): Use IsValueType instead of
20603 IsSubclassOf (value_type)
20604 (New.DoResolve): ditto.
20605 (Invocation.EmitCall): ditto.
20607 * assign.cs (Assign): ditto.
20609 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
20610 Statements *are* currently doing part of their resolution during
20613 Expressions do always resolve during resolve, but statements are
20614 only required to propagate resolution to their children.
20616 2002-07-11 Miguel de Icaza <miguel@ximian.com>
20618 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
20620 (LoadAssembly): Do not add the dll if it is already specified
20622 (MainDriver): Add the System directory to the link path at the end,
20623 after all the other -L arguments.
20625 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
20626 wrong opcode for loading bytes and bools (ldelem.i1 instead of
20627 ldelem.u1) and using the opposite for sbytes.
20629 This fixes Digger, and we can finally run it.
20631 * driver.cs (UnixParseOption): Move the option parsing here.
20632 (CSCParseOption): Implement CSC-like parsing of options.
20634 We now support both modes of operation, the old Unix way, and the
20635 new CSC-like way. This should help those who wanted to make cross
20636 platform makefiles.
20638 The only thing broken is that /r:, /reference: and /lib: are not
20639 implemented, because I want to make those have the same semantics
20640 as the CSC compiler has, and kill once and for all the confussion
20641 around this. Will be doing this tomorrow.
20643 * statement.cs (Unsafe.Resolve): The state is checked during
20644 resolve, not emit, so we have to set the flags for IsUnsfe here.
20646 2002-07-10 Miguel de Icaza <miguel@ximian.com>
20648 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
20649 not catch the Error_ObjectRefRequired in SimpleName (as it is
20650 possible to have a class/instance variable name that later gets
20651 deambiguated), we have to check this here.
20653 2002-07-10 Ravi Pratap <ravi@ximian.com>
20655 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
20656 make static and put into Expression.
20658 (Event.Define): Register the private field of the event with the
20659 TypeManager so that GetFieldFromEvent can get at it.
20661 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
20662 keep track of the private field associated with an event which
20665 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
20668 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
20670 2002-07-10 Miguel de Icaza <miguel@ximian.com>
20672 * expression.cs (Binary.EmitBranchable): this routine emits the
20673 Binary expression in a branchable context. This basically means:
20674 we need to branch somewhere, not just get the value on the stack.
20676 This works together with Statement.EmitBoolExpression.
20678 * statement.cs (Statement.EmitBoolExpression): Use
20681 2002-07-09 Miguel de Icaza <miguel@ximian.com>
20683 * statement.cs (For): Reduce the number of jumps in loops.
20685 (For): Implement loop inversion for the For statement.
20687 (Break): We can be breaking out of a Try/Catch controlled section
20688 (foreach might have an implicit try/catch clause), so we need to
20689 use Leave instead of Br.
20691 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
20692 now). If the instace expression supports IMemoryLocation, we use
20693 the AddressOf method from the IMemoryLocation to extract the
20694 address instead of emitting the instance.
20696 This showed up with `This', as we were emitting the instance
20697 always (Emit) instead of the Address of This. Particularly
20698 interesting when This is a value type, as we dont want the Emit
20699 effect (which was to load the object).
20701 2002-07-08 Miguel de Icaza <miguel@ximian.com>
20703 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
20705 * statement.cs (Checked): Set the CheckedState during the resolve
20706 process too, as the ConvCast operations track the checked state on
20707 the resolve process, and not emit.
20709 * cs-parser.jay (namespace_member_declaration): Flag that we have
20710 found a declaration when we do. This is used to flag error 1529
20712 * driver.cs: Report ok when we display the help only.
20714 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
20716 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
20718 2002-07-04 Miguel de Icaza <miguel@ximian.com>
20720 * cs-tokenizer.cs (define): We also have to track locally the
20721 defines. AllDefines is just used for the Conditional Attribute,
20722 but we also need the local defines for the current source code.
20724 2002-07-03 Miguel de Icaza <miguel@ximian.com>
20726 * statement.cs (While, For, Do): These loops can exit through a
20727 Break statement, use this information to tell whether the
20728 statement is the last piece of code.
20730 (Break): Flag that we break.
20732 * codegen.cs (EmitContexts): New `Breaks' state variable.
20734 2002-07-03 Martin Baulig <martin@gnome.org>
20736 * class.cs (TypeContainer.MethodModifiersValid): Allow override
20737 modifiers in method declarations in structs. Otherwise, you won't
20738 be able to override things like Object.Equals().
20740 2002-07-02 Miguel de Icaza <miguel@ximian.com>
20742 * class.cs (Method, Property, Indexer): Do not allow the public
20743 modifier to be used in explicit interface implementations.
20745 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
20746 override modifiers in method declarations in structs
20748 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
20750 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
20751 integer or real overflow, report an error
20753 2002-07-02 Martin Baulig <martin@gnome.org>
20755 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
20756 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
20757 to tell the runtime about our newly created System.Object and
20758 System.ValueType types.
20760 2002-07-02 Miguel de Icaza <miguel@ximian.com>
20762 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
20763 struct instead of Ldarg/Starg.
20765 2002-07-02 Martin Baulig <martin@gnome.org>
20767 * expression.cs (Indirection.Indirection): Call
20768 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
20770 2002-07-02 Martin Baulig <martin@gnome.org>
20772 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
20773 ValueType, call TypeManager.TypeToCoreType() on it.
20774 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
20775 the OpCodes.Newarr argument.
20777 2002-07-02 Martin Baulig <martin@gnome.org>
20779 * expression.cs (Invocation.EmitCall): When compiling corlib,
20780 replace all calls to the system's System.Array type to calls to
20781 the newly created one.
20783 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
20784 System.Array methods.
20785 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
20786 from the system's System.Array type which must be replaced.
20788 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
20790 * typemanager.cs: load unverifiable_code_ctor so we can build
20791 corlib using the correct type. Avoid using GetTypeCode() with
20793 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
20794 TypeManager.object_type to allow building corlib.
20796 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
20798 * ecore.cs: handle System.Enum separately in LoadFromPtr().
20800 2002-07-01 Martin Baulig <martin@gnome.org>
20802 * class.cs: Make the last change actually work, we need to check
20803 whether `ifaces != null' to avoid a crash.
20805 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20807 * class.cs: when we build structs without fields that implement
20808 interfaces, we need to add the interfaces separately, since there is
20809 no API to both set the size and add the interfaces at type creation
20812 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20814 * expression.cs: the dimension arguments to the array constructors
20815 need to be converted if they are a long.
20817 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
20819 * class.cs: don't emit ldarg.0 if there is no parent constructor
20820 (fixes showstopper for corlib).
20822 2002-06-29 Martin Baulig <martin@gnome.org>
20824 MCS now compiles corlib on GNU/Linux :-)
20826 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
20827 ie. check for MethodImplOptions.InternalCall.
20829 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
20830 and TypeManager.attribute_type are null, so we must explicitly check
20831 whether parent is not null to find out whether it's an attribute type.
20832 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
20833 and SetBuilder, not only if the property is neither abstract nor external.
20834 This is necessary to set the MethodImplOptions on the accessor methods.
20835 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
20836 SetBuilder, see Property.Emit().
20838 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
20839 populate "System.Object", "System.ValueType" and "System.Attribute" since
20840 they've already been populated from BootCorlib_PopulateCoreTypes().
20842 2002-06-29 Martin Baulig <martin@gnome.org>
20844 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
20845 is the NullLiteral, we also need to make sure that target_type is not
20848 2002-06-29 Martin Baulig <martin@gnome.org>
20850 * rootcontext.cs (RootContext.ResolveCore): We must initialize
20851 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
20852 before calling BootstrapCorlib_ResolveDelegate ().
20854 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20856 * statement.cs: fixed build-breaker. All tests passed ok.
20858 2002-06-27 Martin Baulig <martin@gnome.org>
20860 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
20861 for System.Decimal when compiling corlib.
20863 2002-06-27 Martin Baulig <martin@gnome.org>
20865 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
20866 switch blocks which contain nothing but a default clause.
20868 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
20870 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
20872 2002-06-27 Martin Baulig <martin@gnome.org>
20874 * ecore.cs (PropertyExpr.PropertyExpr): Call
20875 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
20877 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
20878 is already a TypeBuilder.
20880 2002-06-27 Martin Baulig <martin@gnome.org>
20882 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
20883 `target_type == TypeManager.array_type', not IsAssignableFrom() in
20884 the "from an array-type to System.Array" case. This makes it work
20885 when compiling corlib.
20887 2002-06-27 Martin Baulig <martin@gnome.org>
20889 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
20890 non-static PropertyExpr, set its InstanceExpression. This makes
20891 the `ICollection.Count' property work in System/Array.cs.
20893 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
20895 * driver.cs: Made error handling more consistent. Errors now
20896 tracked by Report class, so many methods which used to return int
20897 now return void. Main() now prints success/failure and
20898 errors/warnings message.
20900 Renamed '--probe' compiler argument to '--expect-error'. Removed
20901 the magic number return values (123 and 124). Now, if the
20902 expected error occurs, the compiler exits with success (exit value
20903 0). If the compilation completes without seeing that particular
20904 error, the compiler exits with failure (exit value 1). The
20905 makefile in mcs/errors has been changed to handle the new behaviour.
20907 * report.cs: Made 'expected error' number a property and renamed
20908 it from 'Probe' to 'ExpectedError'.
20910 * genericparser.cs: Removed error handling support, since it is
20911 now all done by Report class.
20913 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
20914 class, so parse() no longer returns an int.
20916 * namespace.cs: Use Report.Error instead of GenericParser.error
20918 2002-06-22 Miguel de Icaza <miguel@ximian.com>
20920 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
20921 TypeContainer.AddOperator): At the front of the list put the
20922 explicit implementations, so they get resolved/defined first.
20924 2002-06-21 Miguel de Icaza <miguel@ximian.com>
20926 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
20927 interface type is implemented by this TypeContainer. Used during
20928 explicit interface implementation.
20930 (Property.Define, Indexer.Define, Method.Define): Validate that
20931 the given interface in the explicit implementation is one of the
20932 base classes for the containing type.
20934 Also if we are explicitly implementing an interface, but there is
20935 no match in the pending implementation table, report an error.
20937 (Property.Define): Only define the property if we are
20938 not explicitly implementing a property from an interface. Use the
20939 correct name also for those properties (the same CSC uses,
20940 although that is really not needed).
20942 (Property.Emit): Do not emit attributes for explicitly implemented
20943 properties, as there is no TypeBuilder.
20945 (Indexer.Emit): ditto.
20947 Hiding then means that we do not really *implement* a pending
20948 implementation, which makes code fail.
20950 2002-06-22 Martin Baulig <martin@gnome.org>
20952 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
20953 the return value of Object.GetType(). [FIXME: we need to do this whenever
20954 we get a type back from the reflection library].
20956 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
20958 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
20960 2002-06-20 Miguel de Icaza <miguel@ximian.com>
20962 * attribute.cs: Return null if we can not look up the type.
20964 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
20965 the interface types found.
20967 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
20968 interface types found.
20970 * typemanager.cs (GetInterfaces): Make this routine returns alll
20971 the interfaces and work around the lame differences between
20972 System.Type and System.Reflection.Emit.TypeBuilder in the results
20973 result for GetInterfaces.
20975 (ExpandInterfaces): Given an array of interface types, expand and
20976 eliminate repeated ocurrences of an interface. This expands in
20977 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
20980 2002-06-21 Martin Baulig <martin@gnome.org>
20982 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
20985 2002-06-21 Martin Baulig <martin@gnome.org>
20987 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
20988 and called with one of the core types, return the corresponding typebuilder for
20991 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
20994 2002-06-21 Martin Baulig <martin@gnome.org>
20996 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
20997 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
20998 (Expression.ConvertReferenceExplicit): Likewise.
21000 * expression.cs (ElementAccess.DoResolve): Likewise.
21001 (ElementAccess.DoResolveLValue): Likewise.
21003 2002-06-10 Martin Baulig <martin@gnome.org>
21005 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
21006 add the "value" parameter to the parameter list.
21008 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
21011 2002-06-19 Miguel de Icaza <miguel@ximian.com>
21013 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
21014 the argument to an int, uint, long or ulong, per the spec. Also
21015 catch negative constants in array creation.
21017 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
21019 * class.cs: do not allow the same interface to appear twice in
21020 the definition list.
21022 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
21024 * ecore.cs: don't use ldlen with System.Array.
21026 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
21028 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
21030 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
21032 * modifiers.cs: produce correct field attributes for protected
21033 internal. Easy fix so miguel can work on ther harder stuff:-)
21035 2002-06-18 Miguel de Icaza <miguel@ximian.com>
21037 * pending.cs: New file. Move the code from class.cs here.
21038 Support clearning the pending flag for all methods (when not doing
21039 explicit interface implementation).
21041 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
21043 * rootcontext.cs: added a couple more types needed to bootstrap.
21045 2002-06-17 Miguel de Icaza <miguel@ximian.com>
21047 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
21048 constructor in the type, instead of any constructor in the type
21049 hierarchy. Thanks to Paolo for finding this bug (it showed up as
21050 a bug in the Mono runtime when applying the params attribute).
21052 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
21053 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
21055 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
21057 * expression.cs (Unary.ResolveOperator): Use TypeManager
21058 to resolve the type.
21060 2002-06-13 Ravi Pratap <ravi@ximian.com>
21062 * cs-parser.jay (enum_member_declaration): Pass in the attributes
21065 * enum.cs (AddEnumMember): Add support to store the attributes associated
21066 with each member too.
21068 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
21069 field builders too - this takes care of the enum member case.
21071 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
21073 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
21074 address-of operator on both value types and pointers.
21076 2002-06-10 Martin Baulig <martin@gnome.org>
21078 * interface.cs (Interface.PopulateIndexer): Add the indexer's
21079 PropertyBuilder to the `property_builders' list.
21081 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
21082 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
21083 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
21084 find any indexers which are inherited from an interface.
21086 2002-06-09 Martin Baulig <martin@gnome.org>
21088 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
21089 the same type as the constant if necessary. There's also a test-130.cs
21092 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
21094 * typemanager.cs (TypeManager.ChangeType): Previously known as
21095 Enum.ChangeEnumType().
21097 2002-06-09 Martin Baulig <martin@gnome.org>
21099 * expression.cs (Cast.TryReduce): Added support for consts.
21101 2002-06-08 Ravi Pratap <ravi@ximian.com>
21103 * class.cs (Accessor): Hold attributes information so we can pass
21106 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
21107 Modify to pass in attributes attached to the methods.
21109 (add_accessor_declaration, remove_accessor_declaration): Ditto.
21111 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
21112 to handle the Accessor kind :-)
21114 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
21116 2002-06-08 Martin Baulig <martin@gnome.org>
21118 * expression.cs (Unary.TryReduceNegative): Added support for
21121 2002-06-08 Martin Baulig <martin@gnome.org>
21123 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
21124 name can't be found in the `defined_names' - the caller will do a
21125 MemberLookup in this case and thus find methods in System.Enum
21126 such as Enum.IsDefined().
21128 2002-06-08 Martin Baulig <martin@gnome.org>
21130 * enum.cs (Enum.ChangeEnumType): This is a custom version of
21131 Convert.ChangeType() which works with TypeBuilder created types.
21132 (Enum.LookupEnumValue, Enum.Define): Use it here.
21134 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
21135 `TypeBuilder.BaseType != null' check.
21136 (TypeContainer.FindMembers): Only lookup parent members if we
21137 actually have a parent.
21138 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
21139 (ConstructorInitializer.Resolve): Likewise.
21141 * interface.cs (Interface.FindMembers): Added
21142 `TypeBuilder.BaseType != null' check.
21144 * rootcontext.cs (RootContext.ResolveCore): Added
21145 "System.Runtime.CompilerServices.IndexerNameAttribute" to
21146 classes_second_stage.
21148 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
21149 debug_type and trace_type when compiling with --nostdlib.
21151 2002-06-07 Martin Baulig <martin@gnome.org>
21153 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
21154 (AddField): Set it to true when adding a non-static field.
21155 (DefineType): Use `have_nonstatic_fields' to find out whether we
21156 have non-static fields, not `Fields != null'.
21158 2002-06-02 Miguel de Icaza <miguel@ximian.com>
21160 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
21161 dereferencing a null on the static-field code path)
21163 2002-05-30 Martin Baulig <martin@gnome.org>
21165 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
21166 to take command line arguments. Use reflection to call the new
21167 custom `Initialize' function on the symbol writer and pass it the
21168 command line arguments.
21170 * driver.cs (--debug-args): New command line argument to pass command
21171 line arguments to the symbol writer.
21173 2002-05-28 Miguel de Icaza <miguel@ximian.com>
21175 * assign.cs (DoResolve): Forgot to do the implicit conversion to
21176 the target type for indexers and properties. Thanks to Joe for
21179 2002-05-27 Miguel de Icaza <miguel@ximian.com>
21181 * typemanager.cs (MethodFlags): returns the method flags
21182 (Obsolete/ShouldIgnore) that control warning emission and whether
21183 the invocation should be made, or ignored.
21185 * expression.cs (Invocation.Emit): Remove previous hack, we should
21186 not do this on matching a base type, we should do this based on an attribute
21188 Only emit calls to System.Diagnostics.Debug and
21189 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
21190 on the command line.
21192 * rootcontext.cs: Global settings for tracing and debugging.
21194 * cs-tokenizer.cs (define): New utility function to track
21195 defines. Set the global settings for TRACE and DEBUG if found.
21197 2002-05-25 Ravi Pratap <ravi@ximian.com>
21199 * interface.cs (Populate*): Pass in the TypeContainer as well as
21200 the DeclSpace as parameters so that we can create EmitContexts and
21201 then use that to apply attributes etc.
21203 (PopulateMethod, PopulateEvent, PopulateProperty)
21204 (PopulateIndexer): Apply attributes everywhere.
21206 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
21209 (ApplyAttributes): Update accordingly.
21211 We now apply interface attributes for all members too.
21213 2002-05-26 Miguel de Icaza <miguel@ximian.com>
21215 * class.cs (Indexer.Define); Correctly check if we are explicit
21216 implementation (instead of checking the Name for a ".", we
21217 directly look up if the InterfaceType was specified).
21219 Delay the creation of the PropertyBuilder.
21221 Only create the PropertyBuilder if we are not an explicit
21222 interface implementation. This means that explicit interface
21223 implementation members do not participate in regular function
21224 lookups, and hence fixes another major ambiguity problem in
21225 overload resolution (that was the visible effect).
21227 (DefineMethod): Return whether we are doing an interface
21230 * typemanager.cs: Temporary hack until we get attributes in
21231 interfaces (Ravi is working on that) and we get IndexerName
21232 support in interfaces.
21234 * interface.cs: Register the indexers as properties.
21236 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
21237 warning, I have verified that this is a bug in the .NET runtime
21238 (JavaScript suffers of the same problem).
21240 * typemanager.cs (MemberLookup): When looking up members for
21241 interfaces, the parent of an interface is the implicit
21242 System.Object (so we succeed in searches of Object methods in an
21243 interface method invocation. Example: IEnumerable x; x.ToString
21246 2002-05-25 Miguel de Icaza <miguel@ximian.com>
21248 * class.cs (Event): Events should also register if they do
21249 implement the methods that an interface requires.
21251 * typemanager.cs (MemberLookup); use the new GetInterfaces
21254 (GetInterfaces): The code used to lookup interfaces for a type is
21255 used in more than one place, factor it here.
21257 * driver.cs: Track the errors at the bottom of the file, we kept
21260 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
21261 instance if the method we are calling is static!
21263 2002-05-24 Miguel de Icaza <miguel@ximian.com>
21265 * attribute.cs (ApplyAttributes): Make this function filter out
21266 the IndexerName attribute (as that attribute in reality is never
21267 applied) and return the string constant for the IndexerName
21270 * class.cs (TypeContainer.Emit): Validate that all the indexers
21271 have the same IndexerName attribute, and if so, set the
21272 DefaultName attribute on the class.
21274 * typemanager.cs: The return value might contain other stuff (not
21275 only methods). For instance, consider a method with an "Item"
21276 property and an Item method.
21278 * class.cs: If there is a problem with the parameter types,
21281 2002-05-24 Ravi Pratap <ravi@ximian.com>
21283 * ecore.cs (ImplicitConversionExists): Wrapper function which also
21284 looks at user defined conversion after making a call to
21285 StandardConversionExists - we need this for overload resolution.
21287 * expression.cs : Update accordingly the various method calls.
21289 This fixes 2 bugs filed against implicit user defined conversions
21291 2002-05-22 Miguel de Icaza <miguel@ximian.com>
21293 * statement.cs: Track the result of the assignment.
21295 2002-05-21 Miguel de Icaza <miguel@ximian.com>
21297 * expression.cs (MemberAccess): Improved error reporting for
21298 inaccessible members.
21300 2002-05-22 Martin Baulig <martin@gnome.org>
21302 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
21303 itself with debugging support.
21305 2002-05-22 Martin Baulig <martin@gnome.org>
21307 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
21308 Removed, this isn't needed anymore.
21310 2002-05-20 Martin Baulig <martin@gnome.org>
21312 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
21313 be underlying type for an enum.
21315 2002-05-20 Miguel de Icaza <miguel@ximian.com>
21317 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
21318 that splits out the loading of just the core types.
21320 * rootcontext.cs (ResolveCore): Split the struct resolution in
21321 two, so we can load the enumeration underlying types before any
21324 * expression.cs (Is): Bandaid until we fix properly Switch (see
21325 bug #24985 for details).
21327 * typemanager.cs (ImplementsInterface): The hashtable will contain
21328 a null if there are no interfaces implemented.
21330 2002-05-18 Miguel de Icaza <miguel@ximian.com>
21332 * cs-parser.jay (indexer_declarator): It is fine to have array
21335 2002-05-17 Miguel de Icaza <miguel@ximian.com>
21337 * typemanager.cs: (RegisterBuilder): New function used to register
21338 TypeBuilders that implement interfaces. Since
21339 TypeBuilder.GetInterfaces (as usual) does not work with lame
21341 (AddUserType): register interfaces.
21343 (ImplementsInterface): Use the builder_to_ifaces hash if we are
21344 dealing with TypeBuilder. Also, arrays are showing up as
21345 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
21346 methods can not be invoked on them!
21348 * ecore.cs (ExplicitReferenceConversionExists): Made public.
21349 (ImplicitReferenceConversionExists): Split out from
21350 StandardConversionExists.
21352 * expression.cs (As): We were only implementing one of the three
21353 cases for the as operator. We now implement them all.
21354 (Is): Implement the various other cases for Is as well.
21356 * typemanager.cs (CACHE): New define used to control if we want or
21357 not the FindMembers cache. Seems to have a negative impact on
21358 performance currently
21360 (MemberLookup): Nested types have full acess to
21361 enclosing type members
21363 Remove code that coped with instance/static returns for events, we
21364 now catch this in RealFindMembers.
21366 (RealFindMembers): only perform static lookup if the instance
21367 lookup did not return a type or an event.
21369 2002-05-17 Miguel de Icaza <miguel@ximian.com>
21371 * assign.cs (CompoundAssign): We pass more semantic information
21372 now to Compound Assignments than we did before: now we have all
21373 the information at hand, and now we resolve the target *before* we
21374 do the expression expansion, which allows the "CacheValue" method
21375 to have the effect we intended (before, a [x] += 1 would generate
21376 two differen ArrayAccess expressions from the ElementAccess,
21377 during the resolution process).
21379 (CompoundAssign.DoResolve): Resolve target and original_source here.
21381 2002-05-16 Miguel de Icaza <miguel@ximian.com>
21383 * expression.cs (ArrayAccess): dropped debugging information.
21385 * typemanager.cs: Small bug fix: I was always returning i_members,
21386 instead of one of i_members or s_members (depending on which had
21389 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
21390 method is invoked before any code generation takes place, and it
21391 is a mechanism to inform that the expression will be invoked more
21392 than once, and that the method should use temporary values to
21393 avoid having side effects
21395 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
21397 * ecore.cs (Expression.CacheTemporaries): Provide empty default
21400 * expression.cs (Indirection, ArrayAccess): Add support for
21401 CacheTemporaries in these two bad boys.
21403 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
21404 ldobj or ldind_ref.
21405 (StoreFromPtr): Handle stobj as well.
21407 * expression.cs (UnaryMutator): Share more code.
21409 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
21410 down: I was not tracking the Filter function as well, which
21411 was affecting the results of the cache.
21413 2002-05-15 Miguel de Icaza <miguel@ximian.com>
21415 * attribute.cs: Remove the hack to handle the CharSet property on
21418 2002-05-14 Miguel de Icaza <miguel@ximian.com>
21420 * attribute.cs (DoResolve): More uglyness, we now only try to
21421 resolve the attribute partially, to extract the CharSet
21422 information (only if we are a StructLayout attribute). Otherwise
21424 (GetExtraTypeInfo): Add some code to conditionally kill in the
21425 future this. I am more and more convinced that the .NET
21426 framework has special code to handle the attribute setting on
21429 * expression.cs (IsParamsMethodApplicable): Revert my previous
21430 foreach change here, it was wrong.
21432 2002-05-13 Miguel de Icaza <miguel@ximian.com>
21434 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
21435 (pp_expr): do not abort on unknown input, just return.
21436 (eval): abort if there are pending chars.
21438 * attribute.cs (Attribute.Resolve): Positional parameters are
21439 optional. Deal with that case.
21441 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
21442 the Ansi/Unicode/Auto information for the type.
21444 (TypeContainer.DefineType): instantiate the EmitContext here, as
21445 we will be using it during the type definition (to resolve
21446 attributes) and during the emit phase.
21448 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
21449 to pull type information out of the attributes
21451 (Attribute.Resolve): track the constructor builder, and allow for
21452 multiple invocations (structs and classes will use this).
21454 * ecore.cs (MemberLookupFinal): new version with all the
21455 parameters customizable.
21457 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
21458 constructors. Return if the result value is null (as the error
21459 would have been flagged already by MemberLookupFinal)
21461 Do not allow instances of abstract classes or interfaces to be
21464 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
21465 We have to compare the assembly property here when dealing with
21466 FamANDAssem and Assembly access modifiers, because we might be
21467 creating an assembly from *modules* (that means that we are not
21468 getting TypeBuilders for types defined in other modules that are
21469 part of this assembly).
21471 (Method.Emit): If the method is marked abstract and has a body,
21474 (TypeContainer.DefineMembers): If both the defined member and the
21475 parent name match are methods, then do not emit any warnings: let
21476 the Method.Define routine take care of flagging warnings. But if
21477 there is a mismatch (method overrides something else, or method is
21478 overriwritten by something, then emit warning).
21480 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
21481 set to null, this means `do not check for the return type on the
21484 (Method.Define): set the return type for the method signature to
21485 null, so that we get methods with the same name and parameters and
21486 different return types. This is used to flag warning 114 (you are
21487 hiding a method, and you probably want to use the new/override
21490 * typemanager.cs (MemberLookup): Implemented proper access
21491 control, closing a long standing set of bug reports. The problem
21492 was that the Framework only has two bits: Public and NonPublic,
21493 and NonPublic includes private and protected methods, but we need
21494 to enforce the FamANDAssem, FamOrAssem and Family.
21496 2002-05-11 Miguel de Icaza <miguel@ximian.com>
21498 * statement.cs (GotoCase): Return true: Ammounts to giving up
21499 knowledge on whether we return or not, and letting the other case
21500 be responsible for it.
21502 2002-05-10 Miguel de Icaza <miguel@ximian.com>
21504 * driver.cs: Do not load directories for each file processed, only
21505 do it if there is a pattern.
21507 * ecore.cs: Report readonly assigns here as well, as we might have
21508 been resolved only by MemberAccess.
21510 (SimpleName.SimpleNameResolve): Also be useful for LValue
21511 resolution. We need this to propagate assign to local readonly variables
21513 * typemanager.cs: Use a ptrhashtable for the criteria, because we
21514 do not want to reuse potential criteria memory.
21516 * class.cs (MyEventBuilder): Set reflected_type;
21518 * ecore.cs (Constantify): Added support for constifying bools.
21520 (RootContext.LookupType): Added a cache for values looked up in
21521 the declaration space.
21523 * typemanager.cs (FindMembers): Now is a front-end to
21524 RealFindMembers, and provides a two-level hashtable-based cache to
21527 15% performance improvement: from 22.5 to 19.2 seconds.
21529 * expression.cs (IsParamsMethodApplicable): use foreach.
21530 (Invocation.DoResolve): ditto.
21531 (New.DoResolve): ditto.
21532 (ArrayCreation.DoResolve): ditto.
21534 * ecore.cs (FindMostEncompassingType): use foreach.
21536 * delegate.cs (NewDelegate.DoResolve): Use foreach
21538 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
21539 (RemoveMethods): use foreach.
21541 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
21542 nested foreach statements instead of for, and also break out of
21543 the inner loop once a match is found.
21545 (Invocation.OverloadResolve): Use foreach, simplify the code.
21547 2002-05-08 Miguel de Icaza <miguel@ximian.com>
21549 * cfold.cs (BinaryFold): During an enumeration evaluation context,
21550 we actually unwrap the expression to allow for extra information
21553 * expression.cs: Use Shr_Un on unsigned operations.
21555 2002-05-08 Ravi Pratap <ravi@ximian.com>
21557 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
21558 applicable operators was not being considered correctly. This closes
21559 the bug Miguel reported.
21561 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
21563 * attribute.cs: check that the type derives from System.Attribute
21564 and report the correct error in that case (moved the duplicate code to
21565 its own method, too).
21567 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
21569 * attribute.cs: lookup attribute type name as the spec says: first the
21570 bare attribute name and then name + "Attribute" (nant compiles with
21571 mcs after this fix).
21573 2002-05-07 Miguel de Icaza <miguel@ximian.com>
21575 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
21576 Because of the way we parse things, we should try to see if a
21577 UIntConstant can fit in an integer.
21579 2002-05-07 Ravi Pratap <ravi@ximian.com>
21581 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
21582 when we are in an explicit context.
21584 (ConvertReferenceExplicit): When converting from Iface type S to Class
21585 T make sure the rules are implemented as an OR.
21587 * parameter.cs (ParameterType): Make it a property for now although the
21588 purpose really isn't anything immediate.
21590 * expression.cs (Is*Applicable): Do better checking on the parameter type
21591 of a ref/out parameter. The ones from the system assemblies are already
21592 marked with the correct type so we don't need to do any correction.
21594 * ecore.cs (StandardConversionExists): Conversion from Interface types to
21595 the object type is standard too so include that.
21597 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21599 * ecore.cs (StandardConversionExists): Augment with missing code:
21600 deal with IntConstant, LongConstants and Enumerations.
21602 * assign.cs: Report the error, instead of failing silently
21604 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
21605 typecontainer that they are declared, because the
21606 typecontainer/namespace will have the list of using clauses that
21607 need to be applied.
21609 Assembly Attributes were escaping the normal registration
21612 (EmitCode): Apply attributes within an EmitContext that represents
21613 the container they were declared on.
21615 * cs-parser.jay: Track bases for structs. How did I get this wrong?
21617 2002-05-06 Ravi Pratap <ravi@ximian.com>
21619 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
21620 Revamp completely - make much cleaner as we now operate only
21623 (FindMostSpecificSource, FindMostSpecificTarget): New methods
21624 to implement the logic detailed in the spec more correctly.
21626 (UserDefinedConversion): Update accordingly.
21628 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21630 * statement.cs: Return flow analysis information up.
21632 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
21635 (token): Do not consume an extra character before calling
21638 2002-05-06 Piers Haken <piersh@friskit.com>
21640 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
21642 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21644 * class.cs (Constructor.Emit): Set the IsStatic flag in the
21645 EmitContext during the instance constructor initializer
21646 resolution, to stop access to instance variables.
21648 This is mandated by the spec, last paragraph of the `constructor
21649 initializers' section.
21651 2002-05-05 Miguel de Icaza <miguel@ximian.com>
21653 * cs-parser.jay, class.cs (Accessor): new class used to represent
21654 an accessor (get or set). In the past we used `null' to represent
21655 a missing accessor. But this is ambiguous because there was no
21656 way to tell in abstract indexers/properties if one of them was
21659 Now there is a way of addressing that.
21661 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
21662 instead of FindMembers.
21664 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
21665 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
21667 * attribute.cs: Treat indexers and properties as the same in terms
21668 of applying attributes
21670 * ecore.cs (FindMostEncompassedType): Use statically initialized
21671 EmptyExpressions()s like we do elsewhere to avoid creating useless
21672 objects (and we take this out of the tight loop).
21674 (GetConversionOperators): Move the code to extract the actual
21675 operators to a separate routine to clean things up.
21677 2002-05-04 Miguel de Icaza <miguel@ximian.com>
21679 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
21680 events are always registered FieldBuilders.
21682 * class.cs (FieldBase): New class shared by Fields
21684 * delegate.cs: If we are a toplevel delegate, use our full name.
21685 If we are a nested delegate, then only use our tail name.
21687 2002-05-02 Ravi Pratap <ravi@ximian.com>
21689 * expression.cs (IsApplicable): Ensure that we add the "&" to
21690 ref/out types before comparing it with the type of the argument.
21692 (IsParamsMethodApplicable): Ditto.
21694 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
21697 * delegate.cs : Handle the case when we have more than one applicable
21698 method. Flag an error only when we finish checking all.
21700 2002-05-02 Miguel de Icaza <miguel@ximian.com>
21702 * expression.cs: Add support for boolean static initializers.
21704 2002-05-01 Miguel de Icaza <miguel@ximian.com>
21706 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
21708 * parameter.cs (ComputeParameterTypes,
21709 ComputeAndDefineParameterTypes): Better error handling: now we
21710 clear the `types' cache if we fail during any of the type lookups.
21711 We also return the status code correctly to our caller
21713 * delegate.cs: If we fail to define a delegate, abort the extra
21716 * expression.cs (Binary.ResolveOperator): for
21717 operator==(object,object) and operator !=(object, object) we also
21718 have to verify that there is an implicit conversion from one to
21721 (ArrayAccess.DoResolve): Array Access can operate on
21724 2002-04-30 Miguel de Icaza <miguel@ximian.com>
21726 * assign.cs (CompoundAssign): A new class used as a "flag" that
21727 the assignment actually is happening as part of a compound
21728 assignment operator.
21730 During compound assignment, a few new rules exist to enable things
21737 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
21738 to the type of x) if y is implicitly convertible to the type of x,
21739 and the operator is a builtin operator and the return type of the
21740 operator is explicitly convertible to the type of x.
21742 * rootcontext.cs: Reset warning level to 2. 4 catches various
21743 "interesting" features in mcs, we must clean this up at some
21744 point, but currently am trying to kill other bugs ;-)
21746 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
21747 in container classes as well.
21749 * expression.cs (Binary.ResolveOperator): Handle string case
21750 before anything else (as operator overloading does emit an error
21751 before doing anything else).
21753 This code could go away when we move to a table driven model, but
21754 i could not come up with a good plan last night.
21756 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
21758 * typemanager.cs (CSharpName): reimplementation using regex.
21759 * class.cs: added null check for fields in Emit
21760 * rootcontext.cs: set warninglevel to 4
21762 2002-04-29 Miguel de Icaza <miguel@ximian.com>
21764 * typemanager.cs (CSharpName): reimplemented with Lupus
21767 2002-04-28 Miguel de Icaza <miguel@ximian.com>
21769 * statement.cs (If): correclty implement Resolve, because we were
21770 not catching sem errors in there. The same process is needed
21772 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
21775 (Statement.Warning_DeadCodeFound): Factorize code.
21776 (While): Report dead code here too.
21778 (Statement): Added Resolve virtual method to allow
21779 for resolution split from the emit code.
21781 2002-04-26 Miguel de Icaza <miguel@ximian.com>
21783 * statement.cs (EmitBoolExpression): No longer try to resolve the
21785 (MakeBoolean): New utility function that resolve, implicitly
21786 converts to boolean and tags the expression.
21789 (If, Do): Implement dead code elimination.
21790 (While): Implement loop inversion
21792 (Do, While, For, If): Resolve the expression prior to calling our
21795 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
21798 - added method Report28 (warning: program has more than one entry point)
21799 - added method IsEntryPoint, implements paragraph 10.1 of the spec
21800 - modified method Method.Define, the part at the end of the method
21802 * rootcontext.cs: added static public Location EntryPointLocation;
21804 * ../errors/cs0028.cs : Add test case for the above warning.
21807 - modified method CSharpName to allow arrays of primitive type to
21808 be printed nicely (e.g. instead of System.Int32[][] it now prints
21810 - added method CSharpSignature: returns the signature of a method
21811 in string format to be used in reporting errors, warnings, etc.
21813 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
21816 2002-04-26 Ravi Pratap <ravi@ximian.com>
21818 * delegate.cs (Define): Fix extremely silly bug where I was
21819 setting the type of the 'object' parameter of the BeginInvoke
21820 method to System.IAsyncResult instead of System.Object ;-)
21822 2002-04-26 Miguel de Icaza <miguel@ximian.com>
21824 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
21827 (Constructor.Emit): return if we fail to initialize the
21828 constructor. Another door closed!
21830 * expression.cs (New.DoResolve): Improve error message (from -6 to
21831 1501). Use DeclaredOnly lookup to find the exact constructor.
21833 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
21834 loop. This is useful.
21836 * cs-parser.jay: Adjust the default parameters so that destructors
21837 have the proper signature.
21839 2002-04-26 Martin Baulig <martin@gnome.org>
21841 * driver.cs (LoadAssembly): If `assembly' contains any characters
21842 which are only valid in path names and not in assembly names
21843 (currently slash, backslash and point), use Assembly.LoadFrom ()
21844 instead of Assembly.Load () on the `assembly' (before iteration
21845 over the link_paths).
21847 2002-04-26 Martin Baulig <martin@gnome.org>
21849 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
21851 2002-04-25 Miguel de Icaza <miguel@ximian.com>
21853 * class.cs (Property): use the new typemanager.MemberLookup
21855 (TypeContainer.MemberLookup): Implement using the
21856 TypeManager.MemberLookup now.
21858 * typemanager.cs: Make MemberLookup a function of the TypeManager,
21859 and return MemberInfos, so that these can be used without an
21860 EmitContext (what we had before).
21862 2002-04-24 Miguel de Icaza <miguel@ximian.com>
21864 * expression.cs: Fix the case where the argument to params if the
21865 type of the params. I omitted handling this before. Fixed
21867 2002-04-22 Miguel de Icaza <miguel@ximian.com>
21869 * driver.cs: Call BootCorlib_PopulateCoreType
21871 * class.cs (Property.CheckBase): Check for properties only, not
21874 * interface.cs: Temporary hack: try/catch around the
21875 CustomAttributeBuilder, because I am getting an exception that I
21878 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
21879 types whose definitions are required to be there (attributes are
21880 defined before standard types).
21882 Compute definitions as we boot the various types, as they are used
21883 immediately (value_type class will need object_type, but if we do
21884 not initialize object_type, we will pass a null, which will let
21885 the runtime pick the System.Object from the existing corlib, which
21886 is not what we want).
21888 2002-04-22 Patrik Torstensson <totte@labs2.com>
21890 * cs-tokenizer.cs: fixed a number of trim() issues.
21892 2002-04-22 Ravi Pratap <ravi@ximian.com>
21894 * expression.cs (Argument.Type): Ensure that we return the correct
21895 type when we have out or ref parameters [in which case we
21898 2002-04-22 Miguel de Icaza <miguel@ximian.com>
21900 * class.cs (Property, Indexer): Allow extern modifier in there.
21902 * typemanager.cs (InitBaseTypes): Initializes object_type and
21903 value_type, since those will be used early on during the bootstrap
21904 process to compile corlib.
21906 (InitCoreTypes): Move code from here to InitBaseTypes.
21908 2002-04-21 Miguel de Icaza <miguel@ximian.com>
21910 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
21911 single-dimension arrays as using the ldlen opcode.
21913 Daniel Lewis discovered this optimization.
21915 * typemanager.cs: Add signature for System.Array::get_Length
21917 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21919 * statement.cs: report the error when the foreach does not apply to an
21920 array nor a collection.
21922 2002-04-19 Miguel de Icaza <miguel@ximian.com>
21924 * expression.cs: Add implicit conversions to the operator ~.
21926 * constant.cs (DecimalConstant.Emit): Emit decimal value.
21928 * typemanager.cs: Locate the decimal constructor.
21930 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21932 * attribute.cs: use the new property of TypeOf.
21933 * expression.cs: added 'get' property around typearg.
21935 These changes fix a build breaker reported by NickD. Is this the
21936 correct way to fix? If not, please, revert my changes and make it
21939 2002-04-17 Miguel de Icaza <miguel@ximian.com>
21941 * attribute.cs: Add support for typeof in attribute invocations.
21942 I am not sure that this is right though.
21944 2002-04-14 Duncan Mak <duncan@ximian.com>
21946 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
21947 Binary.Operator.Division case.
21949 2002-04-13 Ravi Pratap <ravi@ximian.com>
21951 * class.cs (DefineType): Ensure that we do a proper check on
21952 attribute types and also register it with the TypeManager.
21954 (TypeContainer.Targets): The default for attribute types is
21955 AttributeTargets.All.
21957 * attribute.cs (ApplyAttributes): Registering the attribute type
21958 is done elsewhere, not when we discover we have a Usage attribute.
21960 2002-04-12 Ravi Pratap <ravi@ximian.com>
21962 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
21963 and get rid of is_delegate parameter.
21965 * everywhere : update.
21967 2002-04-12 Ravi Pratap <ravi@ximian.com>
21969 * cs-parser.jay (compilation_unit): Revamp completely to use
21970 some new ideas that I got from Rhys' grammar to solve the problems
21971 with assembly level attributes.
21973 (outer_declaration): New grammar production.
21975 (attribute_sections): Add.
21977 (opt_attributes): Base on attribute_sections
21979 (namespace_declaration): Allow opt_attributes to tackle the case
21980 when we have assembly level attributes - we are clever in this
21983 * attribute.cs (ApplyAttributes): Do not worry about assembly
21984 attributes in the non-global context.
21986 * rootcontext.cs (AddGlobalAttributes): Go back to using this
21987 instead of SetGlobalAttributes.
21989 * class.cs, rootcontext.cs : Ensure we define and generate
21990 attribute types before anything else.
21992 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
21993 and flag the new error -20 for the case when the attribute type
21994 does not have valid targets specified. csc does not catch this.
21996 * ../errors/errors.txt : update for error # -20
21998 2002-04-11 Ravi Pratap <ravi@ximian.com>
22000 * support.cs (InternalParameters.ParameterModifier): Do some null
22001 checking and return sane values.
22003 * class.cs (Method.Define): If we are a PInvoke method, ensure
22004 that we are static and extern. Report error # 601
22006 * ../errors/cs0601.cs : Add test case for the above error.
22008 2002-04-07 Ravi Pratap <ravi@ximian.com>
22010 * rootcontext.cs (attribute_types): We need to keep type of
22011 all attribute types separately and emit code for them first.
22013 (RegisterAttribute) : Implement.
22015 * class.cs (DefineType): Check if the current Type is a custom
22016 attribute type and register it accordingly.
22018 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
22019 adding the first attribute twice and rename to
22021 (SetGlobalAttributes): this.
22023 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
22026 * attribute.cs (ApplyAttributes): Take an additional argument telling us
22027 if we are processing global arguments. Hmm, I am unsure of this.
22029 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22031 * expression.cs: added static array of strings to avoid calling
22032 Enum.ToString () for Operator in Binary. Significant recover of
22035 2002-04-10 Miguel de Icaza <miguel@ximian.com>
22037 * class.cs (FindMembers): Allow the Builders of the various
22038 members to be null. If they are skip them. This only happens
22039 during the PInvoke declaration.
22041 2002-04-09 Miguel de Icaza <miguel@ximian.com>
22043 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
22044 failure, so we do not keep going afterwards.
22046 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
22047 wanted to pass `false' as the `is_delegate' argument. If this is
22048 the case, why not use delegate_type == null to mean `is_delegate =
22049 false' and anything else as is_delegate = true.
22051 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
22053 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
22054 code for the section, not the beginning of the tests.
22056 2002-04-08 Miguel de Icaza <miguel@ximian.com>
22058 * cfold.cs: Handle operator + (Enum x, Underlying x)
22060 * expression.cs (Binary): same. Warn about errors where we have
22061 Enum/Enum in operator + as well.
22063 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
22066 - added support for switch(bool)
22067 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
22068 - add TableSwitchEmit() to handle table-based switch statements
22070 2002-04-05 Ravi Pratap <ravi@ximian.com>
22072 * expression.cs (Invocation.OverloadResolve): Factor out code which
22073 does parameter compatibility checking with arguments so that we can
22074 re-use the code even from Delegate.VerifyApplicability
22076 (VerifyArgumentsCompat): Move above code here.
22078 * delegate.cs (VerifyApplicability): Get rid of duplicate code
22079 and instead make a call to the above method.
22081 2002-03-31 Ravi Pratap <ravi@ximian.com>
22083 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
22084 We use it to keep track of classes which are attribute types.
22086 2002-04-02 Miguel de Icaza <miguel@ximian.com>
22088 * delegate.cs (Delegate.Define): Correctly define the types in the
22089 presence of fixed and array parameters.
22091 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
22094 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
22095 include NonPublic after the first iteration.
22097 * class.cs (Indexer.CheckBase): Only check if both parents are
22100 * cs-parser.jay (accessor_body): If empty, set to null.
22102 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
22103 same code path here to resolve constants names that we did have in
22104 MemberAccess.DoResolve. There is too much code duplicated here.
22106 2002-04-01 Miguel de Icaza <miguel@ximian.com>
22108 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
22110 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
22113 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
22114 tokens, numbers and strings.
22116 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
22119 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
22120 asyncronous parameters and the regular parameters.
22122 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
22123 specify the target directory.
22125 * expression.cs: (This.DoResolve): Simplify
22126 (As.Emit): Optimize, do not generate IsInst if the expression is
22127 always of the given type.
22129 (Is.DoResolve): Bug fix, we were reporting both always/never for
22132 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
22133 creating too many unnecessary arrays.
22135 2002-03-31 Miguel de Icaza <miguel@ximian.com>
22137 * class.cs (EmitFieldInitializer): Use Assign expression to assign
22138 fields instead of rolling our own initializer. Takes care of all
22139 implicit conversions, and drops unnecessary static checks/argument.
22141 2002-03-31 Dick Porter <dick@ximian.com>
22143 * driver.cs: use the GetDirectories() return values properly, and
22144 use "/" as path separator.
22146 2002-03-30 Miguel de Icaza <miguel@ximian.com>
22148 * expression.cs (Unary): Optimize - - expr into expr.
22149 (Binary): Optimize a + (-b) into a -b.
22151 * codegen.cs (CodeGen): Made all methods static.
22153 2002-03-29 Miguel de Icaza <miguel@ximian.com>
22157 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
22158 TypeBuilder property.
22160 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
22163 * tree.cs: Removed the various RecordXXXX, and replaced with a
22164 single RecordDecl. Removed all the accessor methods, and just
22165 left a single access point Type
22167 * enum.cs: Rename DefineEnum to DefineType.
22169 * decl.cs: New abstract method `DefineType' used to unify the
22170 Defines for Enumerations, Interfaces, TypeContainers and
22173 (FindType): Moved LookupInterfaceOrClass here. Moved the
22174 LookupBaseClasses method that used to live in class.cs and
22175 interface.cs here, and renamed to FindType.
22177 * delegate.cs: Implement DefineType. Take advantage of the
22178 refactored pattern for locating the parent builder without taking
22179 the parent_builder argument (which we know does not work if we are
22180 nested, and triggering a toplevel definition).
22182 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22184 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
22185 accessibility of a member has changed during override and report
22188 * class.cs (Method.Define, Property.Define): Only complain on
22189 overrides if the method is private, any other accessibility is
22190 fine (and since we just checked the permission is the same, we are
22193 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
22194 and elif are processed always. The other pre-processing
22195 directives are only processed if we are "taking" the path
22197 2002-03-29 Martin Baulig <martin@gnome.org>
22199 * class.cs (Method.Emit): Only emit symbolic debugging info if the
22200 current location is not Null.
22202 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
22203 a separate method so we can profile it.
22205 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
22206 `span.Seconds' are just seconds, but no minutes or hours.
22207 (MainDriver): Profile the CodeGen.SaveSymbols calls.
22209 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22211 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
22212 Remove the gratuitous set of Final:
22214 // If an interface implementation, then we can set Final.
22215 if (((flags & MethodAttributes.Abstract) == 0) &&
22216 implementing.DeclaringType.IsInterface)
22217 flags |= MethodAttributes.Final;
22219 I do not know what I was smoking when I used that.
22222 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
22223 step into fixing the name resolution issues for delegates and
22224 unifying the toplevel name resolution.
22226 2002-03-28 Martin Baulig <martin@gnome.org>
22228 * class.cs (Method.Emit): If we have a symbol writer, call its
22229 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
22230 tell it about the current method.
22232 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
22233 writer that we're going to emit the first byte of IL code for a new
22234 statement (a new source line).
22235 (EmitContext.EmitTopBlock): If we have a symbol writer, call
22236 EmitContext.Mark() before emitting any code.
22238 * location.cs (SymbolDocument): Return null when we're Null.
22240 * statement.cs (Statement): Moved the `Location loc' variable here.
22241 (Statement.EmitBoolExpression): If we have a symbol writer, call
22242 ec.Mark() before emitting any code to tell it that we're at the
22243 beginning of a new statement.
22244 (StatementExpression): Added `Location' argument to the constructor.
22245 (Block): Added public readonly variable `StartLocation' and public
22246 variable `EndLocation'. The latter is to be set using SetEndLocation().
22247 (Block): Added constructor which takes a start and end location.
22248 (Block.SetEndLocation): New method. This sets the end location.
22249 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
22250 local variables we create.
22251 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
22252 each statement and do also mark the begin and end of the block.
22254 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
22255 tell it the current lexer.Location, use Location.Null for the end of the
22257 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
22258 current block, set its end location using SetEndLocation().
22259 (statement_expression): StatementExpression constructor now takes the
22260 lexer.Location as additional argument.
22261 (for_statement, declare_local_variables): Likewise.
22262 (declare_local_variables): When creating a new implicit block, use the
22263 new Block constructor and pass it the lexer.Location.
22265 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22267 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
22268 members also on the parent interfaces recursively.
22270 2002-03-27 Miguel de Icaza <miguel@ximian.com>
22272 * report.cs: Use new formats, since Gonzalo finished the missing
22275 * expression.cs (Binary.ResolveOperator): added missing operator|
22276 operator& and operator^ for bool/bool.
22278 * cs-parser.jay: CheckDef now takes a Location argument that is
22279 used to report errors more precisly (instead of reporting the end
22280 of a definition, we try to track something which is a lot closer
22281 to the source of the problem).
22283 * cs-tokenizer.cs: Track global token use, so we can properly flag
22284 the use of #define/#undef after the first token has been seen.
22286 Also, rename the reportXXXX to Error_DescriptiveName
22288 * decl.cs (DeclSpace.IsTopLevel): Move property here from
22289 TypeContainer, so that Enum and Interface can use this too.
22291 * class.cs (TypeContainer.LookupInterfaceOrClass,
22292 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
22293 `builder' argument. Typically this was used to pass the parent
22294 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
22297 The problem is that a nested class could trigger the definition of
22298 a toplevel class, and the builder would be obviously wrong in that
22301 So we drop this argument, and we compute dynamically the
22302 TypeBuilder/ModuleBuilder (the correct information was available
22303 to us anyways from DeclSpace.Parent)
22305 * interface.cs (Interface.DefineInterface): Drop builder
22306 parameter cleanup like class.cs
22308 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
22311 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
22314 (Try.Emit): Propagate the returns value from the statement.
22316 (Return.Emit): Even if we are leavning
22318 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
22320 * modifiers.cs: Fix the computation of MethodAttributes flags.
22322 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
22324 * driver.cs: allow compilation of files that start with '/'.
22325 Add a default case when checking the argument of --target.
22327 2002-03-25 Miguel de Icaza <miguel@ximian.com>
22329 * interface.cs: Implement the same search algorithm for types in
22330 the interface code.
22332 * delegate.cs: Do not allow multiple definition.
22334 * Recovered ChangeLog that got accidentally amputated
22336 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
22338 * rootcontext.cs: Load manually enum to allow core classes to
22339 contain enumerations.
22341 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
22342 Update to new static methods in TypeManager.
22344 * typemanager.cs (GetMethod, GetConstructor): Use our
22345 implementation of FindMembers to find the members, since during
22346 corlib compilation, the types are TypeBuilders and GetMethod and
22347 GetConstructor do not work.
22349 Make all methods in TypeManager static.
22351 (InitCodeHelpers): Split the functionality from
22352 the InitCodeTypes function.
22354 * driver.cs: Call InitCodeHelpers after we have populated the
22357 * cs-parser.jay (delegate_declaration): we did not used to compute
22358 the delegate name correctly for void delegates.
22360 2002-03-24 Miguel de Icaza <miguel@ximian.com>
22362 * rootcontext.cs (RootContext): Init the interface_resolve_order
22363 and type_container_resolve_order always.
22365 (ResolveCore, BootstrapCorlib_ResolveClass,
22366 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
22367 compiler when compiling with --nostdlib
22369 * class.cs (TypeContainer.DefineType): Check that our parent is
22370 not null. This test is most important when we are bootstraping
22373 * codegen.cs: Split out the symbol writing code.
22375 2002-03-25 Martin Baulig <martin@gnome.org>
22377 * driver.cs (-g): Made -g an alias for --debug.
22379 2002-03-24 Martin Baulig <martin@gnome.org>
22381 * codegen.cs (SymbolWriter): New public variable. Returns the
22382 current symbol writer.
22383 (CodeGen): Added `bool want_debugging_support' argument to the
22384 constructor. If true, tell the ModuleBuild that we want debugging
22385 support and ask it for the ISymbolWriter.
22386 (Save): If we have a symbol writer, call it's Close() method after
22387 saving the assembly.
22389 * driver.c (--debug): New command line argument to create a
22390 debugger information file.
22392 * location.cs (SymbolDocument): New public property. Returns an
22393 ISymbolDocumentWriter object for the current source file or null
22394 if we don't have a symbol writer.
22396 2002-03-21 Miguel de Icaza <miguel@ximian.com>
22398 * driver.cs (LoadAssembly): Correctly return when all the paths
22399 have been tried and not before.
22401 * statement.cs (Switch.Emit): return the actual coverage for this
22402 statement (returns/not-returns)
22404 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
22405 switch of the statement if we are the last switch section. That
22406 kills two problems: try/catch problems (we used to emit an empty
22407 nop at the end) and switch statements where all branches would
22410 2002-03-19 Miguel de Icaza <miguel@ximian.com>
22412 * driver.cs: Add default assemblies (the equivalent to the
22413 Microsoft CSC.RSP file)
22415 * cs-tokenizer.cs: When updating `cols and setting it to zero,
22416 also update tokens_seen and set it to false.
22418 * driver.cs: Implement --recurse for Mike.
22420 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
22421 correctly splitting out the paths.
22423 2002-03-18 Miguel de Icaza <miguel@ximian.com>
22425 * interface.cs (Interface.PopulateProperty): Instead of using
22426 `parent' as the declaration space for the set parameters, use
22429 * support.cs (InternalParameters): InternalParameters constructor
22430 takes a DeclSpace instead of a TypeContainer.
22432 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
22433 types are being initialized, load the address of it before calling
22436 (New): Provide a mechanism to disable the generation of local
22437 value type temporaries when the caller will be providing us with
22438 an address to store it.
22440 (ArrayCreation.EmitDynamicInitializers): Use it.
22442 2002-03-17 Miguel de Icaza <miguel@ximian.com>
22444 * expression.cs (Invocation.EmitArguments): Only probe for array
22445 property if there is more than one argument. Sorry about that.
22447 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
22448 empty param arrays.
22450 * class.cs (Method.LabelParameters): Fix incorrect code path that
22451 prevented the `ParamArrayAttribute' from being applied to the
22454 2002-03-16 Miguel de Icaza <miguel@ximian.com>
22456 * support.cs (ReflectionParameters): Correctly compute whether the
22457 last argument is a params array. Fixes the problem with
22460 * typemanager.cs: Make the assemblies array always be non-null
22461 (empty, but non-null)
22463 * tree.cs (RecordDecl): New function that abstracts the recording
22464 of names. This reports error 101, and provides a pointer to the
22465 previous declaration. Fixes a crash in the compiler.
22467 * cs-parser.jay (constructor_declaration): Update to new grammar,
22468 and provide a constructor_body that can be empty.
22470 2002-03-15 Miguel de Icaza <miguel@ximian.com>
22472 * driver.cs: Add support for --resources.
22474 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
22475 Make all types for the various array helper methods be integer.
22477 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
22478 CheckState to ConvCast.
22480 (ConvCast): Now it takes a `checked' state argument, to avoid
22481 depending on the emit context for the conversion, and just using
22482 the resolve time setting.
22484 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
22485 instead of Invocation.EmitArguments. We do not emit the original
22486 arguments, instead we emit those which have been converted to
22487 unsigned int expressions.
22489 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
22491 * codegen.cs: ditto.
22493 * expression.cs (LocalVariableReference): Drop the use of the
22494 Store function that depended on the variable index.
22496 * statement.cs (VariableInfo): Drop the `Idx' property from this
22497 class, as this is not taking into account the indexes for
22498 temporaries tat we generate during the execution, getting the
22501 * class.cs: First emit class initializers, then call the parent
22504 * expression.cs (Binary): Fix opcode emision.
22505 (UnaryMutator.EmitCode): Support checked code generation
22507 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
22508 matches for events for both the Static and Instance scans,
22509 pointing to the same element. Fix that.
22511 2002-03-14 Miguel de Icaza <miguel@ximian.com>
22513 * rootcontext.cs (ResolveTree): Always set the
22514 interface_resolve_order, because nested interfaces will be calling
22517 * class.cs (GetInterfaceOrClass): Track the same resolution
22518 process used by TypeManager.LookupType. This fixes the nested
22519 type lookups in class declarations (separate path from
22522 (TypeContainer.DefineType): Also define nested interfaces.
22523 (TypeContainer.RegisterOrder): New public function used to
22524 register the order in which child interfaces need to be closed.
22526 Nested interfaces need to be closed after their parents have been
22529 * interface.cs (InterfaceAttr): Put all the logic for computing
22530 the interface attribute here.
22532 (DefineInterface): Register our interface order with the
22533 RootContext or with the TypeContainer depending on the case.
22535 2002-03-12 Miguel de Icaza <miguel@ximian.com>
22537 * cs-parser.jay: rework foreach statement to work with the new
22538 changes to the policy on SimpleNames.
22540 * report.cs: support Stacktrace on warnings as well.
22542 * makefile: drop --unsafe and /unsafe from the compile.
22544 2002-03-13 Ravi Pratap <ravi@ximian.com>
22546 * ecore.cs (StandardConversionExists): Modify to take an Expression
22547 as the first parameter. Ensure we do null -> reference type conversion
22550 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
22551 temporary Expression objects.
22553 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
22555 * interface.cs: workaround bug in method overloading resolution
22556 (there is already a bugzilla bug for it).
22558 2002-03-12 Miguel de Icaza <miguel@ximian.com>
22560 We could also solve this problem by having a separate path for
22561 performing type lookups, instead of DoResolve, we could have a
22562 ResolveType entry point, and only participating pieces of the
22563 production (simplename, deref, array) would implement this.
22565 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
22566 signal SimpleName to only resolve type names and not attempt to
22567 resolve anything else.
22569 * expression.cs (Cast): Set the flag.
22571 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
22573 * class.cs: Only report 108 if there is no `new' modifier.
22575 * cs-parser.jay: rework foreach statement to work with the new
22576 changes to the policy on SimpleNames.
22578 * report.cs: support Stacktrace on warnings as well.
22580 * makefile: drop --unsafe and /unsafe from the compile.
22582 2002-03-11 Miguel de Icaza <miguel@ximian.com>
22584 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22585 lookups here, instead of doing that at parse time. This means
22586 that our grammar will not introduce `LocalVariableReferences' as
22587 expressions at this point. That solves the problem of code like
22591 static void Main ()
22595 This is only half the fix. The full fix requires parameters to
22596 also be handled in this way.
22598 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
22599 makes the use more obvious of the DeclSpace. The
22600 ec.TypeContainer.TypeBuilder is now only used to pull the
22601 TypeBuilder for it.
22603 My theory is that I can get rid of the TypeBuilder completely from
22604 the EmitContext, and have typecasts where it is used (from
22605 DeclSpace to where it matters).
22607 The only pending problem is that the code that implements Aliases
22608 is on TypeContainer, and probably should go in DeclSpace.
22610 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22611 lookups here, instead of doing that at parse time. This means
22612 that our grammar will not introduce `LocalVariableReferences' as
22613 expressions at this point. That solves the problem of code like
22617 static void Main ()
22621 This is only half the fix. The full fix requires parameters to
22622 also be handled in this way.
22624 * class.cs (Property.DefineMethod): When implementing an interface
22625 method, set newslot, when implementing an abstract method, do not
22626 set the flag (before we tried never setting it, or always setting
22627 it, which is the difference).
22628 (Indexer.DefineMethod): same.
22629 (Method.DefineMethod): same.
22631 * ecore.cs: Only set the status used flag if we get back a Field.
22633 * attribute.cs: Temporary hack, so Paolo can keep working.
22635 2002-03-08 Ravi Pratap <ravi@ximian.com>
22637 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
22638 the unmanaged type in the case we have a MarshalAs attribute.
22640 (Resolve): Handle the case when we are parsing the special MarshalAs
22641 attribute [we need to store the unmanaged type to use later]
22643 * typemanager.cs (marshal_as_attr_type): Built in type for the
22644 MarshalAs Attribute.
22646 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
22647 on parameters and accordingly set the marshalling info.
22649 2002-03-09 Miguel de Icaza <miguel@ximian.com>
22651 * class.cs: Optimizing slightly by removing redundant code after
22652 we switched to the `NoTypes' return value.
22653 (Property.DefineMethod): use NoTypes here too.
22655 This fixes the bug I introduced in my last batch of changes.
22657 2002-03-05 Ravi Pratap <ravi@ximian.com>
22659 * tree.cs (RecordEnum): Add. We now keep track of enums too.
22661 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
22662 Enums since those are types too.
22664 * cs-parser.jay (enum_declaration): Record enums as we parse them.
22666 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
22667 thanks to a call during the lookup process.
22669 2002-03-07 Miguel de Icaza <miguel@ximian.com>
22671 * statement.cs (Foreach): Lots of work to accomodate a particular
22672 kind of foreach statement that I had not kept in mind. It is
22673 possible to have foreachs on classes that provide a GetEnumerator
22674 method that return objects that implement the "pattern" for using
22675 a foreach, there is no need to support GetEnumerator
22678 This is needed to compile nant.
22680 * decl.cs: Only report 114 if the member is not `Finalize' and if
22681 the warning level is at least 2.
22683 * class.cs: Moved the compare function from Method to
22686 (MethodSignature.InheritableMemberSignatureCompare): Add new
22687 filter function that is used to extract inheritable methods from a
22690 (Method.Define): Use the new `inheritable_method_signature_filter'
22693 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
22696 2002-03-06 Miguel de Icaza <miguel@ximian.com>
22698 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
22700 * cs-parser.jay: Add opt_semicolon to the interface declaration.
22702 * expression.cs: Pass location information to
22703 ConvertImplicitStandard.
22705 * class.cs: Added debugging code to track return values from
22708 2002-03-05 Miguel de Icaza <miguel@ximian.com>
22710 * expression.cs (Is.DoResolve): If either side of the `is' is an
22711 interface, do not flag the warning.
22713 * ecore.cs (ImplicitReferenceConversion): We need a separate test
22716 * report.cs: Allow for --fatal to be used with --probe.
22718 * typemanager.cs (NoTypes): Move the definition for the empty Type
22721 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
22723 (TypeContainer.DefineProxy): New function used to proxy to parent
22724 implementations when implementing interfaces.
22725 (TypeContainer.ParentImplements): used to lookup if our parent
22726 implements a public function that is required by an interface.
22727 (TypeContainer.VerifyPendingMethods): Hook this up.
22729 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
22730 `modules' and `assemblies' arraylists into arrays. We only grow
22731 these are the very early start up of the program, so this improves
22732 the speedof LookupType (nicely measured).
22734 * expression.cs (MakeByteBlob): Replaced unsafe code with
22735 BitConverter, as suggested by Paolo.
22737 * cfold.cs (ConstantFold.Binary): Special case: perform constant
22738 folding of string concatenation, but if either side is a string,
22739 and the other is not, then return null, and let the runtime use
22740 the concatenation on the string plus the object (using
22741 `Object.ToString').
22743 2002-03-04 Miguel de Icaza <miguel@ximian.com>
22745 Constant Folding has been implemented now.
22747 * expression.cs (Unary.Reduce): Do not throw an exception, catch
22748 the error instead on types that are not supported in one's
22751 * constant.cs (Constant and all children): New set of functions to
22752 perform implict and explicit conversions.
22754 * ecore.cs (EnumConstant): Implement the new functions to perform
22755 conversion by proxying to the child expression.
22757 * codegen.cs: (ConstantCheckState): Constant evaluation has its
22758 own separate setting that can not be turned off from the command
22759 line using --unchecked or --checked and is only controlled using
22760 the checked/unchecked statements and expressions. This setting is
22761 used by the constant folder to flag errors.
22763 * expression.cs (CheckedExpr, UncheckedExpr): Set the
22764 ConstantCheckState as well.
22766 During Resolve, they also have to flag the state, because the
22767 constant folder runs completely in the Resolve phase.
22769 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
22772 2002-03-01 Miguel de Icaza <miguel@ximian.com>
22774 * cfold.cs: New file, this file contains the constant folder.
22776 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
22777 argument to track whether we are using the resulting address to
22778 load or store a value and provide better error messages.
22780 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
22781 new AddressOf arguments.
22783 * statement.cs (Foreach.EmitCollectionForeach): Update
22785 * expression.cs (Argument.Emit): Call AddressOf with proper
22786 arguments to track usage.
22788 (New.DoEmit): Call AddressOf with new arguments.
22790 (Unary.Emit): Adjust AddressOf call.
22792 2002-03-01 Ravi Pratap <ravi@ximian.com>
22794 * cs-parser.jay (member_access): Change the case for pre-defined types
22795 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
22798 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
22801 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
22802 essentially like methods and apply attributes like MethodImplOptions to them too.
22804 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
22807 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
22808 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
22811 * Update code everywhere accordingly.
22813 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
22815 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
22817 2002-02-28 Ravi Pratap <ravi@ximian.com>
22819 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
22820 try performing lookups against those instead of jumping straight into using
22821 the 'using' clauses.
22823 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
22825 (LookupType): Perform lookups in implicit parents too.
22827 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
22828 sequence as RootContext.LookupType.
22830 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
22831 the various cases of namespace lookups into this method.
22833 2002-03-01 Miguel de Icaza <miguel@ximian.com>
22835 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
22836 in positional arguments)
22838 * class.cs (Operator): Update the AllowedModifiers to contain
22841 * cs-parser.jay: Update operator declaration to allow for the
22842 operator body to be empty.
22844 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
22847 2002-02-27 Miguel de Icaza <miguel@ximian.com>
22849 * class.cs (Method.Emit): Label parameters.
22851 * driver.cs: Return 1 or 0 as the program exit code.
22853 2002-02-26 Miguel de Icaza <miguel@ximian.com>
22855 * expression.cs: Special case the `null' object when trying to
22856 auto-compute the type, as anything can be explicitly converted to
22859 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
22860 spotting this Paolo.
22862 (Expression.ImplicitNumericConversion): Perform comparissions of
22863 the type using the underlying type in the case of an enumeration
22864 rather than using the enumeration type for the compare.
22866 Cope with the underlying == type case, which is not possible to
22869 (Expression.ConvertNumericExplicit): Perform comparissions of
22870 the type using the underlying type in the case of an enumeration
22871 rather than using the enumeration type for the compare.
22873 * driver.cs: If the user does not supply an extension, assume .exe
22875 * cs-parser.jay (if_statement): Rewrote so that we can track the
22876 location for the if statement.
22878 * expression.cs (Binary.ConstantFold): Only concat strings when
22879 the operation is "+", not everything ;-)
22881 * statement.cs (Statement.EmitBoolExpression): Take a location
22883 (If, While, Do): Track location.
22885 * expression.cs (Binary.ResolveOperator): In the object + string
22886 case, I was missing a call to ConvertImplicit
22888 2002-02-25 Ravi Pratap <ravi@ximian.com>
22890 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
22891 Location arguments. Ensure we use RootContext.LookupType to do our work
22892 and not try to do a direct Type.GetType and ModuleBuilder.GetType
22894 * interface.cs (PopulateMethod): Handle the type of the parameter being
22897 * expression.cs (Invocation.BetterFunction): Handle the case when we
22898 have a params method with no fixed arguments and a call is made with no
22901 2002-02-25 Miguel de Icaza <miguel@ximian.com>
22903 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
22904 the verbatim-string-literal
22906 * support.cs (InternalParameters.ParameterModifier): handle null
22908 (InternalParameters.ParameterType): ditto.
22910 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
22911 duplicating the name of the variable parameter.
22912 (GetParameterByName): Fix bug where we were not looking up array
22913 paramters if they were the only present (thanks Paolo!).
22914 (GetParameterInfo): We only have an empty set of types if both
22915 fixed and array are set to null.
22916 (GetParameterInfo-idx): Handle FixedParameter == null
22918 * cs-parser.jay: Handle the case where there is no catch
22919 statements (missing null test).
22921 2002-02-22 Miguel de Icaza <miguel@ximian.com>
22923 * driver.cs (MainDriver): Be conservative on our command line
22926 Catch DirectoryNotFoundException when calling GetFiles.
22928 (SplitPathAndPattern): Used to split the input specification into
22929 a path and a pattern that we can feed to Directory.GetFiles.
22931 2002-02-21 Miguel de Icaza <miguel@ximian.com>
22933 * statement.cs (Fixed): Implement the last case of the Fixed
22934 statement (string handling).
22936 * expression.cs (StringPtr): New class used to return a char * to
22937 a string; Used by the Fixed statement.
22939 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
22941 * expression.cs (Binary.ResolveOperator): Remove redundant
22942 MemberLookup pn parent type.
22943 Optimize union call, we do not need a union if the types are the same.
22944 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
22947 Specialize the use of MemberLookup everywhere, instead of using
22948 the default settings.
22950 (StackAlloc): Implement stackalloc keyword.
22952 * cs-parser.jay: Add rule to parse stackalloc.
22954 * driver.cs: Handle /h, /help, /?
22956 * expression.cs (MakeByteBlob): Removed the hacks we had in place
22957 before we supported unsafe code.
22959 * makefile: add --unsafe to the self compilation of mcs.
22961 2002-02-20 Miguel de Icaza <miguel@ximian.com>
22963 * expression.cs (PointerArithmetic): New class that is used to
22964 perform pointer arithmetic.
22965 (Binary.Resolve): Handle pointer arithmetic
22966 Handle pointer comparission.
22967 (ArrayPtr): Utility expression class that is used to take the
22968 address of an array.
22970 (ElementAccess): Implement array access for pointers
22972 * statement.cs (Fixed): Implement fixed statement for arrays, we
22973 are missing one more case before we are done.
22975 * expression.cs (Indirection): Implement EmitAssign and set the
22976 ExprClass to Variable. This allows pointer dereferences to be
22977 treated as variables, and to have values assigned to them.
22979 * ecore.cs (Expression.StoreFromPtr): New utility function to
22980 store values dereferencing.
22982 2002-02-20 Ravi Pratap <ravi@ximian.com>
22984 * expression.cs (Binary.ResolveOperator): Ensure that we are
22985 not trying to operate on a void type - this fixes the reported
22988 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
22989 the parent implementation is sealed.
22991 * ../errors/cs0239.cs : Add.
22993 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
22995 * typemanager.cs (unverifiable_code_type): Corresponds to
22996 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
22997 which have unsafe code in them.
22999 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
23002 2002-02-19 Miguel de Icaza <miguel@ximian.com>
23004 * cs-tokenizer.cs: Add support for @"litreal strings"
23006 Make tokenizer accept pre-processor directives
23007 on any column (remove the old C-like limitation).
23009 * rootcontext.cs (EmitCode): Emit any global attributes.
23010 (AddGlobalAttributes): Used to keep track of assembly attributes.
23012 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
23014 * cs-parser.jay: Add support for global attributes.
23016 2002-02-17 Miguel de Icaza <miguel@ximian.com>
23018 * expression.cs (Indirection): New helper class. Unary will
23019 create Indirection classes to be able to implement the
23020 IMemoryLocation interface on it.
23022 2002-02-16 Miguel de Icaza <miguel@ximian.com>
23024 * cs-parser.jay (fixed_statement): reference the right statement.
23026 * statement.cs (Fixed.Emit): Finish implementing the fixed
23027 statement for the &x case.
23029 2002-02-14 Miguel de Icaza <miguel@ximian.com>
23031 * class.cs (Property.Define, Method.Define): Remove newslot when
23034 * modifiers.cs: My use of NewSlot when `Abstract' was set was
23035 wrong. NewSlot should only be used if the `new' keyword is present.
23037 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
23038 locating our system dir. Sorry about this.
23040 2002-02-13 Miguel de Icaza <miguel@ximian.com>
23042 * driver.cs (GetSystemDir): Compute correctly the location of our
23043 system assemblies. I was using the compiler directory instead of
23044 the library directory.
23046 2002-02-13 Ravi Pratap <ravi@ximian.com>
23048 * expression.cs (BetterFunction): Put back in what Miguel commented out
23049 since it is the correct fix. The problem is elsewhere ;-)
23051 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
23052 parameters of the parms method are themselves compatible or not !
23054 (StandardConversionExists): Fix very dangerous bug where we were forgetting
23055 to check that a class implements an interface before saying that an implicit
23056 conversion was allowed. Use ImplementsInterface to do the checking.
23058 2002-02-13 Miguel de Icaza <miguel@ximian.com>
23060 * class.cs (Method.Define): Track whether we are an explicit
23061 implementation or not. And only call DefineMethodOverride if we
23062 are an explicit implementation.
23064 (Property.DefineMethod): Ditto.
23066 2002-02-11 Ravi Pratap <ravi@ximian.com>
23068 * expression.cs (BetterFunction): Catch hideous bug which was
23069 preventing us from detecting ambiguous calls due to implicit casts i.e
23072 2002-01-29 Miguel de Icaza <miguel@ximian.com>
23074 * support.cs (Pair): Remove un-needed method. I figured why I was
23075 getting the error in cs-parser.jay, the variable in a foreach loop
23076 is readonly, and the compiler does not really treat this as a variable.
23078 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
23079 instead of EQUALS in grammar.
23081 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
23083 * expression.cs (Unary.DoResolve): Check whether the argument is
23086 2002-01-28 Miguel de Icaza <miguel@ximian.com>
23088 * support.cs: Api for Pair to set a value. Despite the fact that
23089 the variables are public the MS C# compiler refuses to compile
23090 code that accesses the field if the variable is part of a foreach
23093 * statement.cs (Fixed): Begin implementation of the fixed
23096 (Block.AddVariable): Return the VariableInfo on success and null
23097 on failure instead of true/false.
23099 * cs-parser.jay (foreach): Catch errors on variables already
23100 defined (we were ignoring this value before) and properly unwind
23101 the block hierarchy
23103 (fixed_statement): grammar for the fixed statement.
23105 2002-01-25 Miguel de Icaza <miguel@ximian.com>
23107 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
23108 pointer types to be incretemented.
23110 (SizeOf): Implement.
23112 * cs-parser.jay (pointer_member_access): Implement
23113 expr->IDENTIFIER production.
23115 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
23116 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
23119 (Unary): Implement indirection.
23121 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
23122 use in non-unsafe context).
23124 (SimpleName.DoResolve): Check for pointers in field access on safe
23127 (Expression.LoadFromPtr): Factor the load-indirect code in this
23128 function. This was duplicated in UnboxCast and ParameterReference
23130 2002-01-24 Miguel de Icaza <miguel@ximian.com>
23132 * expression.cs (ComposedCast): report an error if a pointer cast
23133 is used in a safe region.
23135 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
23136 pointer type casts in unsafe context.
23138 * codegen.cs (EmitContext): Set up IsUnsafe.
23140 * cs-parser.jay (non_expression_type): Add productions for pointer
23143 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
23144 code. We should not use force into static mode if the method is
23145 not virtual. Fixes bug in MIS
23147 * statement.cs (Do.Emit, While.Emit, For.Emit,
23148 Statement.EmitBoolExpression): Add support to Do and While to
23149 propagate infinite loop as `I do return' semantics.
23151 Improve the For case to also test for boolean constants.
23153 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
23154 to the list of attributes we can add.
23156 Remove `EmitContext' argument.
23158 * class.cs (Method.Define): Apply parameter attributes.
23159 (Constructor.Define): Apply parameter attributes.
23160 (MethodCore.LabelParameters): Move here the core of labeling
23163 * support.cs (ReflectionParameters.ParameterModifier,
23164 InternalParameters.ParameterModifier): Use IsByRef on the type and
23165 only return the OUT bit for these parameters instead of in/out/ref
23168 This is because I miss-understood things. The ParameterInfo.IsIn
23169 and IsOut represent whether the parameter has the [In] and [Out]
23172 2002-01-22 Miguel de Icaza <miguel@ximian.com>
23174 * ecore.cs (FieldExpr.Emit): Release temporaries.
23176 * assign.cs (LocalTemporary.Release): new function.
23178 * codegen.cs (EmitContext.GetTemporaryStorage,
23179 EmitContext.FreeTemporaryStorage): Rework the way we deal with
23180 temporary storage. Now we can "put back" localbuilders when we
23183 2002-01-21 Miguel de Icaza <miguel@ximian.com>
23185 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
23186 need to make a copy of the variable to generate verifiable code.
23188 2002-01-19 Miguel de Icaza <miguel@ximian.com>
23190 * driver.cs: Compute dynamically the system directory.
23192 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
23193 Slower, but more generally useful. Used by the abstract
23194 registering implementation.
23196 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
23197 the rules for the special rule on Type/instances. First check if
23198 we have the same name, and if so, try that special static path
23199 rather than the instance path.
23201 2002-01-18 Miguel de Icaza <miguel@ximian.com>
23203 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
23206 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
23207 Enum, ValueType, Delegate or Array for non-corlib compiles.
23209 * cs-tokenizer.cs: Catch long identifiers (645)
23211 * typemanager.cs (IndexerPropetyName): Ravi never tested this
23214 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
23215 fix, we were returning too early, so we were not registering
23216 pending methods from abstract classes.
23218 Do not register pending methods if the class is abstract.
23220 * expression.cs (Conditional.DoResolve): Report circular implicit
23221 conversions when we neecd to compute it for conditional
23224 (Is.DoResolve): If the expression is always of the provided type,
23225 flag warning 183. If the expression can not ever be of the
23226 provided type flag warning 184.
23228 * class.cs: Catch 169 as well.
23230 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
23233 2002-01-18 Nick Drochak <ndrochak@gol.com>
23235 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
23237 2002-01-17 Miguel de Icaza <miguel@ximian.com>
23239 * interface.cs: (PopulateMethod): Check for pointers being defined
23240 only if the unsafe context is active.
23241 (PopulateProperty): ditto.
23242 (PopulateIndexer): ditto.
23244 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
23245 specified. If pointers are present, make sure that they are
23246 present in an unsafe context.
23247 (Constructor, Constructor.Define): ditto.
23248 (Field, Field.Define): ditto.
23249 (Property, Property.Define): ditto.
23250 (Event, Event.Define): ditto.
23252 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
23253 hashtable if there are classes or structs defined.
23255 * expression.cs (LocalVariableReference.DoResolve): Simplify this
23256 code, as the constant resolution moved.
23258 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
23259 the metadata, so we can flag error 133.
23261 * decl.cs (MemberCore.UnsafeOK): New function to test that a
23262 pointer is being declared in an unsafe context.
23264 2002-01-16 Miguel de Icaza <miguel@ximian.com>
23266 * modifiers.cs (Modifiers.Check): Require a Location argument.
23267 Report error 227 for Unsafe use.
23269 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
23271 * statement.cs (For.Emit): If the test is null, then report that
23272 we do `return', as we wont reach anything afterwards.
23274 (Switch.SwitchGoverningType): Track the expression that matched
23277 * driver.cs: Allow negative numbers as an error code to flag.
23279 * cs-parser.jay: Handle 1551.
23281 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
23283 2002-01-15 Miguel de Icaza <miguel@ximian.com>
23285 * cs-parser.jay: Report 1518 (type declaration can only contain
23286 class, struct, interface, enum or delegate)
23288 (switch_label): Report 1523 (keywords `case' or `default' must
23291 (opt_switch_sections): Report 1522 (empty switch)
23293 * driver.cs: Report 1515 (response file specified multiple times)
23294 Report 1516 (Source file specified multiple times).
23296 * expression.cs (Argument.Resolve): Signal 1510
23298 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
23299 access not allowed in static code)
23301 2002-01-11 Ravi Pratap <ravi@ximian.com>
23303 * typemanager.cs (IsPointerType): Utility method which we are going
23306 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
23307 the object type, so we take care of that.
23309 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
23311 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
23312 added to non-params parameters :-)
23314 * typemanager.cs (CSharpName): Include 'void' type too.
23316 (void_ptr_type): Include in the set of core types.
23318 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
23321 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
23324 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
23325 completely forgotten about it.
23327 2002-01-10 Ravi Pratap <ravi@ximian.com>
23329 * cs-parser.jay (pointer_type): Add. This begins our implementation
23330 of parsing rules for unsafe code.
23332 (unsafe_statement): Implement.
23334 (embedded_statement): Modify to include the above.
23336 * statement.cs (Unsafe): Implement new class for unsafe blocks.
23338 * codegen.cs (EmitContext.InUnsafe): Add. This determines
23339 if the current context is an unsafe one.
23341 * cs-parser.jay (local_variable_pointer_type): Since local variable types
23342 are handled differently, we need separate rules for them.
23344 (local_variable_declaration): Update to use local_variable_pointer_type
23345 to allow variable declarations of unmanaged pointer types.
23347 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
23348 in unsafe contexts.
23350 * ../errors/cs0214.cs : Add.
23352 2002-01-16 Nick Drochak <ndrochak@gol.com>
23354 * makefile: remove 'response' file when cleaning.
23356 2002-01-15 Miguel de Icaza <miguel@ximian.com>
23358 * cs-parser.jay: Report 1524.
23360 2002-01-14 Miguel de Icaza <miguel@ximian.com>
23362 * typemanager.cs (RegisterMethod): drop checking if we have
23363 registered this from here
23365 2002-01-12 Miguel de Icaza <miguel@ximian.com>
23367 * class.cs (Method.EmitDestructor): Implement calling our base
23370 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
23371 value of InFinally.
23373 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
23374 this routine and will wrap the call in a try/catch block. Deal
23377 2002-01-11 Miguel de Icaza <miguel@ximian.com>
23379 * ecore.cs (Expression.MemberLookup): instead of taking a
23380 parameter `same_type' that was used to tell whether we could
23381 access private members we compute our containing type from the
23384 (FieldExpr): Added partial support for volatile fields. This does
23385 not work for volatile fields exposed from assemblies, as I can not
23386 figure out how to extract the modreq from it.
23388 Updated all the source files to use this.
23390 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
23391 because it is referenced by MemberLookup very often.
23393 2002-01-09 Ravi Pratap <ravi@ximian.com>
23395 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
23396 TypeBuilder.GetCustomAttributes to retrieve what we need.
23398 Get rid of redundant default_member_attr_type as this is the same as
23399 default_member_type which already exists.
23401 * interface.cs, attribute.cs : Update accordingly.
23403 2002-01-08 Miguel de Icaza <miguel@ximian.com>
23405 * typemanager.cs: Enable IndexerPropertyName again. It does not
23406 work for TYpeBuilders though. Ravi, can you please fix this?
23408 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
23410 * expression.cs (Argument.Emit): Handle the case of ref objects
23411 being passed to ref functions;
23413 (ParameterReference.EmitLoad): Loads the content of the pointer
23414 without dereferencing.
23416 2002-01-07 Miguel de Icaza <miguel@ximian.com>
23418 * cs-tokenizer.cs: Implemented the pre-processing expressions.
23420 2002-01-08 Ravi Pratap <ravi@ximian.com>
23422 * class.cs (Indexer.DefineMethod): Incorporate the interface
23423 type in the name of the method if we are doing explicit interface
23426 * expression.cs (ConversionExists): Remove as it is completely obsolete.
23428 (BetterConversion): Fix extremely trivial bug where we were referring to
23429 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
23432 * ../errors/bug16.cs : Add although we have fixed it.
23434 2002-01-07 Miguel de Icaza <miguel@ximian.com>
23436 * expression.cs (BaseIndexer): Begin implementation.
23438 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
23440 * cs-parser.jay (indexer_declarator): Use qualified_identifier
23441 production directly to remove a shift/reduce, and implement
23442 explicit interface implementation.
23444 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
23445 after a floating point suffix.
23447 * expression.cs (DoNumericPromotions): Improved the conversion for
23448 uint/uint. If we have a constant, we avoid doing a typecast to a
23451 * class.cs (Indexer): Implement explicit interface implementation
23454 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
23456 * class.cs: make the default instance constructor public and hidebysig.
23458 2001-01-03 Ravi Pratap <ravi@ximian.com>
23460 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
23461 so we can call it from elsewhere.
23463 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
23464 we emit it internally if the class has a defined indexer; otherwise the user
23465 emits it by decorating the class definition with the DefaultMemberAttribute.
23467 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
23468 attribute is not used on a type which defines an indexer.
23470 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
23471 character when we skip whitespace.
23473 * ../errors/cs0646.cs : Add.
23475 2002-01-03 Miguel de Icaza <miguel@ximian.com>
23477 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
23480 * makefile: Add practical target `mcs3.exe' which builds the third
23481 generation compiler.
23483 * expression.cs (New): Fix structures constructor calling.
23485 * class.cs (Property, Method, Indexer): Emit Final flag on the
23486 method if we are an interface implementation and we are not
23489 * ecore.cs (PropertyExpr): New public field `IsBase', tells
23490 whether this property is referencing a `base' method.
23492 * expression.cs (Invocation.EmitCall): take an extra argument:
23493 is_base, this is used to determine whether the `call' or
23494 `callvirt' opcode should be used.
23497 * delegate.cs: update EmitCall.
23499 * class.cs (Method.Define): Set NewSlot for the cases where we are
23500 not implementing an interface method.
23502 (Property.Define): ditto.
23504 2002-01-02 Miguel de Icaza <miguel@ximian.com>
23506 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
23507 'r'. Allows mcs to parse itself fully.
23509 2002-01-02 Ravi Pratap <ravi@ximian.com>
23511 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
23512 of the number of initializers that require the InitializeArray method.
23514 (CheckIndices): Store the Expression in all cases - not the plain value. Also
23515 update the above field where necessary.
23517 (MakeByteBlob): Update accordingly.
23519 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
23522 (EmitDynamicInitializers): Update in accordance with the new optimization.
23524 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
23525 same OpCode applies.
23527 * cs-parser.jay : Fix some glaring errors I introduced.
23529 2002-01-01 Ravi Pratap <ravi@ximian.com>
23531 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
23532 so that we can check for name clashes there too.
23534 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
23535 for interface indexers.
23537 * interfaces.cs (Define): Emit the default member attribute.
23539 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
23540 variable was being referred to while setting the value ;-)
23542 2002-01-01 Miguel de Icaza <miguel@ximian.com>
23544 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
23545 byte-by-byte information when we know the data is zero.
23547 Make the block always a multiple of 4, because
23548 DefineInitializedData has a bug.
23550 * assign.cs: Fix, we should assign from the temporary, not from
23553 * expression.cs (MakeByteBlob): Fix my incorrect code.
23555 2001-12-31 Miguel de Icaza <miguel@ximian.com>
23557 * typemanager.cs (EnumToUnderlying): This function is used to get
23558 the underlying type from an enumeration, because it does not
23561 * constant.cs: Use the I4_S form for values between -128 and 127.
23563 * statement.cs (Block.LookupLabel): Looks up a label.
23564 (Block): Drop support for labeled blocks.
23566 (LabeledStatement): New kind of statement that represents a label
23569 (Goto): Finally implement this bad boy.
23571 * cs-parser.jay: Update to reflect new mechanism to implement
23574 2001-12-30 Miguel de Icaza <miguel@ximian.com>
23576 * codegen.cs (EmitContext.This): a codegen property that keeps the
23577 a single instance of this instead of creating many different this
23580 * delegate.cs (Delegate.DoResolve): Update to use the property;
23582 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
23584 * expression.cs (BaseAccess.DoResolve): Ditto.
23586 2001-12-29 Ravi Pratap <ravi@ximian.com>
23588 * typemanager.cs (methodimpl_attr_type): Add to hold the type
23589 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
23591 (InitCoreTypes): Update accordingly.
23593 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
23594 so we can quickly store the state.
23596 (ApplyAttributes): Set the correct implementation flags
23597 for InternalCall methods.
23599 2001-12-29 Miguel de Icaza <miguel@ximian.com>
23601 * expression.cs (EmitCall): if a method is not virtual, then do
23602 not use callvirt on it.
23604 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
23605 user defined stuff) requires the use of stobj, which takes an
23606 address on the stack instead of an array and an index. So emit
23607 the Ldelema operation for it.
23609 (EmitStoreOpcode): Use stobj for valuetypes.
23611 (UnaryMutator.EmitCode): Use the right 1 value depending on
23612 whether we are dealing with int64/uint64, float or doubles.
23614 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
23615 constructors that I implemented last night.
23617 (Constructor.IsDefault): Fix to work properly for static
23620 * cs-parser.jay (CheckDef): report method signature errors.
23621 Update error number 103 to be 132.
23623 * decl.cs: New AdditionResult enumeration value: MethodExists.
23624 Although we do this check for methods later on in the semantic
23625 analysis, catching repeated default constructors is so easy that
23626 we catch these here.
23628 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
23631 (ParameterReference.EmitAssign, Emit): handle
23634 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
23635 (ArrayAccess.EmitStoreOpcode): ditto.
23637 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
23639 * expression.cs (MakeByteBlob): Complete all the missing types
23640 (uint, short, ushort, byte, sbyte)
23642 * class.cs: Only init instance field initializers on instance
23645 Rename `constructors' to instance_constructors.
23647 (TypeContainer.AddConstructor): Only add constructors to the list
23648 if it is not static.
23650 Make sure that we handle default_static_constructor independently
23651 everywhere where we handle instance_constructors
23653 2001-12-28 Miguel de Icaza <miguel@ximian.com>
23655 * class.cs: Do not lookup or create a base initializer for a
23656 static constructor.
23658 (ConstructorInitializer.Resolve): use the proper type to lookup
23661 * cs-parser.jay: Report error 1585 (modifiers between type and name).
23663 * enum.cs, interface.cs: Remove CloseType, this is taken care by
23666 * decl.cs: CloseType is now an virtual method, the default
23667 implementation just closes this type.
23669 2001-12-28 Ravi Pratap <ravi@ximian.com>
23671 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
23672 to PreserveSig by default. Also emit HideBySig on such methods.
23674 Basically, set the defaults to standard values.
23676 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
23677 argument, if candidate is better, it can't be worse than the best !
23679 (Invocation): Re-write bits to differentiate between methods being
23680 applicable in their expanded form and their normal form - for params
23683 Get rid of use_standard everywhere as only standard conversions are allowed
23684 in overload resolution.
23686 More spec conformance.
23688 2001-12-27 Miguel de Icaza <miguel@ximian.com>
23690 * driver.cs: Add --timestamp, to see where the compiler spends
23693 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
23694 `this' in static code.
23696 (SimpleName.DoResolve): Implement in terms of a helper function
23697 that allows static-references to be passed upstream to
23700 (Expression.ResolveWithSimpleName): Resolve specially simple
23701 names when called by MemberAccess to implement the special
23704 (Expression.ImplicitReferenceConversion): Handle conversions from
23705 Null to reference types before others, as Null's type is
23708 * expression.cs (Invocation.EmitCall): Handle the special case of
23709 calling methods declared on a reference type from a ValueType
23710 (Base classes System.Object and System.Enum)
23712 (MemberAccess.Resolve): Only perform lookups on Enumerations if
23713 the left hand side is a TypeExpr, not on every enumeration.
23715 (Binary.Resolve): If types are reference types, then do a cast to
23716 object on operators != and == of both arguments.
23718 * typemanager.cs (FindMembers): Extract instance and static
23719 members if requested.
23721 * interface.cs (PopulateProperty): Use void_type instead of null
23722 as the return type for the setter method.
23724 (PopulateIndexer): ditto.
23726 2001-12-27 Ravi Pratap <ravi@ximian.com>
23728 * support.cs (ReflectionParameters): Fix minor bug where we
23729 were examining the wrong parameter for the ParamArray attribute.
23731 Cope with requests for the type of the parameter at position
23732 greater than the params parameter's. We now return the element
23733 type of the params array as that makes more sense.
23735 * expression.cs (Invocation.IsParamsMethodApplicable): Update
23736 accordingly as we no longer have to extract the element type
23739 (Invocation.OverloadResolve): Update.
23741 2001-12-27 Miguel de Icaza <miguel@ximian.com>
23743 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
23744 against IEnumerator, test whether the return value is a descendant
23745 of the IEnumerator interface.
23747 * class.cs (Indexer.Define): Use an auxiliary method to implement
23748 the other bits of the method definition. Begin support for
23749 explicit interface implementation.
23751 (Property.DefineMethod): Use TypeManager.void_type instead of null
23752 for an empty return value.
23754 2001-12-26 Miguel de Icaza <miguel@ximian.com>
23756 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
23757 dealing with a FieldExpr which is composed of a FieldBuilder, in
23758 the code path we did extract the constant, but we should have
23759 obtained the underlying value to be able to cast it (otherwise we
23760 end up in an infinite loop, this is what Ravi was running into).
23762 (ArrayCreation.UpdateIndices): Arrays might be empty.
23764 (MemberAccess.ResolveMemberAccess): Add support for section
23765 14.5.4.1 that deals with the special case of E.I when E is a type
23766 and something else, that I can be a reference to a static member.
23768 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
23769 handle a particular array type to create byte blobs, it is just
23770 something we dont generate byteblobs for.
23772 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
23775 * location.cs (Push): remove the key from the hashtable that we
23776 are about to add. This happens for empty files.
23778 * driver.cs: Dispose files after we have parsed them.
23780 (tokenize): new function that only runs the tokenizer on its
23781 input, for speed testing.
23783 2001-12-26 Ravi Pratap <ravi@ximian.com>
23785 * class.cs (Event.Define): Define the private field only if there
23786 are no accessors defined.
23788 * expression.cs (ResolveMemberAccess): If there is no associated
23789 field with the event, that means we have an event defined with its
23790 own accessors and we should flag error cs0070 since transforming
23791 ourselves into a field is not valid in that case.
23793 * ecore.cs (SimpleName.DoResolve): Same as above.
23795 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
23796 and charset to sane values.
23798 2001-12-25 Ravi Pratap <ravi@ximian.com>
23800 * assign.cs (DoResolve): Perform check on events only if they
23801 are being accessed outside the declaring type.
23803 * cs-parser.jay (event_declarations): Update rules to correctly
23804 set the type of the implicit parameter etc.
23806 (add_accessor, remove_accessor): Set current local parameters.
23808 * expression.cs (Binary): For delegate addition and subtraction,
23809 cast the return value from the method into the appropriate delegate
23812 2001-12-24 Ravi Pratap <ravi@ximian.com>
23814 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
23815 of these as the workaround is unnecessary.
23817 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
23818 delegate data - none of that is needed at all.
23820 Re-write bits to extract the instance expression and the delegate method
23823 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
23826 * attribute.cs (ApplyAttributes): New method to take care of common tasks
23827 of attaching attributes instead of duplicating code everywhere.
23829 * everywhere : Update code to do attribute emission using the above method.
23831 2001-12-23 Miguel de Icaza <miguel@ximian.com>
23833 * expression.cs (IsParamsMethodApplicable): if there are not
23834 parameters, return immediately.
23836 * ecore.cs: The 0 literal can be implicity converted to an enum
23839 (SimpleName.DoResolve): First lookup the type, then lookup the
23842 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
23843 want to get its address. If the InstanceExpression is not
23844 addressable, store the result in a temporary variable, then get
23847 * codegen.cs: Only display 219 errors on warning level or above.
23849 * expression.cs (ArrayAccess): Make it implement the
23850 IMemoryLocation interface.
23852 (Binary.DoResolve): handle the operator == (object a, object b)
23853 and operator != (object a, object b) without incurring into a
23854 BoxedCast (because 5 != o should never be performed).
23856 Handle binary enumerator operators.
23858 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
23859 value type, otherwise use Ldelem_ref.
23861 Use precomputed names;
23863 (AddressOf): Implement address of
23865 * cs-parser.jay (labeled_statement): Fix recursive block
23866 addition by reworking the production.
23868 * expression.cs (New.DoEmit): New has a special case:
23870 If we are dealing with a ValueType, we have a few
23871 situations to deal with:
23873 * The target of New is a ValueType variable, that is
23874 easy, we just pass this as the variable reference
23876 * The target of New is being passed as an argument,
23877 to a boxing operation or a function that takes a
23880 In this case, we need to create a temporary variable
23881 that is the argument of New.
23884 2001-12-23 Ravi Pratap <ravi@ximian.com>
23886 * rootcontext.cs (LookupType): Check that current_type is not null before
23887 going about looking at nested types.
23889 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
23890 not implement the IAssignMethod interface any more.
23892 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
23893 where we tranform them into FieldExprs if they are being resolved from within
23894 the declaring type.
23896 * ecore.cs (SimpleName.DoResolve): Do the same here.
23898 * assign.cs (DoResolve, Emit): Clean up code considerably.
23900 * ../errors/bug10.cs : Add.
23902 * ../errors/cs0070.cs : Add.
23904 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
23906 * assign.cs : Get rid of EventIsLocal everywhere.
23908 2001-12-23 Miguel de Icaza <miguel@ximian.com>
23910 * ecore.cs (ConvertIntLiteral): finished the implementation.
23912 * statement.cs (SwitchLabel): Convert the value we are using as a
23913 key before looking up the table.
23915 2001-12-22 Miguel de Icaza <miguel@ximian.com>
23917 * codegen.cs (EmitTopBlock): Require a Location argument now.
23919 * cs-parser.jay (constructor_declarator): We need to setup
23920 current_local_parameters before we parse the
23921 opt_constructor_initializer, to allow the variables to be bound
23922 to the constructor arguments.
23924 * rootcontext.cs (LookupType): First lookup nested classes in our
23925 class and our parents before we go looking outside our class.
23927 * expression.cs (ConstantFold): Extract/debox the values at the
23930 * rootcontext.cs (EmitCode): Resolve the constants first before we
23931 resolve the types. This is not really needed, but it helps debugging.
23933 * statement.cs: report location.
23935 * cs-parser.jay: pass location to throw statement.
23937 * driver.cs: Small bug fix.
23939 * report.cs: Updated format to be 4-zero filled digits.
23941 2001-12-22 Ravi Pratap <ravi@ximian.com>
23943 * expression.cs (CheckIndices): Fix minor bug where the wrong
23944 variable was being referred to ;-)
23946 (DoEmit): Do not call EmitStaticInitializers when the
23947 underlying type is System.Object.
23949 2001-12-21 Ravi Pratap <ravi@ximian.com>
23951 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
23952 and do the usual workaround for SRE.
23954 * class.cs (MyEventBuilder.EventType): New member to get at the type
23955 of the event, quickly.
23957 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
23959 * assign.cs (Assign.DoResolve): Handle the case when the target
23960 is an EventExpr and perform the necessary checks.
23962 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
23965 (SimpleName.MemberStaticCheck): Include check for EventExpr.
23967 (EventExpr): Set the type in the constructor itself since we
23968 are meant to be born fully resolved.
23970 (EventExpr.Define): Revert code I wrote earlier.
23972 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
23973 instance expression is null. The instance expression is a This in that case
23974 or a null, depending on whether it is a static method or not.
23976 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
23977 refers to more than one method.
23979 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
23980 and accordingly flag errors.
23982 2001-12-21 Miguel de Icaza <miguel@ximian.com>
23984 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
23986 2001-12-22 Miguel de Icaza <miguel@ximian.com>
23988 * location.cs (ToString): Provide useful rutine.
23990 2001-12-21 Miguel de Icaza <miguel@ximian.com>
23992 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
23993 objects, return the actual integral boxed.
23995 * statement.cs (SwitchLabel): define an ILLabel for each
23998 (Switch.CheckSwitch): If the value is a Literal, extract
23999 the underlying literal.
24001 Also in the unused hashtable we had, add the SwitchLabel so we can
24002 quickly look this value up.
24004 * constant.cs: Implement a bunch of new constants. Rewrite
24005 Literal based on this. Made changes everywhere to adapt to this.
24007 * expression.cs (Expression.MakeByteBlob): Optimize routine by
24008 dereferencing array only once, and also copes with enumrations.
24010 bytes are two bytes wide, not one.
24012 (Cast): Perform constant conversions.
24014 * ecore.cs (TryImplicitIntConversion): Return literals instead of
24015 wrappers to the literals here.
24017 * expression.cs (DoNumericPromotions): long literals can converted
24018 to ulong implicity (this is taken care of elsewhere, but I was
24019 missing this spot).
24021 * ecore.cs (Expression.Literalize): Make the return type Literal,
24022 to improve type checking.
24024 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
24026 2001-12-20 Miguel de Icaza <miguel@ximian.com>
24028 * literal.cs: Revert code from ravi that checked the bounds. The
24029 bounds are sane by the definition of the type itself.
24031 * typemanager.cs: Fix implementation of ImplementsInterface. We
24032 need to actually look up in our parent hierarchy for interfaces
24035 * const.cs: Use the underlying type for enumerations
24037 * delegate.cs: Compute the basename for the delegate creation,
24038 that should fix the delegate test case, and restore the correct
24039 Type Lookup semantics in rootcontext
24041 * rootcontext.cs: Revert Ravi's last patch. The correct way of
24042 referencing a nested type with the Reflection API is using the "+"
24045 * cs-parser.jay: Do not require EOF token at the end.
24047 2001-12-20 Ravi Pratap <ravi@ximian.com>
24049 * rootcontext.cs (LookupType): Concatenate type names with
24050 a '.' instead of a '+' The test suite passes again.
24052 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
24053 field of the enumeration.
24055 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
24056 the case when the member is an EventExpr.
24058 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
24059 static has an associated instance expression.
24061 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
24063 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
24065 * class.cs (Event.Define): Register event and perform appropriate checks
24068 We define the Add and Remove methods even if the use provides none because
24069 in that case, we provide default implementations ourselves.
24071 Define a private field of the type of the event. This is done by the CSC compiler
24072 and we should be doing it too ;-)
24074 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
24075 More methods we use in code we generate.
24077 (multicast_delegate_type, delegate_type): Two separate types since the distinction
24080 (InitCoreTypes): Update accordingly for the above.
24082 * class.cs (Event.Emit): Generate code for default accessors that we provide
24084 (EmitDefaultMethod): Do the job in the above.
24086 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
24089 2001-12-20 Miguel de Icaza <miguel@ximian.com>
24091 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
24092 builders even if we were missing one.
24094 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
24095 pass the Basename as our class name instead of the Name. The
24096 basename will be correctly composed for us.
24098 * parameter.cs (Paramters): Now takes a Location argument.
24100 * decl.cs (DeclSpace.LookupType): Removed convenience function and
24101 make all the code call directly LookupType in RootContext and take
24102 this chance to pass the Location information everywhere.
24104 * Everywhere: pass Location information.
24106 2001-12-19 Miguel de Icaza <miguel@ximian.com>
24108 * class.cs (Constructor.Define): Updated way of detecting the
24109 length of the parameters.
24111 (TypeContainer.DefineType): Use basename as the type name for
24114 (TypeContainer.Define): Do not recursively define types here, as
24115 definition is taken care in order by the RootContext.
24117 * tree.cs: Keep track of namespaces in a per-file basis.
24119 * parameter.cs (Parameter.ComputeSignature): Update to use
24122 (Parameters.GetSignature): ditto.
24124 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
24125 instead of a TypeContainer.
24127 (Interface.SemanticAnalysis): Use `this' instead of our parent to
24128 resolve names. Because we need to be resolve in our context, not
24131 * driver.cs: Implement response files.
24133 * class.cs (TypeContainer.DefineType): If we are defined, do not
24134 redefine ourselves.
24136 (Event.Emit): Emit the code for add/remove handlers.
24137 (Event.Define): Save the MethodBuilders for add/remove.
24139 * typemanager.cs: Use pair here too.
24141 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
24142 DictionaryEntry requires the first argument to be non-null.
24144 (enum_declaration): Compute full name for registering the
24147 (delegate_declaration): Instead of using
24148 formal_parameter_list, use opt_formal_parameter_list as the list
24151 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
24152 (EventParsing): New property that controls whether `add' and
24153 `remove' are returned as tokens or identifiers (for events);
24155 2001-12-19 Ravi Pratap <ravi@ximian.com>
24157 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
24158 use MyEventBuilder only and let it wrap the real builder for us.
24160 (MyEventBuilder): Revamp constructor etc.
24162 Implement all operations that we perform on EventBuilder in precisely the same
24165 (FindMembers): Update to use the EventBuilder member.
24167 (Event.Emit): Update accordingly.
24169 2001-12-18 Ravi Pratap <ravi@ximian.com>
24171 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
24172 by calling the appropriate methods.
24174 (GetCustomAttributes): Make stubs as they cannot possibly do anything
24177 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
24179 2001-12-17 Ravi Pratap <ravi@ximian.com>
24181 * delegate.cs (Delegate.Populate): Check that the return type
24182 and various parameters types are indeed accessible.
24184 * class.cs (Constructor.Define): Same here.
24186 (Field.Define): Ditto.
24188 (Event.Define): Ditto.
24190 (Operator.Define): Check that the underlying Method defined itself
24191 correctly - so it's MethodBuilder should not be null.
24193 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
24194 expression happens to be null.
24196 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
24197 members but as of now we don't seem to be able to do anything really useful with it.
24199 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
24200 not the EventBuilder.
24202 2001-12-18 Miguel de Icaza <miguel@ximian.com>
24204 * cs-tokenizer.cs: Add support for defines.
24205 Add support for #if, #elif, #else, #endif
24207 (eval_var): evaluates a variable.
24208 (eval): stubbed for evaluating functions.
24210 * cs-parser.jay: Pass the defines information
24212 * driver.cs: Add --define command line option.
24214 * decl.cs: Move MemberCore here.
24216 Make it the base class for DeclSpace. This allows us to catch and
24217 report 108 and 109 for everything now.
24219 * class.cs (TypeContainer.Define): Extract all the members
24220 before populating and emit the warning 108 (new keyword required
24221 to override) instead of having each member implement this.
24223 (MemberCore.Define): New abstract method, we will be using this in
24224 the warning reporting engine in Populate.
24226 (Operator.Define): Adjust to new MemberCore protocol.
24228 * const.cs (Const): This does not derive from Expression, it is a
24229 temporary object we use to create fields, it is a MemberCore.
24231 * class.cs (Method.Define): Allow the entry point to be in a
24234 * driver.cs: Rewrite the argument handler to clean it up a bit.
24236 * rootcontext.cs: Made it just an auxiliary namespace feature by
24237 making everything static.
24239 * driver.cs: Adapt code to use RootContext type name instead of
24242 * delegate.cs: Remove RootContext argument.
24244 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
24247 * class.cs (Event.Define): The lookup can fail.
24249 * cs-tokenizer.cs: Begin implementation of pre-procesor.
24251 * expression.cs: Resolve the this instance before invoking the code.
24253 2001-12-17 Miguel de Icaza <miguel@ximian.com>
24255 * cs-parser.jay: Add a production in element_access that allows
24256 the thing to become a "type" reference. This way we can parse
24257 things like "(string [])" as a type.
24259 Note that this still does not handle the more complex rules of
24263 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
24265 * ecore.cs: (CopyNewMethods): new utility function used to
24266 assemble the list of methods from running FindMembers.
24268 (MemberLookup): Rework FindMembers so that
24270 2001-12-16 Miguel de Icaza <miguel@ximian.com>
24272 * class.cs (TypeContainer): Remove Delegates who fail to be
24275 * delegate.cs (Populate): Verify that we dont get null return
24276 values. TODO: Check for AsAccessible.
24278 * cs-parser.jay: Use basename to emit error 574 (destructor should
24279 have the same name as container class), not the full name.
24281 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
24282 possible representation.
24284 Also implements integer type suffixes U and L.
24286 2001-12-15 Miguel de Icaza <miguel@ximian.com>
24288 * expression.cs (ArrayCreation.DoResolve): We need to do the
24289 argument resolution *always*.
24291 * decl.cs: Make this hold the namespace. Hold the root context as
24293 (LookupType): Move here.
24295 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
24297 * location.cs (Row, Name): Fixed the code, it was always returning
24298 references to the first file.
24300 * interface.cs: Register properties defined through interfaces.
24302 * driver.cs: Add support for globbing on the command line
24304 * class.cs (Field): Make it derive from MemberCore as well.
24307 2001-12-15 Ravi Pratap <ravi@ximian.com>
24309 * class.cs (Event::Define): Check that the type of the event is a delegate
24310 type else flag error #66.
24312 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
24315 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
24316 values of EntryPoint, CharSet etc etc.
24318 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
24320 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
24321 be null and we should ignore this. I am not sure if this is really clean. Apparently,
24322 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
24323 which needs this to do its work.
24325 * ../errors/cs0066.cs : Add.
24327 2001-12-14 Miguel de Icaza <miguel@ximian.com>
24329 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
24332 * class.cs: (MethodSignature.MethodSignature): Removed hack that
24333 clears out the parameters field.
24334 (MemberSignatureCompare): Cleanup
24336 (MemberCore): New base class used to share code between MethodCore
24339 (RegisterRequiredImplementations) BindingFlags.Public requires
24340 either BindingFlags.Instace or Static. Use instance here.
24342 (Property): Refactored code to cope better with the full spec.
24344 * parameter.cs (GetParameterInfo): Return an empty array instead
24347 * class.cs (Property): Abstract or extern properties have no bodies.
24349 * parameter.cs (GetParameterInfo): return a zero-sized array.
24351 * class.cs (TypeContainer.MethodModifiersValid): Move all the
24352 method modifier validation to the typecontainer so we can reuse
24353 this on properties.
24355 (MethodCore.ParameterTypes): return an empty sized array of types.
24357 (Property.Define): Test property modifier validity.
24359 Add tests for sealed/override too.
24361 (Method.Emit): abstract or extern methods have no bodies.
24363 2001-12-14 Ravi Pratap <ravi@ximian.com>
24365 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
24368 (Method::Define, ::Emit): Modify accordingly.
24370 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
24372 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
24374 * makefile: Pass in /unsafe.
24376 2001-12-13 Miguel de Icaza <miguel@ximian.com>
24378 * class.cs (MakeKey): Kill routine.
24380 * class.cs (TypeContainer.Define): Correctly define explicit
24381 method implementations (they require the full interface name plus
24384 * typemanager.cs: Deply the PtrHashtable here and stop using the
24385 lame keys. Things work so much better.
24387 This of course broke everyone who depended on `RegisterMethod' to
24388 do the `test for existance' test. This has to be done elsewhere.
24390 * support.cs (PtrHashtable): A hashtable that avoid comparing with
24391 the object stupid Equals method (because, that like fails all over
24392 the place). We still do not use it.
24394 * class.cs (TypeContainer.SetRequiredInterface,
24395 TypeContainer.RequireMethods): Killed these two routines and moved
24396 all the functionality to RegisterRequiredImplementations.
24398 (TypeContainer.RegisterRequiredImplementations): This routine now
24399 registers all the implementations required in an array for the
24400 interfaces and abstract methods. We use an array of structures
24401 which can be computed ahead of time to reduce memory usage and we
24402 also assume that lookups are cheap as most classes will not
24403 implement too many interfaces.
24405 We also avoid creating too many MethodSignatures.
24407 (TypeContainer.IsInterfaceMethod): Update and optionally does not
24408 clear the "pending" bit if we find that there are problems with
24411 (TypeContainer.VerifyPendingMethods): Update to report errors of
24412 methods that look like implementations but are not.
24414 (TypeContainer.Define): Add support for explicit interface method
24417 2001-12-12 Miguel de Icaza <miguel@ximian.com>
24419 * typemanager.cs: Keep track of the parameters here instead of
24420 being a feature of the TypeContainer.
24422 * class.cs: Drop the registration of parameters here, as
24423 InterfaceMethods are also interface declarations.
24425 * delegate.cs: Register methods with the TypeManager not only with
24426 the TypeContainer. This code was buggy.
24428 * interface.cs: Full registation here.
24430 2001-12-11 Miguel de Icaza <miguel@ximian.com>
24432 * expression.cs: Remove reducer for binary expressions, it can not
24435 * const.cs: Put here the code that used to go into constant.cs
24437 * constant.cs: Put here the code for constants, this is a new base
24438 class for Literals.
24440 * literal.cs: Make Literal derive from Constant.
24442 2001-12-09 Miguel de Icaza <miguel@ximian.com>
24444 * statement.cs (Return.Emit): Report error 157 if the user
24445 attempts to return from a finally block.
24447 (Return.Emit): Instead of emitting a return, jump to the end of
24450 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
24451 LocalBuilder to store the result of the function. ReturnLabel is
24452 the target where we jump.
24455 2001-12-09 Radek Doulik <rodo@ximian.com>
24457 * cs-parser.jay: remember alias in current namespace
24459 * ecore.cs (SimpleName::DoResolve): use aliases for types or
24462 * class.cs (LookupAlias): lookup alias in my_namespace
24464 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
24466 (LookupAlias): lookup alias in this and if needed in parent
24469 2001-12-08 Miguel de Icaza <miguel@ximian.com>
24473 * rootcontext.cs: (ModuleBuilder) Made static, first step into
24474 making things static. I need this to avoid passing the
24475 TypeContainer when calling ParameterType.
24477 * support.cs (InternalParameters.ParameterType): Remove ugly hack
24478 that did string manipulation to compute the type and then call
24479 GetType. Use Parameter.ParameterType instead.
24481 * cs-tokenizer.cs: Consume the suffix for floating values.
24483 * expression.cs (ParameterReference): figure out whether this is a
24484 reference parameter or not. Kill an extra variable by computing
24485 the arg_idx during emission.
24487 * parameter.cs (Parameters.GetParameterInfo): New overloaded
24488 function that returns whether a parameter is an out/ref value or not.
24490 (Parameter.ParameterType): The type of the parameter (base,
24491 without ref/out applied).
24493 (Parameter.Resolve): Perform resolution here.
24494 (Parameter.ExternalType): The full type (with ref/out applied).
24496 * statement.cs (Using.Emit, Using.EmitExpression): Implement
24497 support for expressions on the using statement.
24499 2001-12-07 Miguel de Icaza <miguel@ximian.com>
24501 * statement.cs (Using.EmitLocalVariableDecls): Split the
24502 localvariable handling of the using statement.
24504 (Block.EmitMeta): Keep track of variable count across blocks. We
24505 were reusing slots on separate branches of blocks.
24507 (Try.Emit): Emit the general code block, we were not emitting it.
24509 Check the type of the declaration to be an IDisposable or
24510 something that can be implicity converted to it.
24512 Emit conversions if required.
24514 * ecore.cs (EmptyExpression): New utility class.
24515 (Expression.ImplicitConversionExists): New utility function.
24517 2001-12-06 Miguel de Icaza <miguel@ximian.com>
24519 * statement.cs (Using): Implement.
24521 * expression.cs (LocalVariableReference): Support read only variables.
24523 * statement.cs: Remove the explicit emit for the Leave opcode.
24524 (VariableInfo): Add a readonly field.
24526 2001-12-05 Miguel de Icaza <miguel@ximian.com>
24528 * ecore.cs (ConvCast): new class used to encapsulate the various
24529 explicit integer conversions that works in both checked and
24530 unchecked contexts.
24532 (Expression.ConvertNumericExplicit): Use new ConvCast class to
24533 properly generate the overflow opcodes.
24535 2001-12-04 Miguel de Icaza <miguel@ximian.com>
24537 * statement.cs: The correct type for the EmptyExpression is the
24538 element_type, not the variable type. Ravi pointed this out.
24540 2001-12-04 Ravi Pratap <ravi@ximian.com>
24542 * class.cs (Method::Define): Handle PInvoke methods specially
24543 by using DefinePInvokeMethod instead of the usual one.
24545 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
24546 above to do the task of extracting information and defining the method.
24548 2001-12-04 Ravi Pratap <ravi@ximian.com>
24550 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
24551 of the condition for string type.
24553 (Emit): Move that here.
24555 (ArrayCreation::CheckIndices): Keep string literals in their expression
24558 (EmitDynamicInitializers): Handle strings appropriately.
24560 2001-12-04 Miguel de Icaza <miguel@ximian.com>
24562 * codegen.cs (EmitContext): Replace multiple variables with a
24563 single pointer to the current Switch statement.
24565 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
24568 2001-12-03 Miguel de Icaza <miguel@ximian.com>
24572 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
24575 (Foreach.Emit): Foreach on arrays was not setting
24576 up the loop variables (for break/continue).
24578 (GotoCase): Semi-implented.
24580 2001-12-03 Ravi Pratap <ravi@ximian.com>
24582 * attribute.cs (CheckAttribute): Handle system attributes by using
24583 Attribute.GetAttributes to examine information we need.
24585 (GetValidPlaces): Same here.
24587 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
24589 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
24591 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
24593 (Method::Define): Set appropriate flags if we have a DllImport attribute.
24595 (Method::Emit): Handle the case when we are a PInvoke method.
24597 2001-12-03 Miguel de Icaza <miguel@ximian.com>
24599 * expression.cs: Use ResolveWithSimpleName on compound names.
24601 2001-12-02 Ravi Pratap <ravi@ximian.com>
24603 * constant.cs (EmitConstant): Make sure we resolve the associated expression
24604 before trying to reduce it.
24606 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
24608 * constant.cs (LookupConstantValue): Implement.
24610 (EmitConstant): Use the above in emitting the constant.
24612 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
24613 that are user-defined by doing a LookupConstantValue on them.
24615 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
24618 2001-11-29 Miguel de Icaza <miguel@ximian.com>
24620 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
24622 (BaseAccess.DoResolve): Implement.
24624 (MemberAccess.DoResolve): Split this routine into a
24625 ResolveMemberAccess routine that can be used independently
24627 2001-11-28 Miguel de Icaza <miguel@ximian.com>
24629 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
24630 As that share bits of the implementation. Is returns a boolean,
24631 while As returns the Type that is being probed.
24633 2001-12-01 Ravi Pratap <ravi@ximian.com>
24635 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
24636 instead of a Literal - much easier.
24638 (EnumInTransit): Remove - utterly useless :-)
24640 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
24642 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
24644 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
24645 chain when we have no associated expression.
24647 2001-11-30 Ravi Pratap <ravi@ximian.com>
24649 * constant.cs (Define): Use Location while reporting the errror.
24651 Also emit a warning when 'new' is used and there is no inherited
24654 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
24657 (LookupEnumValue): Implement to lookup an enum member's value and define it
24660 (Populate): Re-write accordingly to use the above routine.
24662 2001-11-27 Miguel de Icaza <miguel@ximian.com>
24664 * expression.cs (This): Fix prototype for DoResolveLValue to
24665 override the base class DoResolveLValue.
24667 * cs-parser.cs: Report errors cs574 and cs575 (destructor
24670 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
24671 (we need to load the address of the field here). This fixes
24674 (FieldExpr.DoResolveLValue): Call the DoResolve
24675 function to initialize the Instance expression.
24677 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
24678 correctly the GetEnumerator operation on a value type.
24680 * cs-parser.jay: Add more simple parsing error catches.
24682 * statement.cs (Switch): Add support for string switches.
24683 Handle null specially.
24685 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
24687 2001-11-28 Ravi Pratap <ravi@ximian.com>
24689 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
24691 (declare_local_constant): New helper function.
24693 * statement.cs (AddConstant): Keep a separate record of constants
24695 (IsConstant): Implement to determine if a variable is a constant.
24697 (GetConstantExpression): Implement.
24699 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
24701 * statement.cs (IsVariableDefined): Re-write.
24703 2001-11-27 Ravi Pratap <ravi@ximian.com>
24705 * class.cs (TypeContainer::FindMembers): Look for constants
24706 in the case when we are looking for MemberTypes.Field
24708 * expression.cs (MemberAccess::DoResolve): Check that in the
24709 case we are a FieldExpr and a Literal, we are not being accessed
24710 by an instance reference.
24712 * cs-parser.jay (local_constant_declaration): Implement.
24714 (declaration_statement): Implement for constant declarations.
24716 2001-11-26 Miguel de Icaza <miguel@ximian.com>
24718 * statement.cs (Switch): Catch double defaults.
24720 (Switch): More work on the switch() statement
24721 implementation. It works for integral values now, need to finish
24725 2001-11-24 Miguel de Icaza <miguel@ximian.com>
24727 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
24728 integer literals into other integer literals. To be used by
24731 2001-11-24 Ravi Pratap <ravi@ximian.com>
24733 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
24736 (EmitDynamicInitializers): Cope with the above since we extract data
24737 directly from ArrayData now.
24739 (ExpectInitializers): Keep track of whether initializers are mandatory
24742 (Bounds): Make it a hashtable to prevent the same dimension being
24743 recorded for every element in that dimension.
24745 (EmitDynamicInitializers): Fix bug which prevented the Set array method
24748 Also fix bug which was causing the indices to be emitted in the reverse
24751 2001-11-24 Miguel de Icaza <miguel@ximian.com>
24753 * expression.cs (ArrayCreation): Implement the bits that Ravi left
24754 unfinished. They do not work, because the underlying code is
24757 2001-11-22 Miguel de Icaza <miguel@ximian.com>
24759 * cs-parser.jay: Remove bogus fixme.
24761 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
24762 on Switch statement.
24764 2001-11-23 Ravi Pratap <ravi@ximian.com>
24766 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
24769 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
24770 parameter. Apparently, any expression is allowed.
24772 (ValidateInitializers): Update accordingly.
24774 (CheckIndices): Fix some tricky bugs thanks to recursion.
24776 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
24777 I was being completely brain-dead.
24779 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
24780 and re-write acordingly.
24782 (DelegateInvocation): Re-write accordingly.
24784 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
24786 (MakeByteBlob): Handle types more correctly.
24788 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
24789 initialization from expressions but it is incomplete because I am a complete
24792 2001-11-22 Miguel de Icaza <miguel@ximian.com>
24794 * statement.cs (If.Emit): Fix a bug that generated incorrect code
24795 on If. Basically, we have to return `true' (ie, we do return to
24796 our caller) only if both branches of the if return.
24798 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
24799 short-circuit operators, handle them as short circuit operators.
24801 (Cast.DoResolve): Resolve type.
24802 (Cast.Cast): Take an expression as the target type.
24804 * cs-parser.jay (cast_expression): Remove old hack that only
24805 allowed a limited set of types to be handled. Now we take a
24806 unary_expression and we resolve to a type during semantic
24809 Use the grammar productions from Rhys to handle casts (this is
24810 not complete like Rhys syntax yet, we fail to handle that corner
24811 case that C# has regarding (-x), but we will get there.
24813 2001-11-22 Ravi Pratap <ravi@ximian.com>
24815 * class.cs (EmitFieldInitializer): Take care of the case when we have a
24816 field which is an array type.
24818 * cs-parser.jay (declare_local_variables): Support array initialization too.
24820 * typemanager.cs (MakeKey): Implement.
24822 (everywhere): Use the above appropriately.
24824 * cs-parser.jay (for_statement): Update for array initialization while
24825 declaring variables.
24827 * ecore.cs : The error message was correct, it's the variable's names that
24828 were misleading ;-) Make the code more readable.
24830 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
24831 the correct type etc.
24833 (ConvertExplicit): Handle Enum types by examining the underlying type.
24835 2001-11-21 Ravi Pratap <ravi@ximian.com>
24837 * parameter.cs (GetCallingConvention): Always return
24838 CallingConventions.Standard for now.
24840 2001-11-22 Miguel de Icaza <miguel@ximian.com>
24842 * expression.cs (Binary.ResolveOperator): Update the values of `l'
24843 and `r' after calling DoNumericPromotions.
24845 * ecore.cs: Fix error message (the types were in the wrong order).
24847 * statement.cs (Foreach.ProbeCollectionType): Need to pass
24848 BindingFlags.Instance as well
24850 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
24851 implicit int literal conversion in an empty cast so that we
24852 propagate the right type upstream.
24854 (UnboxCast): new class used to unbox value types.
24855 (Expression.ConvertExplicit): Add explicit type conversions done
24858 (Expression.ImplicitNumericConversion): Oops, forgot to test for
24859 the target type before applying the implicit LongLiterals to ULong
24862 2001-11-21 Miguel de Icaza <miguel@ximian.com>
24864 * cs-parser.jay (for_statement): Reworked the way For works: now
24865 we declare manually any variables that are introduced in
24866 for_initializer to solve the problem of having out-of-band code
24867 emition (that is what got for broken).
24869 (declaration_statement): Perform the actual variable declaration
24870 that used to be done in local_variable_declaration here.
24872 (local_variable_declaration): Do not declare anything, just pass
24873 the information on a DictionaryEntry
24875 2001-11-20 Ravi Pratap <ravi@ximian.com>
24877 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
24878 re-write of the logic to now make it recursive.
24880 (UpdateIndices): Re-write accordingly.
24882 Store element data in a separate ArrayData list in the above methods.
24884 (MakeByteBlob): Implement to dump the array data into a byte array.
24886 2001-11-19 Ravi Pratap <ravi@ximian.com>
24888 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
24891 * constant.cs (Define): Implement.
24893 (EmitConstant): Re-write fully.
24895 Pass in location info.
24897 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
24900 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
24901 DictionaryEntry since we need location info too.
24903 (constant_declaration): Update accordingly.
24905 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
24906 code into another method : UpdateIndices.
24908 2001-11-18 Ravi Pratap <ravi@ximian.com>
24910 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
24911 some type checking etc.
24913 2001-11-17 Ravi Pratap <ravi@ximian.com>
24915 * expression.cs (ArrayCreation::ValidateInitializers): Implement
24916 bits to provide dimension info if the user skips doing that.
24918 Update second constructor to store the rank correctly.
24920 2001-11-16 Ravi Pratap <ravi@ximian.com>
24922 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
24923 and try to implement.
24925 * ../errors/cs0150.cs : Add.
24927 * ../errors/cs0178.cs : Add.
24929 2001-11-16 Miguel de Icaza <miguel@ximian.com>
24931 * statement.cs: Implement foreach on multi-dimensional arrays.
24933 * parameter.cs (Parameters.GetParameterByName): Also lookup the
24934 name of the params argument.
24936 * expression.cs: Use EmitStoreOpcode to get the right opcode while
24937 initializing the array.
24939 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
24940 we can use this elsewhere.
24942 * statement.cs: Finish implementation of foreach for single
24945 * cs-parser.jay: Use an out-of-band stack to pass information
24946 around, I wonder why I need this.
24948 foreach_block: Make the new foreach_block the current_block.
24950 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
24951 function used to return a static Parameters structure. Used for
24952 empty parameters, as those are created very frequently.
24954 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
24956 2001-11-15 Ravi Pratap <ravi@ximian.com>
24958 * interface.cs : Default modifier is private, not public. The
24959 make verify test passes again.
24961 2001-11-15 Ravi Pratap <ravi@ximian.com>
24963 * support.cs (ReflectionParameters): Fix logic to determine
24964 whether the last parameter is a params one. Test 9 passes again.
24966 * delegate.cs (Populate): Register the builders we define with
24967 RegisterParameterForBuilder. Test 19 passes again.
24969 * cs-parser.jay (property_declaration): Reference $6 instead
24970 of $$ to get at the location.
24972 (indexer_declaration): Similar stuff.
24974 (attribute): Ditto.
24976 * class.cs (Property): Register parameters for the Get and Set methods
24977 if they exist. Test 23 passes again.
24979 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
24980 call to EmitArguments as we are sure there aren't any params arguments.
24981 Test 32 passes again.
24983 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
24984 IndexOutOfRangeException.
24986 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
24987 Test 33 now passes again.
24989 2001-11-15 Miguel de Icaza <miguel@ximian.com>
24991 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
24992 broke a bunch of things. Will have to come up with a better way
24993 of tracking locations.
24995 * statement.cs: Implemented foreach for single dimension arrays.
24997 2001-11-09 Miguel de Icaza <miguel@ximian.com>
24999 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
25000 an error. This removes the lookup from the critical path.
25002 * cs-parser.jay: Removed use of temporary_loc, which is completely
25005 2001-11-14 Miguel de Icaza <miguel@ximian.com>
25007 * support.cs (ReflectionParameters.ParameterModifier): Report
25008 whether the argument is a PARAMS argument or not.
25010 * class.cs: Set the attribute `ParamArrayAttribute' on the
25011 parameter argument.
25013 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
25014 and cons_param_array_attribute (ConstructorInfo for
25015 ParamArrayAttribute).,
25017 * codegen.cs: Emit the return using the `Return' statement, that
25018 way we can report the error correctly for missing return values.
25020 * class.cs (Method.Emit): Clean up.
25022 * expression.cs (Argument.Resolve): Take another argument: the
25023 location where this argument is used. Notice that this is not
25024 part of the "Argument" class as to reduce the size of the
25025 structure (we know the approximate location anyways).
25027 Test if the argument is a variable-reference, if not, then
25028 complain with a 206.
25030 (Argument.Emit): Emit addresses of variables.
25032 (Argument.FullDesc): Simplify.
25034 (Invocation.DoResolve): Update for Argument.Resolve.
25036 (ElementAccess.DoResolve): ditto.
25038 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
25039 method should be virtual, as this method is always virtual.
25041 (NewDelegate.DoResolve): Update for Argument.Resolve.
25043 * class.cs (ConstructorInitializer.DoResolve): ditto.
25045 * attribute.cs (Attribute.Resolve): ditto.
25047 2001-11-13 Miguel de Icaza <miguel@ximian.com>
25049 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
25051 * expression.cs (ParameterReference): Drop IStackStorage and implement
25052 IAssignMethod instead.
25054 (LocalVariableReference): ditto.
25056 * ecore.cs (FieldExpr): Drop IStackStorage and implement
25057 IAssignMethod instead.
25059 2001-11-13 Miguel de Icaza <miguel@ximian.com>
25061 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
25062 enumerations that are used in heavily used structures derive from
25063 byte in a laughable and pathetic attempt to reduce memory usage.
25064 This is the kind of pre-optimzations that you should not do at
25065 home without adult supervision.
25067 * expression.cs (UnaryMutator): New class, used to handle ++ and
25068 -- separatedly from the other unary operators. Cleans up the
25069 code, and kills the ExpressionStatement dependency in Unary.
25071 (Unary): Removed `method' and `Arguments' from this class, making
25072 it smaller, and moving it all to SimpleCall, so I can reuse this
25073 code in other locations and avoid creating a lot of transient data
25074 strucutres when not required.
25076 * cs-parser.jay: Adjust for new changes.
25078 2001-11-11 Miguel de Icaza <miguel@ximian.com>
25080 * enum.cs (Enum.Populate): If there is a failure during
25083 * cs-parser.jay (opt_enum_base): we used to catch type errors
25084 here, but this is really incorrect. The type error should be
25085 catched during semantic analysis.
25087 2001-12-11 Ravi Pratap <ravi@ximian.com>
25089 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
25090 current_local_parameters as expected since I, in my stupidity, had forgotten
25093 * attribute.cs (GetValidPlaces): Fix stupid bug.
25095 * class.cs (Method::Emit): Perform check on applicability of attributes.
25097 (Constructor::Emit): Ditto.
25099 (Field::Emit): Ditto.
25101 (Field.Location): Store location information.
25103 (Property, Event, Indexer, Operator): Ditto.
25105 * cs-parser.jay (field_declaration): Pass in location for each field.
25107 * ../errors/cs0592.cs : Add.
25109 2001-11-12 Ravi Pratap <ravi@ximian.com>
25111 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
25113 (InitCoreTypes): Update accordingly.
25115 (RegisterAttrType, LookupAttr): Implement.
25117 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
25118 info about the same.
25120 (Resolve): Update to populate the above as necessary.
25122 (Error592): Helper.
25124 (GetValidPlaces): Helper to the above.
25126 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
25128 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
25130 2001-11-12 Ravi Pratap <ravi@ximian.com>
25132 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
25134 * ../errors/cs0617.cs : Add.
25136 2001-11-11 Ravi Pratap <ravi@ximian.com>
25138 * enum.cs (Emit): Rename to Populate to be more consistent with what
25139 we expect it to do and when exactly it is called.
25141 * class.cs, rootcontext.cs : Update accordingly.
25143 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
25144 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
25146 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
25148 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
25149 of a fieldinfo using the above, when dealing with a FieldBuilder.
25151 2001-11-10 Ravi Pratap <ravi@ximian.com>
25153 * ../errors/cs0031.cs : Add.
25155 * ../errors/cs1008.cs : Add.
25157 * ../errrors/cs0543.cs : Add.
25159 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
25162 (FindMembers): Implement.
25164 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
25165 enums and delegates too.
25167 (enum_types): Rename to builder_to_enum.
25169 (delegate_types): Rename to builder_to_delegate.
25171 * delegate.cs (FindMembers): Implement.
25173 2001-11-09 Ravi Pratap <ravi@ximian.com>
25175 * typemanager.cs (IsEnumType): Implement.
25177 * enum.cs (Emit): Re-write parts to account for the underlying type
25178 better and perform checking etc.
25180 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
25181 of the underlying type.
25183 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
25186 * enum.cs (error31): Helper to report error #31.
25188 * cs-parser.jay (enum_declaration): Store location of each member too.
25190 * enum.cs (member_to_location): New hashtable.
25192 (AddEnumMember): Update location hashtable.
25194 (Emit): Use the location of each member while reporting errors.
25196 2001-11-09 Miguel de Icaza <miguel@ximian.com>
25198 * cs-parser.jay: A for_initializer if is a
25199 local_variable_declaration really ammount to have an implicit
25200 block with the variable declaration and no initializer for for.
25202 * statement.cs (For.Emit): Cope with null initializers.
25204 This fixes the infinite loop on for initializers.
25206 2001-11-08 Miguel de Icaza <miguel@ximian.com>
25208 * enum.cs: More cleanup.
25210 * ecore.cs: Remove dead code.
25212 * class.cs (Property.Emit): More simplification.
25213 (Event.Emit): ditto.
25215 Reworked to have less levels of indentation.
25217 2001-11-08 Ravi Pratap <ravi@ximian.com>
25219 * class.cs (Property): Emit attributes.
25229 * enum.cs (Emit): Ditto.
25231 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
25234 * class.cs (Field, Event, etc.): Move attribute generation into the
25235 Emit method everywhere.
25237 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
25238 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
25239 as we had no way of defining nested enums !
25241 * rootcontext.cs : Adjust code accordingly.
25243 * typemanager.cs (AddEnumType): To keep track of enum types separately.
25245 2001-11-07 Ravi Pratap <ravi@ximian.com>
25247 * expression.cs (EvalConstantExpression): Move into ecore.cs
25249 * enum.cs (Enum): Rename some members and make them public and readonly
25250 according to our convention.
25252 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
25255 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
25257 (Enum::Emit): Write a simple version for now which doesn't try to compute
25258 expressions. I shall modify this to be more robust in just a while.
25260 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
25262 (TypeContainer::CloseType): Create the Enum types too.
25264 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
25266 * expression.cs (EvalConstantExpression): Get rid of completely.
25268 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
25269 user-defined values and other cases.
25271 (IsValidEnumLiteral): Helper function.
25273 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
25274 out there in the case we had a literal FieldExpr.
25276 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
25278 (Literalize): Revamp a bit to take two arguments.
25280 (EnumLiteral): New class which derives from Literal to wrap enum literals.
25282 2001-11-06 Ravi Pratap <ravi@ximian.com>
25284 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
25286 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
25288 (Resolve): Use the above to ensure we have proper initializers.
25290 2001-11-05 Ravi Pratap <ravi@ximian.com>
25292 * expression.cs (Expression::EvalConstantExpression): New method to
25293 evaluate constant expressions.
25295 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
25297 2001-11-07 Miguel de Icaza <miguel@ximian.com>
25299 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
25302 (Binary.ResolveOperator): Handle operator != (object a, object b)
25303 and operator == (object a, object b);
25305 (Binary.DoNumericPromotions): Indicate whether the numeric
25306 promotion was possible.
25308 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
25311 Made the ArrayAccess implement interface IAssignMethod instead of
25312 IStackStore as the order in which arguments are passed reflects
25315 * assign.cs: Instead of using expr.ExprClass to select the way of
25316 assinging, probe for the IStackStore/IAssignMethod interfaces.
25318 * typemanager.cs: Load InitializeArray definition.
25320 * rootcontext.cs (RootContext.MakeStaticData): Used to define
25321 static data that can be used to initialize arrays.
25323 2001-11-05 Miguel de Icaza <miguel@ximian.com>
25325 * expression.cs: Handle operator== and operator!= for booleans.
25327 (Conditioal.Reduce): Implement reducer for the ?: operator.
25329 (Conditional.Resolve): Implement dead code elimination.
25331 (Binary.Resolve): Catch string literals and return a new
25332 concatenated string.
25334 (Unary.Reduce): Implement reduction of unary expressions.
25336 * ecore.cs: Split out the expression core handling here.
25338 (Expression.Reduce): New method used to perform constant folding
25339 and CSE. This is needed to support constant-expressions.
25341 * statement.cs (Statement.EmitBoolExpression): Pass true and false
25342 targets, and optimize for !x.
25344 2001-11-04 Ravi Pratap <ravi@ximian.com>
25346 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
25347 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
25348 set custom atttributes.
25350 * literal.cs (Literal::GetValue): New abstract method to return the actual
25351 value of the literal, cast as an object.
25353 (*Literal): Implement GetValue method.
25355 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
25356 expressions to the arraylist but objects of type Argument.
25358 * class.cs (TypeContainer::Emit): Emit our attributes too.
25360 (Method::Emit, Constructor::Emit): Ditto.
25362 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
25363 to be ignoring earlier.
25365 2001-11-03 Ravi Pratap <ravi@ximian.com>
25367 * attribute.cs (AttributeSection::Define): Implement to do the business
25368 of constructing a CustomAttributeBuilder.
25370 (Attribute): New trivial class. Increases readability of code.
25372 * cs-parser.jay : Update accordingly.
25374 (positional_argument_list, named_argument_list, named_argument): New rules
25376 (attribute_arguments): Use the above so that we are more correct.
25378 2001-11-02 Ravi Pratap <ravi@ximian.com>
25380 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
25381 to perform all checks for a method with a params parameter.
25383 (Invocation::OverloadResolve): Update to use the above method and therefore
25384 cope correctly with params method invocations.
25386 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
25389 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
25390 constructors in our parent too because we can't afford to miss out on
25393 * attribute.cs (AttributeSection): New name for the class Attribute
25395 Other trivial changes to improve readability.
25397 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
25398 use the new class names.
25400 2001-11-01 Ravi Pratap <ravi@ximian.com>
25402 * class.cs (Method::Define): Complete definition for params types too
25404 (Indexer::Define): Ditto.
25406 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
25407 Cope everywhere with a request for info about the array parameter.
25409 2001-11-01 Ravi Pratap <ravi@ximian.com>
25411 * tree.cs (RecordNamespace): Fix up to check for the correct key.
25413 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
25414 local_variable_type to extract the string corresponding to the type.
25416 (local_variable_type): Fixup the action to use the new helper method.
25418 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
25421 * expression.cs : Clean out code which uses the above.
25423 2001-10-31 Ravi Pratap <ravi@ximian.com>
25425 * typemanager.cs (RegisterMethod): Check if we already have an existing key
25426 and bale out if necessary by returning a false.
25428 (RegisterProperty): Ditto.
25430 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
25431 and print out appropriate error messages.
25433 * interface.cs (everywhere): Ditto.
25435 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
25436 location to constructor.
25438 * class.cs (Property, Event, Indexer): Update accordingly.
25440 * ../errors/cs111.cs : Added.
25442 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
25443 of a method, as laid down by the spec.
25445 (Invocation::OverloadResolve): Use the above method.
25447 2001-10-31 Ravi Pratap <ravi@ximian.com>
25449 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
25450 now take a TypeContainer and a Parameters object.
25452 (ParameterData): Modify return type of ParameterModifier method to be
25453 Parameter.Modifier and not a string.
25455 (ReflectionParameters, InternalParameters): Update accordingly.
25457 * expression.cs (Argument::GetParameterModifier): Same here.
25459 * support.cs (InternalParameters::ParameterType): Find a better way of determining
25460 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
25461 symbol in it at all so maybe this is only for now.
25463 2001-10-30 Ravi Pratap <ravi@ximian.com>
25465 * support.cs (InternalParameters): Constructor now takes an extra argument
25466 which is the actual Parameters class.
25468 (ParameterDesc): Update to provide info on ref/out modifiers.
25470 * class.cs (everywhere): Update call to InternalParameters to pass in
25471 the second argument too.
25473 * support.cs (ParameterData): Add ParameterModifier, which is a method
25474 to return the modifier info [ref/out etc]
25476 (InternalParameters, ReflectionParameters): Implement the above.
25478 * expression.cs (Argument::ParameterModifier): Similar function to return
25479 info about the argument's modifiers.
25481 (Invocation::OverloadResolve): Update to take into account matching modifiers
25484 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
25485 a new SetFormalParameters object which we pass to InternalParameters.
25487 2001-10-30 Ravi Pratap <ravi@ximian.com>
25489 * expression.cs (NewArray): Merge into the ArrayCreation class.
25491 2001-10-29 Ravi Pratap <ravi@ximian.com>
25493 * expression.cs (NewArray): Merge classes NewBuiltinArray and
25494 NewUserdefinedArray into one as there wasn't much of a use in having
25497 * expression.cs (Argument): Change field's name to ArgType from Type.
25499 (Type): New readonly property which returns the proper type, taking into
25500 account ref/out modifiers.
25502 (everywhere): Adjust code accordingly for the above.
25504 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
25505 whether we are emitting for a ref or out parameter.
25507 * expression.cs (Argument::Emit): Use the above field to set the state.
25509 (LocalVariableReference::Emit): Update to honour the flag and emit the
25512 * parameter.cs (Attributes): Set the correct flags for ref parameters.
25514 * expression.cs (Argument::FullDesc): New function to provide a full desc.
25516 * support.cs (ParameterData): Add method ParameterDesc to the interface.
25518 (ReflectionParameters, InternalParameters): Implement the above method.
25520 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
25523 (Invocation::FullMethodDesc): Ditto.
25525 2001-10-29 Miguel de Icaza <miguel@ximian.com>
25527 * cs-parser.jay: Add extra production for the second form of array
25530 * expression.cs (ArrayCreation): Update to reflect the above
25533 * Small changes to prepare for Array initialization.
25535 2001-10-28 Miguel de Icaza <miguel@ximian.com>
25537 * typemanager.cs (ImplementsInterface): interface might be null;
25538 Deal with this problem;
25540 Also, we do store negative hits on the cache (null values), so use
25541 this instead of calling t.GetInterfaces on the type everytime.
25543 2001-10-28 Ravi Pratap <ravi@ximian.com>
25545 * typemanager.cs (IsBuiltinType): New method to help determine the same.
25547 * expression.cs (New::DoResolve): Get rid of array creation code and instead
25548 split functionality out into different classes.
25550 (New::FormArrayType): Move into NewBuiltinArray.
25552 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
25555 (NewBuiltinArray): New class to handle creation of built-in arrays.
25557 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
25558 account creation of one-dimensional arrays.
25560 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
25562 (NewUserdefinedArray::DoResolve): Implement.
25564 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
25566 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
25567 we maintain inside the TypeManager. This is necessary to perform lookups on the
25570 (LookupType): Update to perform GetType on the module builders too.
25572 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
25574 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
25576 2001-10-23 Ravi Pratap <ravi@ximian.com>
25578 * expression.cs (New::DoResolve): Implement guts of array creation.
25580 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
25582 2001-10-27 Miguel de Icaza <miguel@ximian.com>
25584 * expression.cs: Fix bug I introduced lsat night that broke
25587 (Expression.Resolve): Report a 246 error (can not resolve name)
25588 if we find a SimpleName in the stream.
25590 (Expression.ResolveLValue): Ditto.
25592 (Expression.ResolveWithSimpleName): This function is a variant of
25593 ResolveName, this one allows SimpleNames to be returned without a
25594 warning. The only consumer of SimpleNames is MemberAccess
25596 2001-10-26 Miguel de Icaza <miguel@ximian.com>
25598 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
25599 might arrive here. I have my doubts that this is correct.
25601 * statement.cs (Lock): Implement lock statement.
25603 * cs-parser.jay: Small fixes to support `lock' and `using'
25605 * cs-tokenizer.cs: Remove extra space
25607 * driver.cs: New flag --checked, allows to turn on integer math
25610 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
25611 Threading.Monitor.Exit
25613 2001-10-23 Miguel de Icaza <miguel@ximian.com>
25615 * expression.cs (IndexerAccess::DoResolveLValue): Set the
25616 Expression Class to be IndexerAccess.
25618 Notice that Indexer::DoResolve sets the eclass to Value.
25620 2001-10-22 Miguel de Icaza <miguel@ximian.com>
25622 * class.cs (TypeContainer::Emit): Emit code for indexers.
25624 * assign.cs (IAssignMethod): New interface implemented by Indexers
25625 and Properties for handling assignment.
25627 (Assign::Emit): Simplify and reuse code.
25629 * expression.cs (IndexerAccess, PropertyExpr): Implement
25630 IAssignMethod, clean up old code.
25632 2001-10-22 Ravi Pratap <ravi@ximian.com>
25634 * typemanager.cs (ImplementsInterface): New method to determine if a type
25635 implements a given interface. Provides a nice cache too.
25637 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
25640 (ConvertReferenceExplicit): Ditto.
25642 * delegate.cs (Delegate::Populate): Update to define the parameters on the
25643 various methods, with correct names etc.
25645 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
25646 Operator.UnaryNegation.
25648 * cs-parser.jay (operator_declarator): Be a little clever in the case where
25649 we have a unary plus or minus operator.
25651 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
25654 * everywhere : update accordingly.
25656 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
25659 * class.cs (Method::Define): For the case where we are implementing a method
25660 inherited from an interface, we need to set the MethodAttributes.Final flag too.
25661 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
25663 2001-10-21 Ravi Pratap <ravi@ximian.com>
25665 * interface.cs (FindMembers): Implement to work around S.R.E
25668 * typemanager.cs (IsInterfaceType): Implement.
25670 (FindMembers): Update to handle interface types too.
25672 * expression.cs (ImplicitReferenceConversion): Re-write bits which
25673 use IsAssignableFrom as that is not correct - it doesn't work.
25675 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
25676 and accordingly override EmitStatement.
25678 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
25679 using the correct logic :-)
25681 2001-10-19 Ravi Pratap <ravi@ximian.com>
25683 * ../errors/cs-11.cs : Add to demonstrate error -11
25685 2001-10-17 Miguel de Icaza <miguel@ximian.com>
25687 * assign.cs (Assign::Resolve): Resolve right hand side first, and
25688 then pass this as a hint to ResolveLValue.
25690 * expression.cs (FieldExpr): Add Location information
25692 (FieldExpr::LValueResolve): Report assignment to readonly
25695 (Expression::ExprClassFromMemberInfo): Pass location information.
25697 (Expression::ResolveLValue): Add new method that resolves an
25700 (Expression::DoResolveLValue): Default invocation calls
25703 (Indexers): New class used to keep track of indexers in a given
25706 (IStackStore): Renamed from LValue, as it did not really describe
25707 what this did. Also ResolveLValue is gone from this interface and
25708 now is part of Expression.
25710 (ElementAccess): Depending on the element access type
25712 * typemanager.cs: Add `indexer_name_type' as a Core type
25713 (System.Runtime.CompilerServices.IndexerNameAttribute)
25715 * statement.cs (Goto): Take a location.
25717 2001-10-18 Ravi Pratap <ravi@ximian.com>
25719 * delegate.cs (Delegate::VerifyDelegate): New method to verify
25720 if two delegates are compatible.
25722 (NewDelegate::DoResolve): Update to take care of the case when
25723 we instantiate a delegate from another delegate.
25725 * typemanager.cs (FindMembers): Don't even try to look up members
25726 of Delegate types for now.
25728 2001-10-18 Ravi Pratap <ravi@ximian.com>
25730 * delegate.cs (NewDelegate): New class to take care of delegate
25733 * expression.cs (New): Split the delegate related code out into
25734 the NewDelegate class.
25736 * delegate.cs (DelegateInvocation): New class to handle delegate
25739 * expression.cs (Invocation): Split out delegate related code into
25740 the DelegateInvocation class.
25742 2001-10-17 Ravi Pratap <ravi@ximian.com>
25744 * expression.cs (New::DoResolve): Implement delegate creation fully
25745 and according to the spec.
25747 (New::DoEmit): Update to handle delegates differently.
25749 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
25750 because of which we were printing out arguments in reverse order !
25752 * delegate.cs (VerifyMethod): Implement to check if the given method
25753 matches the delegate.
25755 (FullDelegateDesc): Implement.
25757 (VerifyApplicability): Implement.
25759 * expression.cs (Invocation::DoResolve): Update to accordingly handle
25760 delegate invocations too.
25762 (Invocation::Emit): Ditto.
25764 * ../errors/cs1593.cs : Added.
25766 * ../errors/cs1594.cs : Added.
25768 * delegate.cs (InstanceExpression, TargetMethod): New properties.
25770 2001-10-16 Ravi Pratap <ravi@ximian.com>
25772 * typemanager.cs (intptr_type): Core type for System.IntPtr
25774 (InitCoreTypes): Update for the same.
25776 (iasyncresult_type, asynccallback_type): Ditto.
25778 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
25781 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
25784 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
25785 the builders for the 4 members of a delegate type :-)
25787 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
25790 * expression.cs (New::DoResolve): Implement guts for delegate creation.
25792 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
25794 2001-10-15 Miguel de Icaza <miguel@ximian.com>
25796 * statement.cs (Break::Emit): Implement.
25797 (Continue::Emit): Implement.
25799 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
25800 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
25801 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
25802 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
25805 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
25806 properties that track the label for the current loop (begin of the
25807 loop and end of the loop).
25809 2001-10-15 Ravi Pratap <ravi@ximian.com>
25811 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
25812 use of emitting anything at all.
25814 * class.cs, rootcontext.cs : Get rid of calls to the same.
25816 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
25818 (Populate): Define the constructor correctly and set the implementation
25821 * typemanager.cs (delegate_types): New hashtable to hold delegates that
25824 (AddDelegateType): Implement.
25826 (IsDelegateType): Implement helper method.
25828 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
25830 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
25831 and accordingly handle it.
25833 * delegate.cs (Populate): Take TypeContainer argument.
25834 Implement bits to define the Invoke method. However, I still haven't figured out
25835 how to take care of the native int bit :-(
25837 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
25838 Qualify the name of the delegate, not its return type !
25840 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
25843 (StandardConversionExists): Checking for array types turns out to be recursive.
25845 (ConvertReferenceExplicit): Implement array conversion.
25847 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
25849 2001-10-12 Ravi Pratap <ravi@ximian.com>
25851 * cs-parser.jay (delegate_declaration): Store the fully qualified
25852 name as it is a type declaration.
25854 * delegate.cs (ReturnType, Name): Rename members to these. Make them
25857 (DefineDelegate): Renamed from Define. Does the same thing essentially,
25858 as TypeContainer::DefineType.
25860 (Populate): Method in which all the definition of the various methods (Invoke)
25863 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
25866 (CloseDelegate): Finally creates the delegate.
25868 * class.cs (TypeContainer::DefineType): Update to define delegates.
25869 (Populate, Emit and CloseType): Do the same thing here too.
25871 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
25872 delegates in all these operations.
25874 2001-10-14 Miguel de Icaza <miguel@ximian.com>
25876 * expression.cs: LocalTemporary: a new expression used to
25877 reference a temporary that has been created.
25879 * assign.cs: Handle PropertyAccess back here, so that we can
25880 provide the proper semantic access to properties.
25882 * expression.cs (Expression::ConvertReferenceExplicit): Implement
25883 a few more explicit conversions.
25885 * modifiers.cs: `NEW' modifier maps to HideBySig.
25887 * expression.cs (PropertyExpr): Make this into an
25888 ExpressionStatement, and support the EmitStatement code path.
25890 Perform get/set error checking, clean up the interface.
25892 * assign.cs: recognize PropertyExprs as targets, and if so, turn
25893 them into toplevel access objects.
25895 2001-10-12 Miguel de Icaza <miguel@ximian.com>
25897 * expression.cs: PropertyExpr::PropertyExpr: use work around the
25900 * typemanager.cs: Keep track here of our PropertyBuilders again to
25901 work around lameness in SRE.
25903 2001-10-11 Miguel de Icaza <miguel@ximian.com>
25905 * expression.cs (LValue::LValueResolve): New method in the
25906 interface, used to perform a second resolution pass for LValues.
25908 (This::DoResolve): Catch the use of this in static methods.
25910 (This::LValueResolve): Implement.
25912 (This::Store): Remove warning, assigning to `this' in structures
25915 (Invocation::Emit): Deal with invocation of
25916 methods on value types. We need to pass the address to structure
25917 methods rather than the object itself. (The equivalent code to
25918 emit "this" for structures leaves the entire structure on the
25919 stack instead of a pointer to it).
25921 (ParameterReference::DoResolve): Compute the real index for the
25922 argument based on whether the method takes or not a `this' pointer
25923 (ie, the method is static).
25925 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
25926 value types returned from functions when we need to invoke a
25927 method on the sturcture.
25930 2001-10-11 Ravi Pratap <ravi@ximian.com>
25932 * class.cs (TypeContainer::DefineType): Method to actually do the business of
25933 defining the type in the Modulebuilder or Typebuilder. This is to take
25934 care of nested types which need to be defined on the TypeBuilder using
25935 DefineNestedMethod.
25937 (TypeContainer::GetClassBases): Implement. Essentially the code from the
25938 methods in RootContext, only ported to be part of TypeContainer.
25940 (TypeContainer::GetInterfaceOrClass): Ditto.
25942 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
25944 * interface.cs (Interface::DefineInterface): New method. Does exactly
25945 what RootContext.CreateInterface did earlier, only it takes care of nested types
25948 (Interface::GetInterfaces): Move from RootContext here and port.
25950 (Interface::GetInterfaceByName): Same here.
25952 * rootcontext.cs (ResolveTree): Re-write.
25954 (PopulateTypes): Re-write.
25956 * class.cs (TypeContainer::Populate): Populate nested types too.
25957 (TypeContainer::Emit): Emit nested members too.
25959 * typemanager.cs (AddUserType): Do not make use of the FullName property,
25960 instead just use the name argument passed in as it is already fully
25963 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
25964 to TypeContainer mapping to see if a type is user-defined.
25966 * class.cs (TypeContainer::CloseType): Implement.
25968 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
25969 the default constructor.
25971 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
25974 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
25976 * interface.cs (CloseType): Create the type here.
25978 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
25981 Remove all the methods which are now in TypeContainer.
25983 2001-10-10 Ravi Pratap <ravi@ximian.com>
25985 * delegate.cs (Define): Re-write bits to define the delegate
25988 2001-10-10 Miguel de Icaza <miguel@ximian.com>
25990 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
25992 * expression.cs (ImplicitReferenceConversion): handle null as well
25993 as a source to convert to any reference type.
25995 * statement.cs (Return): Perform any implicit conversions to
25996 expected return type.
25998 Validate use of return statement.
26000 * codegen.cs (EmitContext): Pass the expected return type here.
26002 * class.cs (Method, Constructor, Property): Pass expected return
26003 type to EmitContext.
26005 2001-10-09 Miguel de Icaza <miguel@ximian.com>
26007 * expression.cs: Make DoResolve take an EmitContext instead of a
26010 Replaced `l' and `location' for `loc', for consistency.
26012 (Error, Warning): Remove unneeded Tc argument.
26014 * assign.cs, literal.cs, constant.cs: Update to new calling
26017 * codegen.cs: EmitContext now contains a flag indicating whether
26018 code is being generated in a static method or not.
26020 * cs-parser.jay: DecomposeQI, new function that replaces the old
26021 QualifiedIdentifier. Now we always decompose the assembled
26022 strings from qualified_identifier productions into a group of
26025 2001-10-08 Miguel de Icaza <miguel@ximian.com>
26027 * rootcontext.cs: Deal with field-less struct types correctly now
26028 by passing the size option to Define Type.
26030 * class.cs: Removed hack that created one static field.
26032 2001-10-07 Miguel de Icaza <miguel@ximian.com>
26034 * statement.cs: Moved most of the code generation here.
26036 2001-10-09 Ravi Pratap <ravi@ximian.com>
26038 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
26041 (ElementAccess): Remove useless bits for now - keep checks as the spec
26044 2001-10-08 Ravi Pratap <ravi@ximian.com>
26046 * expression.cs (ElementAccess::DoResolve): Remove my crap code
26047 and start performing checks according to the spec.
26049 2001-10-07 Ravi Pratap <ravi@ximian.com>
26051 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
26052 rank_specifiers instead.
26054 (rank_specifiers): Change the order in which the rank specifiers are stored
26056 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
26058 * expression.cs (ElementAccess): Implement the LValue interface too.
26060 2001-10-06 Ravi Pratap <ravi@ximian.com>
26062 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
26063 except that user defined conversions are not included.
26065 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
26066 perform the conversion of the return type, if necessary.
26068 (New::DoResolve): Check whether we are creating an array or an object
26069 and accordingly do the needful.
26071 (New::Emit): Same here.
26073 (New::DoResolve): Implement guts of array creation.
26075 (New::FormLookupType): Helper function.
26077 2001-10-07 Miguel de Icaza <miguel@ximian.com>
26079 * codegen.cs: Removed most of the code generation here, and move the
26080 corresponding code generation bits to the statement classes.
26082 Added support for try/catch/finalize and throw.
26084 * cs-parser.jay: Added support for try/catch/finalize.
26086 * class.cs: Catch static methods having the flags override,
26087 virtual or abstract.
26089 * expression.cs (UserCast): This user cast was not really doing
26090 what it was supposed to do. Which is to be born in fully resolved
26091 state. Parts of the resolution were being performed at Emit time!
26095 2001-10-05 Miguel de Icaza <miguel@ximian.com>
26097 * expression.cs: Implicity convert the result from UserCast.
26099 2001-10-05 Ravi Pratap <ravi@ximian.com>
26101 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
26102 prevented it from working correctly.
26104 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
26105 merely ConvertImplicit.
26107 2001-10-05 Miguel de Icaza <miguel@ximian.com>
26109 * typemanager.cs: Make the LookupTypeContainer function static,
26110 and not per-instance.
26112 * class.cs: Make static FindMembers (the one that takes a Type
26115 * codegen.cs: Add EmitForeach here.
26117 * cs-parser.jay: Make foreach a toplevel object instead of the
26118 inline expansion, as we need to perform semantic analysis on it.
26120 2001-10-05 Ravi Pratap <ravi@ximian.com>
26122 * expression.cs (Expression::ImplicitUserConversion): Rename to
26123 UserDefinedConversion.
26125 (Expression::UserDefinedConversion): Take an extra argument specifying
26126 whether we look for explicit user conversions too.
26128 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
26130 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
26132 (ExplicitUserConversion): Make it a call to UserDefinedConversion
26133 with the appropriate arguments.
26135 * cs-parser.jay (cast_expression): Record location too.
26137 * expression.cs (Cast): Record location info.
26139 (Expression::ConvertExplicit): Take location argument.
26141 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
26142 to determine if we are doing explicit conversions.
26144 (UserCast::Emit): Update accordingly.
26146 (Expression::ConvertExplicit): Report an error if everything fails.
26148 * ../errors/cs0030.cs : Add.
26150 2001-10-04 Miguel de Icaza <miguel@ximian.com>
26152 * modifiers.cs: If the ABSTRACT keyword is present, also set the
26153 virtual and newslot bits.
26155 * class.cs (TypeContainer::RegisterRequiredImplementations):
26156 Record methods we need.
26158 (TypeContainer::MakeKey): Helper function to make keys for
26159 MethodBases, since the Methodbase key is useless.
26161 (TypeContainer::Populate): Call RegisterRequiredImplementations
26162 before defining the methods.
26164 Create a mapping for method_builders_to_methods ahead of time
26165 instead of inside a tight loop.
26167 (::RequireMethods): Accept an object as the data to set into the
26168 hashtable so we can report interface vs abstract method mismatch.
26170 2001-10-03 Miguel de Icaza <miguel@ximian.com>
26172 * report.cs: Make all of it static.
26174 * rootcontext.cs: Drop object_type and value_type computations, as
26175 we have those in the TypeManager anyways.
26177 Drop report instance variable too, now it is a global.
26179 * driver.cs: Use try/catch on command line handling.
26181 Add --probe option to debug the error reporting system with a test
26184 * report.cs: Add support for exiting program when a probe
26185 condition is reached.
26187 2001-10-03 Ravi Pratap <ravi@ximian.com>
26189 * expression.cs (Binary::DoNumericPromotions): Fix the case when
26190 we do a forcible conversion regardless of type, to check if
26191 ForceConversion returns a null.
26193 (Binary::error19): Use location to report error.
26195 (Unary::error23): Use location here too.
26197 * ../errors/cs0019.cs : Check in.
26199 * ../errors/cs0023.cs : Check in.
26201 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
26202 case of a non-null MethodInfo object with a length of 0 !
26204 (Binary::ResolveOperator): Flag error if overload resolution fails to find
26205 an applicable member - according to the spec :-)
26206 Also fix logic to find members in base types.
26208 (Unary::ResolveOperator): Same here.
26210 (Unary::report23): Change name to error23 and make first argument a TypeContainer
26211 as I was getting thoroughly confused between this and error19 :-)
26213 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
26214 (::FindMostEncompassedType): Implement.
26215 (::FindMostEncompassingType): Implement.
26216 (::StandardConversionExists): Implement.
26218 (UserImplicitCast): Re-vamp. We now need info about most specific
26219 source and target types so that we can do the necessary conversions.
26221 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
26222 mathematical union with no duplicates.
26224 2001-10-03 Miguel de Icaza <miguel@ximian.com>
26226 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
26227 in order from base classes to child classes, so that we can in
26228 child classes look up in our parent for method names and
26229 attributes (required for handling abstract, virtual, new, override
26230 constructs: we need to instrospect our base class, and if we dont
26231 populate the classes in order, the introspection might be
26232 incorrect. For example, a method could query its parent before
26233 the parent has any methods and would determine that the parent has
26234 no abstract methods (while it could have had them)).
26236 (RootContext::CreateType): Record the order in which we define the
26239 2001-10-02 Miguel de Icaza <miguel@ximian.com>
26241 * class.cs (TypeContainer::Populate): Also method definitions can
26242 fail now, keep track of this.
26244 (TypeContainer::FindMembers): Implement support for
26245 DeclaredOnly/noDeclaredOnly flag.
26247 (Constructor::Emit) Return the ConstructorBuilder.
26249 (Method::Emit) Return the MethodBuilder.
26250 Check for abstract or virtual methods to be public.
26252 * rootcontext.cs (RootContext::CreateType): Register all the
26253 abstract methods required for the class to be complete and the
26254 interface methods that must be implemented.
26256 * cs-parser.jay: Report error 501 (method requires body if it is
26257 not marked abstract or extern).
26259 * expression.cs (TypeOf::Emit): Implement.
26261 * typemanager.cs: runtime_handle_type, new global type.
26263 * class.cs (Property::Emit): Generate code for properties.
26265 2001-10-02 Ravi Pratap <ravi@ximian.com>
26267 * expression.cs (Unary::ResolveOperator): Find operators on base type
26268 too - we now conform exactly to the spec.
26270 (Binary::ResolveOperator): Same here.
26272 * class.cs (Operator::Define): Fix minor quirk in the tests.
26274 * ../errors/cs0215.cs : Added.
26276 * ../errors/cs0556.cs : Added.
26278 * ../errors/cs0555.cs : Added.
26280 2001-10-01 Miguel de Icaza <miguel@ximian.com>
26282 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
26283 single integer which is really efficient
26285 2001-10-01 Ravi Pratap <ravi@ximian.com>
26287 * expression.cs (Expression::ImplicitUserConversion): Use location
26288 even in the case when we are examining True operators.
26290 * class.cs (Operator::Define): Perform extensive checks to conform
26291 with the rules for operator overloading in the spec.
26293 * expression.cs (Expression::ImplicitReferenceConversion): Implement
26294 some of the other conversions mentioned in the spec.
26296 * typemanager.cs (array_type): New static member for the System.Array built-in
26299 (cloneable_interface): For System.ICloneable interface.
26301 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
26302 we start resolving the tree and populating types.
26304 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
26306 2001-10-01 Miguel de Icaza <miguel@ximian.com>
26308 * expression.cs (Expression::ExprClassFromMemberInfo,
26309 Expression::Literalize): Create literal expressions from
26310 FieldInfos which are literals.
26312 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
26313 type casts, because they were wrong. The test suite in tests
26316 (ImplicitNumericConversion): ushort to ulong requires a widening
26319 Int32 constant to long requires widening cast as well.
26321 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
26322 for integers because the type on the stack is not i4.
26324 2001-09-30 Miguel de Icaza <miguel@ximian.com>
26326 * expression.cs (report118): require location argument.
26328 * parameter.cs: Do not dereference potential null value.
26330 * class.cs: Catch methods that lack the `new' keyword when
26331 overriding a name. Report warnings when `new' is used without
26332 anything being there to override.
26334 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
26336 * class.cs: Only add constructor to hashtable if it is non-null
26337 (as now constructors can fail on define).
26339 (TypeManager, Class, Struct): Take location arguments.
26341 Catch field instance initialization in structs as errors.
26343 accepting_filter: a new filter for FindMembers that is static so
26344 that we dont create an instance per invocation.
26346 (Constructor::Define): Catch errors where a struct constructor is
26349 * cs-parser.jay: Pass location information for various new
26352 * delegate.cs (Delegate): take a location argument.
26354 * driver.cs: Do not call EmitCode if there were problesm in the
26355 Definition of the types, as many Builders wont be there.
26357 * decl.cs (Decl::Decl): Require a location argument.
26359 * cs-tokenizer.cs: Handle properly hex constants that can not fit
26360 into integers, and find the most appropiate integer for it.
26362 * literal.cs: Implement ULongLiteral.
26364 * rootcontext.cs: Provide better information about the location of
26365 failure when CreateType fails.
26367 2001-09-29 Miguel de Icaza <miguel@ximian.com>
26369 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
26372 * expression.cs (Binary::CheckShiftArguments): Add missing type
26374 (Binary::ResolveOperator): Add type to the logical and and logical
26375 or, Bitwise And/Or and Exclusive Or code paths, it was missing
26378 (Binary::DoNumericPromotions): In the case where either argument
26379 is ulong (and most signed types combined with ulong cause an
26380 error) perform implicit integer constant conversions as well.
26382 2001-09-28 Miguel de Icaza <miguel@ximian.com>
26384 * expression.cs (UserImplicitCast): Method should always be
26386 (Invocation::BetterConversion): Simplified test for IntLiteral.
26388 (Expression::ImplicitNumericConversion): Split this routine out.
26389 Put the code that performs implicit constant integer conversions
26392 (Expression::Resolve): Become a wrapper around DoResolve so we can
26393 check eclass and type being set after resolve.
26395 (Invocation::Badness): Remove this dead function
26397 (Binary::ResolveOperator): Do not compute the expensive argumnets
26398 unless we have a union for it.
26400 (Probe::Emit): Is needs to do an isinst and then
26401 compare against null.
26403 (::CanConvert): Added Location argument. If the Location argument
26404 is null (Location.Null), then we do not report errors. This is
26405 used by the `probe' mechanism of the Explicit conversion. We do
26406 not want to generate an error for something that the user
26407 explicitly requested to be casted. But the pipeline for an
26408 explicit cast first tests for potential implicit casts.
26410 So for now, if the Location is null, it means `Probe only' to
26411 avoid adding another argument. Might have to revise this
26414 (ClassCast): New class used to type cast objects into arbitrary
26415 classes (used in Explicit Reference Conversions).
26417 Implement `as' as well.
26419 Reverted all the patches from Ravi below: they were broken:
26421 * The use of `level' as a mechanism to stop recursive
26422 invocations is wrong. That was there just to catch the
26423 bug with a strack trace but not as a way of addressing
26426 To fix the problem we have to *understand* what is going
26427 on and the interactions and come up with a plan, not
26428 just get things going.
26430 * The use of the type conversion cache that I proposed
26431 last night had an open topic: How does this work across
26432 protection domains. A user defined conversion might not
26433 be public in the location where we are applying the
26434 conversion, a different conversion might be selected
26435 (ie, private A->B (better) but public B->A (worse),
26436 inside A, A->B applies, but outside it, B->A will
26439 * On top of that (ie, even if the above is solved),
26440 conversions in a cache need to be abstract. Ie, `To
26441 convert from an Int to a Short use an OpcodeCast', not
26442 `To convert from an Int to a Short use the OpcodeCast on
26443 the variable 5' (which is what this patch was doing).
26445 2001-09-28 Ravi Pratap <ravi@ximian.com>
26447 * expression.cs (Invocation::ConversionExists): Re-write to use
26448 the conversion cache
26450 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
26451 cache all conversions done, not just user-defined ones.
26453 (Invocation::BetterConversion): The real culprit. Use ConversionExists
26454 to determine if a conversion exists instead of acutually trying to
26455 perform the conversion. It's faster too.
26457 (Expression::ConvertExplicit): Modify to use ConversionExists to check
26458 and only then attempt the implicit conversion.
26460 2001-09-28 Ravi Pratap <ravi@ximian.com>
26462 * expression.cs (ConvertImplicit): Use a cache for conversions
26463 already found. Check level of recursion and bail out if necessary.
26465 2001-09-28 Miguel de Icaza <miguel@ximian.com>
26467 * typemanager.cs (string_concat_string_string, string_concat_object_object):
26468 Export standard methods that we expect for string operations.
26470 * statement.cs (Block::UsageWarning): Track usage of variables and
26471 report the errors for not used variables.
26473 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
26476 2001-09-27 Miguel de Icaza <miguel@ximian.com>
26478 * codegen.cs: remove unnneded code
26480 * expression.cs: Removed BuiltinTypeAccess class
26482 Fix the order in which implicit conversions are
26485 The previous fixed dropped support for boxed conversions (adding a
26486 test to the test suite now)
26488 (UserImplicitCast::CanConvert): Remove test for source being null,
26489 that code is broken. We should not feed a null to begin with, if
26490 we do, then we should track the bug where the problem originates
26491 and not try to cover it up here.
26493 Return a resolved expression of type UserImplicitCast on success
26494 rather than true/false. Ravi: this is what I was talking about,
26495 the pattern is to use a static method as a "constructor" for
26498 Also, do not create arguments until the very last minute,
26499 otherwise we always create the arguments even for lookups that
26500 will never be performed.
26502 (UserImplicitCast::Resolve): Eliminate, objects of type
26503 UserImplicitCast are born in a fully resolved state.
26505 * typemanager.cs (InitCoreTypes): Init also value_type
26506 (System.ValueType).
26508 * expression.cs (Cast::Resolve): First resolve the child expression.
26510 (LValue): Add new method AddressOf to be used by
26513 Change the argument of Store to take an EmitContext instead of an
26514 ILGenerator, because things like FieldExpr need to be able to call
26515 their children expression to generate the instance code.
26517 (Expression::Error, Expression::Warning): Sugar functions for
26520 (Expression::MemberLookup): Accept a TypeContainer instead of a
26521 Report as the first argument.
26523 (Expression::ResolvePrimary): Killed. I still want to improve
26524 this as currently the code is just not right.
26526 (Expression::ResolveMemberAccess): Simplify, but it is still
26529 (Unary::Resolve): Catch errors in AddressOf operators.
26531 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
26532 index to a byte for the short-version, or the compiler will choose
26533 the wrong Emit call, which generates the wrong data.
26535 (ParameterReference::Emit, ::Store): same.
26537 (FieldExpr::AddressOf): Implement.
26539 * typemanager.cs: TypeManager: made public variable instead of
26542 * driver.cs: document --fatal.
26544 * report.cs (ErrorMessage, WarningMessage): new names for the old
26545 Error and Warning classes.
26547 * cs-parser.jay (member_access): Turn built-in access to types
26548 into a normal simplename
26550 2001-09-27 Ravi Pratap <ravi@ximian.com>
26552 * expression.cs (Invocation::BetterConversion): Fix to cope
26553 with q being null, since this was introducing a bug.
26555 * expression.cs (ConvertImplicit): Do built-in conversions first.
26557 2001-09-27 Ravi Pratap <ravi@ximian.com>
26559 * expression.cs (UserImplicitCast::Resolve): Fix bug.
26561 2001-09-27 Ravi Pratap <ravi@ximian.com>
26563 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
26564 I had introduced long ago (what's new ?).
26566 * expression.cs (UserImplicitCast::CanConvert): Static method to do
26567 the work of all the checking.
26568 (ConvertImplicit): Call CanConvert and only then create object if necessary.
26569 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
26571 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
26572 that is the right way.
26574 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
26575 overloading resolution. Use everywhere instead of cutting and pasting code.
26577 (Binary::ResolveOperator): Use MakeUnionSet.
26579 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
26580 we have to convert to bool types. Not complete yet.
26582 2001-09-27 Miguel de Icaza <miguel@ximian.com>
26584 * typemanager.cs (TypeManager::CSharpName): support ushort.
26586 * expression.cs (Expression::TryImplicitIntConversion): Attempts
26587 to provide an expression that performsn an implicit constant int
26588 conversion (section 6.1.6).
26589 (Expression::ConvertImplicitRequired): Reworked to include
26590 implicit constant expression conversions.
26592 (Expression::ConvertNumericExplicit): Finished.
26594 (Invocation::Emit): If InstanceExpression is null, then it means
26595 that we perform a call on this.
26597 2001-09-26 Miguel de Icaza <miguel@ximian.com>
26599 * expression.cs (Unary::Emit): Remove some dead code.
26600 (Probe): Implement Resolve and Emit for `is'.
26601 (Expression::ConvertImplicitRequired): Attempt to do constant
26602 expression conversions here. Maybe should be moved to
26603 ConvertImplicit, but I am not sure.
26604 (Expression::ImplicitLongConstantConversionPossible,
26605 Expression::ImplicitIntConstantConversionPossible): New functions
26606 that tell whether is it possible to apply an implicit constant
26607 expression conversion.
26609 (ConvertNumericExplicit): Started work on explicit numeric
26612 * cs-parser.jay: Update operator constants.
26614 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
26615 (Parameters::GetSignature): Hook up VerifyArgs here.
26616 (Parameters::VerifyArgs): Verifies that no two arguments have the
26619 * class.cs (Operator): Update the operator names to reflect the
26620 ones that the spec expects (as we are just stringizing the
26623 * expression.cs (Unary::ResolveOperator): Fix bug: Use
26624 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
26625 previous usage did only work for our methods.
26626 (Expression::ConvertImplicit): Handle decimal implicit numeric
26627 conversions as well.
26628 (Expression::InternalTypeConstructor): Used to invoke constructors
26629 on internal types for default promotions.
26631 (Unary::Emit): Implement special handling for the pre/post
26632 increment/decrement for overloaded operators, as they need to have
26633 the same semantics as the other operators.
26635 (Binary::ResolveOperator): ditto.
26636 (Invocation::ConversionExists): ditto.
26637 (UserImplicitCast::Resolve): ditto.
26639 2001-09-26 Ravi Pratap <ravi@ximian.com>
26641 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
26642 operator, return after emitting body. Regression tests pass again !
26644 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
26645 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
26646 (Invocation::OverloadResolve): Ditto.
26647 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
26649 * everywhere : update calls to the above methods accordingly.
26651 2001-09-26 Miguel de Icaza <miguel@ximian.com>
26653 * assign.cs (Assign): Make it inherit from ExpressionStatement.
26655 * expression.cs (ExpressionStatement): New base class used for
26656 expressions that can appear in statements, so that we can provide
26657 an alternate path to generate expression that do not leave a value
26660 (Expression::Emit, and all the derivatives): We no longer return
26661 whether a value is left on the stack or not. Every expression
26662 after being emitted leaves a single value on the stack.
26664 * codegen.cs (EmitContext::EmitStatementExpression): Use the
26665 facilties of ExpressionStatement if possible.
26667 * cs-parser.jay: Update statement_expression.
26669 2001-09-25 Miguel de Icaza <miguel@ximian.com>
26671 * driver.cs: Change the wording of message
26673 2001-09-25 Ravi Pratap <ravi@ximian.com>
26675 * expression.cs (Binary::ResolveOperator): Had forgottten to set
26676 the type of the expression to the return type of the method if
26677 we have an overloaded operator match ! The regression tests pass again !
26678 (Unary::ResolveOperator): Ditto.
26680 * expression.cs (Invocation::ConversionExists): Correct the member lookup
26681 to find "op_Implicit", not "implicit" ;-)
26682 (UserImplicitCast): New class to take care of user-defined implicit conversions.
26683 (ConvertImplicit, ForceConversion): Take TypeContainer argument
26685 * everywhere : Correct calls to the above accordingly.
26687 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
26688 (ConvertImplicit): Do user-defined conversion if it exists.
26690 2001-09-24 Miguel de Icaza <miguel@ximian.com>
26692 * assign.cs: track location.
26693 (Resolve): Use implicit conversions on assignment.
26695 * literal.cs: Oops. Not good, Emit of short access values should
26696 pass (Bytes) or the wrong argument will be selected.
26698 * expression.cs (Unary::Emit): Emit code for -expr.
26700 (Unary::ResolveOperator): Handle `Substract' for non-constants
26701 (substract from zero from the non-constants).
26702 Deal with Doubles as well.
26704 (Expression::ConvertImplicitRequired): New routine that reports an
26705 error if no implicit conversion exists.
26707 (Invocation::OverloadResolve): Store the converted implicit
26708 expressions if we make them
26710 2001-09-24 Ravi Pratap <ravi@ximian.com>
26712 * class.cs (ConstructorInitializer): Take a Location argument.
26713 (ConstructorBaseInitializer): Same here.
26714 (ConstructorThisInitializer): Same here.
26716 * cs-parser.jay : Update all calls accordingly.
26718 * expression.cs (Unary, Binary, New): Take location argument.
26719 Update accordingly everywhere.
26721 * cs-parser.jay : Update all calls to the above to take a location
26724 * class.cs : Ditto.
26726 2001-09-24 Ravi Pratap <ravi@ximian.com>
26728 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
26729 (Invocation::BetterConversion): Same here
26730 (Invocation::ConversionExists): Ditto.
26732 (Invocation::ConversionExists): Implement.
26734 2001-09-22 Ravi Pratap <ravi@ximian.com>
26736 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
26737 Also take an additional TypeContainer argument.
26739 * All over : Pass in TypeContainer as argument to OverloadResolve.
26741 * typemanager.cs (CSharpName): Update to check for the string type and return
26744 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
26747 2001-09-21 Ravi Pratap <ravi@ximian.com>
26749 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
26750 (Invocation::BetterFunction): Implement.
26751 (Invocation::BetterConversion): Implement.
26752 (Invocation::ConversionExists): Skeleton, no implementation yet.
26754 Okay, things work fine !
26756 2001-09-21 Miguel de Icaza <miguel@ximian.com>
26758 * typemanager.cs: declare and load enum_type, delegate_type and
26761 * expression.cs (Expression::Emit): Now emit returns a value that
26762 tells whether a value is left on the stack or not. This strategy
26763 might be reveted tomorrow with a mechanism that would address
26764 multiple assignments.
26765 (Expression::report118): Utility routine to report mismatches on
26768 (Unary::Report23): Report impossible type/operator combination
26771 (Unary::IsIncrementableNumber): Whether the type can be
26772 incremented or decremented with add.
26773 (Unary::ResolveOperator): Also allow enumerations to be bitwise
26775 (Unary::ResolveOperator): Implement ++, !, ~,
26777 (Invocation::Emit): Deal with new Emit convetion.
26779 * All Expression derivatives: Updated their Emit method to return
26780 whether they leave values on the stack or not.
26782 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
26783 stack for expressions that are statements.
26785 2001-09-20 Miguel de Icaza <miguel@ximian.com>
26787 * expression.cs (LValue): New interface. Must be implemented by
26789 (LocalVariableReference, ParameterReference, FieldExpr): Implement
26792 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
26793 interface for generating code, simplifies the code.
26795 2001-09-20 Ravi Pratap <ravi@ximian.com>
26797 * expression.cs (everywhere): Comment out return statements in ::Resolve
26798 methods to avoid the warnings.
26800 2001-09-20 Miguel de Icaza <miguel@ximian.com>
26802 * driver.cs (parse): Report error 2001 if we can not open the
26805 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
26808 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
26811 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
26812 otherwise nested blocks end up with the same index.
26814 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
26816 * expression.cs: Instead of having FIXMEs in the Resolve
26817 functions, throw exceptions so it is obvious that we are facing a
26820 * cs-parser.jay (invocation_expression): Pass Location information.
26822 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
26823 Use a basename for those routines because .NET does not like paths
26826 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
26829 2001-09-19 Miguel de Icaza <miguel@ximian.com>
26831 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
26832 are loading the correct data types (throws an exception if not).
26833 (TypeManager::InitCoreTypes): Use CoreLookupType
26835 * expression.cs (Unary::ResolveOperator): return the child
26836 expression for expressions which are just +expr.
26837 (Unary::ResolveOperator): Return negative literals for -LITERAL
26838 expressions (otherwise they are Unary {Literal}).
26839 (Invocation::Badness): Take into account `Implicit constant
26840 expression conversions'.
26842 * literal.cs (LongLiteral): Implement long literal class.
26843 (IntLiteral): export the `Value' of the intliteral.
26845 2001-09-19 Ravi Pratap <ravi@ximian.com>
26847 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
26849 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
26850 instead of 'Operator'
26852 * expression.cs (Binary::ResolveOperator): Update accordingly.
26853 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
26856 * cs-parser.jay (unary_expression): Update to use the new names.
26858 * gen-treedump.cs (GetUnary): Same here.
26860 * expression.cs (Unary::Resolve): Implement.
26861 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
26862 operators are found instead of making noise ;-)
26863 (Unary::ResolveOperator): New method to do precisely the same thing which
26864 Binary::ResolveOperator does for Binary expressions.
26865 (Unary.method, .Arguments): Add.
26866 (Unary::OperName): Implement.
26867 (Unary::ForceConversion): Copy and Paste !
26869 * class.cs (Operator::Define): Fix a small bug for the case when we have
26872 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
26873 for the inbuilt operators. Only overloading works for now ;-)
26875 2001-09-18 Miguel de Icaza <miguel@ximian.com>
26877 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
26878 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
26880 * expression.cs (This::Emit): Implement.
26881 (This::Resolve): Implement.
26882 (TypeOf:Resolve): Implement.
26883 (Expression::ResolveSimpleName): Add an implicit this to instance
26885 (MemberAccess::Resolve): Deal with Parameters and Fields.
26886 Bind instance variable to Field expressions.
26887 (FieldExpr::Instance): New field used to track the expression that
26888 represents the object instance.
26889 (FieldExpr::Resolve): Track potential errors from MemberLookup not
26891 (FieldExpr::Emit): Implement.
26893 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
26894 the last instruction contains a return opcode to avoid generating
26895 the last `ret' instruction (this generates correct code, and it is
26896 nice to pass the peverify output).
26898 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
26899 initializer for static and instance variables.
26900 (Constructor::Emit): Allow initializer to be null in the case of
26901 static constructors. Only emit initializer for instance
26904 (TypeContainer::FindMembers): Return a null array if there are no
26907 Also fix the code for the MemberTypes.Method branch, as it was not
26908 scanning that for operators (or tried to access null variables before).
26910 * assign.cs (Assign::Emit): Handle instance and static fields.
26914 * driver.cs: Stop compilation if there are parse errors.
26916 * cs-parser.jay (constructor_declaration): Provide default base
26917 initializer for non-static constructors.
26918 (constructor_declarator): Do not provide a default base
26919 initializers if none was specified.
26920 Catch the fact that constructors should not have parameters.
26922 * class.cs: Do not emit parent class initializers for static
26923 constructors, that should be flagged as an error.
26925 2001-09-18 Ravi Pratap <ravi@ximian.com>
26927 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
26928 Move back code into TypeContainer::Populate.
26930 2001-09-18 Ravi Pratap <ravi@ximian.com>
26932 * class.cs (TypeContainer::AddConstructor): Fix the check to
26933 compare against Name, not Basename.
26934 (Operator::OpType): Change Plus and Minus to Add and Subtract.
26936 * cs-parser.jay : Update accordingly.
26938 * class.cs (TypeContainer::FindMembers): For the case where we are searching
26939 for methods, don't forget to look into the operators too.
26940 (RegisterMethodBuilder): Helper method to take care of this for
26941 methods, constructors and operators.
26942 (Operator::Define): Completely revamp.
26943 (Operator.OperatorMethod, MethodName): New fields.
26944 (TypeContainer::Populate): Move the registering of builders into
26945 RegisterMethodBuilder.
26946 (Operator::Emit): Re-write.
26948 * expression.cs (Binary::Emit): Comment out code path to emit method
26949 invocation stuff for the case when we have a user defined operator. I am
26950 just not able to get it right !
26952 2001-09-17 Miguel de Icaza <miguel@ximian.com>
26954 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
26957 (Expression::MemberLookup): Provide a version that allows to
26958 specify the MemberTypes and BindingFlags.
26960 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
26961 so it was not fetching variable information from outer blocks.
26963 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
26964 Beforefieldinit as it was buggy.
26966 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
26967 that Ravi put here.
26969 * class.cs (Constructor::Emit): Only emit if block is not null.
26970 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
26971 deal with this by semantically definining it as if the user had
26974 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
26975 constructors as we now "emit" them at a higher level.
26977 (TypeContainer::DefineDefaultConstructor): Used to define the
26978 default constructors if none was provided.
26980 (ConstructorInitializer): Add methods Resolve and Emit.
26982 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
26984 2001-09-17 Ravi Pratap <ravi@ximian.com>
26986 * class.cs (TypeContainer::EmitDefaultConstructor): Register
26987 the default constructor builder with our hashtable for methodbuilders
26990 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
26991 and argument_count is 0 in which case we have a match.
26992 (Binary::ResolveOperator): More null checking and miscellaneous coding
26995 2001-09-17 Ravi Pratap <ravi@ximian.com>
26997 * rootcontext.cs (IsNameSpace): Compare against null.
26999 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
27001 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
27002 and Unary::Operator.
27004 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
27007 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
27008 we have overloaded operators.
27009 (Binary::ResolveOperator): Implement the part which does the operator overload
27012 * class.cs (Operator::Emit): Implement.
27013 (TypeContainer::Emit): Emit the operators we have too.
27015 * expression.cs (Binary::Emit): Update to emit the appropriate code for
27016 the case when we have a user-defined operator.
27018 2001-09-17 Miguel de Icaza <miguel@ximian.com>
27020 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
27022 2001-09-16 Ravi Pratap <ravi@ximian.com>
27024 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
27025 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
27026 (Constructor::Emit): Implement.
27027 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
27028 if we have no work to do.
27029 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
27032 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
27033 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
27035 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
27038 2001-09-15 Ravi Pratap <ravi@ximian.com>
27040 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
27042 (Tree::RecordNamespace): Method to do what the name says ;-)
27043 (Tree::Namespaces): Property to get at the namespaces hashtable.
27045 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
27048 * rootcontext.cs (IsNamespace): Fixed it :-)
27050 2001-09-14 Miguel de Icaza <miguel@ximian.com>
27052 * class.cs (TypeContainer::FindMembers): Add support for
27054 (MethodCore): New class that encapsulates both the shared aspects
27055 of a Constructor and a Method.
27056 (Method, Constructor): Factored pieces into MethodCore.
27058 * driver.cs: Added --fatal which makes errors throw exceptions.
27059 Load System assembly as well as part of the standard library.
27061 * report.cs: Allow throwing exceptions on errors for debugging.
27063 * modifiers.cs: Do not use `parent', instead use the real type
27064 container to evaluate permission settings.
27066 * class.cs: Put Ravi's patch back in. He is right, and we will
27067 have to cope with the
27069 2001-09-14 Ravi Pratap <ravi@ximian.com>
27071 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
27072 FamORAssem, not FamANDAssem.
27074 2001-09-14 Miguel de Icaza <miguel@ximian.com>
27076 * driver.cs: Added --parse option that only parses its input files
27079 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
27080 incorrect. IsTopLevel is not used to tell whether an object is
27081 root_types or not (that can be achieved by testing this ==
27082 root_types). But to see if this is a top-level *class* (not
27083 necessarly our "toplevel" container).
27085 2001-09-14 Ravi Pratap <ravi@ximian.com>
27087 * enum.cs (Enum::Define): Modify to call the Lookup method on the
27088 parent instead of a direct call to GetType.
27090 2001-09-14 Ravi Pratap <ravi@ximian.com>
27092 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
27093 Modifiers.TypeAttr. This should just be a call to that method.
27095 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
27096 object so that we can determine if we are top-level or not.
27098 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
27101 * enum.cs (Enum::Define): Ditto.
27103 * modifiers.cs (FieldAttr): Re-write.
27105 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
27106 (TypeContainer::HaveStaticConstructor): New property to provide access
27107 to precisely that info.
27109 * modifiers.cs (MethodAttr): Re-write.
27110 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
27112 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
27113 of top-level types as claimed.
27115 2001-09-13 Miguel de Icaza <miguel@ximian.com>
27117 * expression.cs (MemberLookup): Fruitless attempt to lookup
27118 constructors. Maybe I need to emit default constructors? That
27119 might be it (currently .NET emits this for me automatically).
27120 (Invocation::OverloadResolve): Cope with Arguments == null.
27121 (Invocation::EmitArguments): new function, shared by the new
27122 constructor and us.
27123 (Invocation::Emit): Handle static and instance methods. Emit
27124 proper call instruction for virtual or non-virtual invocations.
27125 (New::Emit): Implement.
27126 (New::Resolve): Implement.
27127 (MemberAccess:Resolve): Implement.
27128 (MethodGroupExpr::InstanceExpression): used conforming to the spec
27129 to track instances.
27130 (FieldExpr::Resolve): Set type.
27132 * support.cs: Handle empty arguments.
27134 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
27135 SimpleLookup): Auxiliary routines to help parse a qualifier
27138 Update qualifier_identifier rule.
27140 * codegen.cs: Removed debugging messages.
27142 * class.cs: Make this a global thing, this acts just as a "key" to
27143 objects that we might have around.
27145 (Populate): Only initialize method_builders_to_methods once.
27147 * expression.cs (PropertyExpr): Initialize type from the
27150 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
27151 Resolve pattern. Attempt to implicitly convert value to boolean.
27154 * expression.cs: Set the type for the int32/int32 argument case.
27155 (Binary::ResolveOperator): Set the return type to boolean for
27156 comparission operators
27158 * typemanager.cs: Remove debugging print code.
27160 (Invocation::Resolve): resolve type.
27162 * class.cs: Allocate a MemberInfo of the correct size, as the code
27163 elsewhere depends on the test to reflect the correct contents.
27165 (Method::) Keep track of parameters, due to System.Reflection holes
27167 (TypeContainer::Populate): Keep track of MethodBuilders to Method
27170 (TypeContainer::FindMembers): Use ArrayList and then copy an array
27171 of the exact size and return that.
27173 (Class::LookupMethodByBuilder): New function that maps
27174 MethodBuilders to its methods. Required to locate the information
27175 on methods because System.Reflection bit us again.
27177 * support.cs: New file, contains an interface ParameterData and
27178 two implementations: ReflectionParameters and InternalParameters
27179 used to access Parameter information. We will need to grow this
27182 * expression.cs (Invocation::GetParameterData): implement a cache
27183 and a wrapper around the ParameterData creation for methods.
27184 (Invocation::OverloadResolve): Use new code.
27186 2001-09-13 Ravi Pratap <ravi@ximian.com>
27188 * class.cs (TypeContainer::EmitField): Remove and move into
27189 (Field::Define): here and modify accordingly.
27190 (Field.FieldBuilder): New member.
27191 (TypeContainer::Populate): Update accordingly.
27192 (TypeContainer::FindMembers): Implement.
27194 2001-09-13 Miguel de Icaza <miguel@ximian.com>
27196 * statement.cs: (VariableInfo::VariableType): New field to be
27197 initialized with the full type once it is resolved.
27199 2001-09-12 Miguel de Icaza <miguel@ximian.com>
27201 * parameter.cs (GetParameterInfo): Use a type cache to compute
27202 things only once, and to reuse this information
27204 * expression.cs (LocalVariableReference::Emit): Implement.
27205 (OpcodeCast::Emit): fix.
27207 (ParameterReference::Resolve): Implement.
27208 (ParameterReference::Emit): Implement.
27210 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
27211 that are expressions need to stay as Expressions.
27213 * typemanager.cs (CSharpName): Returns the C# name of a type if
27216 * expression.cs (Expression::ConvertImplicit): New function that
27217 implements implicit type conversions.
27219 (Expression::ImplicitReferenceConversion): Implements implicit
27220 reference conversions.
27222 (EmptyCast): New type for transparent casts.
27224 (OpcodeCast): New type for casts of types that are performed with
27225 a sequence of bytecodes.
27227 (BoxedCast): New type used for casting value types into reference
27228 types. Emits a box opcode.
27230 (Binary::DoNumericPromotions): Implements numeric promotions of
27231 and computation of the Binary::Type.
27233 (Binary::EmitBranchable): Optimization.
27235 (Binary::Emit): Implement code emission for expressions.
27237 * typemanager.cs (TypeManager): Added two new core types: sbyte
27240 2001-09-12 Ravi Pratap <ravi@ximian.com>
27242 * class.cs (TypeContainer::FindMembers): Method which does exactly
27243 what Type.FindMembers does, only we don't have to use reflection. No
27244 implementation yet.
27246 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
27247 typecontainer objects as we need to get at them.
27248 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
27250 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
27251 typecontainer object.
27253 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
27254 of just a Report object.
27256 2001-09-11 Ravi Pratap <ravi@ximian.com>
27258 * class.cs (Event::Define): Go back to using the prefixes "add_" and
27260 (TypeContainer::Populate): Now define the delegates of the type too.
27261 (TypeContainer.Delegates): Property to access the list of delegates defined
27264 * delegates.cs (Delegate::Define): Implement partially.
27266 * modifiers.cs (TypeAttr): Handle more flags.
27268 2001-09-11 Ravi Pratap <ravi@ximian.com>
27270 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
27272 (Operator::Define): Re-write logic to get types by using the LookupType method
27273 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
27274 (Indexer::Define): Ditto.
27275 (Event::Define): Ditto.
27276 (Property::Define): Ditto.
27278 2001-09-10 Ravi Pratap <ravi@ximian.com>
27280 * class.cs (TypeContainer::Populate): Now define operators too.
27281 (TypeContainer.Operators): New property to access the list of operators
27283 (Operator.OperatorMethodBuilder): New member to hold the method builder
27284 for the operator we are defining.
27285 (Operator::Define): Implement.
27287 2001-09-10 Ravi Pratap <ravi@ximian.com>
27289 * class.cs (Event::Define): Make the prefixes of the accessor methods
27290 addOn_ and removeOn_
27292 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
27293 of the location being passed in too. Ideally, this should go later since all
27294 error reporting should be done through the Report object.
27296 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
27297 (Populate): Iterate thru the indexers we have and define them too.
27298 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
27299 for the get and set accessors.
27300 (Indexer::Define): Implement.
27302 2001-09-09 Miguel de Icaza <miguel@ximian.com>
27304 * expression.cs (Binary::Resolve): Beginning of it. I scratched
27305 my previous implementation, did not work.
27307 * typemanager.cs: Add a couple of missing types (the longs).
27309 * literal.cs: Use TypeManager.bool_type instead of getting it.
27311 * expression.cs (EventExpr): New kind of expressions.
27312 (Expressio::ExprClassFromMemberInfo): finish
27314 2001-09-08 Miguel de Icaza <miguel@ximian.com>
27316 * assign.cs: Emit stores to static fields differently.
27318 2001-09-08 Ravi Pratap <ravi@ximian.com>
27320 * Merge in changes and adjust code to tackle conflicts. Backed out my
27321 code in Assign::Resolve ;-)
27323 2001-09-08 Ravi Pratap <ravi@ximian.com>
27325 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
27326 instead Report.Error and also pass in the location.
27327 (CSharpParser::Lexer): New readonly property to return the reference
27328 to the Tokenizer object.
27329 (declare_local_variables): Use Report.Error with location instead of plain
27333 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
27334 (Operator.CheckBinaryOperator): Ditto.
27336 * cs-parser.jay (operator_declarator): Update accordingly.
27338 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
27339 (CheckBinaryOperator): Same here.
27341 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
27342 on the name without any prefixes of namespace names etc. This is because we
27343 already might have something already fully qualified like
27344 'System.Console.WriteLine'
27346 * assign.cs (Resolve): Begin implementation. Stuck ;-)
27348 2001-09-07 Ravi Pratap <ravi@ximian.com>
27350 * cs-tokenizer.cs (location): Return a string which also contains
27353 * expression.cs (ElementAccess): New class for expressions of the
27354 type 'element access.'
27355 (BaseAccess): New class for expressions of the type 'base access.'
27356 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
27359 * cs-parser.jay (element_access): Implement action.
27360 (base_access): Implement actions.
27361 (checked_expression, unchecked_expression): Implement.
27363 * cs-parser.jay (local_variable_type): Correct and implement.
27364 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
27366 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
27368 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
27369 name and the specifiers.
27371 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
27373 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
27374 making them all public ;-)
27376 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
27379 2001-09-07 Miguel de Icaza <miguel@ximian.com>
27381 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
27383 (FieldExpr, PropertyExprs): New resolved expressions.
27384 (SimpleName::MemberStaticCheck): Perform static checks for access
27385 to non-static fields on static methods. Maybe this should be
27386 generalized for MemberAccesses.
27387 (SimpleName::ResolveSimpleName): More work on simple name
27390 * cs-parser.jay (primary_expression/qualified_identifier): track
27391 the parameter index.
27393 * codegen.cs (CodeGen::Save): Catch save exception, report error.
27394 (EmitContext::EmitBoolExpression): Chain to expression generation
27395 instead of temporary hack.
27396 (::EmitStatementExpression): Put generic expression code generation.
27398 * assign.cs (Assign::Emit): Implement variable assignments to
27399 local variables, parameters and fields.
27401 2001-09-06 Miguel de Icaza <miguel@ximian.com>
27403 * statement.cs (Block::GetVariableInfo): New method, returns the
27404 VariableInfo for a variable name in a block.
27405 (Block::GetVariableType): Implement in terms of GetVariableInfo
27407 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
27408 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
27410 2001-09-06 Ravi Pratap <ravi@ximian.com>
27412 * cs-parser.jay (operator_declaration): Continue on my quest : update
27413 to take attributes argument.
27414 (event_declaration): Ditto.
27415 (enum_declaration): Ditto.
27416 (indexer_declaration): Ditto.
27418 * class.cs (Operator::Operator): Update constructor accordingly.
27419 (Event::Event): Ditto.
27421 * delegate.cs (Delegate::Delegate): Same here.
27423 * enum.cs (Enum::Enum): Same here.
27425 2001-09-05 Ravi Pratap <ravi@ximian.com>
27427 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
27429 * ../tests/cs0658.cs : New file to demonstrate error 0658.
27431 * attribute.cs (Attributes): New class to encapsulate all attributes which were
27432 being passed around as an arraylist.
27433 (Attributes::AddAttribute): Method to add attribute sections.
27435 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
27436 (struct_declaration): Update accordingly.
27437 (constant_declaration): Update.
27438 (field_declaration): Update.
27439 (method_header): Update.
27440 (fixed_parameter): Update.
27441 (parameter_array): Ditto.
27442 (property_declaration): Ditto.
27443 (destructor_declaration): Ditto.
27445 * class.cs (Struct::Struct): Update constructors accordingly.
27446 (Class::Class): Ditto.
27447 (Field::Field): Ditto.
27448 (Method::Method): Ditto.
27449 (Property::Property): Ditto.
27450 (TypeContainer::OptAttribute): update property's return type.
27452 * interface.cs (Interface.opt_attributes): New member.
27453 (Interface::Interface): Update to take the extra Attributes argument.
27455 * parameter.cs (Parameter::Parameter): Ditto.
27457 * constant.cs (Constant::Constant): Ditto.
27459 * interface.cs (InterfaceMemberBase): New OptAttributes field.
27460 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
27461 the attributes as a parameter.
27462 (InterfaceProperty): Update constructor call.
27463 (InterfaceEvent): Ditto.
27464 (InterfaceMethod): Ditto.
27465 (InterfaceIndexer): Ditto.
27467 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
27468 pass the attributes too.
27469 (interface_event_declaration): Ditto.
27470 (interface_property_declaration): Ditto.
27471 (interface_method_declaration): Ditto.
27472 (interface_declaration): Ditto.
27474 2001-09-05 Miguel de Icaza <miguel@ximian.com>
27476 * class.cs (Method::Define): Track the "static Main" definition to
27477 create an entry point.
27479 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
27480 EntryPoint if we find it.
27482 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
27483 (EmitContext::ig): Make this variable public.
27485 * driver.cs: Make the default output file be the first file name
27486 with the .exe extension.
27488 Detect empty compilations
27490 Handle various kinds of output targets. Handle --target and
27491 rename -t to --dumper.
27493 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
27494 methods inherited from Expression return now an Expression. This
27495 will is used during the tree rewriting as we resolve them during
27498 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
27499 the spec. Missing entirely is the information about
27500 accessability of elements of it.
27502 (Expression::ExprClassFromMemberInfo): New constructor for
27503 Expressions that creates a fully initialized Expression based on
27504 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
27507 (Invocation::Resolve): Begin implementing resolution of invocations.
27509 * literal.cs (StringLiteral): Implement Emit.
27511 2001-09-05 Ravi Pratap <ravi@ximian.com>
27513 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
27516 2001-09-04 Ravi Pratap <ravi@ximian.com>
27518 * cs-parser.jay (attribute_arguments): Implement actions.
27519 (attribute): Fix bug in production. Implement action.
27520 (attribute_list): Implement.
27521 (attribute_target): Implement.
27522 (attribute_target_specifier, opt_target_specifier): Implement
27523 (CheckAttributeTarget): New method to check if the attribute target
27525 (attribute_section): Implement.
27526 (opt_attributes): Implement.
27528 * attribute.cs : New file to handle attributes.
27529 (Attribute): Class to hold attribute info.
27531 * cs-parser.jay (opt_attribute_target_specifier): Remove production
27532 (attribute_section): Modify production to use 2 different rules to
27533 achieve the same thing. 1 s/r conflict down !
27534 Clean out commented, useless, non-reducing dimension_separator rules.
27536 * class.cs (TypeContainer.attributes): New member to hold list
27537 of attributes for a type.
27538 (Struct::Struct): Modify to take one more argument, the attribute list.
27539 (Class::Class): Ditto.
27540 (Field::Field): Ditto.
27541 (Method::Method): Ditto.
27542 (Property::Property): Ditto.
27544 * cs-parser.jay (struct_declaration): Update constructor call to
27545 pass in the attributes too.
27546 (class_declaration): Ditto.
27547 (constant_declaration): Ditto.
27548 (field_declaration): Ditto.
27549 (method_header): Ditto.
27550 (fixed_parameter): Ditto.
27551 (parameter_array): Ditto.
27552 (property_declaration): Ditto.
27554 * constant.cs (Constant::Constant): Update constructor similarly.
27555 Use System.Collections.
27557 * parameter.cs (Parameter::Parameter): Update as above.
27559 2001-09-02 Ravi Pratap <ravi@ximian.com>
27561 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
27562 (TypeContainer.delegates): New member to hold list of delegates.
27564 * cs-parser.jay (delegate_declaration): Implement the action correctly
27565 this time as I seem to be on crack ;-)
27567 2001-09-02 Miguel de Icaza <miguel@ximian.com>
27569 * rootcontext.cs (RootContext::IsNamespace): new function, used to
27570 tell whether an identifier represents a namespace.
27572 * expression.cs (NamespaceExpr): A namespace expression, used only
27573 temporarly during expression resolution.
27574 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
27575 utility functions to resolve names on expressions.
27577 2001-09-01 Miguel de Icaza <miguel@ximian.com>
27579 * codegen.cs: Add hook for StatementExpressions.
27581 * class.cs: Fix inverted test for static flag in methods.
27583 2001-09-02 Ravi Pratap <ravi@ximian.com>
27585 * class.cs (Operator::CheckUnaryOperator): Correct error number used
27586 to make it coincide with MS' number.
27587 (Operator::CheckBinaryOperator): Ditto.
27589 * ../errors/errors.txt : Remove error numbers added earlier.
27591 * ../errors/cs1019.cs : Test case for error # 1019
27593 * ../errros/cs1020.cs : Test case for error # 1020
27595 * cs-parser.jay : Clean out commented cruft.
27596 (dimension_separators, dimension_separator): Comment out. Ostensibly not
27597 used anywhere - non-reducing rule.
27598 (namespace_declarations): Non-reducing rule - comment out.
27600 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
27601 with TypeContainer::AddEnum.
27603 * delegate.cs : New file for delegate handling classes.
27604 (Delegate): Class for declaring delegates.
27606 * makefile : Update.
27608 * cs-parser.jay (delegate_declaration): Implement.
27610 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
27612 * class.cs (Event::Define): Implement.
27613 (Event.EventBuilder): New member.
27615 * class.cs (TypeContainer::Populate): Update to define all enums and events
27617 (Events): New property for the events arraylist we hold. Shouldn't we move to using
27618 readonly fields for all these cases ?
27620 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
27622 * class.cs (Property): Revamp to use the convention of making fields readonly.
27623 Accordingly modify code elsewhere.
27625 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
27626 the Define method of the Property class.
27628 * class.cs : Clean up applied patch and update references to variables etc. Fix
27630 (TypeContainer::Populate): Update to define all the properties we have. Also
27631 define all enumerations.
27633 * enum.cs (Define): Implement.
27635 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
27637 * cs-parser.jay (overloadable_operator): The semantic value is an
27638 enum of the Operator class.
27639 (operator_declarator): Implement actions.
27640 (operator_declaration): Implement.
27642 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
27643 validity of definitions.
27644 (Operator::CheckBinaryOperator): Static method to check for binary operators
27645 (TypeContainer::AddOperator): New method to add an operator to a type.
27647 * cs-parser.jay (indexer_declaration): Added line to actually call the
27648 AddIndexer method so it gets added ;-)
27650 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
27651 already taken care of by the MS compiler ?
27653 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
27655 * class.cs (Operator): New class for operator declarations.
27656 (Operator::OpType): Enum for the various operators.
27658 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
27660 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
27661 ostensibly handle this in semantic analysis.
27663 * cs-parser.jay (general_catch_clause): Comment out
27664 (specific_catch_clauses, specific_catch_clause): Ditto.
27665 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
27666 (catch_args, opt_catch_args): New productions.
27667 (catch_clause): Rewrite to use the new productions above
27668 (catch_clauses): Modify accordingly.
27669 (opt_catch_clauses): New production to use in try_statement
27670 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
27671 and re-write the code in the actions to extract the specific and
27672 general catch clauses by being a little smart ;-)
27674 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
27675 Hooray, try and catch statements parse fine !
27677 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27679 * statement.cs (Block::GetVariableType): Fix logic to extract the type
27680 string from the hashtable of variables.
27682 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
27683 I end up making that mistake ;-)
27684 (catch_clauses): Fixed gross error which made Key and Value of the
27685 DictionaryEntry the same : $1 !!
27687 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27689 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
27691 * cs-parser.jay (event_declaration): Correct to remove the semicolon
27692 when the add and remove accessors are specified.
27694 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27696 * cs-parser.jay (IndexerDeclaration): New helper class to hold
27697 information about indexer_declarator.
27698 (indexer_declarator): Implement actions.
27699 (parsing_indexer): New local boolean used to keep track of whether
27700 we are parsing indexers or properties. This is necessary because
27701 implicit_parameters come into picture even for the get accessor in the
27702 case of an indexer.
27703 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
27705 * class.cs (Indexer): New class for indexer declarations.
27706 (TypeContainer::AddIndexer): New method to add an indexer to a type.
27707 (TypeContainer::indexers): New member to hold list of indexers for the
27710 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
27712 * cs-parser.jay (add_accessor_declaration): Implement action.
27713 (remove_accessor_declaration): Implement action.
27714 (event_accessors_declaration): Implement
27715 (variable_declarators): swap statements for first rule - trivial.
27717 * class.cs (Event): New class to hold information about event
27719 (TypeContainer::AddEvent): New method to add an event to a type
27720 (TypeContainer::events): New member to hold list of events.
27722 * cs-parser.jay (event_declaration): Implement actions.
27724 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
27726 * cs-parser.jay (dim_separators): Implement. Make it a string
27727 concatenating all the commas together, just as they appear.
27728 (opt_dim_separators): Modify accordingly
27729 (rank_specifiers): Update accordingly. Basically do the same
27730 thing - instead, collect the brackets here.
27731 (opt_rank_sepcifiers): Modify accordingly.
27732 (array_type): Modify to actually return the complete type string
27733 instead of ignoring the rank_specifiers.
27734 (expression_list): Implement to collect the expressions
27735 (variable_initializer): Implement. We make it a list of expressions
27736 essentially so that we can handle the array_initializer case neatly too.
27737 (variable_initializer_list): Implement.
27738 (array_initializer): Make it a list of variable_initializers
27739 (opt_array_initializer): Modify accordingly.
27741 * expression.cs (New::NType): Add enumeration to help us
27742 keep track of whether we have an object/delegate creation
27743 or an array creation.
27744 (New:NewType, New::Rank, New::Indices, New::Initializers): New
27745 members to hold data about array creation.
27746 (New:New): Modify to update NewType
27747 (New:New): New Overloaded contructor for the array creation
27750 * cs-parser.jay (array_creation_expression): Implement to call
27751 the overloaded New constructor.
27753 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
27755 * class.cs (TypeContainer::Constructors): Return member
27756 constructors instead of returning null.
27758 2001-08-26 Miguel de Icaza <miguel@ximian.com>
27760 * typemanager.cs (InitCoreTypes): Initialize the various core
27761 types after we have populated the type manager with the user
27762 defined types (this distinction will be important later while
27763 compiling corlib.dll)
27765 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
27766 on Expression Classification. Now all expressions have a method
27767 `Resolve' and a method `Emit'.
27769 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
27770 generation from working. Also add some temporary debugging
27773 2001-08-24 Miguel de Icaza <miguel@ximian.com>
27775 * codegen.cs: Lots of code generation pieces. This is only the
27776 beginning, will continue tomorrow with more touches of polish. We
27777 handle the fundamentals of if, while, do, for, return. Others are
27778 trickier and I need to start working on invocations soon.
27780 * gen-treedump.cs: Bug fix, use s.Increment here instead of
27783 * codegen.cs (EmitContext): New struct, used during code
27784 emission to keep a context. Most of the code generation will be
27787 * cs-parser.jay: Add embedded blocks to the list of statements of
27788 this block. So code generation proceeds in a top down fashion.
27790 2001-08-23 Miguel de Icaza <miguel@ximian.com>
27792 * statement.cs: Add support for multiple child blocks.
27794 2001-08-22 Miguel de Icaza <miguel@ximian.com>
27796 * codegen.cs (EmitCode): New function, will emit the code for a
27797 Block of code given a TypeContainer and its ILGenerator.
27799 * statement.cs (Block): Standard public readonly optimization.
27800 (Block::Block constructors): Link children.
27801 (Block::Child): Child Linker.
27802 (Block::EmitVariables): Emits IL variable declarations.
27804 * class.cs: Drop support for MethodGroups here, delay until
27806 (Method::): Applied the same simplification that I did before, and
27807 move from Properties to public readonly fields.
27808 (Method::ParameterTypes): Returns the parameter types for the
27809 function, and implements a cache that will be useful later when I
27810 do error checking and the semantic analysis on the methods is
27812 (Constructor::GetCallingConvention): Renamed from CallingConvetion
27813 and made a method, optional argument tells whether this is a class
27814 or a structure to apply the `has-this' bit.
27815 (Method::GetCallingConvention): Implement, returns the calling
27817 (Method::Define): Defines the type, a second pass is performed
27818 later to populate the methods.
27820 (Constructor::ParameterTypes): implement a cache similar to the
27821 one on Method::ParameterTypes, useful later when we do semantic
27824 (TypeContainer::EmitMethod): New method. Emits methods.
27826 * expression.cs: Removed MethodGroup class from here.
27828 * parameter.cs (Parameters::GetCallingConvention): new method.
27830 2001-08-21 Miguel de Icaza <miguel@ximian.com>
27832 * class.cs (TypeContainer::Populate): Drop RootContext from the
27835 (Constructor::CallingConvention): Returns the calling convention.
27836 (Constructor::ParameterTypes): Returns the constructor parameter
27839 (TypeContainer::AddConstructor): Keep track of default constructor
27840 and the default static constructor.
27842 (Constructor::) Another class that starts using `public readonly'
27843 instead of properties.
27845 (Constructor::IsDefault): Whether this is a default constructor.
27847 (Field::) use readonly public fields instead of properties also.
27849 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
27850 track of static constructors; If none is used, turn on
27851 BeforeFieldInit in the TypeAttributes.
27853 * cs-parser.jay (opt_argument_list): now the return can be null
27854 for the cases where there are no arguments.
27856 (constructor_declarator): If there is no implicit `base' or
27857 `this', then invoke the default parent constructor.
27859 * modifiers.cs (MethodAttr): New static function maps a set of
27860 modifiers flags into a MethodAttributes enum
27861 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
27862 MethodAttr, TypeAttr to represent the various mappings where the
27863 modifiers are used.
27864 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
27866 2001-08-19 Miguel de Icaza <miguel@ximian.com>
27868 * parameter.cs (GetParameterInfo): Fix bug where there would be no
27871 * interface.cs (PopulateIndexer): Implemented the code generator
27872 for interface indexers.
27874 2001-08-17 Miguel de Icaza <miguel@ximian.com>
27876 * interface.cs (InterfaceMemberBase): Now we track the new status
27879 (PopulateProperty): Implement property population. Woohoo! Got
27880 Methods and Properties going today.
27882 Removed all the properties for interfaces, and replaced them with
27883 `public readonly' fields.
27885 2001-08-16 Miguel de Icaza <miguel@ximian.com>
27887 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
27888 initialize their hashtables/arraylists only when they are needed
27889 instead of doing this always.
27891 * parameter.cs: Handle refs and out parameters.
27893 * cs-parser.jay: Use an ArrayList to construct the arguments
27894 instead of the ParameterCollection, and then cast that to a
27897 * parameter.cs: Drop the use of ParameterCollection and use
27898 instead arrays of Parameters.
27900 (GetParameterInfo): Use the Type, not the Name when resolving
27903 2001-08-13 Miguel de Icaza <miguel@ximian.com>
27905 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
27906 and instead use public readonly fields.
27908 * class.cs: Put back walking code for type containers.
27910 2001-08-11 Miguel de Icaza <miguel@ximian.com>
27912 * class.cs (MakeConstant): Code to define constants.
27914 * rootcontext.cs (LookupType): New function. Used to locate types
27917 2001-08-08 Miguel de Icaza <miguel@ximian.com>
27919 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
27920 this System.Reflection code is. Kudos to Microsoft
27922 * typemanager.cs: Implement a type cache and avoid loading all
27923 types at boot time. Wrap in LookupType the internals. This made
27924 the compiler so much faster. Wow. I rule!
27926 * driver.cs: Make sure we always load mscorlib first (for
27927 debugging purposes, nothing really important).
27929 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
27930 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
27932 * rootcontext.cs: Lookup types on their namespace; Lookup types
27933 on namespaces that have been imported using the `using' keyword.
27935 * class.cs (TypeContainer::TypeAttr): Virtualize.
27936 (Class::TypeAttr): Return attributes suitable for this bad boy.
27937 (Struct::TypeAttr): ditto.
27938 Handle nested classes.
27939 (TypeContainer::) Remove all the type visiting code, it is now
27940 replaced with the rootcontext.cs code
27942 * rootcontext.cs (GetClassBases): Added support for structs.
27944 2001-08-06 Miguel de Icaza <miguel@ximian.com>
27946 * interface.cs, statement.cs, class.cs, parameter.cs,
27947 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
27948 Drop use of TypeRefs, and use strings instead.
27950 2001-08-04 Miguel de Icaza <miguel@ximian.com>
27954 * class.cs (Struct::Struct): set the SEALED flags after
27955 checking the modifiers.
27956 (TypeContainer::TypeAttr): new property, returns the
27957 TypeAttributes for a class.
27959 * cs-parser.jay (type_list): Oops, list production was creating a
27960 new list of base types.
27962 * rootcontext.cs (StdLib): New property.
27963 (GetInterfaceTypeByName): returns an interface by type name, and
27964 encapsulates error handling here.
27965 (GetInterfaces): simplified.
27966 (ResolveTree): Encapsulated all the tree resolution here.
27967 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
27970 * driver.cs: Add support for --nostdlib, to avoid loading the
27971 default assemblies.
27972 (Main): Do not put tree resolution here.
27974 * rootcontext.cs: Beginning of the class resolution.
27976 2001-08-03 Miguel de Icaza <miguel@ximian.com>
27978 * rootcontext.cs: Provide better error reporting.
27980 * cs-parser.jay (interface_base): set our $$ to be interfaces.
27982 * rootcontext.cs (CreateInterface): Handle the case where there
27983 are no parent interfaces.
27985 (CloseTypes): Routine to flush types at the end.
27986 (CreateInterface): Track types.
27987 (GetInterfaces): Returns an array of Types from the list of
27988 defined interfaces.
27990 * typemanager.c (AddUserType): Mechanism to track user types (puts
27991 the type on the global type hash, and allows us to close it at the
27994 2001-08-02 Miguel de Icaza <miguel@ximian.com>
27996 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
27997 RecordInterface instead.
27999 * cs-parser.jay: Updated to reflect changes above.
28001 * decl.cs (Definition): Keep track of the TypeBuilder type that
28002 represents this type here. Not sure we will use it in the long
28003 run, but wont hurt for now.
28005 * driver.cs: Smaller changes to accomodate the new code.
28007 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
28010 * rootcontext.cs (CreateInterface): New method, used to create
28011 the System.TypeBuilder type for interfaces.
28012 (ResolveInterfaces): new entry point to resolve the interface
28014 (CodeGen): Property, used to keep track of the code generator.
28016 2001-07-26 Miguel de Icaza <miguel@ximian.com>
28018 * cs-parser.jay: Add a second production for delegate_declaration
28021 (enum_body): Put an opt_comma here instead of putting it on
28022 enum_body or enum_member_declarations so we can handle trailing
28023 commas on enumeration members. Gets rid of a shift/reduce.
28025 (type_list): Need a COMMA in the middle.
28027 (indexer_declaration): Tell tokenizer to recognize get/set
28029 * Remove old targets.
28031 * Re-add the parser target.
28033 2001-07-13 Simon Cozens <simon@simon-cozens.org>
28035 * cs-parser.jay: Add precendence rules for a number of operators
28036 ot reduce the number of shift/reduce conflicts in the grammar.
28038 2001-07-17 Miguel de Icaza <miguel@ximian.com>
28040 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
28043 Get rid of old crufty code.
28045 * rootcontext.cs: Use this to keep track of the parsed
28046 representation and the defined types available to the program.
28048 * gen-treedump.cs: adjust for new convention.
28050 * type.cs: Split out the type manager, and the assembly builder
28053 * typemanager.cs: the type manager will live here now.
28055 * cil-codegen.cs: And the code generator here.
28057 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
28059 * makefile: Fixed up for easy making.
28061 2001-07-13 Simon Cozens <simon@simon-cozens.org>
28063 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
28066 (unary_expression): Expand pre_increment_expression and
28067 post_decrement_expression to reduce a shift/reduce.
28069 2001-07-11 Simon Cozens
28071 * cs-tokenizer.cs: Hex numbers should begin with a 0.
28073 Improve allow_keyword_as_indent name.
28075 2001-06-19 Miguel de Icaza <miguel@ximian.com>
28077 * Adjustments for Beta2.
28079 2001-06-13 Miguel de Icaza <miguel@ximian.com>
28081 * decl.cs: Added `Define' abstract method.
28082 (InTransit): new property, used to catch recursive definitions.
28084 * interface.cs: Implement `Define'.
28086 * modifiers.cs: Map Modifiers.constants to
28087 System.Reflection.TypeAttribute flags.
28089 * class.cs: Keep track of types and user-defined types.
28090 (BuilderInit): New method for creating an assembly
28091 (ResolveType): New function to launch the resolution process, only
28092 used by interfaces for now.
28094 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
28095 that are inserted into the name space.
28097 2001-06-08 Miguel de Icaza <miguel@ximian.com>
28099 * ARGH. I have screwed up my tree so many times due to the use of
28100 rsync rather than using CVS. Going to fix this at once.
28102 * driver.cs: Objetify driver. Load assemblies, use assemblies to
28105 2001-06-07 Miguel de Icaza <miguel@ximian.com>
28107 * Experiment successful: Use System.Type rather that our own
28110 2001-05-25 Miguel de Icaza <miguel@ximian.com>
28112 * cs-parser.jay: Removed nsAliases from here.
28114 Use new namespaces, handle `using XXX;'
28116 * namespace.cs: Reimplemented namespace handling, use a recursive
28117 definition of the class. Now we can keep track of using clauses
28118 and catch invalid using clauses.
28120 2001-05-24 Miguel de Icaza <miguel@ximian.com>
28122 * gen-treedump.cs: Adapted for all the renaming.
28124 * expression.cs (Expression): this class now has a Type property
28125 which returns an expression Type.
28127 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
28128 `Type', as this has a different meaning now in the base
28130 2001-05-22 Miguel de Icaza <miguel@ximian.com>
28132 * interface.cs, class.cs: Removed from all the sources the
28133 references to signature computation, as we can not do method
28134 signature computation during the parsing time, as we are not
28135 trying to solve at that point distinguishing:
28139 void a (NS.Blah x) {}
28142 Which depending on the context might be valid or not, as we do not
28143 know if Blah is the same thing as NS.Blah at that point.
28145 * Redid everything so the code uses TypeRefs now instead of
28146 Types. TypeRefs are just temporary type placeholders, that need
28147 to be resolved. They initially have a pointer to a string and the
28148 current scope in which they are used. This is used later by the
28149 compiler to resolve the reference to an actual Type.
28151 * DeclSpace is no longer a CIR.Type, and neither are
28152 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
28153 are all DeclSpaces, but no Types.
28155 * type.cs (TypeRefManager): This implements the TypeRef manager,
28156 which keeps track of all the types that need to be resolved after
28157 the parsing has finished.
28159 2001-05-13 Miguel de Icaza <miguel@ximian.com>
28161 * ARGH. We are going to have to store `foreach' as a class rather
28162 than resolving it, as we need to verify error 1579 after name
28163 resolution. *OR* we could keep a flag that says `This request to
28164 IEnumerator comes from a foreach statement' which we can then use
28165 to generate the error.
28167 2001-05-10 Miguel de Icaza <miguel@ximian.com>
28169 * class.cs (TypeContainer.AddMethod): we now add methods to the
28170 MethodGroup instead of the method hashtable.
28172 * expression.cs: Add MethodGroup abstraction, which gets us one
28173 step closer to the specification in the way we handle method
28176 * cs-parser.jay (primary_expression): qualified_identifier now
28177 tried to match up an identifier to a local variable reference or
28178 to a parameter reference.
28180 current_local_parameters is now a parser global variable that
28181 points to the current parameters for the block, used during name
28184 (property_declaration): Now creates an implicit `value' argument to
28187 2001-05-09 Miguel de Icaza <miguel@ximian.com>
28189 * parameter.cs: Do not use `param' arguments as part of the
28190 signature, per the spec.
28192 2001-05-08 Miguel de Icaza <miguel@ximian.com>
28194 * decl.cs: Base class for classes, structs and interfaces. This
28195 is the "Declaration Space"
28197 * cs-parser.jay: Use CheckDef for checking declaration errors
28198 instead of having one on each function.
28200 * class.cs: Factor out some code for handling error handling in
28201 accordance to the "Declarations" section in the "Basic Concepts"
28202 chapter in the ECMA C# spec.
28204 * interface.cs: Make all interface member classes derive from
28205 InterfaceMemberBase.
28207 2001-05-07 Miguel de Icaza <miguel@ximian.com>
28209 * Many things: all interfaces are parsed and generated in
28210 gen-treedump. Support for member variables, constructors,
28211 destructors, properties, constants is there.
28213 Beginning of the IL backend, but very little done, just there for
28216 2001-04-29 Miguel de Icaza <miguel@ximian.com>
28218 * cs-parser.jay: Fix labeled statement.
28220 * cs-tokenizer.cs (escape): Escape " and ' always.
28221 ref_line, ref_name: keep track of the line/filename as instructed
28222 by #line by the compiler.
28225 2001-04-27 Miguel de Icaza <miguel@ximian.com>
28227 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
28228 to match the values in System.CodeDOM.
28230 Divid renamed to Divide.
28232 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
28234 (Statements.set): remove.
28236 * System.CodeDOM/CodeCatchClause.cs: always have a valid
28239 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
28240 falseStatements always have valid values.
28242 * cs-parser.jay: Use System.CodeDOM now.