1 2008-03-12 Marek Safar <marek.safar@gmail.com>
3 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
4 crash when predefined field does not exist.
6 2008-03-12 Marek Safar <marek.safar@gmail.com>
8 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
10 2008-03-12 Marek Safar <marek.safar@gmail.com>
12 * class.cs (FixedField): Don't crash when contructors are missing.
14 2008-03-11 Marek Safar <marek.safar@gmail.com>
16 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
17 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
18 check internal types accessibility for internal and external types.
19 Replaced EnumToUnderlying by GetEnumUnderlyingType.
21 2008-03-11 Marek Safar <marek.safar@gmail.com>
23 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
24 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
25 attribute.cs, statement: Use corect instance of predefined types (work
28 2008-03-07 Marek Safar <marek.safar@gmail.com>
30 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
32 2008-03-07 Marek Safar <marek.safar@gmail.com>
34 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
35 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
36 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
37 predefined types clean up, delayed predefined types members initialization
38 (work related to #364674).
40 2008-03-05 Marek Safar <marek.safar@gmail.com>
42 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
44 2008-03-05 Marek Safar <marek.safar@gmail.com>
46 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
47 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
48 predefined types clean up (work related to #364674).
50 2008-03-04 Marek Safar <marek.safar@gmail.com>
52 * ecore.cs: Print an error message instead of throwing exception.
54 2008-03-04 Marek Safar <marek.safar@gmail.com>
56 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
57 expression.cs, statement.cs: Unififed null literal representation.
59 2008-03-03 Marek Safar <marek.safar@gmail.com>
61 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
62 expression.cs: Refactored binary operators resolve phase and improved speed.
63 The nullable code is still missing and won't work correctly, more fixes
66 It also fixes #323726, #324312, #324248, and many other unreported issues.
68 2008-02-29 Zoltan Varga <vargaz@gmail.com>
70 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
73 2008-02-27 Marek Safar <marek.safar@gmail.com>
75 * ecore.cs: Clean-up and split BetterConversion.
77 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
80 * enum.cs (EnumMember.Value): Only access 'value' if
81 ResolveValue says it's ok.
82 (EnumMember.DoResolveValue): Don't set prev_member.value.
83 (Enum.GetDefinition): Reverse arguments of Equals --
84 EnumMember.Value can return 'null'.
86 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
88 2008-02-22 Marek Safar <marek.safar@gmail.com>
90 * generic.cs, expression.cs: More ongoing work on expression trees.
92 2008-02-21 Marek Safar <marek.safar@gmail.com>
94 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
95 handle missing matches when mutiple operators exist.
97 2008-02-20 Marek Safar <marek.safar@gmail.com>
100 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
103 2008-02-20 Marek Safar <marek.safar@gmail.com>
105 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
106 update. This time to deal correctly with SideEffectConstant expression used
107 as an argument for another constant folding.
109 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
111 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
114 2008-02-19 Marek Safar <marek.safar@gmail.com>
116 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
118 2008-02-19 Marek Safar <marek.safar@gmail.com>
120 A fix for bug #328136
121 * expression.cs: Do not fold immediately LogicalAnd operators when the left
122 side is a false constant, because we still need to evaluate the right-hand
125 * statement.cs (If): Emit two types of boolean constants (simple constant,
126 side-effect constant).
128 2008-02-19 Marek Safar <marek.safar@gmail.com>
130 * constant.cs (SideEffectConstant): Don't emit boolean constant.
132 * expression.cs: Fold immediately LogicalAnd operators when both sides are
135 2008-02-18 Marek Safar <marek.safar@gmail.com>
137 A fix for bug #361457
138 * ecore.cs (IsApplicable): Params methods have lower priority.
140 * support.cs: Return correct parameter modifier for params types.
142 2008-02-18 Marek Safar <marek.safar@gmail.com>
144 * generic.cs (TypeParameter): Cache attribute target name.
146 * support.cs: Removed unused variable.
148 * typemanager.cs: Removed debugging leftover.
150 * ecore.cs: Use local type instead of a property;
152 * class.cs (VerifyMembers): Consider also parent to test whether type member
155 * expression.cs (FullMethodDesc): Removed.
157 * attribute.cs (IsValidArgumentType): Made static.
159 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
161 Cleanup to be more readable.
162 * Makefile (GMCS_PROFILE): Remove.
163 (COMPILER_NAME): New helper.
165 2008-02-15 Miguel de Icaza <miguel@novell.com>
167 * cs-tokenizer.cs: if a conditional expression happens inside a
168 (...) this also means that we do not need to de-ambiguate between
169 an parenthesized expression and a cast.
173 * constant.cs (SideEffectConstant): a constant value that happens
174 to have a side effect.
176 Fixes the build regressions introduced by the fix for #359789
178 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
180 * expression.cs (Conditional.Emit): when emitting the ternary
181 operator, use local variables to generate code verifiable code.
183 The verifier cannot infer that the type on stack before the
184 stloc.0 is executed is of type ParentB. This happens because the
185 stack merge algorithm uses only parent types when deciding which
186 is the common type. This is described in Part III 1.8.1.3 of ECMA
189 This code compiled with mcs is not verifiable under MS. The MS
190 verifier picks the first common interface of Foo and Bar, which is
191 wrong, but doesn't use a full join type of the 2 interfaces.
193 CSC uses a clever hack to compile such code in a verifiable
194 way. It stores the intermediate values in a local variable with
199 2008-02-14 Miguel de Icaza <miguel@novell.com>
201 * expression.cs: Do not fold BitwiseAnd operators when the left
202 side is a false constant, because we still need to evaluate the
207 * support.cs: Instead of throwing an InternalErrorException when
208 the position of the stream is outside the boundary of our buffer,
209 reset the state of the reader, and restart the reading from the
210 beginning of the file.
212 2008-02-14 Marek Safar <marek.safar@gmail.com>
214 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
216 2008-02-14 Marek Safar <marek.safar@gmail.com>
218 A fix for bug #361686
219 * decl.cs: A protected types used inside a private class which parents
220 derives from the protected class are accessible.
222 2008-02-13 Marek Safar <marek.safar@gmail.com>
224 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
225 the parameterless constructor.
227 2008-02-13 Marek Safar <marek.safar@gmail.com>
229 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
230 lookup methods to use standard member cache when doing member lookup.
232 2008-02-12 Marek Safar <marek.safar@gmail.com>
234 * driver.cs: Don't report full path for referenced module as assembly error.
236 2008-02-12 Marek Safar <marek.safar@gmail.com>
238 * Makefile: Fixed `qh' target to work on all machines.
240 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
241 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
242 and HasElementType with TypeManager implementation.
244 2008-02-08 Marek Safar <marek.safar@gmail.com>
246 A fix for bugs #325134, #359749
247 * expression.cs, ecore.cs: Try to resolve an extension method even if the
248 first binds point to non-method member expression.
250 2008-02-08 Marek Safar <marek.safar@gmail.com>
252 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
254 2008-02-08 Marek Safar <marek.safar@gmail.com>
256 A fix for bugs #321394, #323028
257 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
258 Reworked naive IsAccessibleAs implementation to handle nested types.
260 2008-02-05 Jb Evain <jbevain@novell.com>
262 * class.cs: use generic type comparison for parameters
265 2008-02-05 Marek Safar <marek.safar@gmail.com>
267 A fix for bug #325372
268 * class.cs: Use generic type comparison when testing method signatures.
270 2008-02-05 Marek Safar <marek.safar@gmail.com>
272 A fix for bug #357047
273 * ecore.cs: Applied C# 3.0 changes to better conversion.
275 2008-02-05 Marek Safar <marek.safar@gmail.com>
277 A fix for bug #358374
278 * cs-parser.jay: Correctly set modifiers for all constructor types.
280 2008-02-04 Marek Safar <marek.safar@gmail.com>
282 A fix for bug #355251
283 * generic.cs: Added base class constraint based type inference.
285 2008-02-01 Marek Safar <marek.safar@gmail.com>
287 A fix for bug #357255
288 * decl.cs: One more missing visibility check.
290 2008-02-01 Marek Safar <marek.safar@gmail.com>
292 * support.cs: Fixed broken return.
294 2008-01-25 Marek Safar <marek.safar@gmail.com>
296 * report.cs: Correctly reset warnings count after probing.
298 2008-01-25 Martin Baulig <martin@ximian.com>
301 (NamespaceEntry.SymbolFileID): Make this work again after
302 MemberName.ToString() is gone.
304 2008-01-25 Marek Safar <marek.safar@gmail.com>
306 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
309 2008-01-25 Marek Safar <marek.safar@gmail.com>
311 * generic.cs: Use full implicit conversion for type inference fixing.
313 2008-01-24 Marek Safar <marek.safar@gmail.com>
315 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
316 Fixed user operator conversions.
318 2008-01-24 Marek Safar <marek.safar@gmail.com>
320 * generic.cs: Do nullable type to null comparison optimization during
323 2008-01-24 Marek Safar <marek.safar@gmail.com>
325 A fix for bug #355163
326 * generic.cs: Enabled l-value resolve on nullable expressions.
328 2008-01-24 Marek Safar <marek.safar@gmail.com>
330 A fix for bug #353986
331 * class.cs: Ingore static ctors with parameters for any further checks.
333 2008-01-24 Marek Safar <marek.safar@gmail.com>
335 A fix for bug #354310
336 * namespace.cs: Removed redundant check.
338 2008-01-24 Marek Safar <marek.safar@gmail.com>
340 A fix for bug #354928
341 * expression.cs: ElementInitializers can be resolved only once.
343 2008-01-24 Marek Safar <marek.safar@gmail.com>
345 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
346 Condition expressions.
348 2008-01-23 Marek Safar <marek.safar@gmail.com>
350 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
352 2008-01-22 Marek Safar <marek.safar@gmail.com>
354 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
357 * generic.cs: Implemented coalesce expression.
359 2008-01-22 Marek Safar <marek.safar@gmail.com>
361 A fix for bug #355145
362 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
363 expression tree type inference.
365 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
368 * expression.cs (Binary.IsUnsignedType): Fix typo.
370 2008-01-22 Marek Safar <marek.safar@gmail.com>
372 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
374 2008-01-22 Marek Safar <marek.safar@gmail.com>
376 A fix for bug #355161
377 * ecore.cs, expression.cs: Wider range of extension method supported
380 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
382 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
383 AssemblyBuilder to operate in compiler context. Fixes mcs part of
386 2008-01-22 Marek Safar <marek.safar@gmail.com>
388 A fix for bug #355148
389 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
391 2008-01-22 Miguel de Icaza <miguel@novell.com>
393 * expression.cs (CreateExpressionTree): Add support for or and
394 logical or, and indent following the coding conventions.
396 * typemanager.cs (LinqExpression): renamed from
397 ExpressionTreeManager, for a shorter name.
399 Use TypeManager.CoreLookupType to lookup types from our core
400 assemblies and turn those into "Type" variables.
402 Consumers that previously used "Namespace" and "Type" from this
403 class should instead use the TypeExpression which is a type that
404 is fully resolved (without involving the regular C# resolution
407 This typically looks like this:
409 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
410 new MemberAccess (texpr, name, type_arguments, loc)
412 This avoids the problem in: #355178
414 2008-01-21 Marek Safar <marek.safar@gmail.com>
416 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
417 feature in parser only as we do in other cases.
419 2008-01-21 Marek Safar <marek.safar@gmail.com>
421 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
422 typemanager.cs: A refactoring of params arguments to reuse existing
423 expressions (params -> array initializer) to emit params argument instead
424 of specialized handling.
425 It was required by expression tree implementation and it has other benefits
426 as well, we now apply same optimization for params arguments as we do for
429 2008-01-18 Marek Safar <marek.safar@gmail.com>
431 A fix for bug #353526
432 * generic.cs: A type inference of params arguments may not required any
433 temporary array creation.
435 2008-01-18 Marek Safar <marek.safar@gmail.com>
437 A fix for bug #353534
438 * generic.cs, ecore.cs, expression.cs: A method group type inference is
439 supported for delegates only.
441 2008-01-18 Marek Safar <marek.safar@gmail.com>
443 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
444 type for more than 1 candidates.
446 2008-01-18 Marek Safar <marek.safar@gmail.com>
448 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
451 2008-01-16 Marek Safar <marek.safar@gmail.com>
453 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
454 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
455 operator) expressions.
457 2008-01-16 Zoltan Varga <vargaz@gmail.com>
459 * statement.cs: Avoid declaring an IL variable for this_variable since it is
460 not accessed from the generated IL.
462 2008-01-14 Marek Safar <marek.safar@gmail.com>
464 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
465 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
466 statement.cs: The first expression tree implementation drop, mostly
469 2008-01-14 Marek Safar <marek.safar@gmail.com>
471 * ecore.cs (IsNestedChild): Refactored.
473 2008-01-11 Marek Safar <marek.safar@gmail.com>
475 * lambda.cs: Don't use a cast on unknown expression statement.
477 2008-01-10 Geoff Norton <gnorton@novell.com>
479 * cs-tokenizer.cs: One more token to distinguish between method and lambda
482 2008-01-09 Marek Safar <marek.safar@gmail.com>
484 * doc.cs: Report better /doc crash details.
486 2008-01-09 Marek Safar <marek.safar@gmail.com>
488 A fix for bug #352536
489 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
491 2008-01-08 Marek Safar <marek.safar@gmail.com>
493 A fix for bug #352287
494 * ecore.cs, expression.cs: Do `this' access checking in all member access
497 2008-01-08 Marek Safar <marek.safar@gmail.com>
499 * rootcontext.cs, driver.cs: Switch to linq mode by default.
501 * report.cs: Reset message stacks.
503 2008-01-08 Marek Safar <marek.safar@gmail.com>
505 * generic.cs (InferInPhases): Correctly calculate params position.
507 2008-01-08 Marek Safar <marek.safar@gmail.com>
509 * cs-tokenizer.cs: No need to parse full string when parsing lambda
512 2008-01-07 Marek Safar <marek.safar@gmail.com>
514 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
516 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
518 * driver.cs: Updated --help option.
520 2008-01-07 Marek Safar <marek.safar@gmail.com>
522 * generic.cs (InferParamsTypeArguments): Removed.
523 (InferInPhases): Add params type inference.
524 (LowerBoundInference): Fixed scoring mechanism.
526 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
528 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
530 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
531 byte array for unsigned "baked" assemblies.
533 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
535 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
536 array for assemblies that are not strongnamed.
538 2008-01-04 Marek Safar <marek.safar@gmail.com>
540 A fix for bug #351481
541 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
542 declaring type for nested generic types.
544 2008-01-04 Marek Safar <marek.safar@gmail.com>
546 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
549 2008-01-03 Marek Safar <marek.safar@gmail.com>
551 A fix for bug #351047
552 * expression.cs (Binary.ResolveOperator): Allow equality operators between
553 null and structs only when equality and inequality operators are defined
554 either as an user-operators or predefined operators.
556 2008-01-03 Marek Safar <marek.safar@gmail.com>
558 A fix for bug #351047
559 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
561 2008-01-03 Marek Safar <marek.safar@gmail.com>
563 A fix for bug #351257
564 * cs-tokenizer.cs: Advance line number for '\r' correctly.
566 2008-01-03 Marek Safar <marek.safar@gmail.com>
568 A fix for bug #351157
569 * class.cs (Using): Fixed yet another broken cloning.
571 (Block): Put back more sensible default value for statements.
573 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
575 * codegen.cs: Allow AssemblyVersion with only major version component.
578 2007-12-29 Marek Safar <marek.safar@gmail.com>
580 A fix for bug #324654
581 * class.cs: Use FullName property as member name.
583 2007-12-28 Marek Safar <marek.safar@gmail.com>
585 A fix for bug #342117
586 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
587 constructor constraint.
589 2007-12-28 Marek Safar <marek.safar@gmail.com>
591 A fix for bug #338273
592 * class.cs (ProbertyBase): Access modifier checks are required for overrides
595 2007-12-28 Marek Safar <marek.safar@gmail.com>
597 A fix for bug #350839
598 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
600 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
602 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
605 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
607 * statement.cs: Changed some Hashtables to use HybridDictionaries
608 instead. It was observed that some HashTables only contained a few
609 items in the vast majority of cases. Since HybridDictionary is
610 more efficient on small sets (<10 elements), "known_variables"
611 from class ExplicitBlock as well as "labels" and "constants " from
612 class Block were changed to HybridDictionaries.
614 Atsai results: (56216kb->54987kb)
616 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
619 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
621 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
624 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
626 * expression.cs: foreach loop to for loop, saved on allocation of
627 enumerator (59333kb->59141kb)
629 * statement.cs. Changed foreach loops to for loops, saved on
630 allocation of enumerator (59141kb->59006kb)
632 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
633 when constructed with no specified capacity. This was causing a
634 few ArrayLists to allocate more memory than they would potentially
635 need in the Block class and MemberCache class. Setting the
636 ArrayLists to construct with a capacity of 1 saves some
637 memory. (56216kb->55585kb)
639 2007-12-27 Marek Safar <marek.safar@gmail.com>
641 A fix for bug #347189 (2nd issue)
642 * expression.cs (MemberAccess): Nested type can be found in base non-generic
645 2007-12-27 Miguel de Icaza <miguel@novell.com>
647 * report.cs: Do not use colors if stdout and stderr are not a
650 2007-12-27 Marek Safar <marek.safar@gmail.com>
652 A fix for bug #346998
653 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
656 2007-12-27 Marek Safar <marek.safar@gmail.com>
658 A fix for bug #343465
659 * class.cs: Explicit method name for nested types uses dots only.
661 2007-12-27 Marek Safar <marek.safar@gmail.com>
663 A fix for bug #343707
664 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
666 2007-12-27 Marek Safar <marek.safar@gmail.com>
668 * ecore.cs: Report type inference errors only when arguments count matches
671 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
673 * expression.cs, report.cs: New warning.
675 * typemanager.cs: Catch anonymous method type too.
677 2007-12-23 Marek Safar <marek.safar@gmail.com>
679 A fix for bug #346379
680 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
682 2007-12-23 Marek Safar <marek.safar@gmail.com>
684 A fix for bug #347359
685 * expression.cs (Invocation): Don't resolve already resolved expression.
687 2007-12-23 Marek Safar <marek.safar@gmail.com>
689 A fix for bug #347189
690 * class.cs (FixedField): Use non-dependent code only in the define phase.
692 2007-12-23 Marek Safar <marek.safar@gmail.com>
694 A fix for bug #348076
695 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
697 2007-12-22 Marek Safar <marek.safar@gmail.com>
699 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
700 discovered extension methods.
702 2007-12-22 Marek Safar <marek.safar@gmail.com>
704 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
707 2007-12-21 Miguel de Icaza <miguel@novell.com>
709 * report.cs (ErrorMessage): Add support for using colors on
710 terminals that support it.
712 2007-12-21 Marek Safar <marek.safar@gmail.com>
714 * ecore.cs: Use information about expanded params for error reporting.
716 2007-12-21 Marek Safar <marek.safar@gmail.com>
718 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
719 and logic for params overloads.
721 2007-12-15 Miguel de Icaza <miguel@novell.com>
723 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
724 as this is also created from the parser. Fixes #349034
726 2007-12-12 Miguel de Icaza <miguel@novell.com>
728 * statement.cs (Throw.CloneTo): it is valid to have empty
729 expressions for throw.
731 2007-12-03 Marek Safar <marek.safar@gmail.com>
733 * cs-parser.jay: Set delegate constraint parsing region correctly.
735 2007-12-03 Marek Safar <marek.safar@gmail.com>
737 A fix for bug #345467
738 * typemanager.cs (IsEqual): Compare generic parameters position only.
740 2007-11-28 Marek Safar <marek.safar@gmail.com>
742 * expression.cs (BaseAccess): Type arguments can be null.
744 2007-11-27 Raja R Harinath <harinath@gmail.com>
746 * statement.cs (Block.Resolve): Ensure flow-branching tree is
747 consistent even when an error has occured.
748 (Switch.Resolve): Likewise.
750 2007-11-22 Marek Safar <marek.safar@gmail.com>
752 A fix for bug #334505
753 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
756 2007-11-22 Marek Safar <marek.safar@gmail.com>
758 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
759 refactorings required to resolve extension methods correctly when mixing
760 generics and non-generics members.
762 2007-11-20 Marek Safar <marek.safar@gmail.com>
764 A fix for bug #342584
765 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
768 2007-11-19 Marek Safar <marek.safar@gmail.com>
770 A fix for bug #342512
771 * delegate.cs: Use delegate argument expression when is available. Don't
772 emit virtual call when class is sealed.
774 2007-11-16 Marek Safar <marek.safar@gmail.com>
776 A fix for bug #325423
777 * assign.cs (FieldInitializer): Use resolved expression for emit.
779 * class.cs: Print less confusing error message.
781 2007-11-16 Marek Safar <marek.safar@gmail.com>
783 * cs-tokenizer.cs: Removed GMCS ifdefs.
785 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
788 * cs-parser.jay: Disabled nullable check.
790 * generic-mcs: Copied more generic stuff.
792 2007-11-16 Marek Safar <marek.safar@gmail.com>
794 * gcs-parser.jay: Merged to cs-parser.jay.
796 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
797 * *.csproj, *.sources: Updated to use only jay parser file.
799 2007-11-16 Marek Safar <marek.safar@gmail.com>
801 * gcs-parser.jay: Added nullable and default expression feature checks.
803 2007-11-16 Marek Safar <marek.safar@gmail.com>
805 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
806 it fixes many TODOs and hidden bugs.
808 * expression: Removed duplicate error check.
810 2007-11-15 Marek Safar <marek.safar@gmail.com>
812 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
813 implicitly type local variable only when it is used in a declaration.
815 2007-11-15 Marek Safar <marek.safar@gmail.com>
817 * attribute.cs: Use CS0612 for empty strings.
819 2007-11-14 Marek Safar <marek.safar@gmail.com>
821 * lambda.cs, statement.cs: Contextual return may act as a statement.
823 2007-11-14 Marek Safar <marek.safar@gmail.com>
825 A fix for a regression cause by #324222
826 * class.cs: Don't report unused even when it implements an interface.
828 2007-11-13 Marek Safar <marek.safar@gmail.com>
830 A fix for bug #341205
831 * ecore.cs, expression.cs: Method group expression cannot do static
832 method access with an instance reference check before overloading takes
835 2007-11-13 Marek Safar <marek.safar@gmail.com>
837 A fix for bug #325359
838 * class.cs: Use predictable name for automatically generated property.
840 2007-11-12 Marek Safar <marek.safar@gmail.com>
842 A fix for bug #324996
843 * expression.cs (Is): Handle case where D is nullable and T is not
846 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
848 2007-11-12 Marek Safar <marek.safar@gmail.com>
850 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
851 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
852 Flush small error reporting changes.
854 2007-11-09 Marek Safar <marek.safar@gmail.com>
856 A fix for bug #324996
857 * expression.cs: Rewrote Is expression implementation to work with
858 generics, nullable types, anonymous method. A const result expression
859 uses existing infrastructure instead of custom not fully-featured one.
861 2007-11-08 Marek Safar <marek.safar@gmail.com>
863 A fix for bug #340202
864 * class.cs: Consider generics for volatile field.
866 2007-11-08 Marek Safar <marek.safar@gmail.com>
868 A fix for bug #335594
869 * expression.cs: Use conversion rules when handling string addition.
871 2007-11-07 Marek Safar <marek.safar@gmail.com>
873 A fix for bug #336651
874 * expression.cs: Fixed a crash when probing is on.
876 2007-11-07 Marek Safar <marek.safar@gmail.com>
878 A fix for bug #324242
879 * covert.cs: Added a conversion from any nullable-type with an
880 underlying enum-type to the type System.Enum.
882 2007-11-07 Marek Safar <marek.safar@gmail.com>
884 A fix for bug #324222
885 * class.cs: Report all non-used event fields.
887 2007-11-07 Marek Safar <marek.safar@gmail.com>
889 A fix for bug #325161
890 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
891 qualifier for generic types.
893 2007-11-07 Marek Safar <marek.safar@gmail.com>
895 A fix for bug #322971
896 * expression.cs, ecore.cs: Added intermediate result value check for
899 2007-11-07 Marek Safar <marek.safar@gmail.com>
901 A fix for bug #324754
902 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
903 when it was requested.
905 2007-11-07 Marek Safar <marek.safar@gmail.com>
907 A fix for bug #325101
908 * expression.cs: Do type not value comparison for `is' expression.
910 2007-11-07 Marek Safar <marek.safar@gmail.com>
912 A fix for bug #320236
913 * convert.cs: Don't apply user conversion on underlying target type.
915 2007-11-06 Marek Safar <marek.safar@gmail.com>
917 * expression.cs: Don't use unresolved expression for error reporting.
919 2007-11-06 Marek Safar <marek.safar@gmail.com>
921 A fix for bugs #337712, #324490
922 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
923 overloading resolution too.
925 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
926 the process consistent and more robust.
928 * expression.cs, linq.cs, report.cs: Update.
930 2007-11-02 Marek Safar <marek.safar@gmail.com>
932 A fix for bug #332909
933 * attribute.cs: Resolve attributes in correct context using error
936 * rootcontext.cs: Define Obsolete attribute members as core members.
938 2007-11-02 Marek Safar <marek.safar@gmail.com>
940 * statement.cs: Removed unused methods.
942 2007-10-31 Wade Berrier <wberrier@novell.com>
944 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
945 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
948 2007-10-31 Marek Safar <marek.safar@gmail.com>
950 A fix for bug #338102
951 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
952 methods registered as non-generics.
954 2007-10-31 Marek Safar <marek.safar@gmail.com>
956 A fix for bugs #337712, #324490
957 * delegate.cs: Delegate covariance and contravariance is not allowed for
960 2007-10-31 Marek Safar <marek.safar@gmail.com>
962 A fix for bug #337719
963 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
966 2007-10-30 Marek Safar <marek.safar@gmail.com>
968 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
970 2007-10-29 Marek Safar <marek.safar@gmail.com>
972 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
975 2007-10-29 Raja R Harinath <rharinath@novell.com>
977 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
979 2007-10-29 Marek Safar <marek.safar@gmail.com>
981 A fix for bug #334652
982 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
983 extension methods when we have not found the best candidate in normal
986 2007-10-27 Marek Safar <marek.safar@gmail.com>
988 * AssemblyInfo.cs: Keep up-to-date.
990 2007-10-27 Marek Safar <marek.safar@gmail.com>
992 * Makefile: Fixed generics compiler name.
994 2007-10-27 Marek Safar <marek.safar@gmail.com>
996 * lambda.test: removed, lambda parsing is done differently.
998 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
1000 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
1002 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
1004 2007-10-27 Marek Safar <marek.safar@gmail.com>
1006 * Makefile, *.sources : All C# compilers are in mcs folder.
1008 * *.cs: Use existing 2_1 define for smcs.
1010 2007-10-26 Marek Safar <marek.safar@gmail.com>
1012 A fix for bug #335847
1013 * assign.cs, expression.cs: Couple of changes to avoid creating a
1014 temporary variable for each object initializer assignment statement. It
1015 simplifies struct initialization too, otherwise two temporary variables
1017 Implemented optimization of redundant default element initializers.
1019 2007-10-25 Marek Safar <marek.safar@gmail.com>
1021 A fix for bug #336766
1022 * expression.cs (Class.CheckBase): Use generic name when method is
1025 2007-10-25 Marek Safar <marek.safar@gmail.com>
1027 A fix for bug #334737
1028 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
1029 variable and not variable argument for prepared copies.
1031 2007-10-24 Marek Safar <marek.safar@gmail.com>
1033 A fix for bug #325110
1034 * class.cs, expression.cs, attribute.cs: Use open generic method when
1035 checking conditional attribute.
1037 2007-10-24 Marek Safar <marek.safar@gmail.com>
1039 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
1040 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
1041 FeatureIsNotAvailable.
1043 2007-10-24 Marek Safar <marek.safar@gmail.com>
1045 ** C# 3.0 Partial methods
1047 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
1048 methods support. Because of member cache issue with generics only
1049 non-generics partial methods are fully supported.
1051 2007-10-23 Marek Safar <marek.safar@gmail.com>
1053 * class.cs, decl.cs: Rewrote member overloads check to cope with
1054 generics and to use member cache for member checking. It also improves
1055 performance and fixes remaining overloads issues.
1057 2007-10-20 Marek Safar <marek.safar@gmail.com>
1059 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
1060 roottypes.cs, typemanager.cs:
1062 A member cache creation logic changed to add members immediately and
1063 not rely on fallback. The member cache is now only prefered way
1064 how to access and find type declaration members. It saves 5 MB of memory
1065 during MWF compilation and makes code ready for more optimizations and
1066 clean-ups, it's also a pre-requirement for partial methods.
1068 2007-10-18 Raja R Harinath <harinath@gmail.com>
1070 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
1071 handling for generic parameters.
1073 2007-10-15 Marek Safar <marek.safar@gmail.com>
1075 * class.cs (FixedField): Removed redundant volatile check.
1077 2007-10-15 Marek Safar <marek.safar@gmail.com>
1079 * class.cs, decl.cs: Fixed overload members verification to do only one
1080 check per possible collision.
1082 2007-10-13 Marek Safar <marek.safar@gmail.com>
1084 A fix for bug #325478
1085 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
1086 and create only one disposable flags container.
1088 2007-10-12 Marek Safar <marek.safar@gmail.com>
1090 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
1091 * statement.cs (Fixed): Fixed variables cloning.
1093 2007-10-12 Marek Safar <marek.safar@gmail.com>
1095 A fix for bug #333342
1096 * class.cs (EventField): Don't mark value type event as synchronized.
1098 2007-10-12 Marek Safar <marek.safar@gmail.com>
1100 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
1101 inference to identify best candidate method correctly.
1102 (ProperyExpr): A range variable is read only and cannot be modified.
1104 2007-10-11 Marek Safar <marek.safar@gmail.com>
1106 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
1107 logic to identify best candidate method correctly.
1109 2007-10-11 Marek Safar <marek.safar@gmail.com>
1111 * location.cs (Equals, GetHashCode): Removed.
1113 2007-10-11 Marek Safar <marek.safar@gmail.com>
1115 * report.cs: Implemented message recorder. It is used mainly for lambda
1116 expressions to capture otherwise swallowed error messages.
1118 * anonymous.cs, lambda.cs.cs: Do full parameters check.
1120 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
1122 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
1124 * expression.cs (MemberAccess): Always report lookup failure.
1126 * location.cs: Implemented Equals, GetHashCode.
1128 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
1130 2007-10-10 Jb Evain <jbevain@novell.com>
1132 * codegen.cs: re-enable assembly version check.
1134 2007-10-09 Marek Safar <marek.safar@gmail.com>
1136 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
1139 * namespace.cs (UsingAlias): Do correct version check.
1141 2007-10-08 Marek Safar <marek.safar@gmail.com>
1143 * expresison.cs, ecore.cs: Issue extension method error message when
1146 * rootcontext.cs: Added ISO_2 compiler mode option.
1148 2007-10-08 Marek Safar <marek.safar@gmail.com>
1150 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
1153 2007-10-08 Marek Safar <marek.safar@gmail.com>
1155 * attribute.cs (GetString, GetBoolean): Work with both literal and
1158 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
1159 Moved method overload specific methods to MethodGroupExpr.
1161 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
1162 it should be less memory consuming.
1164 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
1166 * codegen.cs: remove the assembly version check until the buildbot is
1169 2007-10-07 Jb Evain <jbevain@novell.com>
1171 * attribute.cs (Attribute.GetString): if the value
1172 expression is a StringConstant, return its string value.
1174 2007-10-07 Jb Evain <jbevain@novell.com>
1176 * typemanager.cs: add `assembly_version_attribute_type`.
1177 * codegen.cs: on attribute emission, check that the
1178 AssemblyVersionAttribute doesn't overflow.
1180 2007-10-05 Marek Safar <marek.safar@gmail.com>
1182 A fix for bug #324677
1183 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
1184 parent container of a scope container with currently resolved one.
1186 2007-10-05 Marek Safar <marek.safar@gmail.com>
1188 A fix for bug #325534
1189 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
1192 2007-10-05 Marek Safar <marek.safar@gmail.com>
1194 A fix for bug #327504
1195 * class.cs (Operator.Define): Refactored implicit and explicit user
1196 operator conversion rules.
1198 2007-10-05 Marek Safar <marek.safar@gmail.com>
1200 A fix for bug #327520
1201 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
1203 2007-10-04 Marek Safar <marek.safar@gmail.com>
1205 A fix for bug #328022
1206 * class.cs (MethodData.Define): Use correct method to check whether
1207 a method implementents an accessor.
1209 2007-10-04 Marek Safar <marek.safar@gmail.com>
1211 A fix for bug #330069
1212 * statement.cs (Fixed.Resolve): Read the first array element only when
1213 an array is instantiated.
1215 2007-10-04 Marek Safar <marek.safar@gmail.com>
1217 * expression.cs, assign.cs, generics.cs: Print correct operator when
1218 compound assignment is used.
1220 2007-10-04 Marek Safar <marek.safar@gmail.com>
1222 A fix for bug #325841
1223 * expression.cs (ArrayAccess): Use full argument cloning only for
1224 string compound concatenation.
1226 2007-10-03 Marek Safar <marek.safar@gmail.com>
1228 A fix for bug #328774
1229 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
1231 (PropertyExpr.EmitAssign): Fixed string concatenation compound
1234 2007-10-03 Raja R Harinath <rharinath@novell.com>
1237 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
1238 Event accessibility checks here. Remove some bogus code that
1239 accidently made GenericMethods work.
1240 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
1242 2007-09-25 Marek Safar <marek.safar@gmail.com>
1244 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
1246 * statement.cs (Block): Refactored AddVariable to allow error handling
1249 * generic.cs: New stub.
1251 2007-09-23 Marek Safar <marek.safar@gmail.com>
1253 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
1256 2007-09-17 Marek Safar <marek.safar@gmail.com>
1258 * class.cs: Use partial container to record whether any partial part
1259 contains static field initializer and therefore default contructor has
1262 2007-09-14 Marek Safar <marek.safar@gmail.com>
1264 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
1265 mono-list when only one of two partial parts has defined accessibility
1268 2007-09-14 Marek Safar <marek.safar@gmail.com>
1270 A fix for bug #82845
1272 * class.cs (TypeContainer): Set correct resolve context for all field
1275 2007-09-13 Marek Safar <marek.safar@gmail.com>
1277 * assign.cs: Fixed a crash when field is resolved twice with an error.
1279 * codegen.cs: Changed InFieldInitializer to be flag.
1281 * anonymous.cs, ecore.cs, expression.cs: Update after
1282 IsInFieldInitializer rename.
1284 * const.cs: Removed unused parameter.
1286 * class.cs: Changed the way how we resolve and emit field initializers.
1287 The field initilizers have to have access to contructor block to emit
1288 compiler generated code.
1290 2007-09-13 Marek Safar <marek.safar@gmail.com>
1292 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
1293 generics use TypeContainer instead.
1295 2007-09-12 Marek Safar <marek.safar@gmail.com>
1297 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
1299 * lambda.cs (ResolveParameters): Use more powerful
1300 InflateGenericArgument.
1302 * parameters.cs: Better exception message.
1304 2007-09-10 Marek Safar <marek.safar@gmail.com>
1306 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
1307 correct expression block type.
1309 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
1311 * expression.cs (Invocation): Extracted method group resolve to
1314 2007-09-07 Marek Safar <marek.safar@gmail.com>
1316 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
1317 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
1319 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
1320 generic extension methods.
1322 2007-09-06 Marek Safar <marek.safar@gmail.com>
1324 A fix for bug #82676 (Do I get it right now?)
1325 * convert.cs (Binary.ResolveOperator): An interface is converted to the
1326 object before a standard conversion is applied.
1328 2007-09-06 Marek Safar <marek.safar@gmail.com>
1330 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
1333 2007-09-05 Marek Safar <marek.safar@gmail.com>
1335 A fix for bug #82676
1336 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
1337 non-generic interface types.
1339 2007-09-05 Marek Safar <marek.safar@gmail.com>
1341 A fix for bug #82690
1342 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
1344 2007-09-05 Marek Safar <marek.safar@gmail.com>
1346 A fix for bug #82571
1347 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
1348 modifier for container based methods.
1350 2007-09-05 Marek Safar <marek.safar@gmail.com>
1352 A fix for bug #82676
1353 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
1354 any interface-type T means to any of interface type T.
1356 2007-09-04 Marek Safar <marek.safar@gmail.com>
1358 * namespace.cs: We have 2 versions of System.Core assembly.
1360 2007-09-04 Marek Safar <marek.safar@gmail.com>
1362 A fix for bug #82652
1363 * class.cs (Class.GetClassBases): Compare types and not expressions.
1365 2007-09-04 Marek Safar <marek.safar@gmail.com>
1367 A fix for bug #82620
1368 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
1369 actually never worked before.
1370 (IndexerAccess): Emit prepared arguments before they are modified.
1372 2007-09-04 Marek Safar <marek.safar@gmail.com>
1374 A fix for bug #82563
1375 * assign.cs: Revert wrong fix.
1377 * expression.cs (VariableReference.EmitAssign): Handle ref reference
1379 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
1380 Instead of ldelema/stdind we have to use temporary variables to handle
1381 cases like String.Concat (params string[]).
1383 2007-08-31 Marek Safar <marek.safar@gmail.com>
1385 * class.cs: EmitAttributes to Emit rename.
1387 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
1389 (MemberCore.HasClsCompliantAttribute): Don't depend on
1390 GetClsCompliantAttributeValue execution.
1392 2007-08-31 Marek Safar <marek.safar@gmail.com>
1394 * anonymous.cs: Use shorter type prefix.
1396 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
1399 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
1400 variables when probing is on.
1402 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
1403 unresolved variables.
1404 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
1405 handle transparent identifiers.
1407 2007-08-26 Marek Safar <marek.safar@gmail.com>
1409 * attribute.cs (IsClsCompliant): Add nullable types test.
1411 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
1413 * doc.cs : catch other types of exception than XmlException to
1414 report CS1570. Fixed bug #82565.
1416 2007-08-23 Marek Safar <marek.safar@gmail.com>
1418 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
1419 The number of delegate parameters has to match.
1420 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
1423 2007-08-21 Marek Safar <marek.safar@gmail.com>
1425 * anonymous.cs (AnonymousMethod): Generate private anonymous method
1426 to fix problem with private arguments.
1428 2007-08-20 Marek Safar <marek.safar@gmail.com>
1430 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
1432 * decl.cs (MemberName): Ignore generic type with no generic arguments.
1434 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
1435 empty. Add cloning suport.
1437 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
1439 2007-08-20 Marek Safar <marek.safar@gmail.com>
1441 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
1442 to create EmptyCast. It handles EmptyConstantCast specialization for
1445 2007-08-18 Marek Safar <marek.safar@gmail.com>
1447 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
1448 (EmitArrayArgument): One routine for array arguments.
1449 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
1451 2007-08-17 Marek Safar <marek.safar@gmail.com>
1453 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
1455 2007-08-17 Marek Safar <marek.safar@gmail.com>
1457 * anonymous.cs: MemberLookupFinal update.
1459 * class.cs (ConstructorInitializer): Is expression based.
1461 * delegate.cs: MethodGroupExpr update.
1463 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
1465 (Error_MemberLookupFailed): Customizable error override.
1466 (MethodGroupExpr): Keep queried type for later usage.
1467 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
1470 * expression.cs: Error_MemberLookupFailed refactoring.
1471 (New.DoResolve): Resolve as much as possible.
1472 (ElementInitializer.Error_MemberLookupFailed): Object initializer
1473 customization for invalid member types.
1475 * statement.cs: MethodGroupExpr update.
1477 2007-08-16 Marek Safar <marek.safar@gmail.com>
1479 * modifier.cs (Check): Check all modifiers and not only accessibility
1482 2007-08-16 Marek Safar <marek.safar@gmail.com>
1484 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
1485 type and not an expression.
1487 2007-08-16 Marek Safar <marek.safar@gmail.com>
1489 * statement.cs (Catch.Clone): Type and variable can be null.
1491 2007-08-16 Marek Safar <marek.safar@gmail.com>
1493 A fix for bug #81979
1494 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
1495 I am really not sure whether this is the best fix.
1497 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
1500 2007-08-14 Marek Safar <marek.safar@gmail.com>
1502 ** C# 3.0 Object and collection initializers (major re-write)
1504 * assign.cs (DoResolve): Initializers are not assign related.
1506 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
1507 used during collection or object initialization.
1509 * expression.cs (Error_InvalidArguments): Add initializers specific
1510 messages. More will come later because it requires some general
1512 (New.DoResolve): Better error handling for unsafe types.
1513 (EmptyExpressionStatement): New class.
1514 (ElementInitializer): An object initializer expression.
1515 (CollectionElementInitializer): A collection initializer expression.
1516 (CollectionOrObjectInitializers): A block of object or collection
1518 (NewInitialize): New expression with element/object initializers.
1520 * statement.cs: Reverted object/collection initializer hacks.
1522 * typemanager.cs (CSharpName): Filter __arglist type.
1524 2007-08-09 Marek Safar <marek.safar@gmail.com>
1526 ** C# 3.0 Anonymous Types (update to the latest standard)
1528 * expression.cs (Binary.ResolveOperator): Threat all null based types
1530 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
1531 (AnonymousTypeParameter): Updated.
1533 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
1534 (AnonymousTypeClass): New anonymous type container.
1536 * class.cs (AddField): Return operation result.
1538 * generic.cs: Another empty TypeArguments overload.
1540 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
1541 are stored at top of normal hierarchy.
1543 * typemanager.cs (CSharpName): Filter anonymous types.
1545 2007-08-09 Marek Safar <marek.safar@gmail.com>
1547 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
1548 as single Concat call. How could we miss that :-(
1550 2007-08-08 Marek Safar <marek.safar@gmail.com>
1552 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
1554 2007-08-07 Miguel de Icaza <miguel@novell.com>
1556 * expression.cs: Fix the previous commit, the creation of the
1557 arguments array list needs also to be conditional on the arguments
1560 * class.cs: Add a little bit of help to help narrow down problems.
1562 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
1563 not try to copy in that case.
1565 * driver.cs: When building SMCS, include a new different set of
1566 default assemblies here. Do this here so we can control whether
1567 to include the default assemblies with /noconfig.
1569 2007-08-03 Marek Safar <marek.safar@gmail.com>
1571 A fix for bug #81979
1572 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
1575 2007-08-03 Marek Safar <marek.safar@gmail.com>
1577 A fix for bug #82300
1579 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
1580 we are in probing scope.
1582 2007-08-03 Marek Safar <marek.safar@gmail.com>
1584 A fix for bug #82301
1586 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
1587 (Statement.CloneTo): Clone and not map children blocks.
1589 2007-08-03 Marek Safar <marek.safar@gmail.com>
1591 A fix for bug #82299
1593 * expression.cs (LocalVariableReference.CloneTo): Remap local info
1596 * statement.cs (Statement.CloneTo): Clone variables before statements
1597 to allow remaping of local variables.
1599 2007-08-03 Marek Safar <marek.safar@gmail.com>
1601 A fix for bug #82296
1604 * report.cs: Log crash details for future clone problems.
1606 * statement.cs (Return.Clone): Don't clone non-existent expression.
1608 2007-08-03 Raja R Harinath <harinath@gmail.com>
1610 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
1611 (Class.AddBasesForPart): Move CS0537 check here from ...
1612 * cs-parser.jay (class_declaration): ... here. Move calling of
1613 'AddBasesForPart' to ...
1614 (class_bases): ... here.
1615 (struct_declaration, interface_declaration): Update to changes.
1617 2007-08-02 Marek Safar <marek.safar@gmail.com>
1619 A fix for bug #81923
1621 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
1622 conversion is allowed.
1624 2007-08-02 Marek Safar <marek.safar@gmail.com>
1626 A fix for bug #81564
1628 * ecore.cs (EventExpr): Add IsBase handling.
1630 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
1633 2007-08-02 Raja R Harinath <harinath@gmail.com>
1635 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
1636 * cs-parser.jay: Some whitespace cleanups.
1637 (current_delegate): New.
1639 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
1640 a dummy code block, and use 'type_name' instead of 'member_name'.
1641 (interface_declaration, class_declaration): Likewise.
1642 (delegate_declaration): Likewise. Rearrange slightly and use
1644 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
1645 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
1647 2007-08-02 Marek Safar <marek.safar@gmail.com>
1649 A fix for bug #82039
1651 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
1654 * typemanager.cs (CSharpName): Split to string overload.
1656 2007-08-02 Marek Safar <marek.safar@gmail.com>
1659 * report.cs: Updated warning CS0472.
1661 2007-08-01 Marek Safar <marek.safar@gmail.com>
1663 A fix for bug #82181
1665 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
1667 2007-08-01 Marek Safar <marek.safar@gmail.com>
1669 A fix for bug #82277
1670 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
1672 2007-08-01 Marek Safar <marek.safar@gmail.com>
1674 ** C# 3.0 Type Inference (major bits are working)
1676 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
1677 (.ImplicitStandardConversionExists): Uses compatible.
1678 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
1679 (.InferReturnType): New method.
1680 (.Compatible): Refactored.
1681 (.ResolveParameters): Uses factory to create resolved parameters.
1682 (.CompatibleMethod): Add probing mode support.
1683 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
1684 clearly distinguish between 2 different operations.
1685 (LambdaMethod): Moved to lambda.cs.
1686 (AnonymousMethod): Removed unused fields and methods.
1687 (AnonymousDelegate): Simplified.
1689 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
1691 * convert. cs (ImplicitConversionStandard): Compatible works differently.
1693 * delegate.cs (Delegate): New mehods to reduce code duplication.
1694 (.GetConstructor): New method.
1695 (.GetInvokeMethod): New method.
1696 (DelegateCreation): Updated.
1698 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
1700 (OverloadResolve): Made probing little bit faster.
1702 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
1705 * generic.cs (TypeInferenceContext): Dummy implementation.
1707 * iterators.cs: Updated after Resolve/Define rename.
1709 * lambda.cs (LambdaExpression)
1710 (.ResolveParameters): Handles both type of arguments and type inference too.
1712 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
1713 (InflateTypes): Updated.
1715 * support.cs (InflateTypes): Changed signature and updated.
1717 * typemanager.cs (LookupMemberCache): Better dynamic type check.
1718 (MemberLookup_FindMembers): More MS tricks.
1719 (GetParameterData): Ditto.
1720 (GetDelegateParameters): Uses quick path for dynamic types.
1722 2007-08-01 Marek Safar <marek.safar@gmail.com>
1724 * class.cs (MethodData.Define): EmitContext is required for generic stuff
1727 2007-07-31 Marek Safar <marek.safar@gmail.com>
1729 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
1732 2007-07-26 Jb Evain <jbevain@novell.com>
1734 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
1735 which takes a boolean 'report_errors', similar to the GetMethod.
1736 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
1737 in .net 2.1, do not report errors here.
1739 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
1740 System.Runtime.CompilerServices.RequiredAttributeAttribute and
1741 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
1744 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
1745 of the type InternalsVisibleToAttribute before the first call
1746 to CoreLookupType which is allowed to fail (third boolean parameter
1747 to true). Because, during the resolution for a type that is not
1748 immediately found, we try to check if the type is not defined in
1749 a friend assembly, and to do so, we need the
1750 InternalVisibleToAttribute.
1752 2007-07-23 Miguel de Icaza <miguel@novell.com>
1754 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
1755 feature that allows structs to be compared against null and inline
1756 the result as true or false.
1758 Notice that the same code is not permitted inside a generic block
1759 of code that would do:
1761 class Foo<T> where T : struct {
1768 It is only allowed if the type of T is not bound (no where
1769 clause). In my opinion, this CSC 2 behavior is broken but people
1770 seem to be using it (IronRuby does, a few bug reports on bugzilla
1771 have it and some people have complained about it).
1773 All of the users that depend on this behavior have code that is
1776 * report.cs (Warning, Error): make these take object arguments,
1777 not strings, as that allows us to take advantage of Format.
1779 2007-07-20 William Holmes <billholmes54@gmail.com>
1781 * decl.cs: Changed MemberName.CountTypeArguments to also check the
1782 Left member variable for the Count.
1783 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
1784 MemberName.CountTypeArguments to avoid a NRE.
1786 This code is contributed under the MIT X11 license
1788 2007-07-18 Marek Safar <marek.safar@gmail.com>
1790 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
1792 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
1794 * doc.cs : generic method arguments are written as ``x while generic
1795 type arguments are `x. Combined with the previous change, fixed bug
1798 2007-07-18 Raja R Harinath <rharinath@novell.com>
1801 * expression.cs (Binary.ResolveOperator): When converting
1802 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
1804 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
1806 * doc.cs : when T: or whatever x: is specified, it does not really
1807 check the doc comment's syntax correctness. Fixed bug #82006.
1809 2007-07-18 Marek Safar <marek.safar@gmail.com>
1811 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
1812 LambdaExpression better.
1814 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
1816 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
1818 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
1819 as it can be generated.
1821 * expression.cs (Invocation.Error_InvalidArguments): Show correct
1824 * lambda.cs (LambdaExpression): Refactored to share same code with
1825 AnonymousMethodExpression.
1827 2007-07-17 Marek Safar <marek.safar@gmail.com>
1829 * anonymous.cs (MakeName): Include host name for easier debugging.
1830 (LambdaMethod): New class for lambda spcecific stuff.
1832 * attribute.cs: Set EmitContext return type.
1834 * class.cs: Set EmitContext return type.
1836 * codegen.cs (EmitContext): Return type cannot be null to stop messing
1837 with null/void meaning.
1839 * iterators.cs (ContainerType): Implemented.
1841 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
1843 * statement.cs (Return): Updated to lambda expressions.
1844 (Block.CloneTo): Parent can be null.
1846 2007-07-13 Marek Safar <marek.safar@gmail.com>
1848 A fix for bug #81917
1849 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
1851 * class.cs (FixedField): Check whether field is in unsafe scope.
1853 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
1854 (FieldExpr.Emit): Fixed buffers cannot be volatile.
1856 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
1859 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
1861 2007-07-13 Marek Safar <marek.safar@gmail.com>
1863 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
1864 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
1867 2007-07-13 Marek Safar <marek.safar@gmail.com>
1869 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
1871 2007-07-13 Marek Safar <marek.safar@gmail.com>
1873 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
1874 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
1876 * codegen.cs(EmitContext): Add ProbingMode flag.
1878 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
1880 * driver.cs: For now set both warning values.
1882 * ecore.cs (SimpleName): Name is readonly.
1883 (MethodGroup.OverloadResolve): One quick path for probing.
1885 * expression.cs (Unary): Set Oper r/o.
1886 (Binary): Set Oper r/o.
1887 (ParameterReference): Set few instance variables as r/o.
1888 (ParameterReference.DoResolveBase): Don't capture aruments when
1890 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
1891 (Arglist): arguments are private.
1892 (SizeOf): type is private and r/o.
1893 (MemberAccess): arguments are private.
1895 * report.cs: Enhanced reporting on/off capabilities.
1897 * lambda.cs: Uses ec.IsInProbingMode.
1898 (ContextualReturn): Derives from return.
1900 * rootcontext.cs: For now set both warning values.
1902 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
1904 (Return.Resolve): Don't die immediately.
1905 (Block.Resolve): Speed-up probing.
1906 (Block.CloneTo): Clone only child blocks.
1908 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
1910 * iterators.cs: reverted Miguel's latest change (r81925) as it
1911 breaks the build in System.
1913 2007-07-13 Miguel de Icaza <miguel@novell.com>
1915 * iterators.cs (Yield.CheckContext): Check for the iterator type
1916 also here as we can call into Yield even in codepaths that are not
1918 (MethodOrOperator is the only path that was checked).
1920 In addition to the standard check, use a more specific check for
1921 constructors to report a more verbose error.
1923 2007-07-12 Miguel de Icaza <miguel@novell.com>
1925 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
1926 report the warning and continue
1928 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
1929 values on the stack on the call to Emit. Use EmitStatement if
1930 possible, or using Emit + Pop if not possible. Fixes #82064
1932 2007-07-12 Raja R Harinath <rharinath@novell.com>
1934 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
1935 avoid try...finally in some cases.
1937 2007-07-10 Marek Safar <marek.safar@gmail.com>
1939 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
1941 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
1942 instead of method. Re-use standard error handling.
1943 (ConstructorInitializer.Emit): Simplified.
1945 * delegate.cs: Updated after Invocation.EmitCall change.
1947 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
1948 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
1949 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
1950 method and don't permanently changing input arguments.
1951 (MethodGroupExpr): Introduced resolved best_candidate, when method group
1952 is resolved it has one of the candidates is the best one which is later
1953 used to emit. Removed a few unused method.
1954 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
1956 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
1957 (Binary.ResolveOperator): Ditto.
1958 (ConditionalLogicalOperator.DoResolve): Ditto.
1959 (Invocation): Uses method group.
1960 (Invocation.DoResolve): Simplified.
1961 (Invocation.EmitCall): Removed useless is_static.
1962 (Invocation.Emit): Delegate to method group.
1963 (Invocation.EmitStatement): Simplified.
1964 (New): Uses method group.
1965 (MemberAccess.DoResolve): Don't destroy original expression.
1967 * statement.cs (ForEach.Resolve): Use null for no method arguments.
1969 2007-07-04 Marek Safar <marek.safar@gmail.com>
1971 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
1974 * lambda.cs: Add custom error message type.
1976 2007-07-03 Marek Safar <marek.safar@gmail.com>
1978 * lambda.cs: Simplified little bit.
1980 * parameter.cs: Introduced ImplicitLambdaParameter.
1981 (Parameters.CreateFullyResolved): New factory instead of ctor.
1985 * delegate.cs: Updated parameter creation.
1987 2007-07-03 Marek Safar <marek.safar@gmail.com>
1989 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
1992 * generic.cs: Synchronized with gmcs.
1994 2007-07-03 Marek Safar <marek.safar@gmail.com>
1996 * class.cs (Indexer): Check return type as soon as possible.
1998 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
2001 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
2003 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
2005 * parameter.cs (Parameter): Use expression type when it is available.
2007 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
2008 method modifier for the first parameter only.
2010 2007-06-24 Marek Safar <marek.safar@gmail.com>
2012 A fix for bug #81938
2013 * typemanager.cs (ChangeType): Fixed couple of char conversions.
2015 * constant.cs: Tide up an exception message.
2017 2007-06-22 Marek Safar <marek.safar@gmail.com>
2019 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
2020 an uninitialized variable is used.
2022 * expression.cs (LocalVariableReference.DoResolve): Ditto.
2024 2007-06-22 Marek Safar <marek.safar@gmail.com>
2026 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
2027 not found error handling.
2029 * expression.cs (ArrayCreation): Removed redundant fields and little bit
2031 (ArrayCreation.ResolveArrayElement): To be ready to customization.
2032 (ArrayCreation.DoResolve): Simplified.
2033 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
2034 its own resolve process.
2035 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
2037 2007-06-20 Marek Safar <marek.safar@gmail.com>
2039 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
2042 2007-06-20 Marek Safar <marek.safar@gmail.com>
2044 * cs-tokenizer.cs: Removed var related stuff.
2046 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
2047 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
2048 a type and a keyword at same time.
2050 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
2053 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
2054 implicitly typed arrays, more changes will follow.
2056 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
2058 2007-06-19 Marek Safar <marek.safar@gmail.com>
2060 * ecore.cs (VarExpr): Removed Handled field.
2062 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
2063 build-in assign functionality.
2064 (ForEach.Resolve): Removed all implicitly typed local variable code and
2066 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
2067 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
2069 2007-06-18 Marek Safar <marek.safar@gmail.com>
2071 * assign.cs: Removed implicitly typed local variable check.
2073 * expression.cs (LocalVariableReference.DoResolve): Add check for self
2074 referencing implicitly typed local variable.
2075 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
2078 * statement.cs (Fixed): Removed unsupported implicitly typed local
2081 2007-06-15 Marek Safar <marek.safar@gmail.com>
2083 * decl.cs (MemberName): Moved all Unbound stuff to parser.
2085 2007-06-14 Marek Safar <marek.safar@gmail.com>
2087 A fix for bugs #81855 and #76274
2088 * attribute.cs (AttachTo): Always set owner for global attributes to
2091 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
2094 * cs-parser.jay: Assembly and module attributes must precede all other
2095 elements except using clauses and extern alias declarations.
2097 2007-06-13 Marek Safar <marek.safar@gmail.com>
2099 A fix for bug #81748
2101 * expression.cs: More checks for non ISO-1 features.
2103 2007-06-12 Marek Safar <marek.safar@gmail.com>
2105 A fix for bug #81807
2106 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
2107 present inside switch statement and it is required by nullable check.
2109 2007-06-12 Marek Safar <marek.safar@gmail.com>
2111 A fix for bug #81840
2112 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
2113 when type matching fails.
2115 * namespace.cs: Tiny error message change.
2117 2007-06-12 Marek Safar <marek.safar@gmail.com>
2119 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
2120 reporting. Added automatic property check.
2122 * class.cs: Updated after CheckAbstractAndExtern relocation.
2123 (AEventPropertyAccessor.GetSignatureForError): Customized.
2125 2007-06-11 Marek Safar <marek.safar@gmail.com>
2127 * class.cs (DefineBaseTypes): Base type can be undefined.
2129 * ecore.cs (TypeLookup): Minor refactoring.
2130 (DoResolveAsTypeStep): Removed redundant check.
2132 * namespace.cs (Lookup): Removed redundant check.
2134 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
2135 ResolveAsTypeTerminal step.
2136 (BootstrapCorlib_*): Simplified.
2137 (PopulateCoreType): Core types can be now external.
2139 2007-06-07 Marek Safar <marek.safar@gmail.com>
2141 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
2143 (InferTypeArguments): Infers anonymous expression type arguments.
2144 (Compatible): Split to Compatible and InferTypeArguments.
2146 * lambda.cs: Updated.
2148 2007-06-08 Marek Safar <marek.safar@gmail.com>
2150 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
2152 2007-06-07 Raja R Harinath <harinath@gmail.com>
2154 Fix #80477, cs0135-2.cs, cs0135-3.cs
2155 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
2156 names to the "known" variables list.
2157 (Block.CheckInvariantMeaningInBlock): Handle the fact the
2158 parameter names are also "known".
2159 (Block.CheckError136): Remove.
2160 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
2163 2007-06-07 Marek Safar <marek.safar@gmail.com>
2165 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
2167 2007-06-06 Marek Safar <marek.safar@gmail.com>
2169 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
2170 internal error not an user error.
2172 * expression.cs (IsApplicable): Refactored to make debugging easier.
2174 * support.cs: More tricks for non-mono runtimes.
2176 * typemanager.cs (CoreLookupType): Made public.
2177 (InitSystemCore): All linq specific stuff moved to linq.cs
2179 2007-06-05 Marek Safar <marek.safar@gmail.com>
2181 * typemanager.cs (CSharpSignature): One more missing build-in types
2183 More tricks for non-mono runtime.
2185 2007-06-05 Raja R Harinath <harinath@gmail.com>
2187 * statement.cs (Block.CheckError136_InParents): Remove.
2188 (Block.AddVariable): Use GetParameterInfo instead.
2189 (ToplevelBlock.ProcessArguments): Likewise.
2191 2007-06-04 Raja R Harinath <rharinath@novell.com>
2193 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
2195 (ToplevelBlock.GetParameterInfo): Split out of ...
2196 (ToplevelBlock.GetParameterRefernce): ... this.
2197 (ToplevelBlock.ParameterMap): Remove.
2198 * expression.cs (ParameterReference): Update to use
2199 ToplevelParameterInfo.
2201 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
2204 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
2205 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
2207 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
2208 (ToplevelBlock.ProcessParameters) ... here.
2209 (ToplevelBlock..ctor): Invoke it.
2211 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
2214 * statement.cs (IKnownVariable): New interface.
2215 (LocalInfo): Implement it.
2216 (ToplevelParameterInfo): New class.
2217 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
2218 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
2219 GetKnownVariableInfo.
2221 2007-06-03 Raja R Harinath <harinath@gmail.com>
2223 Partly speed up CS0136 error checks.
2224 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
2225 'recurse' parameter.
2226 (Block.DoCheckError136): Only check errors in parameters. Move
2227 local variable checks ...
2228 (Block.AddVariable): ... here, and ...
2229 (ToplevelBlock.ResolveMeta): ... here.
2231 2007-06-02 Raja R Harinath <harinath@gmail.com>
2233 * statement.cs (Block.IsChildOf): Remove.
2235 * statement.cs (Statement.Clone): Move special case code ...
2236 (Block.CloneTo): ... here.
2238 2007-05-29 Raja R Harinath <rharinath@novell.com>
2240 * statement.cs (ToplevelBlock.container): Remove field. It's
2241 redundant with 'Parent'.
2242 (ToplevelBlock.ContainerBlock): Remove accessor.
2243 (ToplevelBlock..ctor): Update to changes. Register anonymous
2244 child with parent here, ...
2245 * cs-parser.jay (end_anonymous): ... not here. Don't modify
2247 (start_anonymous): Don't save current_block.
2248 (top_current_block): Remove.
2250 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
2251 (Block.Resolve): Update to changes.
2252 (Block..ctor): Move setting of "correct" 'Toplevel'
2253 and 'Explicit' fields to ...
2254 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
2256 2007-05-27 Raja R Harinath <harinath@gmail.com>
2259 * statement.cs (Block.Implicit): Remove.
2260 (Block): Update to changes.
2261 * flowanalysis.cs: Likewise.
2263 Mildly speed up CheckInvariantMeaningInBlock
2264 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
2265 Recursively call AddKnownVariable to all enclosing blocks.
2266 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
2267 Remove recursive calls.
2268 (Block): Update to changes.
2270 New ExplicitBlock invariants
2271 * statement.cs (Block.Explicit): New field. It points to the
2272 immediately enclosing non-implicit block.
2273 (Block..ctor): Maintain the invariant.
2274 * cs-parser.jay: Take advantage of invariant.
2276 Introduce ExplicitBlock
2277 * statement.cs (ExplicitBlock): New.
2278 (ToplevelBlock): Derive from it.
2279 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
2281 (Block.Implicit): Update to changes.
2282 * cs-parser.jay: Update to changes.
2285 * codegen.cs (EmitContext.IsLastStatement): Remove.
2286 * statement.cs (Block.DoEmit): Update to changes.
2288 2007-05-25 Raja R Harinath <rharinath@novell.com>
2290 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
2291 modifying current_block directly.
2293 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
2295 * class.cs: Implemented automatic properties (C# 3.0)
2296 Thanks to Marek for the help.
2298 2007-05-23 Raja R Harinath <rharinath@novell.com>
2300 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
2301 variable as assigned, note also that all its components are
2303 (MyBitVector.SetRange): New. Function to set multiple bits to true.
2305 2007-05-19 Marek Safar <marek.safar@gmail.com>
2307 * anonymous.cs, class.cs: Emit Compiler generated attribute when
2308 member is marked as compiler generated.
2310 * decl.cs (MemberCore): Refactored ModFlags into property.
2312 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
2313 (Check): Check only accessibility modifiers.
2315 2007-05-18 Raja R Harinath <rharinath@novell.com>
2317 Track all assignable slots in one bit array
2318 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
2319 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
2320 logic from VariableMap constructor here. Use the same 'offset'
2321 variable that's later used for computing offsets of local
2323 * flowanalysis.cs (UsageVector.parameters): Remove.
2324 (UsageVector): Update to changes.
2325 (VariableMap): Remove.
2327 Avoid creating ParameterMap in every block
2328 * statement.cs (Block.ParameterMap): Move ...
2329 (ToplevelBlock.ParameterMap): ... here.
2330 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
2332 * flowanalysis.cs (FlowBranching.param_map): Remove.
2333 (FlowBranching.UsageVector): Update to changes.
2334 (FlowBranchingToplevel.CheckOutParameters): Likewise.
2336 * statement.cs (Block.CloneTo): Clone Toplevel field too.
2338 * expression.cs (ParameterReference): Distinguish between block
2339 where parameter was referenced and declared.
2341 2007-05-18 Marek Safar <marek.safar@gmail.com>
2343 * flowanalysis.cs, statement.cs: Put back improved error handling.
2345 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
2349 Imporved object and collection initialization (C# 3.0).
2351 2007-05-15 Marek Safar <marek.safar@gmail.com>
2353 A fix for bug #81380
2354 * expression.cs (Is.DoResolve): Only value types have constant `is'
2357 2007-05-15 Raja R Harinath <rharinath@novell.com>
2359 * statement.cs (ToplevelBlock.child): Remove.
2361 2007-05-15 Raja R Harinath <harinath@gmail.com>
2363 Rationalize ResolveMeta: refactoring
2364 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
2365 out constant handling code into ...
2366 (Block.DoResolveConstants): ... this.
2368 Rationalize ResolveMeta: kill local_map
2369 * statement.cs (Block.local_map, Block.LocalMap): Remove.
2370 (Block.AssignableSlots): New.
2371 (Block.ResolveMeta): Make protected. Don't create a VariableMap
2372 for locals -- move code from VariableMap here. Avoid unnecessary
2374 * flowanalysis.cs (FlowBranching.local_map): Remove.
2375 (FlowBranching..ctor): Use Block.AssignableSlots.
2376 (VariableMap): Remove unused constructors.
2378 2007-05-11 Raja R Harinath <rharinath@novell.com>
2380 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
2382 2007-05-11 Marek Safar <marek.safar@gmail.com>
2384 * typemanager.cs (IsFriendAssembly): Should not be called for building
2387 2007-05-09 Marek Safar <marek.safar@gmail.com>
2389 * literal.cs (NullConstant): Print null in all cases.
2391 * expression.cs (Binary.ResolveOperator): Implemented delegate
2392 comparison based on C# 2.0 changes.
2394 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
2396 This code is contributed under the MIT X11 license
2398 The following enables support for several C# 3.0 language features:
2400 * cs-tokenizer.cs: Added support for the "var" keyword.
2402 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
2403 Added VarExpr class to facilitate type inferencing.
2405 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
2406 to support anonymous types.
2408 * assign.cs: Added support for type inferencing and initialization.
2410 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
2412 * expression.cs: Added implicit array support to ArrayCreation.
2413 Added 5 types and 1 interface:
2415 IInitializable Implementing classes can inject initializing
2416 statements after object instantiation.
2418 Initializer Stores data for object initialization.
2420 AnonymousType An expression for anonymous types.
2422 AnonymousTypeParameter Stores data about an anonymous type's field.
2424 NewInitialize An expression for object initialization.
2426 CollectionInitialize An expression for collection initialization.
2428 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
2431 2007-05-06 Marek Safar <marek.safar@gmail.com>
2433 A fix for bug #81500
2434 * cs-tokenizer.cs: Add special handling for coalescing operator.
2436 2007-05-06 Marek Safar <marek.safar@gmail.com>
2438 A fix for bug #81529
2439 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
2440 its value from base class until it is redefined.
2442 2007-05-02 Raja R Harinath <rharinath@novell.com>
2444 Fix regression in cs0631-3.cs
2445 * cs-parser.jay (operator_declarator): Add opt_attributes to error
2446 fallback. Make error fallback catch more cases.
2448 2007-05-01 Miguel de Icaza <miguel@novell.com>
2450 * cs-parser.jay: Allow parameters in operator declarations to have
2453 2007-04-27 Miguel de Icaza <miguel@novell.com>
2455 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
2458 * lambda.cs (ContextualReturn.Resolve): An expression is valid
2459 inside the ContextualReturn, it does not have to be an
2460 ExpressionStatement.
2462 2007-04-24 Miguel de Icaza <miguel@novell.com>
2464 * lambda.cs (ContextualReturn.Resolve): if the return type is not
2467 2007-04-23 Miguel de Icaza <miguel@novell.com>
2469 * anonymous.cs (AnonymousContainer): split the virtual Resolve
2470 method in two methods: ResolveNoDefine and Resolve.
2472 ResolveNoDefine will stop just after ResolveTopBlock has been
2475 Resolve will then continue by creating a method and issuing the
2476 call to method.Define ().
2478 (AnonymousMethod): Split and implement the new Resolve and
2479 ResolveNoDefine as well.
2481 * lambda.cs (LambdaExpression): Split the anonymous method
2482 resolution code into a separate routine (CoreCompatibilityTest)
2483 from DoCompatibleTest.
2485 (LambdaExpression.TryBuild): New method, this method tries to
2486 build the LambdaExpression with the given set of types to be used
2487 as the types for the various parameters of the lambda expression.
2489 If the compilation succeed with the given types, the infered type
2490 of the Anonymous method is returned, otherwise null is returned.
2492 2007-04-23 Marek Safar <marek.safar@gmail.com>
2494 A fix for bug #81414
2495 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
2497 2007-04-22 Miguel de Icaza <miguel@novell.com>
2499 * cs-tokenizer.cs: Change various identifiers here from the
2500 camelCasing to the recommended Linux-like style for instance
2501 variables from the Coding Guidelines.
2503 2007-04-19 Martin Baulig <martin@ximian.com>
2506 (Convert.ImplicitReferenceConversionCore): Allow conversions from
2507 System.Enum to System.ValueType.
2509 2007-04-13 Martin Baulig <martin@ximian.com>
2511 Rewrote implicit reference conversions. We need to distinguish
2512 between implicit reference conversions (13.1.4) and implicit
2513 boxing conversions (13.1.5).
2515 According to the spec, there's an an implicit conversion
2516 "From a one-dimensional array-type S[] to IList<T> and base
2517 interfaces of this interface, provided there is an implicit
2518 reference conversion from S to T." Note that this does not
2519 include boxing conversions.
2522 (Convert.ImplicitTypeParameterBoxingConversion): New method.
2523 (Convert.ImplicitReferenceConversion): Split into
2524 ImplicitReferenceConversionCore() and
2525 ImplicitBoxingConversionExist().
2526 (Convert.ImplicitReferenceConversionExists): Use the new
2527 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
2529 2007-04-12 Martin Baulig <martin@ximian.com>
2531 * convert.cs (Convert.ImplicitReferenceConversion): Move the
2532 `TypeManager.null_type' checks up to the top of the method.
2534 2007-04-11 Marek Safar <marek.safar@gmail.com>
2536 A fix for bug #81350
2537 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
2540 2007-04-11 Martin Baulig <martin@ximian.com>
2542 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
2543 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
2544 to make this work for generic classes; fixes #79561.
2546 2007-04-11 Martin Baulig <martin@ximian.com>
2548 * expression.cs (As): Add support for nullable types; fixes #79371.
2550 2007-04-11 Martin Baulig <martin@ximian.com>
2552 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
2553 `type.FullName' is null; fixes #80243.
2555 2007-04-11 Martin Baulig <martin@ximian.com>
2557 * expression.cs (Invocation.IsApplicable): Don't modify the method
2558 if type inference succeeded, but the method was not applicable.
2561 2007-04-10 Marek Safar <marek.safar@gmail.com>
2563 A fix for bug #81324
2564 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
2565 internal and external namespaces containers.
2567 2007-04-10 Martin Baulig <martin@ximian.com>
2569 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
2570 TypeManager.DropGenericMethodArguments() so we also call
2571 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
2573 2007-04-10 Martin Baulig <martin@ximian.com>
2575 * iterators.cs (Iterator.CreateIterator): Don't crash if
2576 `method.ReturnType' is null. This happens if something went wrong
2577 while resolving that typ (we already reported an error in this case).
2579 2007-04-10 Martin Baulig <martin@ximian.com>
2581 * expression.cs (New.DoResolve): Don't call CheckComImport() on
2582 generic interfaces; report the CS0144 directly.
2584 2007-04-10 Martin Baulig <martin@ximian.com>
2586 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
2587 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
2589 2007-04-10 Martin Baulig <martin@ximian.com>
2591 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
2593 2007-04-09 Raja R Harinath <rharinath@novell.com>
2596 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
2597 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
2600 * statement.cs (For.Resolve): If resolution fails, use
2603 2007-04-08 Marek Safar <marek.safar@gmail.com>
2605 * anonymous.cs (MakeName): Make faster and zero-based.
2606 (VerifyExplicitParameterCompatibility): Back to mode where generic
2607 parameter is ignored.
2608 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
2610 * class.cs (EmitType): Method can emit another new method.
2612 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
2614 * driver.cs: Updated.
2616 * lambda.cs: Reuse predefined empty parameters.
2618 * parameter.cs: Updated
2620 * support.cs: Implemented InflateTypes.
2622 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
2623 (InitSystemCore): Introduced to isolate 3.0 dependencies.
2625 2007-04-03 Martin Baulig <martin@ximian.com>
2629 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
2630 version of TypeManager.IsOverride() which also works with generic
2633 2007-04-03 Martin Baulig <martin@ximian.com>
2638 (Convert.ExplicitReferenceConversion): We need to cast when
2639 converting from IList<T> to S[].
2641 2007-04-01 Marek Safar <marek.safar@gmail.com>
2643 * decl.cs (FindExtensionMethods): Consider all candidates with same name
2646 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
2648 2007-03-31 Marek Safar <marek.safar@gmail.com>
2650 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
2651 argument and return type inferring.
2653 * codegen.cs (InferReturnType): Flag whether return can be inferred.
2654 (ReturnType): Turned to property.
2656 * statement.cs (Return): Implemented return type inferring.
2658 * support.cs (ReflectionParameters): Use local types if possible.
2660 2007-03-30 Raja R Harinath <rharinath@novell.com>
2662 * flowanalysis.cs (FlowBranching.Reachability): Remove.
2663 (FlowBranching.UsageVector): Update to changes.
2665 Prepare to kill 'Reachability'
2666 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
2667 argument of constructor.
2669 2007-03-29 Raja R Harinath <rharinath@novell.com>
2671 Prepare to kill 'Reachability'
2672 * flowanalysis.cs (UsageVector.is_unreachable): New.
2673 (UsageVector): Update to maintain 'is_unreachable' in parallel to
2674 'reachability', and verify they're consistent.
2677 * expression.cs (New.EmitStatement): Handle type parameters here too.
2679 2007-03-29 Martin Baulig <martin@ximian.com>
2684 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
2685 CompilerGeneratedClass.
2686 (ScopeInfo.EmitScopeInstance): Make this protected.
2687 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
2688 `ec.CurrentAnonymousMethod.Scope == Scope'.
2690 * statement.cs (Block.ScopeInfo): Make this a property.
2692 2007-03-27 Raja R Harinath <harinath@gmail.com>
2694 Prepare to kill 'Reachability'
2695 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
2696 (FlowBranching.UsageVector.Reachability): Remove property.
2697 (FlowBranching.UsageVector.IsUnreachable): New property.
2698 (FlowBranching.UsageVector.ResetBarrier): New.
2699 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
2700 * codegen.cs, statement.cs: Update to changes.
2702 2007-03-27 Martin Baulig <martin@ximian.com>
2707 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
2710 2007-03-26 Raja R Harinath <rharinath@novell.com>
2712 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
2713 instead of TriState. Remove all mention of TriState.
2715 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
2716 replaced by a boolean. Add boolean 'is_unreachable' field, check
2717 and maintain invariants.
2719 2007-03-25 Marek Safar <marek.safar@gmail.com>
2721 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
2723 2007-03-25 Marek Safar <marek.safar@gmail.com>
2725 * expression.cs: Stop using obsolete 2.0 opcodes.
2727 2007-03-25 Marek Safar <marek.safar@gmail.com>
2729 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
2730 one of the latests Martin's fixes.
2732 2007-03-23 Miguel de Icaza <miguel@novell.com>
2734 * expression.cs: On BigEndian systems, swap the bytes, temporary
2735 solution until we get a new bitconverter class.
2737 2007-03-23 Martin Baulig <martin@ximian.com>
2741 * decl.cs (MemberCache.AddMembers): Add generic methods both as
2742 "Method" and "Method`1". Normally, a cache lookup is done on the
2743 "Method" form (ie. without the generic arity), but this one makes
2744 lookups on the full form work as well.
2746 2007-03-22 Raja R Harinath <rharinath@novell.com>
2748 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
2751 2007-03-20 Bill Holmes <billholmes54@gmail.com>
2753 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
2754 ordered_member_list, to TypeBuilder to store members to be defined
2755 in the order they were parsed in.
2756 - ordered_explicit_member_list contains all properties indexers
2757 and methods that are defined as explicit implementation of an
2758 interface or base class.
2759 - ordered_member_list contains all properties indexers and methods
2760 that are not defined as explicit implementation of an interface
2763 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
2764 functionality in these removed classes has been replaced with
2765 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
2766 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
2768 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
2769 to CheckForDuplications inside GetMethod and SetMethod Define Method
2770 to handle method property and indexer name conflicts.
2774 All code is contributed under the MIT/X11 license.
2776 2007-03-20 Martin Baulig <martin@ximian.com>
2778 * class.cs (TypeContainer.Interfaces): Removed; they're now
2779 included in `TypeContainer.Types'.
2781 2007-03-20 Martin Baulig <martin@ximian.com>
2783 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
2785 * class.cs (TypeContainer.CreateType): New public method. This is
2786 now called before DefineType() to create the TypeBuilders.
2787 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
2788 has already been created by CreateType().
2789 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
2790 don't resolve our base classes here; this has been moved into
2791 DefineBaseTypes(). We're now called from CreateType().
2792 (TypeContainer.DefineBaseTypes): New private method; resolve our
2793 base classes here. We're now called from DefineType().
2796 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
2797 our types first to create all the TypeBuilders. After that, call
2798 TypeContainer.DefineType() on all the types which'll resolve their
2799 base classes and setup the resolve order.
2801 2007-03-20 Martin Baulig <martin@ximian.com>
2803 * class.cs (TypeContainer.Enums): Removed; they're now included in
2804 `TypeContainer.Types'.
2806 2007-03-20 Martin Baulig <martin@ximian.com>
2809 (TypeContainer.DefineType): Don't call ResolveMembers() here.
2810 (TypeContainer.DoResolveMembers): Call DefineType() on our
2811 `compiler_generated' classes; moved here from DefineNestedTypes().
2814 (RootContext.ResolveTree): Call ResolveMembers() on all
2815 TypeContainer's in the `type_container_resolve_order'.
2817 2007-03-19 Marek Safar <marek.safar@gmail.com>
2819 * class.cs: Use corlib to handle InternalMethodImplAttribute.
2821 2007-03-17 Marek Safar <marek.safar@gmail.com>
2823 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
2824 implementation flags.
2826 2007-03-17 Marek Safar <marek.safar@gmail.com>
2828 * class.cs: More optimizations for type parameters.
2830 2007-03-15 Marek Safar <marek.safar@gmail.com>
2832 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
2834 * ecore.cs, parameter.cs: More common code for both corlibs.
2836 * typemanager.cs (IsGenericMethod): Simplified.
2838 2007-03-15 Raja R Harinath <rharinath@novell.com>
2840 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2842 * statement.cs, iterators.cs, lambda.cs: Update to changes.
2844 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
2845 unconditionally. Simplify explanation.
2846 (Try.Resolve, Using.Resolve): Likewise.
2848 2007-03-15 Martin Baulig <martin@ximian.com>
2852 * decl.cs (DeclSpace): If we're a partial class, use our
2853 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
2855 2007-03-15 Raja R Harinath <rharinath@novell.com>
2857 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2859 (FlowBranching.UsageVector): Update to changes.
2860 (FlowBranching.MergeSiblings): Likewise.
2861 * statement.cs: Likewise.
2863 2007-03-15 Martin Baulig <martin@ximian.com>
2868 (MemberCache): Added a special .ctor for type parameters.
2871 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
2874 2007-03-09 Martin Baulig <martin@ximian.com>
2876 * enum.cs (Enum): Make this a TypeContainer.
2877 (EnumMember): Derive from `Const'.
2880 (Const.DoResolveValue): New protected virtual method; move most of
2881 the functionality of ResolveValue() here so we can override it in
2883 (Const.CreateConstantReference): Make this virtual.
2885 * class.cs (Kind): Add `Kind.Enum'.
2886 (TypeContainer.Emit): Don't emit the enums here; they're already
2887 in the `RootContext.typecontainer_resolve_order'.
2889 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
2890 here; they're already in the `typecontainer_resolve_order'.
2892 * ecore.cs (EnumConstant.ConvertImplicitly): Add
2893 TypeManager.DropGenericTypeArguments().
2896 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
2897 (TypeManager.IsEnumType): Likewise.
2898 (TypeManager.EnumToUnderlying): Likewise.
2899 (TypeManager.IsEqual): Add support for enums.
2901 2007-03-12 Raja R Harinath <rharinath@novell.com>
2903 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
2904 DefaultParameterValueAttribute to be undefined, say if System.dll
2907 2007-03-11 Marek Safar <marek.safar@gmail.com>
2909 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
2912 2007-03-10 Marek Safar <marek.safar@gmail.com>
2914 * class.cs, parameter.cs: Unified parameters verification.
2916 2007-03-08 Martin Baulig <martin@ximian.com>
2918 * cs-parser.jay (constructor_header): Pass the location to the
2919 newly created TopLevelBlock.
2921 2007-03-07 Martin Baulig <martin@ximian.com>
2923 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
2925 2007-03-06 Miguel de Icaza <miguel@novell.com>
2927 * convert.cs (ExplicitReferenceConversionExists): Sync this method
2928 with the changes from David, fixes the build.
2930 2007-03-05 David Mitchell <dmitchell@logos.com>
2932 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
2933 and its base interfaces to a one-dimensional array type S[],
2934 provided there is an implicit or explicit reference conversion
2937 2007-03-03 Marek Safar <marek.safar@gmail.com>
2939 * cs-tokenizer.cs: Implemented basic linq grammar.
2941 * driver.cs: Set linq lang version on demand.
2943 2007-02-26 Marek Safar <marek.safar@gmail.com>
2945 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
2947 2007-02-25 Marek Safar <marek.safar@gmail.com>
2949 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
2952 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
2954 Check property and event extern attributes.
2956 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
2959 2007-02-24 Marek Safar <marek.safar@gmail.com>
2961 A fix for bug #80407
2962 * ecore.cs: Don't report ambiguity error when methods have same parent.
2964 2007-02-23 Marek Safar <marek.safar@gmail.com>
2966 A fix for bug #80878
2967 * class.cs, cs-parser.jay: Event property can host anonymous methods.
2969 2007-02-22 Marek Safar <marek.safar@gmail.com>
2971 * attribute.cs: Enable ExtensionAttribute presence test.
2973 2007-02-22 Marek Safar <marek.safar@gmail.com>
2975 * class.cs: Warn about missing GetHashCode only when Equals is override.
2977 * decl.cs: Check accessibility of type arguments.
2979 * typemanager.cs: Correctly report nullable array.
2981 2007-02-20 Marek Safar <marek.safar@gmail.com>
2983 * class.cs, report.cs: Capture more details when things go wrong.
2985 2007-02-20 Marek Safar <marek.safar@gmail.com>
2987 A fix for bug #80650
2988 * cs-parser.jay: Anonymous container starts at constructor declaration
2989 and not at block beginning because it has to be usable in constructor
2992 * statement.cs: Use context location and not block one for error reporting.
2994 2007-02-18 Marek Safar <marek.safar@gmail.com>
2996 A fix for bug #78712
2997 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
3000 2007-02-18 Marek Safar <marek.safar@gmail.com>
3002 A fix for bug #80493 by Atsushi Enomoto
3003 * cs-parser.jay: Ignore invalid attribute target.
3005 2007-02-18 Marek Safar <marek.safar@gmail.com>
3007 * cs-tokenizer.cs: Ignore '\0' as white space character.
3009 2007-02-17 Miguel de Icaza <miguel@novell.com>
3011 * cs-parser.jay: Add support for lambda expressions to the mcs
3014 * lambda.cs: Only clone when we are probing, not on the final call
3015 (Compatible is the final call).
3017 * statement.cs (CloneContext): Introduce class to provide block
3018 remapping during clone.
3020 All statements Clone themselves now.
3022 (Clone): special handling for blocks, when we clone a block, we
3023 register the block inside this routine, as children of the block
3024 might trigger a lookup.
3026 * expression.cs: Add support for CloneContext in all expressions.
3028 2007-02-17 Marek Safar <marek.safar@gmail.com>
3030 A fix for bug #80493
3031 * statement.cs: Report ambiguous warning when interfaces are not related.
3033 2007-02-15 Marek Safar <marek.safar@gmail.com>
3035 C# 3.0 extension methods.
3037 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
3038 cannot be used directly.
3040 * class.cs (Class.Emit): Emit extension attribute if any class method
3041 is extension method.
3042 (Method.Define): Add basic extension method validation conditions.
3043 (Method.Emit): Emit extension attribute for method.
3045 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
3046 extension method exists. Currently we follow same approach as Microsoft
3047 does, emit even if a method or a class are private but this can change
3050 * cs-parser.jay: Add handling of `this' keyword in method parameters
3053 * decl.cs (DeclSpace.IsStaticClass): New property.
3054 (MemberCache.FindExtensionMethods): Looks for extension methods with
3055 defined name and extension type.
3057 * doc.cs: Updated after OverloadResolve changes.
3059 * driver.cs: Add new soft reference to System.Core.dll.
3061 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
3062 (ExtensionMethodGroupExpr): Represents group of extension methods.
3064 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
3065 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
3066 to MethodGroupExpr and made non-static for easier customization.
3067 (Invocation.DoResolve): Add extension method lookup when no standard
3069 (MemberAccess.DoResolve): Try extension methods if no member exists.
3071 * modifiers.cs: Add METHOD_EXTENSION modifier.
3073 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
3074 as well as candidate extension type.
3075 (ComputeNamespaces): When assembly constains extension methods registers
3077 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
3078 extension method lookup.
3079 (Namespace.LookupExtensionMethod): Looks for extension method in this
3081 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
3082 find a method which matches name and extensionType.
3084 * parameter.cs (Parameter): Add This modifer.
3085 (HasExtensionMethodModifier): New property.
3086 (Resolve): Add extension parameter check.
3087 (ModFlags): turned to property to exclude this modifier as it is not real
3089 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
3091 * support.cs (ParameterData): Add ExtensionMethodType.
3092 (ReflectionParameters): Implemented ExtensionMethodType interface property.
3094 * typemanager.cs: Add type and ctor extension attribute type.
3096 2007-02-15 Miguel de Icaza <miguel@novell.com>
3098 * report.cs (DisableErrors, EnableErrors): used to prevent error
3099 output when we are "trying" to compile various methods with
3102 * ecore.cs (Expression): Add Clone method that calls the virtual
3103 CloneTo method. The current CloneTo method in Expression throws
3104 an exception so we can track down all the places where this must
3105 be implemented (not using abstract, because that would be a lot of
3106 up-front-work before we can start testing the implementation
3109 Important: we only need Clone capabilities for expressions created
3110 by the parser, as the expressions we will be cloning are
3111 expressions in the pre-resolved state. This vastly simplifies
3114 (SimpleName): Add CloneTo that does nothing.
3115 (EmptyCast): Add CloneTo.
3117 * expression.cs (Binary): Implement CloneTo.
3118 (Invocation.IsApplicable): Store the current ec in
3119 EmitContext.TempEc and restore it on return. This is used so we
3120 do not have to sprinkle hundres of methods with an extra
3121 EmitContext, we know that the only user is the lambda expression
3122 ImplicitConversionExists code.
3124 (Argument): Add Cloning capabilities.
3125 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
3126 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
3127 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
3128 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
3129 IndexerAccess): Add Clone capability.
3131 (LocalVariableReference, This): TODO: needs cloned Block mapping.
3133 (Argument): Add cloning capability.
3135 * assign.cs (Assign): Implement CloneTo.
3137 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
3139 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
3140 version by calling Convert with the EmitContext (that we are
3141 currently storing in ec, this is not great, but will do for now,
3142 to avoid passing EmitContext parameters to hundreds of functions
3143 that do not need them now).
3145 (SetExpression): Remove, it is not needed.
3147 (ContextualReturn): Implement CloneTo.
3149 * statement.cs (Statement): Implement cloning infrastructure,
3150 similar to expressions.
3152 (Block): Partial implementation of Clone for statements.
3154 (Return): Implement clone.
3156 * constant.cs (Constant.CloneTo): New method, does nothing.
3158 * codegen.cs (TempEc): Add a static EmitContext as a temporary
3159 solution, until we decide how to exactly do this.
3161 2007-02-14 Marek Safar <marek.safar@gmail.com>
3163 A fix for bug #80493
3164 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
3165 a property is override we need to use second accessor.
3167 2007-02-13 Marek Safar <marek.safar@gmail.com>
3169 A fix for bug #80418
3170 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
3173 2007-02-13 Marek Safar <marek.safar@gmail.com>
3175 Another fix for bug #80749
3176 * pending.cs: Abstract class has priority over interfaces.
3178 2007-02-13 Marek Safar <marek.safar@gmail.com>
3180 Another fix for bug #80749
3181 * pending.cs: Abstract class has priority over interfaces.
3183 2007-02-13 Marek Safar <marek.safar@gmail.com>
3185 Another fix for bug #80749
3186 * pending.cs: Abstract class has priority over interfaces.
3188 2007-02-13 Marek Safar <marek.safar@gmail.com>
3190 Another fix for bug #80749
3191 * pending.cs: Abstract class has priority over interfaces.
3193 2007-02-13 Marek Safar <marek.safar@gmail.com>
3195 * class.cs Better error message.
3197 * driver.cs: Add shorter versions of -optimize option.
3199 2007-02-13 Martin Baulig <martin@ximian.com>
3201 * class.cs (Constructor.Emit): Check the return value of
3202 ec.ResolveTopBlock() and return on error.
3204 2007-02-13 Raja R Harinath <rharinath@novell.com>
3206 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
3207 message to fix error message regression.
3209 2007-02-12 Marek Safar <marek.safar@gmail.com>
3211 * delegate.cs: Delegate creation expression cannot be of Nullable type.
3213 2007-02-12 Marek Safar <marek.safar@gmail.com>
3215 A fix for bug #80749
3216 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
3217 its parent container.
3219 * class.cs (DefineFieldInitializers): Each initializer can has different
3222 * const.cs: Updated.
3224 2007-02-11 Miguel de Icaza <miguel@novell.com>
3226 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
3227 now all the heavy lifting to check that embedded statements or
3228 expressions have the right form is done in the ContextualReturn.
3230 (ContextualReturn): New class.
3232 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
3233 method that can be invoked to report 201, so we do not replicate
3236 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
3238 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
3239 treating tabs as spaces.
3241 2007-02-09 Marek Safar <marek.safar@gmail.com>
3243 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
3244 * assign.cs: Use full implicit conversion for right side check.
3246 2007-02-09 Marek Safar <marek.safar@gmail.com>
3248 * statement.cs (Switch): Switch over boolean type is not standardized.
3250 2007-02-08 Marek Safar <marek.safar@gmail.com>
3252 A fix for bug #80755
3253 * decl.cs (FindBaseEvent): Don't use method cache for events.
3255 2007-02-07 Marek Safar <marek.safar@gmail.com>
3257 * cs-parser.jay: Better syntax error handling.
3259 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
3260 instead of underlying type value.
3262 2007-02-06 Marek Safar <marek.safar@gmail.com>
3264 * driver.cs: Check define identifier before is registered.
3266 * namespace.cs: Use existing error message.
3268 * report.cs: New warning.
3270 2007-02-06 Marek Safar <marek.safar@gmail.com>
3272 A fix for bug #80742
3273 * expression.cs: Delegate Invoke method can be called directly.
3275 2007-02-06 Marek Safar <marek.safar@gmail.com>
3277 A fix for bug #80676
3278 * class.cs (IsEntryPoint): The Main method can have params modifier.
3280 2007-02-04 Miguel de Icaza <miguel@novell.com>
3282 * parameter.cs (Parameter, Parameters): Add Clone method.
3284 * anonymous.cs (Compatible): Turn method into virtual method, so
3285 LambdaExpression can implement a different behavior.
3287 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
3288 out the basic checking here, so it can be used by
3291 * lambda.cs: Introduce "Compatible" function that will do the
3294 2007-02-02 Marek Safar <marek.safar@gmail.com>
3296 * attribute.cs: Unified one error message.
3298 * class.cs (Class): Use type attributes and not properties to test static
3300 (IsEntryPoint): Don's pass local variable.
3302 * convert.cs: Removed duplicate check.
3304 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
3306 * driver.cs: Don't crash when soft reference does not exist.
3308 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
3309 (UsingEntry): Removed redundant allocation.
3311 * parameter.cs: Add fast path for type parameters.
3313 * support.cs: Don't allocate attribute when it's not used.
3315 2007-01-30 Miguel de Icaza <miguel@novell.com>
3318 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
3319 this into a virtual method, so we can override it in LambdaExpression.
3321 * driver.cs: Improve diagnostics in case of failure.
3323 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
3324 write a function that is slightly more complex and that parses:
3326 type identifier [, type identifier]* )
3328 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
3331 (canEmpty ? i >= 0 : i > 0)
3333 2007-01-30 Raja R Harinath <rharinath@novell.com>
3335 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
3336 exception on possibly valid code.
3338 2007-01-29 Raja R Harinath <rharinath@novell.com>
3340 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
3342 (parse_opt_type_arguments): Remove. It's almost the same as
3344 (parse_namespace_or_typename): Use parse_less_than.
3346 2007-01-28 Miguel de Icaza <miguel@novell.com>
3348 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
3349 this bug took a few hours to find, because the state saved and
3350 restored by PushPosition and PopPosition was ignoring the state of
3351 parse_generic_less_than.
3353 I can also now remove the handling of OP_LT and OP_GT, this solves
3356 * cs-tokenizer.cs: store the location for the ARROW token, we use
3359 (PushPosition, PopPosition): save/restore also `current_token',
3360 restore `parse_generic_less_than' (was missing).
3362 (parse_opt_type_arguments): use parse_type, not
3363 parse_namespace_or_typename to parse types.
3365 * lambda.cs: Empty new file, will eventually have the lambda
3366 expression implementation.
3368 * lambda.test: used to test the internal tokenizer.
3370 * report.cs (FeatureIsNotISO1): Rename from
3371 FeatureIsNotStandardized, because it was about the language level
3372 (1 vs 2) it was not about standarization.
3374 (FeatureRequiresLINQ): New.
3376 * support.cs (SeekableStreamReader): Only require that the reader
3377 is a TextReader, not a StreamReader, so we can plug StringReader.
3379 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
3380 given position in the input stream the following tokens can be
3381 parsed as a type followed by an identifier.
3383 (is_punct): after a '(' if parse_type_and_parameter returns true,
3384 then return a special token OPEN_PARENS_LAMBDA which is used to
3385 avoid reduce/reduce errors in the grammar for the
3386 lambda_expression rules.
3388 (parse_type): implement a type parser inside the
3389 tokenizer, the parser only returns true or false depending on
3390 whether the input at a given position can be parsed as a type.
3392 (peek_token): new method used during type parsing.
3394 2007-01-28 Raja R Harinath <rharinath@novell.com>
3397 * anonymous.cs (ScopeInfo.InflateParameters): New.
3398 (AnonymousContainer.Resolve): Use it to redirect types of
3399 delegate parameters.
3401 2007-01-27 Raja R Harinath <rharinath@novell.com>
3404 * expression.cs (Error_InvalidArguments): Don't use two different
3405 messages for CS1503. Use ExtraInformation and
3406 SymbolRelatedToPreviousError instead.
3409 * decl.cs (DeclSpace.initialize_type_params): Don't access
3410 'type_params' of a partial class directly.
3412 2007-01-26 Miguel de Icaza <miguel@novell.com>
3414 * constant.cs: Removed a handful of out-of-range checks that were
3417 2007-01-25 Marek Safar <marek.safar@gmail.com>
3419 * expression.cs (CheckUselessComparison): Add additional check for char
3422 * namespace.cs: Fixed typo.
3424 2007-01-23 Miguel de Icaza <miguel@novell.com>
3426 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
3427 gone, instead we inline the test, preventing the needless casts to
3428 longs, ulongs and doubles for the parameters, avoiding calls to
3429 methods that overchecked stuff, and instead inlined things
3432 2007-01-20 Marek Safar <marek.safar@gmail.com>
3434 * cs-parser.jay: Better parameter error handling.
3436 2007-01-17 Marek Safar <marek.safar@gmail.com>
3438 A fix for bug #80368, #80522
3439 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
3440 whether array initializer contains constants only.
3441 (ArrayCreation.Emit): Use better formula to decide when
3442 are array initializers for static initialization.
3443 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
3444 have to emit even constants otherwise they are pre-initialized.
3446 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
3447 Raja R Harinath <rharinath@novell.com>
3449 Fix emit order of 'get' vs. 'set'.
3450 * support.cs (Accessors): New.
3451 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
3452 Note the order in which accessors are declared in the source.
3453 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
3454 Refactored from Property.Define and Indexer.Define.
3455 (PropertyBase.DefineAccessors): New helper that calls the above in
3456 appropriate order as noted by the parser.
3457 (Property.Define, Indexer.Define): Update to changes.
3458 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
3460 2007-01-17 Raja R Harinath <rharinath@novell.com>
3462 Fix cs0029-6.cs and gcs0029-2.cs (regression)
3463 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
3464 there's an implicit conversion from the current type to the target
3465 type before converting the underlying constant.
3467 2007-01-16 Marek Safar <marek.safar@gmail.com>
3469 * const.cs (ResolveValue): Updated after constant conversion was made more
3472 * constant.cs (GetAttributableValue): constant to object conversion is
3473 used for attributes only.
3474 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
3475 constant conversions.
3476 (LongConstant.ConvertImplicitly): Ditto.
3478 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
3479 (ImplicitConversionStandard): Handle constant conversion as extra step.
3480 It solves the issue when constant conversion was called indirectly like
3481 inside array initializer and constant folding was skipped.
3483 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
3486 * statement.cs(ImplicitConversionStandard): Updated after constant
3487 conversion was made more generic.
3489 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
3491 * expression.cs (As.DoResolve): Use GenericConstraints instead of
3492 Constraints, solves the problem where the compiler incorrectly
3493 reported that a type parameter was not constrained to a class (Bug
3496 2007-01-14 Marek Habersack <grendello@gmail.com>
3498 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
3500 2007-01-14 Marek Safar <marek.safar@gmail.com>
3502 A fix for bug #80368
3503 * assign.cs (FieldInitializer): New class implements field
3504 initializer statement.
3506 * attribute.cs: Update after FieldMember rename.
3508 * class.cs (PropertyBasedMember): New common class for property based
3510 (InterfaceMemberBase): New base class for all members which can be used as
3511 an interface members.
3512 (MethodCore): Moved really common code to InterfaceMemberBase.
3513 (Method.Define): Equal and GetHasCode detection is relevant for methods
3515 (MethodData.Define): Don't assume that public event implements an
3516 interface automatically.
3517 (MethodData.DefineMethodBuilder): Issue an error even if only extern
3519 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
3520 (FieldMember): Merged with FieldBase.
3521 (EventProperty.AEventPropertyAccessor): New specialization to check whether
3522 event extern modifier can be used.
3523 (EventField.EventFieldAccessor): Moved event field specific code here.
3524 (Event.AllowedModifiers): Even event can be extern.
3525 (Event.FindOutBaseMethod): New override specific to events.
3526 (Indexer.parameters): Reintroduce parameters because base class holds
3527 only properties common data.
3528 (Indexer.CheckForDuplications): Indexers are threated as methods so we
3529 need do extra parameters check.
3531 * const.cs: Update after FieldMember rename.
3533 * decl.cs (MemberCache.FindBaseEvent): New method.
3535 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
3536 to reflect that indexer is now derived from PropertyBased.
3538 * ecore.cs (GetMemberType): Made public.
3539 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
3542 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
3544 * typemanager.cs (CSharpSignature): Correctly print event accessors.
3545 (RegisterEvent): Removed.
3546 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
3547 (GetPrivateFieldOfEvent): Renamed to GetEventField.
3549 2007-01-11 Raja R Harinath <rharinath@novell.com>
3552 * statement.cs (CollectionForeach.TryType): Prefer generic
3553 GetEnumerator over non-generic variant. Fix code to follow comments.
3555 2007-01-09 Raja R Harinath <rharinath@novell.com>
3558 * support.cs (ReflectionParameter): Don't use an invalid index on
3559 the generic parameter data.
3561 2007-01-08 Miguel de Icaza <miguel@novell.com>
3563 * driver.cs: Just add a tiny bit of infrastructure.
3565 2007-01-02 Marek Safar <marek.safar@gmail.com>
3567 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
3568 where field type is struct from current assembly.
3570 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
3573 2007-01-02 Marek Safar <marek.safar@gmail.com>
3575 A fix for bug #80381
3576 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
3579 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
3581 (Namespace.LookupType): Always use core types from corlib when speficied.
3583 * report.cs: A new warning.
3585 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
3586 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
3587 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
3589 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
3590 (InitCoreTypes): Set expression type of object_type and value_type
3591 immediately after lookup.
3593 2007-01-01 Miguel de Icaza <miguel@novell.com>
3595 * cs-tokenizer.cs: Accept Pc class characters (Connector
3596 Punctuation) as valid identifiers. Fixes #78259
3598 * expression.cs (Invocation.DoResolve): Moved the check for the
3599 use of `this' for doing method calls to the Invocation resolution
3600 step, after overload resolution has taken place instead of doing
3601 the check at the low-level `This.DoResolve' level.
3603 The `This.DoResolve'(appens before overload resolution, so it has
3604 no way of knowing if the method that will be called will be
3605 instace or static, triggering an erroneous report for cs0188 (Bug
3608 We now do the check for instance method invocations after we know
3609 what method will be called.
3611 (This.CheckThisUsage): Move the actual use of this structure
3612 checking into its own method and expose it.
3614 * Everywhere that called Error_ValueCannotBeConverted: pass a new
3617 Exceptions: Null.ConvertImplicitly,
3618 Constant.ImplicitConversionRequired as there are too many call
3619 sites for passing the ec.
3621 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
3622 EmitContext, if the value is null, then we do not try to provide
3623 the extra information from the error (If a userdefined conversion
3624 exists, as UserDefinedConversion requires a non null-EmitContext).
3628 2006-12-30 Raja R Harinath <rharinath@novell.com>
3630 * flowanalysis.cs (MyBitVector): Document some invariants.
3631 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
3632 introduced below, and add a couple of others,
3634 2006-12-30 Marek Safar <marek.safar@gmail.com>
3636 * attribute.cs (GetMethodObsoleteAttribute): Uses new
3637 GetPropertyFromAccessor and GetEventFromAccessor.
3639 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
3640 overrides non-obsolete one.
3641 (Indexer.Define): Error message has been moved to the parser.
3643 * cs-parser.jay: Better syntax errors handling.
3645 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
3646 when an invocation has no arguments.
3648 * ecore.cs: Removed not used caching.
3650 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
3653 * report.cs: Add a new warning.
3655 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
3657 * typemanager.cs (enumeration_type): Removed.
3658 (CSharpSignature): Reuses IsSpecialMethod.
3659 (IsEqual): Hack for MS BCL.
3660 (GetPropertyFromAccessor): New method.
3661 (GetEventFromAccessor): New method.
3662 (IsSpecialMethod): Fixed to handle more cases.
3664 2006-12-30 Marek Safar <marek.safar@gmail.com>
3666 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
3667 Made white spaces array static.
3669 * ecore.cs (RemoveGenericArity): Optimized.
3671 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
3673 (MyBitVector.initialize_vector): Simplified.
3675 2006-12-22 Miguel de Icaza <miguel@novell.com>
3677 * ecore.cs: Am not entirely happy with this hack, but it seems to
3678 address the issue in 80257 (a small test case for
3681 I set the MethodGroupExpr.Type to an internal compiler type
3682 (itself in this case) to force the resolution to take place. Why
3683 it does not take place with a null is beyond me.
3685 2006-12-20 Marek Safar <marek.safar@gmail.com>
3687 A fix for bug #80288
3688 * expression.cs (ResolveOperator): Consider user defined conversion for
3689 logical and operator too.
3690 (EmitBranchable): Optimization for logical and when full constant folding
3691 could not be applied but one operand is constant.
3693 2006-12-19 Marek Safar <marek.safar@gmail.com>
3695 * class.cs (GetClassBases): Write 5 times every day, will never use
3696 FullName for error reporting.
3698 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
3700 2006-12-19 Martin Baulig <martin@ximian.com>
3702 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
3703 the symbol file info here.
3705 2006-12-18 Marek Safar <marek.safar@gmail.com>
3707 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
3708 of `elseif' is taking then following sections are not taking.
3709 Fixes an issue reported on mono mailing list.
3711 2006-12-18 Marek Safar <marek.safar@gmail.com>
3713 A fix for bug #80300
3714 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
3715 a caller is not taking.
3717 2006-12-18 Raja R Harinath <rharinath@novell.com>
3719 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
3720 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
3721 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
3722 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
3723 * class.cs: Update to changes.
3725 2006-12-17 Marek Safar <marek.safar@gmail.com>
3727 A fix for bug #79934
3728 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
3731 * class.cs (ResolveMembers): Register an iterator in current container and
3734 2006-12-16 Raja R Harinath <rharinath@novell.com>
3737 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
3738 satisfy a params annotated parameter.
3740 2006-12-16 Marek Safar <marek.safar@gmail.com>
3742 A fix for bug #77014
3743 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
3744 paramters correctly and not rely on hacks in Parameters class.
3745 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
3747 (Invocation.VerifyArgumentsCompat): Ditto.
3748 (Invocation.EmitArguments): Changed to correctly emit params arguments at
3751 * parameter.cs (HasParams): Don't assume that params is the last one.
3753 * support.cs (ReflectionParameters.ctor): Look for params attribute
3755 (ReflectionParameters.ParameterType): Removed hack when we returned last
3756 parameter for out of range parameters.
3757 (ParameterName, ParameterModifier): Ditto.
3759 2006-12-14 Marek Safar <marek.safar@gmail.com>
3761 A fix for bug #79987
3762 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
3763 when assembly is not CLS compliant but type is. I have no idea why is this
3766 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
3768 2006-12-13 Miguel de Icaza <miguel@novell.com>
3770 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
3771 in struct constructors, they are basically no-ops.
3773 2006-12-12 Marek Safar <marek.safar@gmail.com>
3775 * cs-tokenizer.cs (Position): Save preprocessor status too.
3777 2006-12-12 Marek Safar <marek.safar@gmail.com>
3779 A fix for bug #77794
3780 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
3782 2006-12-12 Marek Safar <marek.safar@gmail.com>
3784 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
3786 (pp_expr): Report error for an invalid expression.
3787 (handle_preprocessing_directive): Simplified; add more error checking.
3789 2006-12-11 Marek Safar <marek.safar@gmail.com>
3791 A fix for bug #74939
3792 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
3793 directives handling.
3795 2006-12-10 Marek Safar <marek.safar@gmail.com>
3797 A fix for bugs #80093, and #75984
3798 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
3799 logic, it seems to me as it worked before "by coincidence".
3800 (xtoken): Simplified to use reworked handle_preprocessing_directive.
3801 (cleanup): Enabled endif check.
3803 2006-12-09 Marek Safar <marek.safar@gmail.com>
3805 A fix for bug #80162
3806 * statement.cs (CollectionForeach.TryType): Generics and non-generics
3807 enumerators are never ambiguous.
3809 2006-12-08 Raja R Harinath <rharinath@novell.com>
3812 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
3814 2006-12-06 Marek Safar <marek.safar@gmail.com>
3816 A fix for bug #80144
3817 * class.cs (EventProperty.Define): Explicit implementation means
3818 that an even is used.
3820 2006-12-06 Marek Safar <marek.safar@gmail.com>
3822 Fixes the operators implementation (part II)
3824 * cfold.cs (DoConstantNumericPromotions): Renamed to
3825 DoBinaryNumericPromotions and simplified.
3826 (BinaryFold): Couple of conversion fixes; simplified.
3828 * constant.cs, ecore.cs, literal.cs
3829 (ToType): Renamed to ConvertImplicitly.
3830 (Reduce): Renamed to ConvertExplicitly.
3832 * class.cs, convert.cs: Updated.
3834 * expression.cs: TryReduce doesn't throw an exception.
3836 2006-12-01 Marek Safar <marek.safar@gmail.com>
3838 A fix for bug #80108
3839 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
3842 2006-11-30 Marek Safar <marek.safar@gmail.com>
3844 Fixes unary operators implementation (part I)
3847 * cfold.cs (Error_CompileTimeOverflow): Made internal
3849 * const.cs (IConstant): Changed to use reference to constant and
3850 not constant itself.
3851 Updated IConstant implementations.
3853 * constant.cs (CreateConstant): New factory method.
3854 Updated IConstant implementation.
3856 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
3858 * ecore.cs: Updated to use CreateConstantReference.
3860 * enum.cs: Reflects IConstant changes.
3862 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
3864 * literal.cs (NullConstant): Change to be independently usable.
3866 2006-11-29 Martin Baulig <martin@ximian.com>
3868 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
3869 we need to emit the scope initializer before calling the base .ctor.
3871 * anonymous.cs: Merged back from the new anonymous methods branch.
3872 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
3874 * expression.cs (ParameterReference.DoResolveBase): Create a
3875 "normal" ScopeInfo when capturing parameters rather than using the
3876 root scope; this makes things work with anonymous methods having
3880 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
3882 2006-11-22 Marek Safar <marek.safar@gmail.com>
3884 A fix for bug #79987
3885 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
3886 check to a base class.
3887 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
3888 only when assembly has missing attribute.
3889 * report.cs: Update.
3891 2006-11-21 Marek Safar <marek.safar@gmail.com>
3893 * cs-tokenizer.cs: Merged with gmcs version.
3895 2006-11-20 Marek Safar <marek.safar@gmail.com>
3898 * cs-parser.jay: Better error message when partial keyword is misplaced.
3900 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
3902 A fix for bug #79810
3903 report.cs: CS1058 only applies to 2.0 profile (gmcs).
3904 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
3905 a RuntimeWrappedException by default.
3907 2006-11-18 Marek Safar <marek.safar@gmail.com>
3909 A fix for bug #79843
3910 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
3912 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
3914 2006-11-18 Marek Safar <marek.safar@gmail.com>
3916 * driver.cs, namespace.cs: Uses faster IndexOf version.
3918 2006-11-17 Marek Safar <marek.safar@gmail.com>
3920 A fix for bug #79941
3921 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
3923 (Operator.Define): Implicit/Explicit operator of same type is duplicate
3924 even if internal name is different.
3925 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
3926 (UserDefinedConversion): Simplified as the operators cannot be internal.
3927 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
3929 (MethodLookup): Replaced EmitContext with parentType.
3930 * expression.cs: Updated.
3932 2006-11-09 Raja R Harinath <rharinath@novell.com>
3934 * driver.cs (BadAssembly): Handle all the ugliness of
3935 DefineDynamicAssembly.
3937 2006-11-08 Raja R Harinath <rharinath@novell.com>
3939 Address parts of #58244 -- most of what's left is in the runtime
3940 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
3941 CS1509 error checks, and handle them for all assembly loads, not
3942 just the first invocation.
3943 (LoadModule): Likewise. Move handling of 'adder_method' ...
3944 * codegen.cs (AssemblyClass.AddModule): ... here.
3946 2006-11-02 Marek Safar <marek.safar@gmail.com>
3948 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
3949 IEnumerable<T> is ambiguous.
3951 2006-10-31 Marek Safar <marek.safar@gmail.com>
3953 A fix for bug #67689
3954 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
3955 GetEnumerator is ambiguous.
3957 * report.cs: Add new warning.
3959 2006-10-29 Marek Safar <marek.safar@gmail.com>
3961 A fix for bug #78602
3962 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3963 to protected member can be nested type.
3965 2006-10-28 Marek Safar <marek.safar@gmail.com>
3967 A fix for bug #78965
3968 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3969 to protected member must derive from current type.
3971 2006-10-27 Marek Safar <marek.safar@gmail.com>
3973 assign.cs: Reuses error method.
3975 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
3976 instead of type for constants.
3977 (Expression.Error_ValueAssignment): Common error method.
3979 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
3982 2006-10-27 Marek Safar <marek.safar@gmail.com>
3984 A fix for bug #79081
3985 * expression.cs (MemberAccess.DoResolve): Check nested type
3988 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
3990 * doc.cs : nested delegates were not handled. Fixed bug #79754.
3992 2006-10-26 Marek Safar <marek.safar@gmail.com>
3994 A fix for bug #76591
3995 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
3997 2006-10-26 Marek Safar <marek.safar@gmail.com>
3999 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
4000 type forwarder of the same type multiple times.
4002 2006-10-26 Raja R Harinath <rharinath@novell.com>
4005 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
4006 instance as an rvalue, even when we later resolve as an lvalue.
4008 2006-10-25 Martin Baulig <martin@ximian.com>
4010 * anonymous.cs: Fix #79673.
4012 2006-10-24 Marek Safar <marek.safar@seznam.cz>
4014 A fix for bug #79666
4015 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
4016 ignored when is optimized (= default value) as its value is already set.
4018 2006-10-23 Marek Safar <marek.safar@seznam.cz>
4020 A fix for bug #79724
4021 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
4022 TypeContainer for type lookup.
4024 2006-10-23 Marek Safar <marek.safar@seznam.cz>
4026 A fix for bug #79231
4027 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
4028 * expression.cs (OverloadResolve): Always convert type name for
4030 (ResolveNamespaceOrType): Don't confuse a nested type with any
4033 2006-10-18 Martin Baulig <martin@ximian.com>
4035 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
4037 2006-10-17 Miguel de Icaza <miguel@novell.com>
4039 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
4040 an int32, but requesting an int64 from the conversion
4042 2006-10-12 Martin Baulig <martin@ximian.com>
4045 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
4047 2006-10-12 Martin Baulig <martin@ximian.com>
4050 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
4052 2006-10-11 Miguel de Icaza <miguel@novell.com>
4054 * convert.cs: Remove broken code: I was doing the "Existance"
4055 tests for Implicit conversions.
4057 2006-10-10 Miguel de Icaza <miguel@novell.com>
4059 * convert.cs: Added one missing case in
4060 ImplicitStandardConversionExists uint64 to intptr.
4064 * typemanager.cs (uintptr_type): another core known type.
4066 * ecore.cs (OperatorCast): routine used to do cast operations that
4067 depend on op_Explicit. We could change some of the Decimal
4068 conversions to use this.
4070 This one has a probe mechanism that checks both types for an op_
4071 which it coudl be used to eliminate two classes: CastToDecimal
4072 and CastFromDecimal.
4074 * convert.cs: Implement the conversions documented in #59800
4076 2006-10-10 Martin Baulig <martin@ximian.com>
4078 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
4079 before RootScope.ResolveMembers().
4081 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
4082 `CurrentType' if appropriate.
4084 2006-10-09 Marek Safar <marek.safar@seznam.cz>
4086 A fix for bug #78568
4087 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
4088 when contains binary operators.
4089 * cs-parser.jay: Updated.
4091 2006-10-09 Martin Baulig <martin@ximian.com>
4094 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
4095 moved that into Define() and also do the other type parameter
4096 checks there. Fixes #79094. Added gtest-292.cs.
4099 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
4100 since that doesn't include type parameters; don't use `Ldelema'
4101 for type parameters. Fixes #78980. Added gtest-293.cs.
4103 2006-10-08 Marek Safar <marek.safar@seznam.cz>
4106 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
4107 conversion is allowed.
4109 2006-10-06 Marek Safar <marek.safar@seznam.cz>
4111 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
4112 error reporting when no error occurs.
4114 2006-10-06 Marek Safar <marek.safar@seznam.cz>
4116 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
4119 2006-10-06 Raja R Harinath <rharinath@novell.com>
4122 * class.cs (DefineTypeBuilder): Check circular dependencies before
4123 setting the parent of the TypeBuilder.
4124 (CheckRecursiveDefinition): Don't use 'BaseType', since
4125 it may not be valid until after DefineTypeBuilder. Use
4126 'base_type' instead.
4128 2006-10-04 Martin Baulig <martin@ximian.com>
4130 Merged the Anonymous Methods patch.
4132 * anonymous.cs, iterators.cs: The new anonymous methods code.
4134 * statement.cs (Variable): New public abstract class.
4135 (LocalInfo.Variable): New public property.
4136 (LocalInfo.ResolveVariable): New public method.
4137 (Block.Flags): Add `IsIterator'.
4138 (Block.AddVariable): Improved the CS0136 check.
4139 (Block.AnonymousChildren): New public property.
4140 (Block.AddAnonymousChild): New public method.
4141 (ToplevelBlock): Update to use the new anonymous method framework.
4142 (ToplevelBlock.ctor): `container' is now a `Block' and not a
4143 `ToplevelBlock'; this is required to correctly implement the
4145 (Fixed, Using): Use `TemporaryVariable' instead of directly
4146 creating the `LocalBuilder'.
4148 * parameter.cs (Parameter.ResolveVariable): New public method.
4149 (Parameters.ResolveVariable): Likewise.
4151 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
4153 * class.cs (TypeContainer): Replaced the `iterators' list and
4154 corresponding methods with a list of `CompilerGeneratedClass'es.
4155 (TypeContainer.ResolveMembers): New public method.
4156 (Method): `IIteratorContainer' has been replaced by
4159 * expression.cs (VariableReference): New public abstract base
4160 class for `LocalVariableReference', `ParameterReference' and
4163 * codegen.cs (EmitContext): Removed `capture_context',
4164 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
4165 (EmitContext.EmitThis): Removed.
4167 * cs-parser.jay: Replace `iterator_container' with
4170 2006-10-04 Martin Baulig <martin@ximian.com>
4172 * generic.cs (GenericMethod): Don't make this abstract.
4173 (Constraints.Clone): Added dummy implementation.
4175 2006-10-04 Raja R Harinath <harinath@gmail.com>
4178 * namespace.cs (LookForAnyGenericType): Avoid nullref on
4179 'declspaces'. Avoid allocating arrays willy-nilly.
4182 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
4183 cases out of the switch.
4185 2006-09-28 Marek Safar <marek.safar@seznam.cz>
4187 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
4188 message when non-generic type is used with the type arguments.
4189 * expression.cs: Updated.
4191 2006-09-28 Raja R Harinath <rharinath@novell.com>
4194 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
4195 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4196 Change semantics slightly. Don't insist on having only one
4197 temporary EmptyExpression -- just throttle the creation of new ones.
4200 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
4201 non-interfaces too. If no methods are found, don't try to create
4204 2006-09-28 Marek Safar <marek.safar@seznam.cz>
4206 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
4209 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
4210 us produce better error message.
4212 2006-09-27 Marek Safar <marek.safar@seznam.cz>
4214 * expression.cs (Binary.ResolveOperator): Warn about a side effect
4215 of the `|' operator.
4217 * report.cs: A new warning added.
4219 2006-09-27 Martin Baulig <martin@ximian.com>
4221 * generic.cs (GenericMethod): Don't make this abstract.
4223 2006-09-27 Martin Baulig <martin@ximian.com>
4226 (InternalErrorException): Added overloaded ctor taking a params array.
4228 2006-09-26 Marek Safar <marek.safar@seznam.cz>
4230 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
4231 Fixed the cases when same error was reported twice.
4233 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
4234 now report symbol information.
4236 2006-09-25 Martin Baulig <martin@ximian.com>
4238 * class.cs: Completely unified with the gmcs version.
4240 2006-09-25 Martin Baulig <martin@ximian.com>
4242 * typemanager.cs (TypeManager.IsNullableType): New public function.
4243 (TypeManager.IsNullableTypeOf): Likewise.
4244 (TypeManager.IsNullableValueType): Likewise.
4246 * class.cs (MethodCore): Added the `GenericMethod' argument from
4247 gmcs and also unified all classes derived from `MethodCore' with gmcs.
4249 2006-09-24 Raja R Harinath <harinath@gmail.com>
4251 * convert.cs: Unify with gmcs version.
4253 2006-09-24 Marek Safar <marek.safar@seznam.cz>
4255 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
4256 verify them as well.
4258 * report.cs: New warning.
4260 2006-09-24 Marek Safar <marek.safar@seznam.cz>
4262 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
4263 for anonymous block with out argument.
4265 2006-09-24 Marek Safar <marek.safar@seznam.cz>
4267 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
4268 not used private events only.
4270 2006-09-23 Marek Safar <marek.safar@seznam.cz>
4272 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
4274 * const.cs (Const.Define): Check for constant type.
4275 (Const.IsConstantTypeValid): Looks for valid constant types.
4277 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
4279 * ecore.cs (EmptyConstantCast): New common class for all constant based
4282 * expression.cs (Is.DoResolve): Handle null constant especially.
4283 (New.DoResolve): Check for new void().
4284 (MemberAccess.DoResolve): Cope with all kind of nulls.
4286 * literal.cs (NullConstant): Uses EmptyConstantCast.
4287 (NullDefault): Based on EmptyConstantCast.
4288 (NullLiteral): Uses EmptyConstantCast.
4290 * statement.cs (Block.ResolveMeta): Check for constant type.
4292 2006-09-22 Martin Baulig <martin@ximian.com>
4294 * delegate.cs, attribute.cs: Merged with the gmcs versions.
4296 2006-09-22 Raja R Harinath <rharinath@novell.com>
4298 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
4302 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
4303 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
4306 2006-09-22 Martin Baulig <martin@ximian.com>
4308 * ecore.cs: Merged with the gmcs version.
4310 * generic.cs (ConstructedType): New dummy class.
4311 (TypeArguments): Don't make this abstract.
4314 (TypeManager.IsGenericTypeDefinition): New method.
4315 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
4317 2006-09-22 Raja R Harinath <rharinath@novell.com>
4319 * expression.cs (ComposedCast): Check for arrays of TypedReference
4320 before creating the type, not after.
4322 2006-09-21 Marek Safar <marek.safar@seznam.cz>
4324 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
4325 after ToType change.
4327 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
4328 when constant must be implicitly convertible.
4330 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
4332 * ecore.cs (NullCast): Derives from NullConstant.
4334 * expression.cs (Is.DoResolve): Removed useless variables.
4335 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
4336 (New.Constantify): Add enum support.
4337 (MemberAccess.DoResolve): Add warning when accessing null constant or
4340 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
4343 * literal.cs (NullConstant): New abstract class with common
4344 functionality for all null specializations.
4345 (NullDefault): Represents default(X) when result can be
4347 (NullLiteral): Updated.
4349 * report.cs: Add new warning.
4351 2006-09-21 Martin Baulig <martin@ximian.com>
4353 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
4355 2006-09-21 Martin Baulig <martin@ximian.com>
4357 * generic.cs (GenericConstraints): New dummy class.
4358 (Constraints): Likewise.
4359 (TypeParameter): Likewise.
4360 (TypeParameterName): Likewise.
4361 (GenericMethod): Likewise.
4363 * typemanager.cs (TypeManager.GetGenericArguments): New method.
4365 * decl.cs: Merged with the gmcs version.
4367 2006-09-21 Raja R Harinath <rharinath@novell.com>
4369 * generic.cs (TypeParameter): Implement IMemberContainer.
4370 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
4372 * rootcontext.cs: Unify with gmcs version.
4374 * report.cs: Unify with gmcs version.
4375 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
4376 from gmcs/generics.cs.
4377 * generics.cs (TypeParameter): New dummy class.
4379 * support.cs: Unify with gmcs version.
4381 2006-09-20 Raja R Harinath <rharinath@novell.com>
4383 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
4384 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
4386 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
4387 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
4388 * mcs.exe.sources: Add generic.cs.
4390 * codegen.cs: Unify with gmcs version.
4392 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
4393 (EmitContext): Add GenericDeclContainer implementation.
4394 * decl.cs (MemberCore, DeclSpace): Likewise.
4395 * namespace.cs: Remove #ifdef GMCS_SOURCE.
4397 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
4398 MCS TypeManager has a corresponding dummy method.
4400 2006-09-19 Martin Baulig <martin@ximian.com>
4402 * expression.cs: Completely merged with the gmcs version.
4404 2006-09-19 Martin Baulig <martin@ximian.com>
4406 * expression.cs (Invocation): Merged with the gmcs version.
4407 (ArrayAccess.GetStoreOpcode): Likewise.
4409 2006-09-19 Martin Baulig <martin@ximian.com>
4412 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
4413 (TypeManager.IsGenericMethodDefinition): Likewise.
4415 2006-09-19 Martin Baulig <martin@ximian.com>
4418 (TypeManager.IsEqual): Moved the gmcs implementation here.
4419 (TypeManager.DropGenericTypeArguments): Likewise.
4420 (TypeManager.DropGenericMethodArguments): Likewise.
4421 (TypeManager.GetTypeArguments): Moved here from gmcs.
4422 (TypeManager.HasGenericArguments): Likewise.
4424 2006-09-19 Martin Baulig <martin@ximian.com>
4426 * expression.cs (Binary): Merged with the gmcs version.
4428 2006-09-19 Martin Baulig <martin@ximian.com>
4430 * expression.cs (Probe, As, Is): Merged with the gmcs version.
4432 2006-09-19 Martin Baulig <martin@ximian.com>
4434 * typemanager.cs: Merged with the gmcs version.
4436 2006-09-16 Raja R Harinath <rharinath@novell.com>
4438 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
4439 * driver.cs: Likewise.
4441 2006-09-16 Marek Safar <marek.safar@seznam.cz>
4444 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
4445 only if parent type is class.
4446 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
4449 2006-09-15 Marek Safar <marek.safar@seznam.cz>
4452 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
4454 * typemanager.cs(CSharpName): Converts NullType to null.
4456 2006-09-15 Martin Baulig <martin@ximian.com>
4459 (TypeManager.GetMethodName): Added mcs implementation.
4460 (TypeManager.IsEqual): Likewise.
4463 (SimpleName.RemoveGenericArity): Added dummy implementation.
4465 * pending.cs: Merged with the gmcs version.
4467 2006-09-15 Martin Baulig <martin@ximian.com>
4469 * statement.cs: Merge with the gmcs version.
4471 2006-09-15 Martin Baulig <martin@ximian.com>
4473 * statement.cs (Switch): Merge with the gmcs implementation
4474 (without nullables), which is newer.
4476 2006-09-15 Martin Baulig <martin@ximian.com>
4478 * statement.cs (Block.Variables): Make this public.
4479 (ToplevelBlock.Parameters): Make this a property.
4480 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
4482 2006-09-15 Martin Baulig <martin@ximian.com>
4484 * namespace.cs: Merge with the gmcs version.
4486 2006-09-15 Martin Baulig <martin@ximian.com>
4488 * decl.cs (MemberName): Minor code cleanups.
4490 2006-09-15 Martin Baulig <martin@ximian.com>
4492 * parameter.cs: Merge with the gmcs version.
4494 2006-09-15 Martin Baulig <martin@ximian.com>
4496 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
4497 and an error in mcs.
4499 2006-09-15 Martin Baulig <martin@ximian.com>
4501 * flowanalysis.cs: Merged from GMCS; added the generics code into
4502 a `GMCS_SOURCE' conditional so we can share this file.
4504 2006-09-08 Martin Baulig <martin@ximian.com>
4506 * typemanager.cs (TypeManager.interlocked_type): New public field.
4507 (TypeManager.int_interlocked_compare-exchange): New public field.
4508 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
4509 enumerator types here and call InitGenericCoreTypes().
4510 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
4511 after calling InitEnumUnderlyingTypes().
4514 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
4515 `classes_second_stage'.
4517 2006-09-14 Marek Safar <marek.safar@seznam.cz>
4519 * assign.cs, ecore.cs, expression.cs: Share error message text.
4520 * class.cs (FieldMember.Define): Check for varible of static type.
4521 * driver.cs (LoadAssembly): Uses error output for errors.
4522 * statement.cs: Updated.
4524 2006-09-08 Marek Safar <marek.safar@seznam.cz>
4526 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
4529 2006-09-07 Martin Baulig <martin@ximian.com>
4532 (MainDriver): Revert r62663 from Marek; see #70506 for details.
4534 2006-08-29 Miguel de Icaza <miguel@novell.com>
4536 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
4538 2006-08-17 Miguel de Icaza <miguel@novell.com>
4540 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
4541 #52019 and #79064, the use of the \uXXXX sequence in source code
4542 to represent unicode characters.
4544 2006-08-15 Marek Safar <marek.safar@seznam.cz>
4546 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
4548 * class.cs, ecore.cs, statement.cs: Merged to one error message.
4550 2006-08-13 Miguel de Icaza <miguel@novell.com>
4552 * assign.cs: Catch attempts to assign to a method groups in += and
4555 2006-08-13 Marek Safar <marek.safar@seznam.cz>
4558 * cs-parser.jay: Don't destroy current array type by typeof of array's.
4560 2006-08-12 Marek Safar <marek.safar@seznam.cz>
4562 * class.cs (Method.Define): Issue a warning when generic method looks like
4564 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
4567 2006-08-09 Marek Safar <marek.safar@seznam.cz>
4569 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
4571 * decl.cs (MemberCache.FindMembers): When container is interface we need to
4572 search all base interfaces as a member can be ambiguous.
4573 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
4574 Constructor member type filter.
4575 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
4576 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
4577 reporting for returned memberinfos.
4578 * report.cs: Updated.
4579 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
4580 version to work on all runtimes.
4581 (TypeManager.RealMemberLookup): Removed members filtering.
4583 2006-08-08 Raja R Harinath <rharinath@novell.com>
4585 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
4586 (PropertyExpr.EmitAssign): Likewise.
4587 * expression.cs (Indirection.EmitAssign): Likewise.
4588 (LocalVariableReference.EmitAssign): Likewise.
4589 (ParameterReference.EmitAssign): Likewise.
4590 (Invocation.EmitArguments): Likewise.
4591 (ArrayAccess.EmitAssign): Likewise.
4592 (IndexerAccess.EmitAssign): Likewise.
4593 (This.EmitAssign): Likewise.
4594 (ConditionalLogicalOperator.Emit): Likewise.
4597 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
4598 instead of ArrayList. If the hashtable has a LocalBuilder, don't
4599 leave it in after returning it.
4600 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
4602 2006-08-06 Marek Safar <marek.safar@seznam.cz>
4604 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
4607 2006-08-03 Raja R Harinath <rharinath@novell.com>
4609 Fix cs0146-3.cs and cs0146-4.cs.
4610 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
4611 enclosing types don't depend on the current type.
4613 2006-08-02 Raja R Harinath <rharinath@novell.com>
4616 * class.cs (TypeContainer.DoDefineMembers): Use
4617 FindBaseMemberWithSameName on Parent, since we're interested in
4618 whether we hide inherited members or not.
4619 (FindBaseMemberWithSameName): Make slightly more robust.
4621 Fix the non-generic testcase from #77396
4622 * decl.cs (DeclSpace.DeclContainer): Remove override.
4624 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
4625 declspaces for doppelgangers too.
4626 (UsingEntry): Implement IResolveContext.
4627 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
4628 'this' as the resolve context.
4629 (LocalAliasEntry): Likewise.
4631 Implement parts of #77403
4632 * roottypes.cs (RootDeclSpace): New. Used to represent the
4633 toplevel declaration space. Each namespace declaration introduces
4634 a "partial" root declaretion space.
4635 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
4636 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
4637 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
4638 from 'current_namespace.SlaveDeclSpace'.
4639 (namespace_declaration): Likewise.
4640 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
4641 check. It can't happen now.
4642 * decl.cs (DeclSpace.LookupType): Likewise.
4643 * driver.cs (MainDriver): Sanity check.
4645 2006-08-01 Raja R Harinath <rharinath@novell.com>
4647 * decl.cs (DeclSpace.FindNestedType): Remove.
4648 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
4649 LookupTypeContainer to get the container of the nested type.
4650 * class.cs (TypeContainer.FindNestedType): Make non-override.
4652 2006-07-31 Raja R Harinath <rharinath@novell.com>
4654 * decl.cs (DeclSpace.PartialContainer): Move field from ...
4655 * class.cs (TypeContainer.PartialContainer): ... here.
4656 (TypeContainer.AddBasesForPart): New helper.
4657 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
4659 * cs-parser.jay (current_class): Convert to DeclSpace.
4660 (struct_declaration, interface_declaration, class_declaration):
4661 Use AddBasesForPart instead of .Bases directly.
4662 * const.cs, iterators.cs: Update to changes.
4664 2006-07-28 Raja R Harinath <rharinath@novell.com>
4666 * class.cs (TypeContainer.AddMemberType): Rename from
4668 (TypeContainer.AddMember): Rename from AddToMemberContainer.
4669 (AddTypeContainer): New. Combine AddClassOrStruct and
4671 (AddPartial): Update. Add 'is_partial' argument.
4672 * roottypes.cs: Update to changes.
4673 * cs-parser.jay (push_current_class): New helper for handling
4674 current_container and current_class.
4675 (struct_declaration, interface_declaration, class_declaration):
4678 2006-07-26 Raja R Harinath <rharinath@novell.com>
4680 * roottypes.cs: Rename from tree.cs.
4682 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
4683 * tree.cs (Tree, ITreeDump): Remove types.
4684 * rootcontext.cs (tree, Tree): Remove fields.
4685 (root, ToplevelTypes): New.
4686 * *.cs: Update to rename.
4688 * tree.cs (Tree.RecordDecl): Remove.
4689 (RootTypes.AddToTypeContainer): Record the toplevel type in its
4691 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
4693 2006-07-23 Raja R Harinath <harinath@gmail.com>
4695 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
4696 DoFlowAnalysis and OmitStructFlowAnalysis here.
4697 (ec.With): Rename from WithUnsafe and generalize.
4698 (ec.WithCheckState): Remove. All users can be handled by 'With'.
4699 (ec.WithFlowAnalyis): New.
4700 * ecore.cs, expression.cs, statement.cs: Update.
4702 2006-07-22 Raja R Harinath <harinath@gmail.com>
4704 * statement.cs (Block.ResolveMeta): Simplify slightly.
4706 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
4707 multiple boolean fields. Convert InUnsafe, constant_check_state,
4708 check_state to flags.
4709 (CheckState, ConstantCheckState): Update.
4710 (InUnsafe): New read-only property.
4711 (FlagsHandle): Rename from CheckStateHandle and convert to handle
4713 (WithUnsafe): New helper similar to WithCheckState.
4714 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
4715 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
4717 2006-07-21 Raja R Harinath <rharinath@novell.com>
4719 Make comparisons use the same IL irrespective of whether they're
4720 in a 'checked' or 'unchecked' context: one of the issues in #78899
4721 * codegen.cs (EmitContext.CheckState): Make read-only property.
4722 (EmitContext.ConstantCheckState): Likewise.
4723 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
4724 helper that implement a save/restore stack for CheckState
4725 values. This is the only way to change check-state.
4726 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
4727 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
4728 (CheckedExpr.EmitBranchable): New forwarding method.
4729 (UnCheckedExpr): Likewise.
4730 * statement.cs (Block.ResolveMeta): Use WithCheckState.
4731 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
4732 (Checked.Resolve, checked.DoEmit): Likewise.
4734 2006-07-20 Miguel de Icaza <miguel@novell.com>
4736 * anonymous.cs: Cache the resolved anonymous delegate, and return
4737 this so that the ResolveTopBlock is only triggered once, not
4740 Currently we trigger ResolvetopBlock twice due to a first pass of
4741 argument check compatibility, and a second pass that does the
4744 2006-07-15 Marek Safar <marek.safar@seznam.cz>
4746 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
4748 * rootcontext.cs (Reset): Add helper_classes.
4750 2006-07-15 Marek Safar <marek.safar@seznam.cz>
4753 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
4756 2006-07-13 Miguel de Icaza <miguel@novell.com>
4758 * statement.cs (Lock): Handle expressions of type
4759 TypeManager.null_type specially. Fixes #78770
4761 2006-07-08 Marek Safar <marek.safar@seznam.cz>
4763 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
4766 2006-07-08 Marek Safar <marek.safar@seznam.cz>
4768 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
4769 for accessors as well.
4770 * ecore.cs (EventExpr): Add AccessorTable.
4772 2006-07-01 Marek Safar <marek.safar@seznam.cz>
4775 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
4776 for CS0122 where appropriate.
4777 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
4779 (Filter): Assembly can be null in the case of top level attributes.
4781 2006-06-25 Marek Safar <marek.safar@seznam.cz>
4785 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
4786 is done at global level.
4788 2006-06-24 Marek Safar <marek.safar@seznam.cz>
4790 A fix for #77002, Implemented TypeForwarder support.
4792 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
4793 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
4794 * typemanager.cs (): Add type_forwarder_attr_type.
4796 2006-06-24 Marek Safar <marek.safar@seznam.cz>
4798 * report.cs: Add CS0469 warning.
4800 2006-06-21 Martin Baulig <martin@ximian.com>
4802 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
4803 the `try'-block, so we also report CS0016 etc. there.
4805 2006-06-21 Martin Baulig <martin@ximian.com>
4808 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
4810 2006-06-21 Martin Baulig <martin@ximian.com>
4812 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
4813 also report CS1686 for parameters.
4815 2006-06-21 Martin Baulig <martin@ximian.com>
4817 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
4818 instead of an error if the value is not implicitly convertible to
4819 the switch types; fixes #77964.
4821 2006-06-21 Raja R Harinath <rharinath@novell.com>
4824 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
4825 FieldBuilder is null.
4828 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
4829 'left' and 'right' before error-checking.
4831 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
4833 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
4835 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
4836 (FieldExpr.DoResolve): likewise.
4837 (PropertyExpr.InstanceResolve): likewise.
4838 (EventExpr.InstanceResolve): likewise.
4840 2006-06-04 Marek Safar <marek.safar@seznam.cz>
4842 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
4843 attribute applicable tests for attribute argument.
4845 2006-06-02 Raja R Harinath <rharinath@novell.com>
4848 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
4849 (Binary.OverloadResolve_PredefinedIntegral): New.
4850 (Binary.OverloadResolve_PredefinedFloating): New.
4851 (Binary.OverloadResolve_PredefinedString): New.
4852 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
4853 Follow the standard more closely, and treat numeric promotions in
4854 terms of overload resolution.
4855 (Binary.CheckShiftArguments): Simplify.
4857 2006-06-01 Raja R Harinath <rharinath@novell.com>
4859 * flowanalysis.cs (MyBitVector): Simplify representation.
4860 (MyBitVector.Clone): Avoid allocating BitArray.
4861 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
4862 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
4863 (*): Update. Change all references to MyBitVector.And and
4864 MyBitVector.Or to &= and |=.
4866 2006-05-29 Raja R Harinath <rharinath@novell.com>
4869 * cs-parser.jay (formal_parameter_list): Extend the pattern below
4870 to param arguments too.
4872 2006-05-26 Miguel de Icaza <miguel@novell.com>
4874 * cs-parser.jay: Catch another parsing form for arglist being
4875 followed by other arguments. Fixes #78313.
4877 2006-05-24 Raja R Harinath <rharinath@novell.com>
4879 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
4880 checking of out parameters to ...
4881 (FlowBranchingToplevel.Merge): ... here.
4882 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
4883 set, propagate the origin upward, and only complain if there was
4885 (FlowBranchingException.AddContinueOrigin): Likewise.
4886 (FlowBranchingException.AddReturnOrigin): Likewise.
4887 (FlowBranchingException.AddGotoOrigin): Likewise.
4889 2006-05-23 Raja R Harinath <rharinath@novell.com>
4891 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
4892 unreachable, skip it.
4893 (FlowBranchingException.Merge): Always propagate jumps, even if
4894 the finally block renders subsequent code unreachable.
4896 2006-05-18 Raja R Harinath <rharinath@novell.com>
4899 * statement.cs (Goto.Resolve): Move responsibility for resolving
4900 'goto' to FlowBranching.AddGotoOrigin.
4901 (Goto.SetResolvedTarget): New. Callback to set the
4902 LabeledStatement that's the target of the goto.
4903 (Goto.DoEmit): Use Leave instead of Br when crossing an
4904 unwind-protect boundary.
4905 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
4906 LookupLabel and adjust to new semantics.
4907 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
4908 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
4909 Goto.SetResolvedTarget to update target.
4910 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
4911 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
4912 AddBreakOrigin & co. Delay propagation until ...
4913 (FlowBranchingException.Merge): ... this.
4915 * statement.cs (Block.Resolve): Always depend on flow-branching to
4916 determine unreachability. Kill workaround that originally emitted
4917 only one statement after an "unreachable" label (see infloop in
4920 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
4921 This is still "wrong", but anything better would probably need a
4922 multi-pass algorithm.
4923 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
4924 usage vector. Force current usage vector to be reachable, to
4925 optimistically signify backward jumps.
4926 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
4928 (FlowBranchingLabeled.Merge): New. If no backward jump was
4929 detected, return the original salted-away usage vector instead,
4930 updated with appropriate changes. Print unreachable warning if
4932 * statement.cs (Block.Resolve): Don't print unreachable warning on
4933 a labeled statement.
4935 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
4937 * driver.cs: Pass filename without path to AssemblyBuilder's
4938 AddResourceFile. Fixes bug #78407.
4940 2006-05-17 Raja R Harinath <rharinath@novell.com>
4942 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
4943 * flowanalysis.cs (FlowBranchingLabeled): ... here.
4944 (FlowBranching.MergeChild): Overwrite
4945 reachability information from Labeled branchings too.
4947 2006-05-16 Raja R Harinath <rharinath@novell.com>
4949 * statement.cs (Goto.Resolve): Merge jump origins here ...
4950 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
4952 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
4953 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
4954 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
4955 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
4957 * statement.cs (Goto.Resolve): ... not here.
4958 (Goto.Emit): Remove CS1632 check.
4960 2006-05-14 Marek Safar <marek.safar@seznam.cz>
4962 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
4965 2006-05-11 Raja R Harinath <rharinath@novell.com>
4967 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
4968 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
4969 (FlowBranchingException.Label): Likewise.
4971 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
4973 (MyBitVector.Or): Use it to avoid losing information (Count).
4974 (FlowBranching.MergeOrigins): Likewise.
4976 * flowanalysis.cs (UsageVector.IsDirty): Remove.
4977 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
4978 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
4979 (UsageVector.ToString): Simplify.
4980 (UsageVector.MergeSiblings): Move here from ...
4981 (FlowBranching.Merge): ... here.
4982 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
4985 2006-05-10 Raja R Harinath <rharinath@novell.com>
4987 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
4988 null bitvector is treated as all-true.
4990 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
4991 (MyBitVector): Rationalize invariants. 'vector != null' implies
4992 that we have our own copy of the bitvector. Otherwise,
4993 'InheritsFrom == null' implies all inherited bits are true.
4995 2006-05-09 Marek Safar <marek.safar@seznam.cz>
4997 * statement.cs (LocalInfo): Add IsConstant.
4998 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
4999 local variable for constants.
5001 2006-05-09 Raja R Harinath <rharinath@novell.com>
5003 * flowanalysis.cs (MyBitVector.Empty): New.
5004 (MyBitVector): Don't allow InheritedFrom to be null.
5005 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
5006 (UsageVector, FlowBranching): Update to changes.
5008 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
5009 recursion. The 'Parent == null' condition isn't sufficient for
5011 (FlowBranching.AddBreakOrigin): Likewise.
5012 (FlowBranching.AddContinueOrigin): Likewise.
5013 (FlowBranching.AddReturnOrigin): Likewise.
5014 (FlowBranching.StealFinallyClauses): Likewise.
5015 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
5016 (FlowBranching.CheckOutParameters): Likewise.
5017 (FlowBranchingToplevel): Terminate all the above recursions here.
5018 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
5019 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
5021 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
5023 (FlowBranchingToplevel): New. Empty for now.
5024 (FlowBranching.MergeTopBlock): Update.
5025 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
5026 branching for the anonymous delegate.
5027 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
5029 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
5030 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
5031 information at the start of the merge. Reorganize.
5033 2006-05-07 Marek Safar <marek.safar@seznam.cz>
5035 * class.cs (MethodData.Define): Method cannot implement interface accessor.
5037 2006-05-07 Marek Safar <marek.safar@seznam.cz>
5039 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
5040 to newly introduced ctor.
5042 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
5043 message to one place.
5044 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
5047 2006-05-07 Marek Safar <marek.safar@seznam.cz>
5049 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
5051 * ecore.cs (Expression.ResolveAsConstant): Updated.
5053 * statement.cs (ResolveMeta): Updated.
5055 2006-05-06 Marek Safar <marek.safar@seznam.cz>
5057 * cs-parser.jay: __arglist cannot be used in initializer.
5059 2006-05-06 Marek Safar <marek.safar@seznam.cz>
5062 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
5065 2006-05-05 Raja R Harinath <rharinath@novell.com>
5067 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
5068 (LabeledStatement): Add 'name' parameter.
5069 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
5070 (Block.AddLabel): Update to changes.
5071 * cs-parser.jay (labeled_statement): Likewise.
5073 * flowanalysis.cs (BranchingType.Labeled): New.
5074 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
5075 (FlowBranchingLabeled): New. Does nothing for now, but will
5076 eventually handle 'goto' flows.
5077 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
5078 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
5079 that's terminated ...
5080 (Block.Resolve): ... here.
5082 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
5083 (UsageVector.MergeFinallyOrigins): Likewise.
5084 (FlowBranching.InTryOrCatch): Likewise.
5085 (FlowBranching.AddFinallyVector): Likewise.
5086 (FlowBranchingException): Update to changes.
5089 * statement.cs (Return.Resolve): Move error checking to ...
5090 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
5091 (FlowBranchingException): Handle return origins like break and
5093 (FlowBranching.UsageVector.CheckOutParameters): Remove.
5095 2006-05-04 Marek Safar <marek.safar@seznam.cz>
5098 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
5101 2006-05-04 Marek Safar <marek.safar@seznam.cz>
5104 * class.cs (MethodData.Define): Do public accessor check only when method
5105 implements an interface.
5107 2006-05-04 Raja R Harinath <rharinath@novell.com>
5109 Remove special handling of 'break'
5110 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
5111 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
5112 (UsageVector.Break): Remove.
5113 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
5115 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
5117 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
5118 UsageVector.Breaks (). Don't set NeedsReturnLabel.
5120 2006-05-03 Marek Safar <marek.safar@seznam.cz>
5123 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
5124 be the interface member.
5126 2006-05-03 Marek Safar <marek.safar@seznam.cz>
5129 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
5130 for emitting small (int) values.
5132 2006-05-03 Raja R Harinath <rharinath@novell.com>
5135 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
5136 control-flow passes through the 'finally' after merging-in all the
5137 control-flows from 'try' and the 'catch' clauses.
5139 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
5140 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
5141 always true at the only non-recursive entry point.
5142 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
5143 FlowBranchingBreakable.
5144 (FlowBranchingLoop): Remove.
5145 * statement.cs (Return.DoResolve): Update to changes.
5148 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
5149 (FlowBranching.CreateBranching): Handle it: create a
5150 FlowBranchingContinuable.
5151 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
5152 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
5153 except that it handles the 'continue' command.
5154 (FlowBranching.UsageVector.MergeOrigins): Rename from
5156 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
5157 except that it overrides AddContinueOrigin.
5158 (FlowBranchingException): Override AddContinueOrigin, similar to
5160 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
5161 Create a new branching around the embedded statement.
5162 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
5163 control flow after the embedded statement.
5164 (Continue.Resolve): Move all error checking to AddContinueOrigin.
5166 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
5167 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
5168 FlowBranchingBreakable.
5169 (FlowBranchingSwitch): Remove.
5172 * statement.cs (Break.Resolve): Simplify. Move responsibility for
5173 error reporting to ...
5174 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
5175 Rename from 'AddBreakVector'. Add new location argument. Return
5176 a bool indicating whether the 'break' crosses an unwind-protect.
5177 (FlowBranchingException.AddBreakOrigin): Add.
5178 (FlowBranchingException.Merge): Propagate 'break's to surrounding
5179 flowbranching after updating with the effects of the 'finally'
5181 (FlowBranchingBreakable): New common base class for
5182 FlowBranchingLoop and FlowBranchingSwitch.
5184 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
5186 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
5188 2006-05-02 Raja R Harinath <rharinath@novell.com>
5190 * statement.cs (Do.Resolve): If the loop is infinite, set the
5192 (While.Resolve, For.Resolve): Set a barrier after the embedded
5193 statement. There's no direct control flow that goes from the end
5194 of the embedded statement to the end of the loop.
5195 * flowanalysis.cs (FlowBranching.Infinite): Remove.
5196 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
5197 above ensure that the reachability is correctly computed.
5199 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
5200 (UsageVector.MergeBreakOrigins): If the current path is
5201 unreachable, treat it as if all parameters/locals are initialized.
5202 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
5203 infinite loops before merging-in break origins.
5205 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
5206 (Reachability.Reachable): Split part into ...
5207 (Reachability.Unreachable): ... this. Simplify.
5208 (Reachability.IsUnreachable): Use 'Unreachable' instead.
5210 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
5211 (Reachability.SetThrowsSometimes): Likewise.
5212 (FlowBranchingBlock.MergeTopBlock): Don't compare against
5213 TriState.Always, use corresponding property.
5214 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
5215 (Block.Resolve): Likewise. Remove some redundant checks.
5217 2006-05-02 Raja R Harinath <harinath@gmail.com>
5219 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
5220 (Reachability.Meet): Don't bother checking AlwaysThrows --
5221 barrier is always set.
5222 (FlowBranchingBlock.Merge): Likewise.
5224 2006-05-01 Raja R Harinath <harinath@gmail.com>
5226 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
5227 checks for unreachable.
5229 2006-05-01 Marek Safar <marek.safar@seznam.cz>
5232 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
5234 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
5235 whether field is really assigned.
5237 2006-04-30 Raja R Harinath <harinath@gmail.com>
5239 * flowanalysis.cs (Reachability): Make 4-argument constructor
5241 (Reachability.Meet): Rename from 'And'. Remove static variant.
5242 (Reachability.Always): Rename from the highly misleading
5243 'Reachability.Never'.
5244 (FlowBranching.Merge): Update to changes. Mark an impossible
5245 situation with a 'throw'.
5246 (*): Update to changes.
5248 2006-04-29 Raja R Harinath <harinath@gmail.com>
5250 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
5252 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
5253 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
5254 (*): Update to changes.
5255 * statement.cs: Update to changes.
5257 2006-04-28 Marek Safar <marek.safar@seznam.cz>
5260 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
5262 2006-04-28 Raja R Harinath <harinath@gmail.com>
5264 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
5267 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
5268 argument to two arguments: an usage-vector and a bool. Move call
5269 to FlowBranching.Merge () ...
5270 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
5272 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
5273 handling of loop and switch reachability to ...
5274 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
5276 2006-04-27 Raja R Harinath <harinath@gmail.com>
5278 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
5279 handling to FlowBranchingLoop.InLoop.
5280 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
5282 2006-04-26 Marek Safar <marek.safar@seznam.cz>
5285 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
5286 anonymous method is allowed from AnonymousContainer here.
5288 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
5290 2006-04-24 Raja R Harinath <rharinath@novell.com>
5293 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
5295 2006-04-23 Marek Safar <marek.safar@seznam.cz>
5298 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
5299 (DoubleConstant.Reduce): Ditto.
5301 2006-04-23 Raja R Harinath <rharinath@novell.com>
5303 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
5304 Remove 'lvalue_right_side' argument. Move parts to ...
5305 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
5306 (LocalVariable.DoResolveLValue): ... these.
5308 2006-04-21 Raja R Harinath <rharinath@novell.com>
5311 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
5312 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
5313 (LocalVariableReference.DoResolveBase): Use it to implement new
5315 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
5316 (Argument.Resolve): Simplify. Move CS1510 check ...
5317 * ecore.cs (Expression.ResolveLValue): ... here.
5318 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
5319 (PropertyExpr.DoResolveLValue): Likewise.
5320 (FieldExpr.Report_AssignToReadonly): Likewise.
5321 (FieldExpr.DoResolve): Add 'out_access' argument. Use
5322 LValueMemberAccess or LValueMemberOutAccess on instance depending
5324 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
5325 DoResolve as appropriate.
5327 2006-04-20 Raja R Harinath <rharinath@novell.com>
5330 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
5331 implicit conversions on 'out' and 'ref' arguments.
5333 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
5334 improve clarity. Remove dead code.
5337 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
5338 (Catch.Resolve): Resolve VarBlock if it exists.
5340 2006-04-19 Miguel de Icaza <miguel@novell.com>
5342 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
5343 twice, this was some residual code, the enumerator was emitted
5344 properly in the two branche of if later.
5346 2006-04-19 Raja R Harinath <rharinath@novell.com>
5348 * expression.cs (Cast.ResolveLValue): Remove. The result of a
5349 cast is never an lvalue.
5350 (Cast.DoResolve, Cast.ResolveRest): Combine.
5351 (Argument.Emit): Simplify slightly. Move 'Expr is
5352 IMemoryLocation' check ...
5353 (Argument.Resolve): ... here.
5354 (Argument.Error_LValueRequired): Remove. Inline into only user.
5356 Simplifications. Fix cs0191-2.cs
5357 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
5358 CS1649 and CS1651 to ...
5359 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
5360 the actual selection of the error code and message to a lookup
5361 table. Add a dummy return value to simplify callsites.
5362 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
5363 readonly fields of other instances of the same type. Move CS0197
5365 * expression.cs (Argument.Resolve): ... here. Simplify code.
5366 Ensure that ec.InRefOutArgumentResolving is only set during LValue
5367 resolution of an out or ref argument. The code simplification
5368 above uses this invariant.
5370 2006-04-18 Raja R Harinath <rharinath@novell.com>
5372 Possibly fix #77752. Fix cs1690-[4-7].cs.
5373 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
5374 CheckMarshallByRefAccess. Drop parameter.
5375 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
5377 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
5379 * report.cs (AllWarnings): Add CS1690.
5380 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
5382 (LocalVariableReference.DoResolveBase): Update.
5384 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5386 * class.cs (MethodOrOperator): Moved common parts from method class.
5387 detect obsolete attributes.
5388 (Method.Define): Simplified as it reuses code from base.
5389 (Constructor.ValidAttributeTargets): Fixed issue found during
5391 (Destructor.ValidAttributeTargets): Fixed issue found during
5393 (Operator): Finished refactoring set off by #78020. Operator class is now
5394 ordinary method class.
5396 * anonymous.cs: Updated.
5398 * decl.cs (DeclSpace): Add IsGeneric
5400 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5402 * class.cs (Constructor.Emit): Don't emit the attributes twice.
5404 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5406 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
5407 detect obsolete attributes.
5408 (Method.CreateEmitContext): Moved to MethodOrOperator.
5410 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5413 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
5414 customized exception to make crash detection easier.
5415 (MethodOrOperator): Started to work on new base class for methods and
5417 (Method): Derives from MethodOrOperator.
5418 (Constructor.Emit): Emits its own attributes.
5419 (AbstractPropertyEventMethod.Emit): Ditto.
5420 (Operator): Derives from MethodOrOperator, will refactor fully in extra
5422 (Operator.Emit): It's temporary more tricky than should be.
5424 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
5426 * report.cs (InternalErrorException): Add ctor with inner exception.
5428 2006-04-08 Marek Safar <marek.safar@seznam.cz>
5431 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
5434 2006-04-07 Marek Safar <marek.safar@seznam.cz>
5437 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
5440 2006-04-06 Marek Safar <marek.safar@seznam.cz>
5442 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
5443 attribute is present and Guid not.
5444 (Interface.ApplyAttributeBuilder): Ditto.
5446 * attribute.cs: Add error message.
5448 2006-04-06 Marek Safar <marek.safar@seznam.cz>
5452 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
5453 sources (it's composite) so hold them in extra array as they are used in
5454 Emit phase only. It worked in the previous versions by mistake.
5455 (Attribute.Emit): Emit attribute for more owners when exist.
5457 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
5458 it has now different behaviour.
5460 2006-04-04 Marek Safar <marek.safar@seznam.cz>
5462 * constant.cs (Constant.IsDefaultInitializer): New method.
5464 * class.cs: Updated.
5466 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
5467 re-initialize default values. It saves KBs almost for every assembly.
5468 Thanks Zoltan for the idea.
5469 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
5470 (ArrayCreation.DoResolve): Resolve only once.
5471 (ArrayCreation.Emit): Emit static initializer only when it is faster.
5472 (ArrayCreation.GetAttributableValue): Cope with optimized values.
5474 2006-04-03 Zoltan Varga <vargaz@gmail.com>
5476 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
5479 2006-04-01 Marek Safar <marek.safar@seznam.cz>
5481 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
5482 in an embedded statement too.
5484 2006-04-01 Raja R Harinath <rharinath@novell.com>
5487 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
5489 2006-04-01 Marek Safar <marek.safar@seznam.cz>
5493 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
5496 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
5498 2006-03-31 Marek Safar <marek.safar@seznam.cz>
5500 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
5503 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
5504 LocalTemporary change.
5506 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
5508 (ClassOrStruct.DefineFieldInitializers): Implemented static field
5509 initializers optimization.
5510 (ClassOrStruct.TypeAttr): Moved from modifiers.
5511 (Constructor.CheckBase): Don't crash when static ctor has parameters.
5512 (FieldBase.ResolveInitializer): Resolves initializer.
5513 (FieldBase.HasDefaultInitializer): New property.
5515 * cs-parser.jay: Removed message.
5517 * expression.cs (CompilerGeneratedThis): New specialization.
5519 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
5521 2006-03-28 Marek Safar <marek.safar@seznam.cz>
5523 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
5525 2006-03-27 Marek Safar <marek.safar@seznam.cz>
5527 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
5528 be now EnumConstants only.
5530 2006-03-27 Marek Safar <marek.safar@seznam.cz>
5532 * attribute.cs, driver.cs: Reset more caches.
5534 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5536 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
5538 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5540 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
5541 for easier reuse. Updated all overrides.
5542 (IntegralConstant): New base class for all integral constants.
5543 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
5544 of the constant range, report custom error.
5545 (UIntConstant.Reduce): Fixed uint conversion.
5547 * ecore.cs, literal.cs: Reduce updates.
5549 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5553 * class.cs (Constructor.Define): Removed extra if for default ctors.
5554 A patch from Atsushi Enomoto.
5556 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5558 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
5559 GetAttributableValue.
5561 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
5564 * convert.cs (ImplicitConversionRequired): Error message moved to
5567 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
5568 automatic implicit conversion of an output value.
5569 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
5571 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
5573 (TypeOf.GetAttributableValue): Add extra handling for object type.
5575 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
5576 special error message.
5578 2006-03-25 Marek Safar <marek.safar@seznam.cz>
5580 * class.cs (Constructor.Emit): Don't crash when struct ctor is
5582 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
5583 compatible with MS runtime.
5585 2006-03-23 Marek Safar <marek.safar@seznam.cz>
5587 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
5588 attribute arguments here.
5590 * class.cs (Indexer.Define): The check was moved to attribute class.
5592 2006-03-22 Marek Safar <marek.safar@seznam.cz>
5594 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
5595 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
5598 2006-03-22 Raja R Harinath <rharinath@novell.com>
5600 Support ParameterDefaultValueAttribute in gmcs. Also applied to
5601 mcs to keep code differences small.
5602 * attribute.cs (Attribute.GetParameterDefaultValue): New.
5603 * typemanager.cs (parameter_default_value_attribute_type): New.
5604 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
5607 2006-03-21 Marek Safar <marek.safar@seznam.cz>
5609 * expression.cs (StringConcat.Append): Reverted back to no warning state.
5611 2006-03-21 Marek Safar <marek.safar@seznam.cz>
5613 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
5615 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
5618 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
5620 * doc-bootstrap.cs : fix build.
5622 2006-03-20 Marek Safar <marek.safar@seznam.cz>
5624 * expression.cs (StringConcat.Append): Issue a warning when empty string
5627 2006-03-20 Marek Safar <marek.safar@seznam.cz>
5629 * assign.cs (CompoundAssign.ResolveSource): Removed.
5631 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
5634 * class.cs (TypeContainer.FindMethods): Removed.
5635 (TypeContainer.CheckMemberUsage): Made static.
5637 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
5639 * constant.cs (CheckRange): Removed unused type argument.
5640 (CheckUnsigned): Removed unused type argument.
5642 * cs-parser.jay: Updated after MemberAccess clean up.
5643 Uses Length for empty string test.
5645 * cs-tokenizer.cs: Uses Length for empty string test.
5646 (IsCastToken): Made static.
5647 (is_hex): Made static.
5648 (real_type_suffix): Made static.
5650 * decl.cs (SetupCache): Made static.
5651 (OnGenerateDocComment): Removed unused ds argument.
5653 * delegate.cs (VerifyDelegate): Removed unused argument.
5655 * doc.cs: Uses Length for empty string test.
5657 * driver.cs: Uses Length for empty string test.
5659 * enum.cs (IsValidEnumType): Made static
5661 * expression.cs (EnumLiftUp): Removed unused argument.
5662 (ResolveMethodGroup): Ditto.
5663 (BetterConversion): Ditto.
5664 (GetVarargsTypes): Ditto.
5665 (UpdateIndices): Ditto.
5666 (ValidateInitializers): Ditto.
5667 (MemberAccess.ctor): Ditto.
5668 (GetIndexersForType): Ditto.
5670 * flowanalysis.cs: (MergeFinally): Removed unused argument.
5672 * iterators.cs: Updated after MemberAccess clean up.
5674 * location.cs: Uses Length for empty string test.
5676 * namespace.cs: Uses Length for empty string test.
5678 * report.cs (CheckWarningCode): Made static.
5680 * statement.cs (LabeledStatement): Removed unused argument.
5682 * typemanager.cs (FilterNone): Removed.
5684 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5686 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
5689 * class.cs: Updated.
5691 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5693 * cs-parser.jay.cs: __arglist is not allowed for delegates.
5695 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5699 * expression.cs (VerifyArgumentsCompat): Reverted to double error
5700 reporting, it's more tricky than I thought.
5702 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5706 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
5708 (AnonymousMethod.ImplicitStandardConversionExists): New method.
5709 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
5710 Add more error reporting; Fixed issue with params.
5712 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
5714 * cs-parser.jay: AnonymousMethod requires host container.
5716 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
5718 2006-03-18 Raja R Harinath <harinath@gmail.com>
5720 * class.cs: Change 'TypeContainer ds' constructor argument to
5721 'DeclSpace parent'. Some classes were missed below due to
5722 different naming convention.
5724 * class.cs (MemberCore.Parent): Delete. This makes the
5725 ParentContainer changes below enforceable by the compiler.
5727 Treat pointers to enclosing declaration space as 'DeclSpace', not
5729 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
5730 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
5732 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
5734 (Block.AddThisVariable): Likewise.
5735 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
5736 (AbstractPropertyEventMethod.Emit): Likewise.
5737 (AbstractPropertyEventMethod.EmitMethod): Likewise.
5738 (GetMethod.Define, SetMethod.Define): Likewise.
5739 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
5740 (DelegateMethod.EmitMethod): Likewise.
5742 Fix regression test-partial-13.cs.
5743 Rationalize use of PartialContainer. Ensure that the partial
5744 class semantics can be tied to type-correctness, i.e., any
5745 violation will cause a compile error.
5746 * class.cs, const.cs: Access all fields that belong to class
5747 TypeContainer via ParentContainer. Arguments of EmitContexts and
5748 Resolve()-like functions still use 'Parent'.
5750 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
5751 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
5752 (PropertyMethod.CheckModifiers): Remove unused argument.
5753 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
5756 2006-03-17 Raja R Harinath <harinath@gmail.com>
5758 Make semantics of PartialContainer simpler.
5759 * decl.cs (DeclSpace.IsPartial): Remove.
5760 * class.cs (TypeContainer.IsPartial): Likewise.
5761 (TypeContainer..ctor): Set PartialContainer to point to self.
5762 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
5763 (TypeContainer.FindNestedType): Likewise.
5764 (MemberCore.ParentContainer): Simplify. Remove deprecation.
5766 2006-03-17 Marek Safar <marek.safar@seznam.cz>
5768 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
5770 2006-03-15 Marek Safar <marek.safar@seznam.cz>
5772 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
5775 2006-03-15 Marek Safar <marek.safar@seznam.cz>
5777 * class.cs (Operator.Define): An error for base conversion was not
5780 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
5782 * iterator.cs : yield break is allowed in try statement which has
5783 catch clauses. Fixed bug #77767.
5785 2006-03-13 Marek Safar <marek.safar@seznam.cz>
5787 A fix for #77593, #77574.
5789 * class.cs (MethodCore.CheckBase): Another if for operator.
5791 2006-03-09 Marek Safar <marek.safar@seznam.cz>
5793 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
5796 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
5797 (DelegateCreation.ImplicitStandardConversionExists): New method for just
5800 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
5803 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
5804 Updated after another emitcontext usage was clean up. It should help us to
5805 synchronize with gmcs easier.
5807 2006-03-04 Marek Safar <marek.safar@seznam.cz>
5811 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
5812 (Event.Define): ditto
5813 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
5815 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
5816 Removed redundant code and set NewSlot for Invoke method too.
5818 * parameter.cs (Parameters.ctor): Add custom, type ctor.
5819 (Parameters.MergeGenerated): New method. Use this method when you merge
5820 compiler generated argument with user arguments.
5822 2006-03-03 Marek Safar <marek.safar@seznam.cz>
5824 * attribute.cs (ResolveAsTypeTerminal): Removed.
5826 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
5827 specialization for predefined types; 30% speed up.
5828 Finally placed obsolete check to right place.
5829 (Expression.ResolveType): Removed.
5831 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
5832 Updated after ResolveType was removed.
5834 * expression.cs (Cast.ctor): Check void cast.
5835 (Binary.ResolveAsTypeTerminal): Is never type.
5836 (Conditional.ResolveAsTypeTerminal): Is never type.
5838 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
5840 2006-03-01 Raja R Harinath <rharinath@novell.com>
5843 * expression.cs (ParameterReference.DoResolveBase): Change return
5845 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
5849 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
5852 * typemanager.cs (GetFullNameSignature): Don't nullref on
5853 protected accessors.
5855 2006-02-27 Marek Safar <marek.safar@seznam.cz>
5857 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
5858 these two separated members to simplify the code.
5859 (Attribute.Resolve): Refactored to use new fields and methods.
5860 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
5861 implemented obsolete attribute checking.
5862 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
5863 implemented obsolete checking again. It look line never ending quest ;-)
5864 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
5866 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
5868 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
5870 *class.cs (Property.Define): Add RegisterProperty call.
5872 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
5873 argument groups (only 2).
5875 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
5876 encoding expression to arguments.
5877 (Expression.ExprClassToResolveFlags): Just turned to property.
5879 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
5880 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
5881 optimized as well as implemented support for zero-length attributes.
5883 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
5884 Add caching of PropertyInfo's.
5886 2006-02-25 Marek Safar <marek.safar@seznam.cz>
5888 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
5889 error multiple times.
5891 2006-02-25 Marek Safar <marek.safar@seznam.cz>
5893 New partial class implementation.
5894 A fix for #77027, #77029, #77403
5896 * attribute.cs (Attributable): Made attributes protected.
5898 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
5899 the replacements of ClassPart and PartialContainer.
5900 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
5901 (TypeContainer.AddInterface): Ditto.
5902 (TypeContainer.AddPartial): The main method for partial classes. It checks
5903 for errors and merges ModFlags and attributes. At the end class is added to
5905 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
5907 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
5908 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
5909 from the rest of partial classes.
5910 (TypeContainer.GetClassBases): Simplified.
5911 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
5913 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
5914 (TypeContainer.HasExplicitLayout): Uses Flags now.
5915 (PartialContainer): Removed.
5916 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
5917 (StaticClass): Was merged with Class.
5918 (Class.GetClassBases): class and static class bases are verified here.
5919 (Class.TypeAttr): Added static attributes when class is static.
5920 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
5921 (MemberBase): In some cases we need to call parent container for partial
5922 class. It should be eliminated but it's not easy now.
5924 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
5926 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
5927 partial classed to accumulate class comments.
5928 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
5930 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
5932 * driver.cs (MainDriver): Tree.GetDecl was removed.
5934 * modifiers.cs (Modifiers): Add partial modifier.
5936 * tree.cs (Tree.decl): Removed.
5937 (RootTypes): Started to use this class more often for root types
5940 2006-02-22 Marek Safar <marek.safar@seznam.cz>
5944 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
5945 external interface does not have an attribute.
5947 2006-02-22 Marek Safar <marek.safar@seznam.cz>
5949 Another prerequisites for new partial classs implementation.
5951 * attribute.cs (Attribute.Equal): Implemented.
5952 (Attribute.Emit): Changed as attributes can be applied more than twice.
5953 (Attributes.Emit): Check for duplicate attributes here.
5955 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
5956 as a parameter, clean-up.
5958 2006-02-11 Marek Safar <marek.safar@seznam.cz>
5962 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
5963 contains obsolete attribute check which can in some cases look for base
5964 type of current class which is not initialized yet.
5965 (TypeContainer.BaseType): Replacement of ptype.
5967 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
5969 2006-02-11 Marek Safar <marek.safar@seznam.cz>
5971 First of prerequisites for new partial classs implemention.
5973 * attribute.cs (Attributable): Extended by ResolveContext;
5974 Attributes finally have correct context for resolving in all cases.
5975 (AttachTo): Attribute owner is assigned here.
5977 * codegen.cs (IResolveContext): Introduce new interface to hold
5978 all information needed in resolving phase.
5979 (EmitContext): Implements IResolveContext; more clean-up needed here.
5981 * decl.cs (MemberCore): Implemented IResolveContext.
5983 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
5984 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
5985 parameter.cs, statement.cs, tree.cs, typemanager.cs:
5986 Refactored to use new IResolveContext instead of EmitContext; cleanup
5988 2006-02-06 Miguel de Icaza <miguel@novell.com>
5990 * codegen.cs (EmitScopeInitFromBlock): check here the
5991 capture_context, there is no need to make two calls to the
5994 * anonymous.cs: Add some debugging messages that might help me
5995 track other instances of this problem in the future (the
5996 regression of test 467).
5998 * cs-parser.jay: track the variable block, as we need to initalize
5999 any captured variables declared in this block for the "catch"
6000 portion of the "Try" statement.
6002 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
6003 scope initialization for captured variables.
6005 Also, move the emit for the variables after the block location has
6008 2006-02-06 Marek Safar <marek.safar@seznam.cz>
6010 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
6012 2006-02-02 Miguel de Icaza <miguel@novell.com>
6014 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
6015 commit yesterday, the initialization for the roots is necessary.
6016 What is not necessary is the scope activation.
6018 2006-02-02 Raja R Harinath <rharinath@novell.com>
6020 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
6021 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
6023 (Argument.Resolve): Remove CS0206 checks.
6025 2006-02-01 Miguel de Icaza <miguel@novell.com>
6027 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
6028 scopes for all the roots, the scopes will now be emitted when the
6029 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
6031 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
6032 code. This reduces a lot of existing cruft.
6034 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
6035 that the ScopeInfo is generated as we enter the scope, not at the
6036 time of use, which is what we used to do before.
6038 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
6039 every time a Block is about to be emitted if we have a
6042 2006-02-01 Raja R Harinath <rharinath@novell.com>
6044 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
6046 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
6048 * typemanager.cs (cons_param_array_attribute): Make private.
6049 (Reset): Set it to null.
6050 (InitCoreHelpers): Don't initialize it.
6051 (ConsParamArrayAttribute): New. Initialize it as needed.
6052 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
6054 2006-01-31 Miguel de Icaza <miguel@novell.com>
6056 * expression.cs: There might be errors reported during the
6057 selection of applicable methods. If there are errors, do not
6058 continue execution as it will lead the compiler to crash.
6060 2006-01-30 Miguel de Icaza <miguel@novell.com>
6062 * expression.cs: Member access is not allowed on anonymous
6063 methods. Fixes #77402.
6065 2006-01-30 Raja R Harinath <rharinath@novell.com>
6068 * cs-parser.jay (VariableDeclaration): Don't set
6069 current_array_type to null.
6070 (field_declaration, event_declaration, declaration_statement):
6071 Set it to null here.
6073 2006-01-28 Raja R Harinath <harinath@gmail.com>
6075 * typemanager.cs (GenericParameterPosition): New.
6078 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
6080 * doc.cs : To process "include" elements, first we should create
6081 another list than XmlNodeList, because it could result in node
6082 removal, which could result in that the XmlNodeList gives up
6085 (Also made code identical to gmcs again.)
6087 2006-01-25 Miguel de Icaza <miguel@novell.com>
6089 * ecore.cs: Introduce an error report that we were not catching
6090 before, if not silent, we must report the error. Gonzalo ran into
6093 2006-01-23 Miguel de Icaza <miguel@novell.com>
6095 A fix for bug: #76957
6097 * iterators.cs (MoveNextMethod.CreateMethodHost): call
6098 ComputeMethodHost before creating the method, this is a new
6101 * anonymous.cs (AnonymousContainer): Now we track all the scopes
6102 that this method references (RegisterScope). The actual scope
6103 where the method is hosted is computed with the ComputeMethodHost
6104 before we create the method.
6106 Moved the Deepest routine here.
6108 (AnonymousContainer.ComputeMethodHost): New routine used to
6109 compute the proper ScopeInfo that will host the anonymous method.
6111 (ScopeInfo): Deal with multiple roots. The problem was that we
6112 did not have a unique root where all ScopeInfos could be hanged
6113 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
6116 Remove AdjustMethodScope which is now computed at the end. Remove
6117 LinkScope which did a partial link, instead link all ScopeInfos
6118 before code generation from the new "LinkScopes" routine.
6120 Simplify all the Add* routines as they no longer need to maintain
6121 the tree, they just need to record that they are using variables
6124 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
6125 routines to produce the forest of ScopeInfo trees.
6127 * class.cs (TypeContainer.AppendMethod): This is just like
6128 AddMethod, but ensures that an interface implementation method
6129 (IEnumerable.XXX) is not inserted at the beginning of the queue of
6130 methods, but at the end.
6132 We use this functionality to ensure that the generated MoveNext
6133 method in the iterator class is resolved/emitted before the
6134 enumerator methods created.
6136 This is required because the MoveNext method computes the right
6137 ScopeInfo for the method. And the other methods will eventually
6138 need to resolve and fetch information computed from the anonymous
6141 2006-01-21 Raja R Harinath <harinath@gmail.com>
6142 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6145 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
6147 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
6148 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
6150 2006-01-18 Raja R Harinath <rharinath@novell.com>
6152 Fix #76656, cs0231-2.cs.
6153 * cs-parser.jay (formal_parameter_list): Make error case catch
6155 (parenthesized_expression_0): Add CS1026 check.
6156 (invocation_expression): Remove unused { $$ = lexer.Location }.
6158 2006-01-17 Raja R Harinath <rharinath@novell.com>
6161 * cs-parser.jay (statement_expression): Don't list out the
6162 individual statement-expressions. Convert syntax error into
6165 2006-01-16 Raja R Harinath <rharinath@novell.com>
6168 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
6169 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
6170 CheckIntermediateModification.
6171 (FieldExpr.DoResolve): Add new two-argument version that
6172 allows us to resolve the InstanceExpression as an lvalue.
6173 The one-argument variant is now just a wrapper.
6174 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
6175 Resolve the lhs as an lvalue if the it has a value type.
6176 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
6177 from Assign.DoResolve.
6178 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
6179 resolved as an lvalue.
6180 (PropertyExpr.DoResolve): Update.
6181 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
6182 has a value type. Move CS1612 check here from
6183 CheckIntermediateModification.
6184 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
6185 * expression.cs (EmptyExpression.OutAccess): New. Used as the
6186 'right_side' of a ResolveLValue on an 'out' argument.
6187 (EmptyExpression.LValueMemberAccess): New. Used as the
6188 'right_side' of a propagated ResolveLValue on a value type.
6189 (LocalVariableReference.DoResolveBase): Recognize
6190 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
6192 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
6193 EmptyExpression.Null.
6195 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
6197 * typemanager.cs : added IsGenericParameter(). In mcs it always
6199 * doc.cs : for generic parameters, use GenericParameterPosition,
6202 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
6204 * expression.cs: Fix Console.WriteLine ((this = x).foo);
6206 2006-01-12 Miguel de Icaza <miguel@novell.com>
6208 This fixes the problem where we used ldfld instead of ldflda to
6209 load the "THIS" pointer on captured parameters, when THIS is a
6210 value type. See bug #77205.
6212 * iterators.cs (CapturedThisReference.Emit): Pass false to
6213 EmitThis (we do not need the address).
6215 * codegen.cs (EmitThis): it needs to know whether we need the
6216 address of `this' or not. This is used by value types.
6218 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
6219 every other call passes false.
6221 2006-01-12 Raja R Harinath <rharinath@novell.com>
6224 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
6226 * expression.cs (Invocation.OverloadResolve): Update.
6227 (Invocation.DoResolve): Avoid double resolution of invocation.
6229 2006-01-11 Raja R Harinath <rharinath@novell.com>
6232 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
6233 unary negation of floating point types as 0-expr; negation cannot
6234 overflow in floating point types.
6237 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
6238 on operands of 'void' type.
6241 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
6242 and ExclusiveOr for boolean constants too.
6244 2006-01-09 Raja R Harinath <rharinath@novell.com>
6247 * expression.cs (Invocation.OverloadResolve): Replace reflected
6248 override methods with their base virtual methods, rather than
6250 * typemanager.cs (TypeManager.GetOverride): New.
6252 2006-01-05 Jb Evain <jbevain@gmail.com>
6254 * class.cs (Property.Define, Indexer.Define): do not tag the
6255 properties as SpecialName | RTSpecialName.
6257 2006-01-04 Miguel de Icaza <miguel@novell.com>
6259 * class.cs (MethodCore.IsDuplicateImplementation): This method was
6260 doing a low-level comparission of parameter types. It was lacking
6261 a check for __argslist.
6263 2005-12-30 Miguel de Icaza <miguel@novell.com>
6265 * expression.cs (ParameterReference.DoResolveBase): Allow
6266 reference parameters if they are local to this block.
6268 This allows the ref and out parameters of a delegate to be used in
6269 an anonymous method, for example:
6271 delegate void set (out int x);
6273 set s = delegate (out int x){
6277 This is used by functionality introduced late in the C# language.
6279 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
6280 method that take ref and out parameters.
6282 Fixes #77119 which was a late change in the spec.
6284 2005-12-23 Miguel de Icaza <miguel@novell.com>
6286 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
6287 parent if its the same scope. Fixes #77060.
6289 2005-12-21 Miguel de Icaza <miguel@novell.com>
6291 * driver.cs: Report the case of no source files and no -out:
6294 2005-12-20 Raja R Harinath <rharinath@novell.com>
6297 * expression.cs (ComposedCast.GetSignatureForError): Define.
6299 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6303 * namespace.cs (NamespaceEntry): Add extern_aliases as a
6304 ListDictionary, to contain the ExternAliasEntry entries (in
6305 addition to the NamespaceEntry.aliases hashtable). This field is
6306 shared between the original entry and its doppelganger (bodyless
6308 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
6309 extern_aliases field.
6310 (NamespaceEntry.Lookup): Move the IsImplicit check after the
6311 lookup in extern_aliases.
6313 2005-12-16 Raja R Harinath <rharinath@novell.com>
6316 * class.cs (TypeContainer.Mark_HasEquals): New.
6317 (TypeContainer.Mark_HasGetHashCode): New.
6318 (ClassPart): Override them.
6319 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
6322 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
6323 'parent' argument to the base constructor.
6325 Remove all mention of TypeContainer from decl.cs.
6326 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
6327 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
6328 (DeclSpace.DeclSpace): Likewise.
6329 (DeclSpace.DefineMembers): Remove unused argument.
6330 * cs-parser.jay (pop_current_class): Update to changes. Simplify
6331 debugging check -- we don't care if the debug code throws an
6332 InvalidCastException instead of an InternalErrorException.
6333 * class.cs (TypeContainer.DefineMembers): Update to changes.
6334 (TypeContainer.DoDefineMembers): Likewise.
6335 (TypeContainer.GetMethods): Likewise.
6336 (PropertyMember.Define): Likewise.
6337 (MemberBase.Parent): New property that forwards to
6338 MemberCore.Parent, but ensures that we get a TypeContainer.
6339 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
6340 (RootContext.PopulateTypes): Likewise. Remove special case code
6341 for !RootContext.StdLib: DefineMembers is idempotent.
6343 2005-12-14 Miguel de Icaza <miguel@novell.com>
6345 * convert.cs (ExplicitConversionCore): Check the return value from
6346 ExplicitConversionCore which can return null on failure. Fixes #76914
6348 2005-12-13 Marek Safar <marek.safar@seznam.cz>
6350 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
6352 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
6354 * doc.cs : The search for referenced namespace was insufficient to
6355 get global one as it used to do. Fixed bug #76965.
6357 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
6359 * doc.cs : check name in cref in the last phase that whether it is
6362 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6364 * cs-tokenizer.cs : reverted the latest change: it somehow broke
6367 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6369 * doc.cs : so it turned out that we cannot skip override check for
6370 interface members. Fixed bug #76954.
6372 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6374 * cs-tokenizer.cs : fixed bug #75984:
6375 - #warning and #error should not be handled when the source line
6377 - #line is not checked strictly when the source line is disabled.
6378 - #define and #undef is on the other hand checked strictly at any
6381 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
6383 * cs-tokenizer.cs : missing Location (actually, filename) in one of
6386 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6388 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
6390 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
6392 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
6393 (FieldBase.Initializer): Initializer is now optional.
6394 (EventField.Define): Only event field can have initializer.
6396 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
6398 * const.cs (Const): Reuse initializer.
6400 * cs-parser.jay: Updated after FieldBase changes.
6401 Added current_array_type to simplify array initializers.
6403 * ecore.cs (NullCast.IsDefaultValue): Implemented.
6405 * expression.cs, iterators.cs: Updated.
6407 * namespace.cs (NamespaceEntry): Made UsingFound private.
6409 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6411 * parameterCollection.cs: Obsolete, removed.
6412 * parser.cs: Obsolete, removed.
6414 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6417 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
6419 * enum.cs (Enum.Define): Set obsolete context here.
6421 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
6424 - FindDocumentedMember() now expects 1) paramList as null
6425 when "we don't have to check the number of parameters" and
6426 2) Type.EmptyTypes when "there is no arguments".
6427 - Introduced FoundMember struct to hold the exact type which was
6428 used to find the documented member (the above change broke
6429 test-xml-044; it might be better just to use DeclaringType than
6430 what MS does, like this change does, but it depends on usage.)
6432 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
6434 * doc.cs : documented member might be from DeclaringType for nested
6435 types. Fixed bug #76782.
6437 2005-12-03 Ben Maurer <bmaurer@ximian.com>
6439 * anonymous.cs: Have the param code handle leaving copies on the
6440 stack etc. Allows anonymous params to take part in the assignment
6441 code (++, +=, etc). Fixes bug #76550
6443 * expression.cs: Handle the prepare_for_load/leave_copy by passing
6444 it down to the anon code.
6446 * iterators.cs: Use dummy var here
6448 * codegen.cs: Handle new vars
6450 2005-12-01 Marek Safar <marek.safar@seznam.cz>
6453 * class.cs (MethodData.Define): Set proper Obsolete context.
6455 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
6457 (FieldExpr.DoResolve): Ditto.
6459 2005-12-01 Marek Safar <marek.safar@seznam.cz>
6462 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
6463 parent is not obsolete.
6465 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
6467 * doc.cs : (FindDocumentedMember) find parameterless members first
6468 and get CS0419 in the early stage. Fixed first case of bug #76727.
6470 2005-11-30 Marek Safar <marek.safar@seznam.cz>
6473 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
6474 no error was reported.
6476 *expression.cs (Binary.DoResolve): left can be null.
6478 2005-11-22 Marek Safar <marek.safar@seznam.cz>
6481 * class.cs (MethodData.Emit): Parameters should be labeled first.
6483 2005-11-21 Marek Safar <marek.safar@seznam.cz>
6486 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
6488 2005-11-18 Marek Safar <marek.safar@seznam.cz>
6490 * attribute.cs (AreParametersCompliant): Moved to Parameter.
6492 * class.cs (MethodCore): Parameter clean up.
6493 (IMethodData): Added ParameterInfo.
6494 (MethodData): Parameter clean up.
6495 (Indexer.Define): Parameter clean up.
6507 * typemanager.cs: Parameter clean up.
6509 * delegate.cs (Define): Get rid of duplicated code.
6511 * expression.cs (ParameterReference): Removed useless parameters
6513 (Invocation): Ditto.
6515 * parameter.cs (ParamsParameter): New class, params specialization.
6516 (ArglistParameter): Attemp to separate arglist.
6517 (Parameter): Refactored to be reusable and faster.
6518 (Parameter.Modifier): Made understandable.
6519 (Parameters): Changed to be used as a class for `this' assembly
6520 parameters. Refactored to use new specialized classes.
6522 * support.cs (ParameterData): Added Types property.
6523 (InternalParameters): Deleted.
6525 2005-08-20 Martin Baulig <martin@ximian.com>
6527 Merging this patch from GMCS to fix #75867.
6529 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
6530 scope if we don't already have it.
6532 2005-11-17 Martin Baulig <martin@ximian.com>
6535 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
6536 inherit the scope from our parent. Fixes #76653.
6538 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6540 * doc.cs : the previous patch does not actually fix the bug.
6541 PropertyInfo override check is now implemented and really fixed it.
6542 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
6544 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6546 * doc.cs : apply "override filter" also to properties.
6549 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6551 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
6552 no need to check overrides. For classes, omit those results from
6553 interfaces since they must exist in the class. Fixed bug #76726.
6555 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6557 * typemanager.cs : (GetFullNameSignature) differentiate indexers
6558 with different parameters. Fixed the second problem in #76685.
6560 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6562 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
6563 get expected 'protected' access in CheckValidFamilyAccess()).
6566 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6568 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
6569 Fixed bug #76705. CS1569 was incorrectly commented out.
6571 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
6573 * doc.cs : use Invocation.IsOverride() to do real override check.
6574 * expression.cs : made Invocation.IsOverride() internal.
6576 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
6578 * doc.cs : use TypeManager.FindMembers() instead of (possible)
6579 TypeBuilder.FindMembers() and filter overriden base members out.
6582 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6584 * doc.cs : ref/out parameters are represented as '@' (instead of
6585 '&' in type FullName). Fixed bug #76630 (additionally crefs).
6587 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6589 * doc.cs : when there was no '.' in cref to methods in doc comment,
6590 then parameters were missing in the output. Fixed bug #76691.
6592 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6594 * driver.cs : don't output docs when there is an error.
6597 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6600 Now it should detect indexers. Fixed primary concern in bug #76685.
6601 Fixed CS0419 message to not show the identical member signature in
6604 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6606 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
6607 instead of Type.FindMembers() since it does not handle events.
6610 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
6612 * codegen.cs: Fixed typo (speficied -> specified).
6614 2005-11-11 Marek Safar <marek.safar@seznam.cz>
6617 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
6619 2005-11-11 Marek Safar <marek.safar@seznam.cz>
6621 * attribute.cs: Changed error message.
6623 * cs-tokenizer.cs: One more check.
6625 2005-11-10 Marek Safar <marek.safar@seznam.cz>
6627 * statement.cs (Block.Resolve): Ignore empty statement.
6629 2005-11-10 Marek Safar <marek.safar@seznam.cz>
6631 * report.cs: Made error/warning methods more strict to avoid
6634 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
6635 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
6636 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
6637 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
6639 2005-11-08 Marek Safar <marek.safar@seznam.cz>
6641 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
6642 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
6644 * class.cs (TypeContainer.IsComImport): New property.
6645 (Constructor.Define): Create proper ctor for ComImport types.
6647 * expression.cs (New.CheckComImport): Fixed.
6649 2005-11-07 Miguel de Icaza <miguel@novell.com>
6651 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
6652 that a parameter has been captured does not mean that we do not
6653 have to do the rest of the processing. This fixes the second part
6654 of #76592. If there was another anonymous method capturing
6655 values in the past, the Scope would never be set for the second
6656 method that captured the same parameter.
6658 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
6659 properly manipulate the stack. Second part of fix for #76592.
6661 * expression.cs (New): Add support for invoking "new" on
6662 interfaces that have been flagged with the ComImport attribute and
6663 the CoClass. Fixes #76637
6665 * statement.cs (Try.DoEmit): When a variable is captured, do not
6666 try to emit the vi.LocalBuilder variable as it has been captured.
6667 Create a temporary variable and store the results on the
6668 FieldBuilder. Fixes #76642
6670 2005-11-07 Marek Safar <marek.safar@seznam.cz>
6672 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
6674 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
6676 * expression.cs (Binary.DoResolve): Added && optimalization.
6678 * typemanager.cs (AddUserType): Removed useless argument.
6680 2005-11-04 Marek Safar <marek.safar@seznam.cz>
6682 * statement.cs (Block.variables): Uses ListDictionary.
6684 2005-11-03 Marek Safar <marek.safar@seznam.cz>
6687 * class.cs (PartialContainer.EmitType): Customized to emit
6688 security attributes.
6689 (ClassPart.ApplyAttributeBuilder): Transform security attribute
6690 for partial classes.
6692 2005-11-03 Marek Safar <marek.safar@seznam.cz>
6695 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
6696 access has to be fixed.
6698 * typemanager.cs (IsUnmanagedType): Wrong common field type.
6700 2005-11-01 Marek Safar <marek.safar@seznam.cz>
6703 * ecore.cs (NullCast.Reduce): Implemented.
6705 * expression.cs (ArrayCreation.CheckIndices): Correcly check
6708 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
6710 (Foreach.Resolve): Catch null properly.
6712 2005-10-29 Marek Safar <marek.safar@seznam.cz>
6714 * cs-tokenizer.cs: Warning text fix.
6716 * driver.cs: AllWarningNumbers exposed on public interface.
6718 * report.cs (): Reviewed warning numbers.
6719 (IsValidWarning): Use binary search.
6721 2005-10-29 Marek Safar <marek.safar@seznam.cz>
6723 * driver.cs: Implemeted resource visibility.
6724 (Resources): New class for code sharing between /res: and
6727 2005-10-28 Marek Safar <marek.safar@seznam.cz>
6730 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
6733 * convert (Convert.ImplicitReferenceConversion): NullCast holds
6736 * ecore.cs (NullCast): Child is contant only.
6738 * literal.cs (NullLiteral.Reduce): null can be converted to any
6741 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
6743 * driver.cs: Use Encoding.Default as default code page instead
6746 2005-10-27 Raja R Harinath <rharinath@novell.com>
6749 * expression.cs (Invocation.Error_InvalidArguments): Handle
6750 __arglist parameters.
6751 (Invocation.VerifyArgumentsCompat): Likewise.
6752 * support.cs (ReflectionParameters.GetSignatureForError): Print
6753 __arglist parameters.
6754 (InternalParamters.GetSignatureForError): Likewise.
6755 * parameter.cs (Parameters.GetSignatureForError): Likewise.
6757 2005-10-26 Marek Safar <marek.safar@seznam.cz>
6759 * attribute.cs (GetPropertyValue): Made public.
6761 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
6763 Add new property WrapNonExceptionThrows to handle 2.0 assembly
6765 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
6768 * driver.cs: Reflect method name change.
6770 * statement.cs (Try.Resolve): Warn when try has both general
6773 * typemanager.cs: runtime_compatibility_attr_type new predefined
6776 2005-10-26 Raja R Harinath <harinath@gmail.com>
6779 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
6780 treat it as an empty parameter list.
6782 2005-10-26 Raja R Harinath <rharinath@novell.com>
6785 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
6786 ResolveAsTypeStep silent.
6787 * statement.cs (Block.AddConstant): Mark block as used.
6788 (Block.ResolveMeta): Avoid piling on error messages
6789 if a constant initializer resolution fails.
6791 2005-10-25 Raja R Harinath <rharinath@novell.com>
6793 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
6795 (NamespaceEntry.VerifyAllUsing): New.
6796 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
6797 behaviour. Delegates actual resolution of alias to ...
6798 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
6799 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
6801 * driver.cs (Driver.MainDriver): Update.
6803 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
6804 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
6806 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
6808 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
6809 RootNamespace.DefineNamespacesForAll.
6811 2005-10-24 Raja R Harinath <harinath@gmail.com>
6813 * typemanager.cs (assemblies, external_aliases, modules)
6814 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
6815 (ComputeNamespaces, GetRootNamespace): Remove extra staging
6816 overhead. Move resposibility ...
6817 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
6818 * driver.cs, attribute.cs, codegen.cs: Update to changes.
6820 2005-10-23 Raja R Harinath <harinath@gmail.com>
6822 * namespace.cs (RootNamespace.all_namespaces): Renamed from
6823 cached_namespaces. Improve usage.
6824 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
6825 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
6826 Move from GlobalRootNamespace and simplify.
6827 (RootNamespace.Global): Make instance variable.
6828 (RootNamespace.RootNamespace): Add "alias name" parameter.
6829 (GlobalRootNamespace): Simplify drastically.
6830 (Namespace.Lookup): Don't use GetNamespace.
6831 * typemanager.cs (GetRootNamespace): Rename from
6832 ComputeNamespaceForAlias.
6833 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
6835 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6837 * anonymous.cs (AnonymousContainer): Don't crash when container
6840 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6842 * expression.cs (Binary.DoResolve): Warn when comparing same
6845 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6848 * expression.cs (Binary.DoResolve): It looks like there are no
6849 convetsion rules in enum context.
6851 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6853 Add support for extern alias qualifiers.
6854 * typemanager.cs: Move some LookupTypeReflection code
6855 to namespace.cs, to have cleaner code. Added some methods
6856 to help us keep track of the extern aliased references.
6857 * driver.cs: Add suport for extern alias assemblies on command
6858 line and check for their warnings/errors. Also keep track of the
6859 extern aliased assemblies.
6860 * namespace.cs: Move the global functionality of Namespace
6861 to GlobalRootNamespace/RootNamespace. Now the global namespace
6862 is GlobalRootNamespace.Globa. Also the code moved from
6863 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
6864 Finally added LocalAliasEntry (AliasEntry before) and
6865 ExternAliasEntry, to handle alias statements.
6866 * cs-parser.jay: Add support in the grammar for extern alias
6868 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
6869 Update callings to Namespace (now in GlobalRootNamespace).
6871 2005-10-18 Raja R Harinath <rharinath@novell.com>
6874 * class.cs (TypeContainer.DefineType): Move updating of
6875 topological sort earlier in the code.
6876 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
6878 2005-10-18 Marek Safar <marek.safar@seznam.cz>
6881 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
6883 * constant.cs (Constant.TryReduce): Moved from Cast class.
6884 (Reduce): Made little bit more OO and fixed missing conversions.
6886 * ecore.cs (Reduce): Implemented.
6887 (Binary.EnumLiftUp): New method to upgrade values to enum values.
6889 * literal.cs (Reduce): Implemented.
6891 * class.cs: Reverted Miguel's wrong commit.
6893 2005-10-14 Miguel de Icaza <miguel@novell.com>
6895 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
6897 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
6899 * cs-parser.jay, expression.cs : CS0214 was missing error location
6900 for constants. Fixed bug #76404.
6902 2005-10-11 Marek Safar <marek.safar@seznam.cz>
6905 * convert.cs (ExplicitConversionCore): Fixed object->enum
6908 2005-10-10 Raja R Harinath <rharinath@novell.com>
6910 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
6912 (PropertyExpr.EmitCall): Likewise.
6913 * expression.cs (Invocation.EmitArguments): Handle case where
6915 (Invocation.EmitCall): Avoid allocating temporary variable if
6916 there are no arguments.
6918 2005-10-07 Raja R Harinath <rharinath@novell.com>
6921 * convert.cs (ImplicitConversionStandard): Move conversion of
6922 void* to arbitrary pointer types ...
6923 (ExplicitConversionStandard): .. here.
6924 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
6925 error to always print typenames.
6927 2005-10-07 Raja R Harinath <rharinath@novell.com>
6929 * convert.cs (GetConversionOperator): Rename from
6930 GetConversionOperators. Move operator selection code from ...
6931 (UserDefinedConversion): ... here.
6933 2005-10-06 Marek Safar <marek.safar@seznam.cz>
6935 * convert.cs (ExplicitConversionCore): Removed duplicate enum
6938 2005-10-05 Marek Safar <marek.safar@seznam.cz>
6940 * assign.cs (Assign.DoResolve): Error method changed.
6942 * cfold.cs (DoConstantNumericPromotions): Error method changed.
6944 * const.cs (ResolveValue): Reset in_transit immediately.
6946 * constant.cs: Error method changed.
6948 * convert.cs: Removed useless location parameter.
6949 (ExplicitNumericConversion): Don't do double enum check.
6950 (ExplicitConversionCore): Renamed from ExplicitConversion.
6951 (ExplicitUnsafe): Extracted from ExplicitConversion.
6952 (ExplicitConversion): Uses for error reporting.
6954 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
6956 (ResolveBoolean): Uses common error method.
6957 (CastToDecimal): Get rid of ec.
6958 (CastFromDecimal): Optimized.
6959 (ConvCast): Get rid of ec.
6961 * enum.cs (ResolveValue): Reset in_transit immediately.
6962 (Emit): Return after first error.
6964 * expression.cs: Convert changes.
6966 * literal.cs: Error method changed.
6968 * statement.cs: Error method changed.
6970 2005-10-03 Raja R Harinath <rharinath@novell.com>
6972 * support.cs (SeekableStreamReader.Position): Don't error out when
6973 the requested position is just beyond the end of the current
6976 2005-09-28 Raja R Harinath <rharinath@novell.com>
6978 * support.cs (SeekableStreamReader): Simplify drastically. Don't
6979 try to keep in sync with the byte count of the underlying Stream.
6980 However, this limits us to a window size of 2048 characters: i.e.,
6981 the maximum lookahead of our lexer/parser can be 2048 characters.
6983 2005-09-28 Marek Safar <marek.safar@seznam.cz>
6986 * driver.cs: Fix compilation files with full root path.
6988 2005-09-25 Miguel de Icaza <miguel@novell.com>
6990 * report.cs (SymbolRelatedToPreviousError): Format the output so
6991 it does not use an open parenthesis that is never closed.
6993 * driver.cs: Follow coding guidelines
6995 2005-09-27 Marek Safar <marek.safar@seznam.cz>
6998 * const.cs (Const.ResolveValue): Check for assigning non-null
6999 value to reference type.
7001 2005-09-27 Marek Safar <marek.safar@seznam.cz>
7003 * anonymous.cs: Implemented ExprClassName.
7005 * assign.cs (Assign.DoResolve): Don't chrash when type is not
7008 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
7011 * class.cs (StaticClass.DefineContainerMembers): Report protected
7014 * codegen.cs: if(ed) PRODUCTION.
7016 * convert.cs (Error_CannotImplicitConversion): Better error
7019 * cs-parser.jay: More error checks.
7021 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
7023 * driver.cs (CSCParseOption): Enabled wrong option check.
7025 * ecore.cs (Expression.ExprClassName): Turned to property.
7026 (MemberExpr.CheckIntermediateModification): For checking boxed
7027 value types modification.
7029 * statement.cs (Fixed.Resolve): Expression type must be
7030 convertible to fixed type.
7031 (CollectionForeach.GetEnumeratorFilter,TryType):
7032 Small refactoring for easier error checking.
7034 2005-09-26 Marek Safar <marek.safar@seznam.cz>
7036 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
7039 * class.cs (GeneratedBaseInitializer): New class for customization
7040 compiler generated initializers.
7041 (MemberBase.DoDefine): Check Obsolete attribute here.
7042 (FieldMember.DoDefine): Ditto.
7044 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
7047 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
7048 (MemberCore.GetObsoleteAttribute): Removed argument.
7049 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
7050 (MemberCore.CheckObsoleteType): New helper.
7054 * statement.cs: Updates after MemberCore changes.
7056 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
7057 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
7059 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
7060 obsolete attribute for compiler construct.
7061 (As.DoResolve): Cache result.
7063 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
7065 2005-09-26 Raja R Harinath <rharinath@novell.com>
7068 * expression.cs (This.VerifyFixed): In a value type T, the type of
7069 'this' is T&, iow, 'this' is either an out or ref parameter. In a
7070 value type R, 'this' is treated as a value parameter.
7072 2005-09-22 Miguel de Icaza <miguel@novell.com>
7074 * statement.cs (Lock): Use the TemporaryVariable class instead of
7075 manually using local variables as those do not work when variables
7078 * ecore.cs: Moved the TemporaryVariable class from being a nested
7079 class inside Foreach to be a public class that can be employed in
7082 2005-09-19 Marek Safar <marek.safar@seznam.cz>
7084 * cs-parser.jay: interface_accessors replaced by
7085 accessor_declarations.
7087 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
7090 * statement.cs (GotoCase.Resolve): Convert null constant to
7092 (SwitchLabel.ResolveAndReduce): Ditto.
7093 (SwitchLabel.NullStringCase): Custom null stamp.
7094 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
7096 typemanager.cs (CSharpSignature): Don't skip first argument
7099 2005-09-18 Miguel de Icaza <miguel@novell.com>
7101 * driver.cs: Set InEmacs based on the environment variable EMACS.
7103 * location.cs (InEmacs): in this mode, do not report column
7104 location as it confuses Emacs.
7106 2005-09-16 Marek Safar <marek.safar@seznam.cz>
7108 * cfold.cs, constant.cs, convert.cs, ecore.cs,
7109 expression.cs, iterators.cs, literal.cs: Store constants and
7112 * class.cs (MemberBase.ShortName): Pass location.
7114 * cs-parser.jay: Some location fixes.
7116 * ecore.cs (Expression.Location): Made virtual.
7118 2005-09-05 Miguel de Icaza <miguel@novell.com>
7120 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
7121 if the underlying types are the same, otherwise we need to produce
7122 code that will do the proper cast.
7124 This was exposed by Marek's constant rewrite which produced
7125 invalid code for the call site:
7128 void Method (X v) {}
7132 This fixes test-49.cs
7134 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
7136 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
7137 Type/Object should be allowed as well. Fixed bug #75968.
7139 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
7141 * expression.cs : (Binary.DoResolve): when one is enum constant and
7142 another is constant 0, then return enum one *as enum type*.
7145 2005-09-02 Raja R Harinath <rharinath@novell.com>
7147 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
7151 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
7152 flow-branching for LocalVariableReferences in case we were invoked
7153 from a MemberAccess.
7154 * expression.cs (LocalVariableReference.VerifyAssigned): New.
7156 (LocalVariableReference.DoResolveBase): ... this.
7157 (MemberAccess.Resolve): Do the check that was disabled during
7160 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
7163 (PartialContainer.Create): check abstract/sealed/static strictly
7164 but abstract/sealed can exist only at one side. Fixed bug #75883.
7166 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
7169 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
7170 specified, don't default to UnmanagedType.I4.
7172 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
7174 * expression.cs : conditional operator should check possibly
7175 incorrect assign expression. Fixed bug #75946.
7177 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
7179 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
7180 Reverting the change. gmcs is much complex than mcs on this matter.
7182 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
7184 * cs-tokenizer.cs : To read another token ahead of the actual
7185 consumption, use new SavedToken and cache token instead of moving
7186 back the stream with SeekableStreamReader (it seemed problematic).
7188 driver.cs : Thus use StreamReader directly.
7189 * support.cs : Thus removed SeekableStreamReader.
7191 2005-08-30 Raja R Harinath <rharinath@novell.com>
7194 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
7195 (ScopeInfo.EmitScopeType): Use it to construct field names from
7196 names of captured locals.
7199 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
7200 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
7201 Pass 'target_type' to BoxedCast. Don't default to 'object'.
7202 (ExplicitConversion): Remove enum cases already handled by
7203 implicit conversion. Move implicit conversion check to the beginning.
7204 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
7205 * expression.cs (ArrayCreation.EmitDynamicInitializers):
7206 Don't treat System.Enum as a struct.
7208 2005-08-30 Jb Evain <jbevain@gmail.com>
7210 * attribute.cs: handles as expression in parameters.
7212 2005-08-30 Raja R Harinath <rharinath@novell.com>
7215 * class.cs (TypeContainer.VerifyClsName): Don't use a
7216 PartialContainer when verifying CLS compliance.
7217 (AbstractPropertyEventMethod): Set Parent here, ...
7218 (PropertyMethod): ... not here.
7220 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
7222 * attribute.cs : escaped attribute name should not be allowed to be
7223 resolved (e.g. @class as classAttribute). Fixed bug #75930.
7225 2005-08-29 Raja R Harinath <rharinath@novell.com>
7228 * convert.cs (ImplicitStandardConversionExists): Allow zero also
7229 when converting a long constant to unsigned long.
7230 * expression.cs (Invocation.OverloadResolve): Add sanity check to
7231 detect where IsApplicable and VerifyArgumentsCompat disagree.
7233 2005-08-29 Raja R Harinath <rharinath@novell.com>
7234 and Carlos Alberto Cortez <carlos@unixmexico.org>
7237 * class.cs (TypeContainer.CanElideInitializer): New helper.
7238 (TypeContainer.EmitFieldInitializers): Use it to determine if we
7239 can safely emitting the initializer of a field.
7241 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7243 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
7244 allowed inside a switch (without loop). Fixed bug #75433.
7246 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
7248 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
7249 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
7251 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7253 * driver.cs : kinda reverting the default encoding changes (not exact
7254 revert since I noticed that "codepage:reset" might not work fine).
7256 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7258 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
7259 Location. Now getter and setter store location correctly.
7260 (errors/cs0111-12.cs now reports the expected location.)
7262 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7264 * driver.cs : Use default encoding on the environment.
7265 Removed (now that) extra parameter for SeekableStreamReader.
7266 * support.cs : (SeekableStreamReader) third .ctor() argument for
7267 StreamReader is not required (always true). preamble size could
7268 be acquired in simpler and safe way.
7270 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
7272 * cs-parser.jay: report CS0642 at warning level 3
7273 and report CS0642 for an if else statement also
7274 fixes bug #74745. Patch by John Luke (and a bit
7276 Removed extra CS0642 warning check for "while",
7278 * statement.cs: In Block.Resolve(), CS0642 check
7279 is reimplemented to check a sequence of an empty
7280 statement and a block.
7282 Both fix bug #66777.
7284 2005-08-24 Marek Safar <marek.safar@seznam.cz>
7286 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
7287 detection until I fix it.
7289 * cs-tokenizer.cs: Changed error message.
7291 * cs-parser.jay: Fixed 2 error locations.
7293 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
7294 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
7297 * enum.cs (GetSignatureForError): Fixed.
7299 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
7303 * typemanager.cs (RegisterProperty): Removed.
7305 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
7307 2005-08-24 Raja R Harinath <rharinath@novell.com>
7310 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
7311 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
7313 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7315 * expression.cs : tiny fix is required for not warning positive ulong.
7318 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7320 * expression.cs : add CS0652 check for constant and integral
7321 expression. Fixed bug #53974.
7323 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7325 * expression.cs : in DoNumericPromotions(), check if there is implicit
7326 conversion overload for string (to check CS0034). Fixed bug #52492.
7328 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7330 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
7332 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7334 * ecore.cs : report location when it is *not* Null.
7336 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7342 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
7343 correctly. Fixed bug #75721.
7345 2005-08-23 Raja R Harinath <rharinath@novell.com>
7347 * support.cs (SeekableStreamReader.Position): Avoid an expensive
7348 loop that performs 'min (pos, char_count)'.
7351 * expression.cs (Unary.ResolveOperator): Don't discard implicit
7352 converted value in Operator.OnesComplement.
7354 2005-08-22 Ben Maurer <bmaurer@ximian.com>
7356 * anonymous.cs: If the anon method is pulled into a helper class,
7357 it needs to be `internal' not `private'. Fixes runtime behavior on
7360 2005-08-20 Martin Baulig <martin@ximian.com>
7362 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7363 scope if we don't already have it.
7365 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
7366 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
7369 2005-08-17 Marek Safar <marek.safar@seznam.cz>
7372 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
7375 2005-08-16 Marek Safar <marek.safar@seznam.cz>
7377 The big constants rewrite
7378 Fix #75746, #75685 and more
7379 As a side effect saved 1MB for MWF ;-)
7381 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
7382 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
7383 enum based for corlib compilation.
7385 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
7388 * class.cs (FixedField.Define): Use ResolveAsConstant.
7390 * const.cs (IConstant): Interface constants and enums.
7391 (Const.ResolveValue): New method for constant resolvning.
7392 (ExternalConstant): Constants from imported assemblies.
7394 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
7395 conversion; like enums.
7396 (Constant.ToType): Converts this constant to different type.
7397 (Constant.Increment): Adds 1.
7399 * convert.cs (ImplicitConversionRequired): Simplified.
7401 * cs-parser.jay: Create EnumMember directly.
7403 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
7405 * doc.cs (GenerateEnumDocComment): Removed.
7407 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
7408 (ConvertIntLiteral): Removed.
7409 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
7411 * enum.cs (EnumMember): Implement IConstant.
7412 (Enum.IsValidEnumConstant): Removed.
7413 (Enum.GetNextDefaultValue): Removed.
7414 (Enum.FindMembers): Updated.
7415 (Enum.GenerateDocComment): Iterate enum members.
7417 * expression.cs (Cast.TryReduce): Handle enums correctly.
7418 (New.Constantify): Made public.
7419 (MemberAccess.DoResolve): Removed contant specific if(s).
7421 * literal.cs (NullLiteral): Implement new abstract methods.
7423 * statement.cs (GotoCase.Resolve): Use new constant methods.
7424 (SwitchLabel.ResolveAndReduce): Use new constant methods.
7426 * typemanager.cs (LookupEnum): Removed.
7427 (IsEnumType): Fixed to work with corlib.
7428 (RegisterConstant): Removed.
7429 (LookupConstant): Removed.
7430 (GetConstant): Changed to work with IConstant.
7432 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
7434 * location.cs : Fixed overflown (>255) column number.
7436 2005-08-03 Raja R Harinath <rharinath@novell.com>
7438 First cut of the qualified-alias-member feature.
7439 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
7441 * cs-parser.jay (DOUBLE_COLON): New token.
7442 (namespace_or_type_name): Add rule for recognizing
7443 qualified-alias-members.
7444 (primary_expression): Likewise.
7445 (element_access): Allow QualifiedAliasMember as a possible
7446 type-bearing expression.
7447 (local_variable_type, local_variable_pointer_type): Likewise.
7448 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
7449 aliases in the current and enclosing namespace declarations.
7450 (NamespaceEntry.UsingAlias): Add CS0440 warning.
7451 * decl.cs (MemberName.is_double_colon): New.
7452 (MemberName.MemberName): Add new constructor for alias-member.
7453 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
7454 * expression.cs (QualifiedAliasMember): New expression type.
7456 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7458 * location.cs : it borked when no argument was specified.
7460 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7462 * location.cs : tiny ToString() format fix.
7464 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7466 * statement.cs : oops, it was missing.
7468 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7470 A set of fixes for precise line/column location.
7473 "token" field now holds a file/line "delta", a line number offset
7474 from the segment, and a column number. See also:
7475 http://lists.ximian.com/pipermail/mono-devel-list/2004-
7476 December/009508.html
7477 Removed static IsNull. Use instance IsNull property instead.
7479 For some tokens it stores Location. For Identifier it stores
7480 LocatedToken which is a pair of string name and location.
7481 Column numbers are adjusted only at getChar().
7483 Use Location.ToString() for reporting (it now contains column).
7485 Largely modified to use LocatedToken instead of
7486 string (IDENTIFIER), and to acquire Location from some tokens.
7487 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
7488 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
7490 Now MemberName holds Location. DeclSpace.ctor() receives Location
7491 as a parameter. Removed extra parameters to all derived classes.
7492 Replaced Location.IsNull() with instance property.
7493 * assign.cs, expression.cs :
7494 Added .ctor() overload that omits Location.
7496 Added "nameEscaped" flag that indicates the identifier was escaped
7497 in the source file. This fixes bug #57047.
7499 2005-08-02 Marek Safar <marek.safar@seznam.cz>
7501 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
7502 New method, looking for lo-case imported cls type.
7504 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
7507 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
7509 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
7511 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
7513 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
7515 Optimized to save 3.5 MB for SWF compilation.
7517 2005-08-01 Marek Safar <marek.safar@seznam.cz>
7519 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
7520 (PartialContainer.Create): Moved logic AddToContainer.
7521 (PartialContainer.MarkForDuplicationCheck): Shares name.
7523 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
7526 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
7528 (Namespace.GetSignatureForError): New method.
7530 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
7531 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
7533 2005-08-01 Raja R Harinath <rharinath@novell.com>
7536 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
7537 member lookup rather than qualifier_type, since qualifier_type can
7540 2005-08-01 Marek Safar <marek.safar@seznam.cz>
7542 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
7545 2005-07-31 Miguel de Icaza <miguel@novell.com>
7547 * statement.cs: Copy the local exception into the exception
7548 captured local. Fixes 75674
7550 2005-07-31 Raja R Harinath <harinath@gmail.com>
7553 * expression.cs (Invocation.OverloadResolve): Don't report error
7554 CS1501 if error CS1502 has been reported.
7555 (New.DoResolve): Delegate CS1501 reporting to
7556 Invocation.OverloadResolve.
7559 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
7560 invariant-meaning-in-block property in an enclosing block if
7563 2005-07-29 Marek Safar <marek.safar@seznam.cz>
7565 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
7566 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
7567 (Switch.CheckSwitch): Just save 50kb for SWF.
7569 2005-07-27 Martin Baulig <martin@ximian.com>
7571 * anonymous.cs (CaptureContext.AddField): Added
7572 `AnonymousContainer am' argument; compute its toplevel scope if
7573 it's not already computed. Fixes #75649.
7575 2005-07-26 Raja R Harinath <rharinath@novell.com>
7578 * class.cs (Constructor.Emit): Reset block to null if the block
7581 2005-07-25 Marek Safar <marek.safar@seznam.cz>
7583 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
7585 2005-07-25 Marek Safar <marek.safar@seznam.cz>
7587 * class.cs (MethodData.Define): Check whether accessor implementing
7588 interface is public.
7590 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
7592 2005-07-22 Marek Safar <marek.safar@seznam.cz>
7595 * namespace.cs (LookupType): Moved same type check to...
7597 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
7600 2005-07-21 Raja R Harinath <rharinath@novell.com>
7602 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
7603 already found a typebuilder.
7604 * class.cs (MethodCore.IsDuplicateImplementation): Compare
7605 MemberNames, not strings.
7607 * const.cs (Error_ExpressionMustBeConst):
7608 Rename from Error_EpressionMustBeConst.
7609 * const.cs, class.cs, statement.cd: Update.
7611 2005-07-21 Marek Safar <marek.safar@seznam.cz>
7615 * const.cs (Const.LookupConstantValue): Report missing contant expression
7617 (Error_EpressionMustBeConstant): Only one error method.
7619 * class.cs, statement.c: Updated.
7621 2005-07-20 Raja R Harinath <rharinath@novell.com>
7623 * statement.cs (Block.Flags): Add back HasVarargs.
7624 (Block.flags): Make protected.
7625 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
7627 * typemanager.cs (types, typecontainers, user_types): Remove.
7628 (UserTypes, TypeContainers): Likewise.
7629 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
7630 (CleanUp, Reset): Update.
7631 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
7632 (GetNestedType): Use Type.GetNestedType.
7633 (CoreLookupType): Take two arguments, the namespace and the
7634 basename of the type. Update to use the Namespace.Lookup
7636 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
7637 (RealMemberLookup): Use IsNestedChildOf instead of playing with
7638 string concatenation and substring matches.
7639 * class.cs, enum.cs, delegate.cs: Update to changes.
7641 2005-07-20 Marek Safar <marek.safar@seznam.cz>
7643 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
7644 Expression and made virtual.
7646 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
7647 (ImplicitStandardConversionExists): Fixed `byte' typo ?
7649 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
7651 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
7654 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
7657 2005-07-18 Marek Safar <marek.safar@seznam.cz>
7660 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
7661 AssemblyCultureAttribute is not used on executable.
7664 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
7666 2005-07-16 Raja R Harinath <rharinath@novell.com>
7669 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
7670 New. Reports CS0252/CS0253.
7671 Mostly taken from preliminary patch by Duncak Mak.
7672 (Binary.DoResolveOperator): Store results of operator lookup.
7673 Use them to detect if we need to warn about unintended reference
7676 2005-07-15 Raja R Harinath <rharinath@novell.com>
7679 * namespace.cs (Namespace.Lookup): Add back location parameter.
7680 (Namespace.LookupType): Add CS0436 report. Add location parameter.
7681 * delegate.cs, ecore.cs, expression.cs: Update to changes.
7683 * codegen.cs (EmitContext.DeclSpace): Make readonly.
7684 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
7685 (Namespace.LookupType): ... this.
7686 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
7688 * typemanager.cs (LookupTypeReflection): Remove buggy code that
7689 purported to handle pointers.
7690 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
7693 2005-07-15 Marek Safar <marek.safar@seznam.cz>
7695 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
7698 2005-07-15 Raja R Harinath <rharinath@novell.com>
7700 * namespace.cs (Namespace.Lookup): Drop location parameter.
7701 (NamespaceEntry.LookupAlias): Remove. Merge into ...
7702 (NamespaceEntry.Lookup): ... this.
7703 (NamespaceEntry.Error_AmbiguousTypeReference):
7704 Move here from DeclSpace.
7705 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
7707 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
7708 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
7709 Move to NamespaceEntry.
7710 * delegate.cs, expression.cs: Update to changes.
7712 2005-07-14 Marek Safar <marek.safar@seznam.cz>
7714 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
7715 CheckAttributeType and refactored.
7716 (Attribute.ResolvePossibleAttributeType): Changed to reuse
7717 ResolveAsTypeTerminal error handling.
7718 (ResolveAsTypeTerminal): Introduced because of global attributes extra
7720 (GetSignatureForError): Print errors in same way.
7723 * codegen.cs: Reflect attribute GetSignatureForError change.
7726 * expression.cs: Add silent parameter to ResolveAsTypeStep.
7728 * namespace.cs (UsingEntry): Refactored to make fields private.
7731 statement.cs: Error_UnexpectedKind has extra parameter.
7733 2005-07-14 Raja R Harinath <rharinath@novell.com>
7735 * ecore.cs (IAlias): Remove.
7736 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
7737 that implement the interface.
7738 * namespace.cs (Namespace): Likewise.
7739 (Namespace.declspaces): Renamed from 'defined_names'.
7740 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
7741 DeclSpace instead of an IAlias.
7742 * tree.cs (Tree.AddDecl): Update.
7744 2005-07-12 Raja R Harinath <rharinath@novell.com>
7746 * statement.cs (Block.Flags); Remove HasVarargs.
7747 (Block.HasVarargs): Move to ToplevelBlock.
7748 (Block.ThisVariable, Block.AddThisVariable): Likewise.
7749 (Block.Variables): Make protected. Initialize variable hashtable
7751 (Block.AddVariable): Update.
7752 (Block.Resolve): Update to changes.
7753 (ToplevelBlock.HasVarargs): New boolean.
7754 (ToplevelBlock.ThisVariable): Move here from Block.
7755 (ToplevelBlock.AddThisVariable): Likewise.
7756 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
7757 * expression.cs (This.ResolveBase): Update to changes.
7758 (ArglistAccess.DoResolve): Likewise.
7760 2005-07-11 Marek Safar <marek.safar@seznam.cz>
7763 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
7765 * class.cs (TypeContainer.VerifyMembers): Distinguish between
7766 not used and not used & assigned.
7767 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
7769 2005-07-11 Marek Safar <marek.safar@seznam.cz>
7772 * expression.cs (Is.DoResolve): null is never provided type.
7774 2005-07-08 Marek Safar <marek.safar@seznam.cz>
7777 * cs-parser.jay: Less strict event error rule to catch more errors.
7779 2005-07-08 Martin Baulig <martin@ximian.com>
7781 Fix test-iter-10.cs - distinguish whether we `yield' in a property
7782 gettter (allowed) or setter (not allowed).
7784 * class.cs (Accessor): Implement IIteratorContainer.
7785 (Accessor.Yields): New public field.
7786 (PropertyBase.PropertyMethod.Define): Handle iterators on a
7790 (get_accessor_declaration, set_accessor_declaration): Set the
7791 `yields' flag on the accessor, not the property.
7792 (property_declaration): Do the iterators check on a per-accessor
7793 basis and not for the whole property.
7795 2005-07-08 Martin Baulig <martin@ximian.com>
7797 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
7798 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
7800 2005-07-07 Marek Safar <marek.safar@seznam.cz>
7803 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
7804 (ExtractSecurityPermissionSet): Cope with self referencing security
7805 attributes properly.
7807 * driver.cs (SetOutputFile): Made public property OutputFile.
7809 2005-07-07 Raja R Harinath <rharinath@novell.com>
7812 * class.cs (TypeContainer.first_nonstatic_field): Rename from
7813 has_nonstatic_fields. Make into a FieldBase pointer.
7814 (TypeContainer.AddField): Add CS0282 check.
7815 (TypeContainer.EmitType): Update.
7817 2005-07-06 Miguel de Icaza <miguel@novell.com>
7819 * cs-tokenizer.cs (consume_identifier): Do not create strings to
7820 compare if they start with __.
7822 2005-07-06 Raja R Harinath <rharinath@novell.com>
7824 * statement.cs (Switch.SwitchGoverningType): Only look at
7825 UserCasts that don't need implicit standard conversions to one of
7826 the allowed switch types (Fixes test-322.cs).
7827 (LocalInfo.Resolve): Re-enable sanity-test.
7829 2005-07-06 Marek Safar <marek.safar@seznam.cz>
7831 * cs-tokenizer.cs (consume_identifier): Detect double undescores
7833 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
7835 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
7837 2005-07-06 Raja R Harinath <rharinath@novell.com>
7840 * ecore.cs (SimpleName.GetSignatureForError): Add.
7841 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
7842 (MemberAccess.GetSignatureForError): Add.
7844 2005-07-05 Marek Safar <marek.safar@seznam.cz>
7846 The big error and warning messages review.
7876 * typemanager.cs: Updated.
7878 * class.cs: (MethodCore.SetYields): Moved here to share.
7879 (PropertyMethod.Define): Moved iterator setup here.
7881 * iterators.cs: Add orig_method to have full access to parent
7884 2005-07-05 Raja R Harinath <rharinath@novell.com>
7886 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
7887 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
7888 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
7889 variable of struct type.
7890 * expression.cs (Unary.ResolveOperator): Update to change.
7891 (Indirection.VerifyFixed): Likewise.
7892 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
7893 (ParameterReference.VerifyFixed): Value parameters are fixed.
7894 (This.VerifyFixed): Treat 'this' as a value parameter.
7895 * statement.cs (LocalInfo.IsFixed): Remove.
7897 2005-07-01 Martin Baulig <martin@ximian.com>
7899 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
7900 `ec.EmitThis ()' to get the correct scope.
7902 2005-07-01 Martin Baulig <martin@ximian.com>
7904 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
7905 instance is a ParameterReference; fixes #75299.
7907 2005-07-01 Martin Baulig <martin@ximian.com>
7909 Reverted Marek's latest patch (r46725):
7910 - it contains structural changes which are neither mentioned in
7911 the ChangeLog nor explained anywhere; for example the additional
7912 argument of EmitContext's and Iterator's .ctor's and the
7913 TypeContainer.DefineMembers() change.
7914 - structural changes like this should go in in seperate patches
7915 and not be hidden in a huge patch which just seems to affect
7916 warnings and errors.
7917 a big and hard to understand patch.
7918 - it breaks iterators and causes regressions, for instance in
7921 2005-06-30 Raja R Harinath <rharinath@novell.com>
7924 * expression.cs (Indexers.map): Remove.
7925 (Indexers.Append): Filter out inaccessible setters and getters.
7926 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
7929 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
7931 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
7932 (FieldExpr.Emit, PropertyExpr.Emit): Update.
7933 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
7934 * expression.cs (Invocation.EmitCall): Add CS0120 check.
7936 2005-06-30 Marek Safar <marek.safar@seznam.cz>
7939 * class.cs (FieldBase.GetInitializerExpression): One more field
7942 2005-06-28 Miguel de Icaza <miguel@novell.com>
7944 * pending.cs: Do not define a proxy if the base method is virtual,
7945 it will be picked up by the runtime (bug 75270).
7947 2005-06-08 Martin Baulig <martin@ximian.com>
7949 The big Iterators rewrite :-)
7951 * iterators.cs: Rewrite this to use the anonymous methods framework.
7953 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
7954 before the TypeContainers; see 2test-21.cs.
7957 (TypeContainer.DefineType): Don't create a new EmitContext if we
7958 already have one (this only happens if we're an Iterator).
7959 (TypeContainer.Define): Also call Define() on all our iterators.
7960 (Method.CreateEmitContext): Added support for iterators.
7963 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
7964 (AnonymousContainer.CreateMethodHost): Moved here from
7965 AnonymousMethod and made abstract.
7966 (AnonymousContainer.CreateScopeType): New abstract method.
7967 (AnonymousContainer.IsIterator): New public property.
7968 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
7969 get the ScopeTypeBuilder rather than manually defining it here.
7970 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
7973 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
7974 before RootContext.DefineTypes().
7976 * codegen.cs (EmitContext.RemapToProxy): Removed.
7977 (EmitContext.CurrentAnonymousMethod): Changed type from
7978 AnonymousMethod -> AnonymousContainer.
7979 (EmitContext.ResolveTopBlock): Protect from being called twice.
7980 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
7981 (EmitContext.EmitThis): Removed the iterators hacks; use the
7982 anonymous methods framework for that.
7985 (ToplevelBlock.Container): Make this a property, not a field.
7986 (ToplevelBlock.ReParent): New public method; move the
7987 ToplevelBlock into a new container.
7988 (Foreach.TemporaryVariable): Simplify.
7990 2005-06-05 Martin Baulig <martin@ximian.com>
7992 * statement.cs (LocalInfo.CompilerGenerated): New flag.
7993 (Block.AddTemporaryVariable): New public method; creates a new
7994 `LocalInfo' for a temporary variable.
7995 (Block.EmitMeta): Create the LocalBuilders for all the temporary
7997 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
7998 non-iterator variables.
8000 2005-06-05 Martin Baulig <martin@ximian.com>
8002 * statement.cs (Foreach.TemporaryVariable): Create the
8003 LocalBuilder in the Emit phase and not in Resolve since in some
8004 situations, we don't have an ILGenerator during Resolve; see
8005 2test-19.cs for an example.
8007 2005-06-04 Martin Baulig <martin@ximian.com>
8009 **** Merged r45395 from GCS ****
8011 The big Foreach rewrite - Part II.
8013 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
8014 with `PropertyInfo ienumerator_getcurrent'.
8016 * codegen.cs (VariableStorage): Removed.
8019 (Foreach): Derive from Statement, not ExceptionStatement.
8020 (Foreach.CollectionForeach): New nested class. Moved all the code
8021 dealing with collection foreach here.
8022 (Foreach.ForeachHelperMethods): Removed.
8023 (Foreach.TemporaryVariable): Implement IMemoryLocation.
8025 2005-05-23 Martin Baulig <martin@ximian.com>
8027 * statement.cs (Try.DoResolve): Don't create a `finally' if we
8028 don't need to. Fix #75014.
8030 2005-05-20 Martin Baulig <martin@ximian.com>
8032 Merged r44808 from GMCS.
8034 * class.cs (TypeContainer.CircularDepException): Removed.
8035 (TypeContainer.DefineType): Removed the `InTransit' stuff.
8036 (TypeContainer.CheckRecursiveDefinition): Check for circular class
8037 (CS0146) and interface (CS0529) dependencies here.
8039 2005-06-21 Raja R Harinath <rharinath@novell.com>
8041 * expression.cs (Invocation.EmitCall): Fix initialization
8042 'this_call' to reflect current behaviour. Fix indentation.
8044 * convert.cs (FindMostEncompassedType): Add two trivial special
8045 cases (number_of_types == 0 || number_of_types == 1).
8046 (FindMostEncompasingType): Likewise.
8048 2005-06-17 Raja R Harinath <rharinath@novell.com>
8050 Some cleanups preparing for the fix of #75283.
8051 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
8053 (EventExpr.InstanceResolve): Likewise.
8054 (EventExpr.DoResolve): Remove redundant checks.
8056 2005-06-10 Duncan Mak <duncan@novell.com>
8058 * cs-tokenizer.cs (process_directives): New flag for controlling
8059 the processing of preprocessor directives.
8060 (x_token): After seeing a '#', return Token.NONE instead of going
8061 to handle_preprocessing_directive() when not processing
8062 directives. This avoids unnecessary processing during the token peek in
8067 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
8068 the existing error reporting methods instead of Report.Error.
8070 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
8071 after Raja's rewrite.
8073 2005-06-08 Miguel de Icaza <miguel@novell.com>
8075 * class.cs: Small fix.
8077 2005-06-08 Raja R Harinath <rharinath@novell.com>
8080 * class.cs (GetPartialBases): Fix return value check of
8083 2005-06-07 Raja R Harinath <rharinath@novell.com>
8085 Ensure that partial classes are registered in their enclosing
8086 namespace. Initial part of fix of #75160.
8087 * tree.cs (Tree.RecordDecl): Add new namespace argument.
8088 Register declspace with namespace here, not in
8089 DeclSpace.RecordDecl.
8090 * cs-parser.jay: Pass namespace to RecordDecl.
8091 * class.cs (PartialContainer.Create): Likewise.
8092 (ClassPart.DefineType): New sanity-check. Throws an exception if
8094 * decl.cs (Declspace.RecordDecl): Remove.
8095 * namespace.cs (NamespaceEntry.DefineName): Remove.
8097 2005-06-06 Marek Safar <marek.safar@seznam.cz>
8099 * rootcontext.cs: Reset TargetExt as well.
8101 2005-06-03 Raja R Harinath <rharinath@novell.com>
8103 * ecore.cs (Expression.Resolve): Emit CS0654 error when
8106 2005-06-02 Raja R Harinath <rharinath@novell.com>
8108 Fix #75080, cs0119.cs.
8109 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
8111 (Expression.Resolve): ... this. Use it. Remove bogus code
8112 allowing ExprClass.Type and ExprClass.Namespace for
8113 ResolveFlags.VariableOrValue.
8114 (Expression.Resolve) [1-argument variant]: Change default resolve
8115 flags based on language version.
8116 (Expression.Error_UnexpectedKind): Use a simple string array
8117 rather than an ArrayList.
8118 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
8120 (TypeOfVoid.DoResolve): Likewise.
8121 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
8122 flags argument -- it always has the same value.
8124 2005-05-31 Raja R Harinath <rharinath@novell.com>
8127 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
8128 Use it in the error message.
8129 * assign.cs, expression.cs, statement.cs: Update.
8131 2005-05-30 Raja R Harinath <rharinath@novell.com>
8134 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
8135 the "almostMatchedMember" case too.
8136 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
8137 that failed the accessibility checks to 'almost_match'.
8139 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
8141 * attribute.cs: Use internal MethodBuilder methods to set
8142 ExactSpelling and SetLastError on PInvoke methods, instead
8143 of passing them via charset. Fixes #75060.
8145 2005-05-27 Raja R Harinath <rharinath@novell.com>
8147 * parameter.cs (Parameter): Remove TODO comment.
8148 (Parameter.DefineParameter): Remove Location parameter.
8149 (Parameters.LabelParameters): Likewise.
8150 * class.cs (Constructor.Emit): Update to change.
8151 (MethodData.Emit): Likewise.
8152 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
8153 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
8155 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
8158 Removed Parameters.Location and added Parameter.Location instead.
8159 Removed Location parameter from Emit() and GetSignature().
8166 Modified all related calls.
8168 2005-05-26 Raja R Harinath <rharinath@novell.com>
8170 Improve user-defined conversion handling.
8171 * convert.cs (GetConversionOperators): Rewrite. Return only the
8172 applicable operators.
8173 (AddConversionOperators): New. Helper for GetConversionOperators.
8174 (FindMostEncompassedType, FindMostEncompassingType): Verify that
8175 there is only one most encompassed/encompassing type.
8176 (FindMostSpecificSource, FindMostSpecificTarget): Remove
8177 "applicable operator" handling.
8178 (UserConversion): Move cache here from GetConversionOperators.
8179 Directly cache the chosen operator, rather than the whole
8181 (ExplicitNumericConversion): Fix buggy implementation of Decimal
8182 case. Allow conversion of decimal to sbyte and byte too.
8183 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
8184 New static methods. Used to avoid allocating EmptyExpressions in
8187 2005-05-24 Duncan Mak <duncan@novell.com>
8189 * ecore.cs (CastFromDecimal): New class for casting a decimal to
8190 another class, used in Convert.ExplicitNumericConversion.
8191 (CastToDecimal): New class, similar to above, but casts to
8192 System.Decimal, used in Convert.ImplicitNumericConversion and also
8193 in explicit convesion from double/float to decimal.
8195 * convert.cs (ImplicitNumericConversion): Handle implicit
8196 conversions to System.Decimal.
8197 (ExplicitNumericConversion): handle explicit conversions to
8202 2005-05-20 Miguel de Icaza <miguel@novell.com>
8204 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
8205 know the type at this stage, just break through. Fixes #75008
8207 2005-05-19 Martin Baulig <martin@ximian.com>
8210 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
8211 to disable error reporting.
8213 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
8214 here since we don't want to report an error; see the new test-336.cs.
8216 2005-05-19 Raja R Harinath <rharinath@novell.com>
8218 * statement.cs (ToplevelBlock.GetParameterReference)
8219 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
8220 Move here from class Block.
8221 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
8222 * expression.cs (ParameterReference.DoResolveBase): Likewise.
8224 2005-05-18 Martin Baulig <martin@ximian.com>
8229 (FlowBranching.Reachability): Add non-static public And() and Or()
8231 (FlowBranchingSwitch): New class; do the `break_origins' thing
8232 like in FlowBranchingLoop.
8233 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
8234 reachability, not just locals and parameters.
8235 (FlowBranching.MergeChild): Remove some of the hacks for loop and
8236 switch; MergeBreakOrigins() now takes care of that.
8238 2005-05-18 Martin Baulig <martin@ximian.com>
8240 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8241 a loop and may leave it, reset the barrier; fixes #74974.
8243 2005-05-17 Marek Safar <marek.safar@seznam.cz>
8245 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
8248 * cs-parser.jay: Catch more lexical errors.
8250 * report.cs: Add one more Error method.
8253 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
8255 2005-05-17 Martin Baulig <martin@ximian.com>
8257 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
8260 2005-05-16 Raja R Harinath <rharinath@novell.com>
8262 Fix test-382.cs. Emit values of decimal constants.
8263 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
8265 (TypeContainer.AddField): ... this.
8266 (TypeContainer.EmitFieldInitializers): Allow the list of fields
8267 with initializers to include 'Const's.
8268 (ClassPart.RegisterFieldForInitialization): Forward to
8270 * const.cs (Const.Const): Pass initializer to base class.
8271 (Const.Define): In case of decimal constants, register them for
8272 initialization in a static constructor.
8274 2005-05-14 Martin Baulig <martin@ximian.com>
8276 * statement.cs (Block.Resolve): Correctly handle unreachable code;
8277 do not call ResolveUnreachable() on unreachable statements in
8278 here, see the comment in the source code.
8280 2005-05-13 Raja R Harinath <rharinath@novell.com>
8283 * expression.cs (BinaryResolveOperator): If one of the operands of
8284 an equality comparison is 'null' and the other is a pointer type,
8285 convert the null to a NullPointer.
8286 * convert.cs (ImplicitReferenceConversion): If the expression is a
8287 NullLiteral and the target type is a pointer type, return a
8288 NullPointer instead.
8289 (ImplicitConversionStandard): Likewise.
8291 2005-05-13 Marek Safar <marek.safar@seznam.cz>
8293 * cs-parser.jay: Set readonly context based on special constructs.
8295 * expression.cs (LocalVariableReference.DoResolveBase): Improved
8296 readonly variable error handling.
8298 * rootcontext.cs (EmitCode): Don't verify members when error
8301 * statement.cs (LocalInfo): Add reaodnly context information.
8302 (SetReadOnlyContext, GetReadOnlyContext): New methods.
8304 2005-05-13 Raja R Harinath <rharinath@novell.com>
8306 * statement.cs (Block.Resolve): Revert change below. Modify fix
8307 for #74041 to initialize 'resolved' to false only for explicit
8308 blocks. Fixes #74873.
8310 2005-05-12 Raja R Harinath <harinath@gmail.com>
8313 * typemanager.cs (unmanaged_enclosing_types): New.
8314 (IsUnmanagedType): Avoid infloops by using
8315 'unmanaged_enclosing_types' to talk with recursive invocations.
8317 2005-05-13 Martin Baulig <martin@ximian.com>
8319 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
8320 instance variable, not a local. Fix #74873.
8321 (Block.ResolveUnreachable): Set it to true here.
8323 2005-05-11 Duncan Mak <duncan@novell.com>
8325 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
8326 continuing to process for 'arg'.
8327 (handle_preprocessing_directive): Check the argument of the #endif
8328 directive and report error CS1025 if there are any trailing
8331 According to the C# spec, having even whitespace after the #endif
8332 directive is illegal; however, because we call arg.TrimEnd ()
8333 beforehand, we have the same behavior as csc, allowing whitespace
8334 after the directive.
8338 2005-05-11 Marek Safar <marek.safar@seznam.cz>
8342 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
8343 (Constructor.GetObsoleteAttribute): Implemented correctly.
8345 2005-05-10 Martin Baulig <martin@ximian.com>
8347 * support.cs (ReflectionParameters.ParameterModifier): Use
8348 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
8349 and `ParameterAttributes.In'. Fixes #74884.
8351 2005-05-10 Marek Safar <marek.safar@seznam.cz>
8353 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
8355 * expression.cs (Argument.GetParameterModifier): Turned to property.
8356 (Invocation.Error_InvalidArguments): Add more descriptive errors.
8358 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
8361 2005-05-09 Raja R Harinath <rharinath@novell.com>
8364 * decl.cs (MemberCache.AddMethods): Register override methods,
8365 rather than non-override methods.
8366 * typemanager.cs (RegisterOverride): New.
8367 (IsOverride): Update.
8369 2005-05-09 Marek Safar <marek.safar@seznam.cz>
8373 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
8374 recursive declaration.
8376 * statement.cs (Block.ResolveMeta): Report any error in resolving.
8378 2005-05-06 Marek Safar <marek.safar@seznam.cz>
8380 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
8382 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
8384 2005-05-05 Raja R Harinath <rharinath@novell.com>
8387 * decl.cs (DeclSpace.FamilyAccessible):
8388 Use TypeManager.IsNestedFamilyAccessible.
8390 Fix reopened #64812.
8391 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
8394 2005-05-04 Raja R Harinath <rharinath@novell.com>
8395 Abin Thomas <projectmonokochi@rediffmail.com>
8396 Anoob V E <projectmonokochi@rediffmail.com>
8397 Harilal P R <projectmonokochi@rediffmail.com>
8400 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
8401 allow access to all static members.
8403 2005-05-04 Martin Baulig <martin@ximian.com>
8405 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
8407 2005-05-04 Martin Baulig <martin@ximian.com>
8411 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
8412 section at the end; make things work if `default' is not the last
8415 2005-05-04 Martin Baulig <martin@ximian.com>
8419 * statement.cs (Switch): Replaced the `got_default' field with a
8420 `default_section' one.
8421 (Switch.CheckSwitch): Set `default_section' here.
8422 (Switch.Resolve): If we're a constant switch and the constant is
8423 not found, use the default section.
8425 2005-05-03 Martin Baulig <martin@ximian.com>
8427 * expression.cs (ArrayAccess.EmitGetLength): New public method.
8429 * statement.cs (Foreach.ArrayForeach): New nested class.
8430 (Foreach.TemporaryVariable): New nested class.
8431 (Foreach.EmitArrayForeach): Removed; this is now in the new
8434 2005-05-03 Raja R Harinath <rharinath@novell.com>
8436 * pending.cs (BaseImplements): Move the #74773 fix here. This is
8438 (VerifyPendingMethods): Revert change below.
8440 * typemanager.cs (IsOverride, RegisterNonOverride): New.
8441 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
8442 that used to trigger warning -28. Remove warning -28.
8443 * expression.cs (Invocation.OverloadResolve): Use
8444 TypeManager.IsOverride to distinguish override methods.
8447 * pending.cs (VerifyPendingMethods): If a base type implements the
8448 requested interface, don't bother checking individual methods of
8449 the base type. As a side-effect, this prevents the creation of
8450 unnecessary proxies.
8452 2005-05-02 Martin Baulig <martin@ximian.com>
8456 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8457 Also `And' the locals if the old vector is null.
8458 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
8459 null; in this case we basically reset all the variables.
8461 2005-05-02 Martin Baulig <martin@ximian.com>
8465 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
8466 Added `FlowBranching branching' argument; always `and' the
8467 variables instead of `or'ing them unless we're an infinite loop.
8469 * statement.cs (While.Resolve): Create a new sibling unless we're
8472 2005-05-02 Martin Baulig <martin@ximian.com>
8476 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
8477 arguments; use it instead of creating a new TopLevelBlock.
8478 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
8479 our ConstructorInitializer.
8482 (TopLevelBlock.TopLevelBranching): New public property.
8483 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
8484 and create our `TopLevelBranching'.
8486 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
8487 anonymous method host, use `block.TopLevelBranching' rather than
8488 creating a new branching.
8490 2005-04-20 Miguel de Icaza <miguel@novell.com>
8492 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
8493 a ScopeInfo, if any of the current children is a child of the new
8494 entry, move those children there.
8496 2005-04-30 Martin Baulig <martin@ximian.com>
8498 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
8499 at the beginning of a SwitchSection. Fix #73335.
8501 2005-04-27 Marek Safar <marek.safar@seznam.cz>
8504 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
8506 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
8507 (FieldExpr.DoResolve): Obsolete members are ignored for field
8510 2005-04-26 Marek Safar <marek.safar@seznam.cz>
8512 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
8513 of arrays detection.
8515 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
8517 (Field.VerifyClsCompliance): Volatile fields are not compliant.
8519 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
8522 2005-04-25 Ben Maurer <bmaurer@ximian.com>
8524 * cs-parser.jay: Use the prefered version of -unsafe in error
8527 2005-04-22 Marek Safar <marek.safar@seznam.cz>
8529 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
8532 2005-04-20 John Luke <john.luke@gmail.com>
8534 * driver.cs: fix typo in error message, --outout to --output
8536 2005-04-20 Marek Safar <marek.safar@seznam.cz>
8538 * codegen.cs (InRefOutArgumentResolving): New field.
8540 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
8541 fields outside contructor.
8543 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
8545 2005-04-19 Miguel de Icaza <miguel@novell.com>
8547 * anonymous.cs (CaptureContext.EmitParameterInstance): The
8548 parameter code was not completed ever, so it was not as up-to-date
8549 as local variables. Must finish it.
8551 The bug fix was to compare the Toplevel of the block, not the
8552 current block. Thanks for Ben for pointing this out.
8554 2005-04-19 Raja R Harinath <rharinath@novell.com>
8556 * decl.cs (AddMethods): Use the declaring type of the problem
8557 method to determine if we want to squash a warning.
8559 2005-04-19 Marek Safar <marek.safar@seznam.cz>
8561 * attribute.cs: Removed debug output.
8563 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
8565 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
8568 2005-04-18 Raja R Harinath <rharinath@novell.com>
8571 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
8572 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
8573 all null comparisons against reference types.
8575 2005-04-18 Marek Safar <marek.safar@seznam.cz>
8578 * class.cs (TypeContainer.CircularDepException) New nested
8580 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
8581 (TypeContainer.DefineType): Removed error, reset InTransit before
8583 (Class.DefineType): Throw exception when is in Transit.
8584 Catch exception and report error.
8585 (Struct.DefineType): Throw exception when is in Transit.
8586 Catch exception and report error.
8587 (Interface.DefineType): Throw exception when is in Transit.
8588 Catch exception and report error.
8590 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
8591 handle nested exception handlers.
8593 * flowanalysis.cs (InTryWithCatch): New method, search for try with
8596 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
8597 InFinally and InCatch storage.
8599 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
8600 (Catch.Resolve): Set and Restore ec.InCatch.
8601 (Try.Resolve): Set and Restore ec.InFinally.
8602 (Try.HasCatch): True when try has catch.
8604 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
8606 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
8607 for the same event member, so exclude such cases from warning 419.
8610 2005-04-16 Miguel de Icaza <miguel@novell.com>
8612 * expression.cs (Binary.ResolveOperator): Apply patch from John
8613 Luke to fix bug 59864: operators &, | and ^ on enumerations
8614 require that the same enum type on both sides.
8616 * driver.cs: Add warnings to old flag usage, this is to assist
8617 people who produce Makefiles and hope that the Makefiles will be
8620 * class.cs (TypeContainer.EmitType): Moved the definition of the
8621 special $PRIVATE$ field from the resolve phase to the Emit phase.
8622 During resolve we do not know if we are a struct with
8623 HasExplicitLayout, we know this only after the attributes for the
8626 Set the FieldOffset to zero on the dummy field that we create for
8627 the class. Fixes 74590.
8629 2005-04-16 Raja R Harinath <rharinath@novell.com>
8632 * ecore.cs (PropertyExpr.resolved): New.
8633 (DoResolve): Use it to handle a case of double resolution here.
8634 Handle a case of identical-name-and-type-name.
8635 * expression.cs (ArrayCreation.CheckIndices): Avoid double
8636 resolution by storing the results of expression resolution back
8637 into the "probes" array.
8639 2005-04-15 Raja R Harinath <rharinath@novell.com>
8641 Fix cs0208-7.cs and cs0208-8.cs.
8642 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
8643 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
8644 error reporting to point out the reason a struct is not unmanaged.
8646 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8648 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
8649 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
8651 2005-04-13 Raja R Harinath <rharinath@novell.com>
8654 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
8655 IdenticalNameAndTypeName here.
8656 (EventExpr.InstanceResolve): Likewise.
8658 2005-04-13 Marek Safar <marek.safar@seznam.cz>
8660 C# 2.0 DefaultCharSetAttribute implementation
8662 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
8663 which allows us to set GlobalNamespace for every resolve.
8664 (Attribute.ResolveArguments): Cut from Resolve.
8665 (Attribute.GetCharSetValue): Returns CharSet named argument.
8666 (Attribute.DefinePInvokeMethod): Gets default charset from
8668 (GlobalAttribute.ResolveAsTypeStep): Override.
8669 (GlobalAttribute.ResolveArguments): Override.
8671 * class.cs (TypeAttr): Is protected.
8673 * codegen.cs (ModuleClass.DefaultCharSet): New member.
8674 (ModuleClass.DefaultCharSetType): New memeber.
8675 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
8677 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
8678 charset from module.
8680 * delegate.cs (TypeAttr): Override.
8681 (Delegate.DefineType): Use this TypeAttr.
8683 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
8684 at very early stage (before types are defined) to resolve model
8685 module attributes. It will probably not work with corlib but it
8688 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
8689 charset from module.
8691 * typemanager.cs (default_charset_type): New type.
8693 2005-04-13 Raja R Harinath <rharinath@novell.com>
8695 * decl.cs (MemberCache.AddMethods): Don't warn if
8696 System.Object.Finalize has buggy MethodAttributes.
8698 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
8701 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8703 * doc.cs : detect ambiguous reference to overloaded members.
8704 Fixed bug #71603. MS 1.1 csc does not detect it.
8706 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8708 * doc.cs : delegates must not be referenced with parameters.
8711 2005-04-12 Miguel de Icaza <miguel@novell.com>
8713 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
8715 2005-04-10 Miguel de Icaza <miguel@novell.com>
8717 * driver.cs (MainDriver): Stop processing if the CLS stage found
8720 (CompilerCallableEntryPoint.InvokeCompiler): Always
8721 reset after execution; Take a TextWriter argument for the
8724 * report.cs: Use the error stream instead of hardcoding stderr.
8726 2005-04-09 Miguel de Icaza <miguel@novell.com>
8728 * class.cs: Reduce code paths to test, too small of an
8729 optimization to make it worth the extra testing. Always perform
8732 2005-04-08 Raja R Harinath <rharinath@novell.com>
8735 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
8736 operators that had errors reported on them.
8738 2005-04-08 Marek Safar <marek.safar@seznam.cz>
8740 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
8742 (Attribute.Resolve): Add named argument type checking.
8744 * class.cs (FixedField.Define): Use IsPrimitiveType
8746 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
8748 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
8749 unsafe parameter types.
8751 * statement.cs (Using.ResolveExpression): Add better error description.
8753 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
8755 2005-04-08 Raja R Harinath <rharinath@novell.com>
8758 * attribute.cs (Attribute.GetAttributeUsage): Resolve
8759 AttributeUsageAttribute in the emitcontext of the attribute class,
8760 not in the emitcontext of the attributable entity it was attached to.
8761 * cs-parser.jay: Use 'current_class', not 'current_container',
8762 when creating a GlobalAttribute.
8764 2005-04-08 Alp Toker <alp@atoker.com>
8766 * pending.cs: The fix to #58413 failed to compile methods implementing
8767 interfaces with/without params modifiers and vice versa, even though
8768 params modifiers aren't part of the signature. Make the modifier check
8769 less strict as in csc.
8771 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
8772 Anoob V E <projectmonokochi@rediffmail.com>
8773 Harilal P R <projectmonokochi@rediffmail.com>
8776 * pending.cs (TypeAndMethods.mods): New. Store the parameter
8777 modifiers of pending methods.
8778 (PendingImplementation.PendingImplementation): Initialize it.
8779 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
8780 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
8781 with ParameterData. Add check for modifiers.
8782 * class.cs (MethodData.Define): Update to changes.
8784 2005-04-07 Raja R Harinath <rharinath@novell.com>
8786 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
8788 2005-04-07 Marek Safar <marek.safar@seznam.cz>
8790 * class.cs (PropertyMethod.Define): Check private accessor in abstract
8793 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
8796 * typemanager.cs: Registered RequiredAttributeAttribute.
8798 2005-04-06 Marek Safar <marek.safar@seznam.cz>
8800 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
8801 Warning CS0169 is back at level 3.
8802 (IMethodData.SetMemberIsUsed): New method.
8804 * decl.cs (IsUsed): New value; moved from FieldBase.Status
8805 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
8807 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
8809 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
8811 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
8814 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
8817 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
8818 to avoid the problems with nested types.
8820 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
8821 Anoob V.E <projectmonokochi@rediffmail.com>
8822 Harilal P.R <projectmonokochi@rediffmail.com>
8823 Raja R Harinath <rharinath@novell.com>
8826 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
8828 * typemanager (GetConstructor): Make public.
8830 2005-04-05 John Luke <john.luke@gmail.com>
8831 Raja R Harinath <rharinath@novell.com>
8834 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
8835 struct too. Return false quicker in a few cases.
8836 (VerifyUnManaged): Use it.
8838 2005-04-05 Raja R Harinath <rharinath@novell.com>
8841 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
8842 not 'unreachable_seen'.
8844 2005-04-04 Marek Safar <marek.safar@seznam.cz>
8846 * attribute.cs (Attribute.GetValue): Removed unused.
8848 * codegen.cs (CodeGen.TrimExt): Removed unused.
8850 * cs-parser.jay (output): Removed unused.
8852 * cs-tokenizer.cs (hex_digits): Removed unused.
8854 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
8856 * expression.cs (Indirection.LoadExprValue): Removed unused.
8857 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
8859 * iterators.cs (Iterator.param_types): Removed unused.
8861 * statement.cs (Goto.block): Removed unused.
8862 (ToplevelBlock.did): Removed unused.
8863 (Switch.ResolveConstantSwitch): Removed unused.
8865 2005-04-01 Ben Maurer <bmaurer@ximian.com>
8867 * rootcontext.cs: Allow mcs to bootstrap with the compilation
8870 2005-04-01 Raja R Harinath <rharinath@novell.com>
8872 Fix #74232 and cs0208-3.cs.
8873 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
8874 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
8875 unmanaged type. Don't use FieldBuilders when 't' is a
8876 TypeBuilder. Use ModFlags and MemberType fields.
8877 * class.cs (MemberBase.member_type): Rename from MemberType.
8878 (MemberBase.MemberType): New property. Determines member_type on
8880 (MemberBase.DoDefine): Don't initialize MemberType here.
8881 (FieldMember.Define): Likewise.
8883 2005-04-01 Marek Safar <marek.safar@seznam.cz>
8886 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
8887 Attributes are emitted there.
8889 2005-04-01 Raja R Harinath <rharinath@novell.com>
8891 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
8892 keyword in 'partial enum' too.
8893 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
8895 Report from Kamil Skalski <nazgul@omega.pl>.
8898 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
8899 have partial containers too.
8901 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
8902 in block' checks to Block.CheckInvariantMeaningInBlock.
8903 * statement.cs (Block.GetKnownVariableInfo): Make private.
8904 (Block.IsVariableUsedInChildBlock): Remove.
8905 (Block.IsVariableUsedInBlock): Likewise.
8906 (Block.CheckInvariantMeaningInBlock): New. Show location of
8907 conflicting declaration.
8908 (Block.AddVariable): Make error messages less long-winded and more
8909 specific. Show location of conflicting declaration.
8910 * parameter.cs (Parameters.Location): New readonly property.
8912 2005-03-31 Raja R Harinath <rharinath@novell.com>
8914 Clean up semantics of invoking ResolveMemberAccess.
8915 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
8916 can have an instance, ensure that we pass in a non-TypeExpression
8917 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
8918 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
8919 argument. Update to changes and simplify.
8920 (FieldExpr.Emitinstance): Remove CS0120 check.
8921 (PropertyExpr.EmitInstance): Likewise.
8922 * expression.cs (Argument.Resolve): Likewise.
8923 (Invocation.DoResolve): Update to changes in semantics of
8926 2005-03-31 Marek Safar <marek.safar@seznam.cz>
8929 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
8932 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
8934 2005-03-31 Raja R Harinath <rharinath@novell.com>
8936 Fix difference in behaviour with commandline invocation.
8937 * driver.cs (Driver.Reset): New.
8938 (CompilerCallableEntryPoint): Call it.
8940 * statement.cs (If.Resolve): Avoid spurious "uninitialized
8941 variable" warnings if the boolean expression failed to resolve.
8943 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
8945 * attribute.cs: Fix the union of several permissions when some of them
8946 are unrestricted (so the result isn't an unrestricted permission set).
8949 2005-03-30 Raja R Harinath <rharinath@novell.com>
8951 * ecore.cs (MemberExpr): New class. Convert from interface
8953 (MemberExpr.ResolveMemberAccess): Refactor and move here from
8954 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
8956 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
8957 (MethodGroupExpr.IsExplicitImpl): Remove.
8958 (Expression.GetFieldFromEvent): Remove.
8959 (SimpleName.MemberStaticCheck): Remove.
8960 (SimpleName.DoSimpleNameResolve): Update to changes.
8961 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
8962 (MemberAccess.IdenticalNameAndTypeName): Remove.
8963 (MemberAccess.error176): Move to MemberExpr.
8964 (MemberAccess.DoResolve): Update to changes.
8965 (BaseAccess.DoResolve): Likewise.
8967 2005-03-30 Marek Safar <marek.safar@seznam.cz>
8969 C# 2.0 Conditional attribute class implementation
8971 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
8972 Analyzes class whether it has attribute which has ConditionalAttribute
8973 and its condition is not defined.
8975 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
8976 (Class.IsExcluded): New method. Search for at least one defined
8977 condition in ConditionalAttribute of attribute class.
8979 2005-03-30 Raja R Harinath <rharinath@novell.com>
8981 * ecore.cs (PropertyExpr): Derive from Expression, not
8982 ExpressionStatement.
8983 (PropertyExpr.EmitStatement): Remove.
8985 2005-03-29 Raja R Harinath <rharinath@novell.com>
8988 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
8989 internal field "value__" of an enum be private. The examples for
8990 "value__" that I found on MSDN all used FieldAttributes.Private.
8992 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
8993 Don't mention IL method attribute names.
8995 Fix #47991. Remove a TODO.
8996 * statement.cs (Block.Toplevel): Make into a field.
8997 (Block.Parameters): Move into ToplevelBlock.
8998 (Block.known_variables): Rename from child_variable_names.
8999 (Block.Block): Remove variants that take Parameters. Initialize
9000 'Toplevel' with the immediately surrounding toplevel block.
9001 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
9002 LocalInfo parameter.
9003 (Block.GetKnownVariableInfo): New.
9004 (Block.IsVariableNameUsedInChildBlock): Update.
9005 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
9006 the block, even though it may not be in scope.
9007 (Block.AddVariable): Remove Parameters parameter. Use
9008 Toplevel.Parameters instead.
9009 (Block.AddConstant): Remove Parameters parameter.
9010 (Block.GetParameterReference): Update to use Toplevel.Parameters.
9011 (Block.IsParamaterReference): Likewise.
9012 (Block.IsLocalParameter): Likewise. Simplify a lot.
9013 (ToplevelBlock.Parameters): New. Moved from Block.
9014 (ToplevelBlock.ToplevelBlock): Update to changes. Always
9015 initialize Parameters to a non-null value.
9016 * cs-parser.jay: Update to changes.
9017 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
9018 simple names that mean different things in the same block. Use
9019 Block.IsVariableNameUsedInBlock.
9021 2005-03-28 Raja R Harinath <rharinath@novell.com>
9023 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
9024 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
9025 GetTypeHandle. It is possible for a reflected type to derive from
9026 a TypeBuilder (e.g., int[] derives from the TypeBuilder
9027 System.Array during mscorlib compilation).
9028 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
9029 contain a method_hash, don't create one either. Don't create a
9030 deep copy of the base cache's method_hash.
9031 (MemberCache.SetupCache): Rename back from DeepCopy.
9032 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
9033 already initialized. If we see an override function, add its
9034 underlying base virtual function to the member_hash too.
9036 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
9038 2005-03-26 Raja R Harinath <harinath@acm.org>
9041 * assign.cs (Assign.DoResolve): When the RHS of an assignment
9042 fails to resolve, ensure that the LHS is still resolved as an
9045 2005-03-25 Raja R Harinath <harinath@acm.org>
9047 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
9049 (Enum.current_ec): Remove.
9050 (Enum.LookupEnumValue): Remove EmitContext argument.
9051 Just uses the one created during DefineType.
9052 (Enum.FindMembers): Update.
9053 * expression.cs (MemberAccess.DoResolve): Update.
9055 2005-03-22 Marek Safar <marek.safar@seznam.cz>
9057 * assign.cs (Assign.DoResolve): Check for CS1717 when
9058 source and target are same (uses Equals).
9060 * expression.cs (LocalVariableReference, ParameterReference,
9061 This): Implemented Equals, GetHashCode.
9063 * statement.cs (Block.GetParameterReference): Removed useless
9066 2005-03-22 Raja R Harinath <rharinath@novell.com>
9069 * statement.cs (Block.AddVariable): Ensure that we skip implicit
9070 blocks before deciding whether the error is cs0136 or cs0128.
9072 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
9073 (using_alias_directive, using_namespace_directive): Pass
9074 MemberName, not an expression to Namespace.UsingAlias and
9076 (MakeName): Use the MemberName of the namespace.
9077 * namespace.cs (Namespace.MemberName): New.
9078 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
9079 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
9081 * decl.cs (MemberName.Name): Make readonly.
9082 (MemberName.FromDotted): New "constructor".
9083 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
9084 (MemberCore.Name): Compute from MemberName on demand.
9085 (MemberCore.SetMemberName): Provide a way to change the
9087 (MemberCore.AddToContainer): Don't take a fullname parameter.
9088 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
9089 fully qualified name of the container to the member name.
9090 (TypeContainer.AddToTypeContainer): Use a fully qualified name
9091 only if the type is a member of the root container.
9092 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
9093 MemberName.Left rather than searching for an embedded ".".
9094 (PartialContainer.CreatePart): Update to changes in RootContext.
9095 (MemberBase.ShortName): Turn into a property. Use
9096 MemberCore.SetMemberName.
9097 (MemberBase.ExplicitInterfaceName): Remove.
9098 (MemberBase.UpdateMemberName): Remove.
9099 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
9100 (PropertyBase.SetMemberName): New override.
9101 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
9102 (Tree.GetDecl): New.
9103 (Tree.AllDecls): Rename from Decls.
9104 * attribute.cs, enum.cs, report.cs: Update to changes.
9105 * driver.cs (MainDriver): Use MemberName.FromDotted on
9106 RootContext.MainClass.
9108 2005-03-21 Marek Safar <marek.safar@seznam.cz>
9110 * class.cs (FixedField.Define): Check for CS1664 and more sanity
9113 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
9115 2005-03-18 Marek Safar <marek.safar@seznam.cz>
9117 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
9118 property accessor modifiers.
9120 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
9121 fixed buffer attribute (CS1716).
9122 (PropertyMethod.HasCustomAccessModifier): When property accessor
9123 has custom modifier.
9125 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
9127 (PropertyExpr.DoResolveLValue): Add CS0272.
9129 2005-03-17 Miguel de Icaza <miguel@novell.com>
9131 * convert.cs: When converting to a pointer, use the proper Conv.U
9132 or Conv.I depending on the source data type.
9134 * cs-tokenizer.cs: Make the size for large decimal constants,
9137 2005-03-17 Martin Baulig <martin@ximian.com>
9139 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
9140 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
9142 2005-03-17 Martin Baulig <martin@ximian.com>
9144 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
9145 to bool so we can return an error condition.
9146 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
9149 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
9151 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
9154 2005-03-16 Raja R Harinath <rharinath@novell.com>
9156 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
9157 Refactor to avoid traversing the list of assemblies, and to avoid
9158 string concatenation.
9159 * typemanager.cs (guid_attr_type): Remove.
9160 (negative_hits, pointers, references): Remove hashes.
9162 (GetConstructedType): New. Uses type_hash to handle constructed
9163 types (arrays, references, pointers).
9164 (GetReferenceType, GetPointerType): Use it.
9165 (GetNestedType): New. Uses type_hash to handle nested types of
9167 (LookupType, LookupTypeDirect): Remove.
9168 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
9169 'types' hash and LookupTypeReflection directly.
9170 (params_string, params_object): Use GetConstructedType.
9171 * namespace.cs (Namespace.cached_types): New. Cache of reflected
9173 (Namespace.Lookup): Use cached_types.
9174 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
9175 provided by old TypeManager.LookupType.
9176 * rootcontext.cs (MakeFQN): Remove.
9177 * decl.cs (DeclSpace.MakeFQN): Likewise.
9178 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
9179 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9180 TypeManager.GetConstructedType.
9181 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
9183 2005-03-15 Marek Safar <marek.safar@seznam.cz>
9185 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
9188 * cs-parser.jay: Reports CS1527 for any namespace element.
9190 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
9193 * expression.cs (ParameterReference.IsAssigned): Changed error to
9195 (Error_WrongNumArguments): Moved CS0245 detection here.
9197 * statement.cs (Return.Resolve): Add CS1622 report.
9199 2005-03-11 Marek Safar <marek.safar@seznam.cz>
9201 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
9203 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
9205 * attribute.cs expression.cs: Get rid of some allocations.
9207 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
9209 * doc.cs : just eliminate the latest change.
9211 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
9213 * doc.cs : commented out the latest change. It breaks xml-030.cs
9215 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
9217 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
9218 fail. So invoke CreateType() in FindDocumentedType().
9220 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
9222 * cs-tokenizer.cs : added IsKeyword().
9223 * doc.cs : Detect keyword incorrectly used as identifier.
9224 Allow identifiers prefixed by @.
9226 2005-03-10 Marek Safar <marek.safar@seznam.cz>
9228 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
9229 It caused exception in namespace resolving (again!).
9231 * class.cs (Class.ctor): Removed exit.
9232 (PropertyMethod.ctor): ditto.
9234 * codegen.cs (Codegen.Reset): Reset static data.
9235 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
9237 * cs-tokenizer.cs (Cleanup): Removed.
9239 * driver.cs (GetSystemDir): Rewrote to one line command.
9240 It caused problem with unloaded dynamic modules.
9241 (UnixParseOption): Removed Exit.
9242 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
9243 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
9244 Now can be mcs used as library.
9246 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
9249 * location.cs (Reset): Reset static data.
9251 * namespace.cs (Reset): Reset static data.
9253 * report.cs (Report.Reset): Reset static data.
9255 * rootcontext.cs (RootContext.Reset): Reset static data.
9257 * tree.cs (RootTypes.ctor): Use Location.Null
9259 * typemanager.cs (TypeManager.Reset): Reset static data.
9260 (CoreLookupType): Removed Exit.
9261 (TypeHandle.Reset): Reset static data.
9263 2005-03-10 Raja R Harinath <rharinath@novell.com>
9266 * typemanager.cs (ComputeNamespaces): Import namespaces from
9267 referenced modules too.
9269 2005-03-09 Raja R Harinath <rharinath@novell.com>
9271 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
9274 2005-03-09 Raja R Harinath <rharinath@novell.com>
9276 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
9277 enclosing DeclSpace. This ensures that a name-lookup populates
9278 more caches and there are fewer 'TypeExpression's. Carve out
9279 nested type lookup into ...
9280 (LookupNestedTypeInHierarchy): ... this.
9282 2005-03-09 Raja R Harinath <rharinath@novell.com>
9284 Clean up a few partial-class semantics.
9285 Fixes test-357.cs and cs1618-2.cs.
9286 * cs-parser.jay (struct_declaration): Use 'current_class' as
9287 parent of newly-created struct. Remove call to Register ().
9288 Use 'pop_current_class' to complete handing the current struct.
9289 (interface_declaration): Likewise.
9290 (class_declaration): Likewise.
9291 (enum_declaration): Use 'current_class' as parent of newly created
9293 (delegate_declaration): Likewise.
9294 (pop_current_class): New function. This is used to handle closing
9295 up the 'current_class' and 'current_container', and pointing them
9296 to the enclosing class/container.
9297 (CSharpParser): Initialize 'current_class' too.
9298 * decl.cs (MemberCore): Add check for invariant: a partial
9299 container is not a parsed entity, and thus does not enclose any
9301 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
9302 (DeclSpace.BaseTypeExpr): Use it.
9303 (DeclSpace.LookupType): Add check for invariant.
9304 * class.cs (TypeContainer): Add check for invariant: a nested
9305 class should have the same NamespaceEntry as its enclosing class.
9306 (TypeContainer.EmitFieldInitializers): Make virtual.
9307 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
9309 (TypeContainer.Register): Remove.
9310 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
9311 null. Use TypeResolveEmitContext for resolving base types and
9312 interfaces. Move initialization of Parts.TypeBuilder here from
9314 (TypeContainer.DefineNestedTypes): ... here.
9315 (PartialContainer): Take a Namespace not a NamespaceEntry.
9316 (PartialContainer.Create): Don't use Register. Call the
9317 appropriate Add... function directly.
9318 (ClassPart): Take both the PartialContainer and the enclosing
9319 class as constructor arguments.
9320 (ClassPart.EmitFieldInitializers): Override.
9321 (ClassPart.PartFindNestedTypes): Remove.
9322 (FieldBase.GetInitializerExpression): Resolve the initializer
9323 expression in the emit context of the enclosing class.
9324 * tree.cs (RootTypes): Remove Register ().
9326 2005-03-08 Marek Safar <marek.safar@seznam.cz>
9328 * cs-parser.jay: Removed CS0134.
9330 * driver.cs: Removed CS1901.
9332 * expression.cs (SizeOf.DoResolve): Don't report CS0233
9333 for predefined types.
9335 2005-03-07 Duncan Mak <duncan@novell.com>
9337 * codegen.cs (Save): Catch UnauthorizedAccessException as
9338 well. Fixes bug #73454.
9340 2005-03-07 Marek Safar <marek.safar@seznam.cz>
9342 * cs-tokenizer.cs (xtoken): Add CS1035.
9344 * class.cs (MethodData.Define): Add CS0683.
9345 (FieldMember.ctor): Add CS0681.
9347 2005-03-07 Raja R Harinath <rharinath@novell.com>
9349 * ecore.cs (SimpleName.DoResolve): Rename from
9350 SimpleName.DoResolveAllowStatic.
9351 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
9352 Pass 'intermediate' flag to MemberStaticCheck.
9353 (SimpleName.MemberStaticCheck): Skip "static check" only in case
9354 of "intermediate" lookups via MemberAccess.
9355 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
9356 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
9358 2005-03-07 Raja R Harinath <rharinath@novell.com>
9361 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
9362 slipped in because of variable names that are identical to a
9363 builtin type's BCL equivalent ('string String;', 'int Int32;').
9364 (PropertyExpr.EmitInstance): Likewise.
9366 2005-03-04 Marek Safar <marek.safar@seznam.cz>
9368 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
9370 * report.cs (warning_ignore_table): Made public.
9372 2005-03-04 Raja R Harinath <rharinath@novell.com>
9375 * class.cs (MethodData.Emit): Pass 'container' to
9376 container.GetObsoleteAttribute instead of 'container.Parent'.
9378 2005-03-03 Marek Safar <marek.safar@seznam.cz>
9380 * cs-parser.jay: Add 1534 error test.
9382 * iterators.cs (Yield.CheckContext): Add error 1629.
9383 (Iterator.ctor): Save unsafe modifier.
9384 (MoveNextMethod.DoEmit): Restore unsafe context.
9386 * namespace.cs (UsingAlias): Better error message.
9388 2005-03-03 Dan Winship <danw@novell.com>
9390 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
9391 the warning message [#73219]
9393 2005-03-03 Raja R Harinath <rharinath@novell.com>
9395 Fix compile with MCS 1.0.0.0.
9396 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
9397 w_restore to not depend on string constant folding.
9399 2005-03-03 Raja R Harinath <rharinath@novell.com>
9401 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
9402 CS0246 check to users who passed 'silent = false'.
9403 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
9405 (SimpleName.SimpleNameResolve): Update.
9406 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
9407 (MemberAccess.IdenticalNameAndTypeName): Update.
9408 * doc.cs (FindDocumentedTypeNonArray): Update.
9410 2005-03-03 Raja R Harinath <rharinath@novell.com>
9412 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
9413 * parameters.cs (ComputeAndDefineParameters): Remove.
9414 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
9415 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
9416 Use GetParameterInfo.
9418 2005-03-02 Marek Safar <marek.safar@seznam.cz>
9420 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
9422 2005-03-02 Raja R Harinath <rharinath@novell.com>
9424 Unify DeclSpace.LookupType and DeclSpace.FindType.
9425 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
9426 is in charge of defining nested types on demand.
9427 (DeclSpace.LookupType): Use it when the current_type is a
9428 TypeBuilder. Use LookupTypeDirect for reflected types.
9429 (DeclSpace.FindType): Remove.
9430 (DeclSpace.LookupInterfaceOrClass): Likewise.
9431 (DeclSpace.DefineTypeAndParents): Likewise.
9432 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
9433 DeclSpace.LookupType.
9434 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
9435 * typemanager.cs (LookupType): Simplify.
9436 (AddUserType): Remove type from negative_hits.
9437 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
9438 * class.cs (TypeContainer.FindMembers): Move handling of nested
9440 (TypeContainer.FindMembers_NestedTypes): ... here.
9441 (TypeContainer.FindNestedType): Implement override.
9442 (ClassPart.FindNestedType): Delegate to PartialContainer.
9443 (ClassPart.PartFindNestedType): Looks up the nested types of the
9446 2005-03-02 Martin Baulig <martin@ximian.com>
9448 * class.cs (TypeContainer.DoDefineMembers): We also need a default
9449 static constructor in static classes.
9451 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
9453 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
9454 sizeParamIndex is not specified.
9456 2005-03-01 Marek Safar <marek.safar@seznam.cz>
9459 * report.cs (WarningMessage.IsEnabled): Missing null check.
9461 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9463 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
9464 in the fields and not in the properties.
9466 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
9468 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
9471 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9473 * attribute.cs: Small refactoring (improved robustness).
9474 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
9475 (ValidateGuid): Removed.
9476 (Resolve): Removed referenced to above mentioned.
9477 (GetAttributeUsage): Made private and changed to work without
9479 (GetIndexerAttributeValue): Don't crash.
9480 (GetConditionalAttributeValue): Ditto.
9481 (GetClsCompliantAttributeValue): Ditto.
9482 (ExtractSecurityPermissionSet): All attributes exceptions are
9484 (GetPropertyValue): New helper.
9485 (GetMethodImplOptions): New method.
9486 (DefinePInvokeMethod): Reuse common code. Implemented handling of
9487 some missing properties.
9489 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
9490 (Method.ApplyAttributeBuilder): Updated.
9492 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
9495 2005-02-28 Raja R Harinath <rharinath@novell.com>
9498 * report.cs (Report.SymbolRelatedToPreviousError): Handle
9499 non-simple types (array, pointer, reference).
9501 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9503 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
9505 * class.cs (MethodCore.IsDuplicateImplementation): Special error
9507 (Method.CheckBase): Catch wrong destructor here.
9508 (MethodData.Define): Add errors 550, 668.
9510 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
9512 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
9514 * pending.cs (VerifyPendingMethods): Add error 551.
9516 * typemanager.cs (CSharpName): Next error report helper.
9518 2005-02-25 Marek Safar <marek.safar@seznam.cz>
9520 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
9521 attributes. Removed useless attribute double check.
9522 It saves almost 2MBs for corlib.
9524 2005-02-25 Raja R Harinath <rharinath@novell.com>
9527 * statement.cs (ExpressionStatement.Resolve): Make robust to being
9528 called twice in case of error.
9530 2005-02-23 Chris Toshok <toshok@ximian.com>
9532 Fix compiler portions of #72827.
9533 * statement.cs (Block.Emit): call Begin/EndScope on the
9534 EmitContext instead of the ILGenerator.
9536 * codegen.cs (EmitContext.BeginScope): new method, call
9537 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
9539 (EmitContext.BeginScope): same, but EndScope and CloseScope
9541 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
9542 offset and call the superclass's OpenScope(int) with it.
9543 (SymbolWriter.CloseScope): get the current il
9544 offset and call superclass's CloseScope(int) with it.
9546 2005-02-23 Marek Safar <marek.safar@seznam.cz>
9548 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
9549 CS1677 for out and ref as well.
9551 * class.cs (Method.Define): Add error CS1599 detection.
9553 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
9555 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
9557 * delegate.cs (Delegate.Define): Add error CS1599 detection.
9559 * support.cs.cs (ModifierDesc): New helper method.
9561 2005-02-23 Raja R Harinath <rharinath@novell.com>
9562 Abin Thomas <projectmonokochi@rediffmail.com>
9563 Anoob V E <projectmonokochi@rediffmail.com>
9564 Harilal P R <projectmonokochi@rediffmail.com>
9567 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
9568 MemberLookup (used for error reporting) actually returns a result.
9569 Fix error report number (122, not 112).
9571 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
9572 Anoob V E <projectmonokochi@rediffmail.com>
9573 Harilal P R <projectmonokochi@rediffmail.com>
9576 * pending.cs (PendingImplementation.GetAbstractMethods):
9577 Find NonPublic members too.
9579 2005-02-22 Marek Safar <marek.safar@seznam.cz>
9581 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
9584 * class.cs (MethodCore.CheckMethodAgainstBase):
9585 Add error 239 report.
9587 2005-02-21 Raja R Harinath <rharinath@novell.com>
9590 * expression.cs (Invocation.IsApplicable): Make public.
9591 (Invocation.IsParamsMethodApplicable): Likewise.
9592 * delegate.cs (Delegate.VerifyApplicability): Don't use
9593 Invocation.VerifyArgumentCompat for parameter applicability
9594 testing. Use Invocation.IsApplicable and
9595 Invocation.IsParamsMethodApplicable.
9597 2005-02-21 Marek Safar <marek.safar@seznam.cz>
9599 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
9601 * class.cs (Operator.Define): Add error 217 report.
9603 2005-02-21 Raja R Harinath <rharinath@novell.com>
9605 * namespace.cs (UsingEntry.Resolve): Undo change below.
9607 2005-02-21 Raja R Harinath <rharinath@novell.com>
9610 * ecore.cs (Expression.MemberLookupFailed): Add argument to
9611 disable the error message when the extended MemberLookup also
9613 (Expression.MemberLookupFinal): Update.
9614 (SimpleName.DoSimpleNameResolve): Update.
9615 * expression.cs (MemberAccess.ResolveNamespaceOrType):
9616 Don't use MemberLookupFinal.
9617 (New.DoResolve): Update.
9618 (BaseAccess.CommonResolve): Update.
9620 2005-02-21 Raja R Harinath <rharinath@novell.com>
9623 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
9624 occured previously, don't resolve again.
9626 2005-02-21 Marek Safar <marek.safar@seznam.cz>
9629 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
9630 argument. Call ResolveAttributeUsage for unresolved.
9631 when types doesn't match ctor arguments.
9633 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
9634 for nested attribute classes.
9635 (Class.attribute_usage): Removed.
9636 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
9637 for attribute class.
9639 * ecore.cs (IsAttribute): Removed.
9641 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
9643 * rootcontext.cs (RegisterAttribute): Removed, attributes are
9645 (attribute_types): Removed.
9646 (EmitCode): Global attributes are emited as the latest.
9648 2005-02-18 Marek Safar <marek.safar@seznam.cz>
9650 * class.cs (EmitFieldInitializers): Don't emit field initializer
9651 for default values when optimilization is on.
9653 * constant.cs (Constant.IsDefaultValue): New property.
9655 * driver.cs: Add /optimize handling.
9659 * literal.cs: Implement new IsDefaultValue property.
9661 * rootcontext.cs (Optimize): New field, holds /optimize option.
9663 2005-02-18 Raja R Harinath <rharinath@novell.com>
9665 Fix crasher in re-opened #72347.
9666 * namespace.cs (Namespace.Lookup): Return null if
9667 DeclSpace.DefineType returns null.
9670 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
9672 2005-02-18 Raja R Harinath <rharinath@novell.com>
9674 Fix remainder of #63202. Change semantics of DoResolveLValue: it
9675 now returns null if it cannot resolve to an lvalue.
9676 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
9677 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
9678 returned null. Remove check for SimpleName.
9679 (EventExpr.DoResolveLValue): New.
9680 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
9681 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
9683 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
9685 (Unary.ResolveOperator): Move CS0211 check ...
9686 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
9688 (Unary.DoResolveLValue): Simplify.
9689 (AddressOf.DoResolveLValue): New.
9690 (ArrayAccess.DoResolveLValue): New.
9692 2005-02-16 Marek Safar <marek.safar@seznam.cz>
9694 * attribute.cs (Attribute.Resolve): Add arguments casting for
9695 when types doesn't match ctor arguments.
9697 2005-02-16 Raja R Harinath <rharinath@novell.com>
9699 Fix parts of #63202.
9700 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
9701 lookup of operator in base type. Ensure that all checks happen
9702 when the operator resolves to an "op_..." method.
9704 2005-02-15 Raja R Harinath <rharinath@novell.com>
9707 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
9708 'ignore_cs0104' parameter. Pass it to ...
9709 (NamespaceEntry.Lookup): ... this.
9710 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
9711 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
9712 (TypeLookupExpression.DoResolveAsTypeStep): Update.
9713 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
9714 Update. Request that cs0104 errors be ignored.
9715 (ComposedCast.ResolveAsTypeStep): Update.
9717 2005-02-14 Raja R Harinath <rharinath@novell.com>
9720 * expression.cs (Invocation.BetterFunction): Remove support for
9721 comparing virtual functions and their overrides.
9722 (Invocation.IsOverride): New.
9723 (Invocation.OverloadResolve): Don't consider 'override' functions
9724 during candidate selection. Store them in a lookaside list.
9725 If the selected method is a 'virtual' function, use the list to
9726 find any overrides that are closer to the LHS type.
9728 2005-02-14 Marek Safar <marek.safar@seznam.cz>
9730 * expression.cs (New.DoResolve): Add complex core type reduction.
9731 (New.Constantify): Converts complex core type syntax like 'new int ()'
9734 2005-02-14 Raja R Harinath <rharinath@novell.com>
9736 * decl.cs (EntryType.EntryType): New constructor to create an
9737 updated copy of a cache entry.
9738 (MemberCache.AddMethods): Use it.
9739 (MemberCache.ClearDeclaredOnly): Remove.
9740 (MemberCache.MemberCache): Update.
9742 2005-02-11 Miguel de Icaza <miguel@novell.com>
9744 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
9745 variable. This one is represents the actual low-level declaration
9746 of the method, as opposed to the semantic level `IsStatic'.
9748 An anonymous method which is hosted into a static method might be
9749 actually an instance method. IsStatic would reflect the
9750 container, while MethodIsStatic represents the actual code
9753 * expression.cs (ParameterReference): Use the new MethodIsStatic
9754 instead of IsStatic.
9756 * anonymous.cs (AnonymousMethod.Compatible): Pass the
9757 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
9758 set on the current EmitContext.
9760 * expression.cs (Cast): Overload DoResolveLValue so we can pass
9761 resolve our casted expression as an LValue. This triggers the
9762 proper LValue processing that is later required by Assign.
9766 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
9768 2005-02-11 Marek Safar <marek.safar@seznam.cz>
9770 C# 2.0 Fixed buffer implementation
9772 * anonymous.cs: Update after RegisterHelperClass renaming.
9774 * attribute.cs (AttributeTester.fixed_buffer_cache):
9775 Cache of external fixed buffers.
9776 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
9777 implementation if field is fixed buffer else null.
9780 (TypeContainer.AddField): Accept FieldMember instead of Field.
9781 (FieldBase.IsFieldClsCompliant): Extracted code from
9782 VerifyClsCompliance descendant customization.
9783 (FixedField): New class handles fixed buffer fields.
9784 (FixedFieldExternal): Keeps information about imported fixed
9786 (IFixedField): Make access to internal or external fixed buffer
9789 * cs-parser.jay: Add fixed buffer parsing.
9791 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
9794 * expression.cs (Indirection): Extended implementation to accept
9796 (PointerArithmetic.Emit): Get element from fixed buffer as well.
9797 (ElementAccess.MakePointerAccess): Get type as parameter.
9798 (DoResolve): Add fixed buffer field expression conversion.
9799 (DoResolveLValue): Ditto.
9800 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
9801 (ArrayPtr): Derives from FixedBufferPtr.
9802 (ArrayPtr.Emit): Add extra emit for array elements.
9804 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
9806 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
9807 for compiler generated types.
9808 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
9810 * statement.cs (Fixed): Refactored to be easier add fixed buffer
9811 and consume less memory.
9812 (Fixed.Resolve): Add fixed buffer case.
9814 * typemanager.cs (compiler_generated_attr_ctor,
9815 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
9816 (HasElementType): Add our own implementation to work on every
9819 2005-02-11 Miguel de Icaza <miguel@novell.com>
9821 * anonymous.cs (CaptureContext): Track whether `this' has been
9824 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
9825 only captured `this' if it was implicitly done (instance
9826 methods/variables were used).
9828 * codegen.cs (EmitContext.CaptureThis): New method to flag that
9829 `this' must be captured.
9831 2005-01-30 Miguel de Icaza <miguel@novell.com>
9833 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
9834 is null it means that there has been no need to capture anything,
9835 so we just create a sibling.
9837 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
9839 Just a partial fix. The other half is fairly elusive.
9841 2005-02-10 Raja R Harinath <rharinath@novell.com>
9843 Fix #52586, cs0121-4.cs.
9844 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
9845 and return a hashtable.
9846 (MemberCache.ClearDeclaredOnly): New.
9847 (MemberCache.MemberCache): Update to change. Make a deep copy of
9848 the method_hash of a base type too.
9849 (MemberCache.AddMethods): Adapt to having a deep copy of the base
9850 type methods. Overwrite entries with the same MethodHandle so
9851 that the ReflectedType is correct. The process leaves in base
9852 virtual functions and their overrides as distinct entries.
9853 (CacheEntry): Now a class instead of a struct. It shouldn't alter
9854 matters since it was boxed in a ArrayList before.
9855 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
9857 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
9858 case of a virtual function and its override (choose the overload
9860 (Invocation.OverloadResolve): Avoid 'override' members during
9861 'applicable_type' calculation.
9863 2005-02-09 Raja R Harinath <rharinath@novell.com>
9865 Combine two near-redundant caches.
9866 * typemanager.cs (method_params): Rename from method_internal_params.
9867 (TypeManager.GetParameterData): New. Replace
9868 Invocation.GetParameterData.
9869 (TypeManager.LookupParametersByBuilder): Remove.
9870 * expression.cs (Invocation.method_parameter_cache): Remove.
9871 (Invocation.GetParameterData): Remove.
9873 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
9876 2005-02-08 Raja R Harinath <rharinath@novell.com>
9879 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
9880 TypeManager.multicast_delegate_type is null, resolve it by looking
9881 up "System.MulticastDelegate".
9882 * rootcontext.cs (RootContext.ResolveCore): Simplify.
9884 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
9885 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
9886 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
9889 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
9890 (LabeledStatement.AddReference): New. Set 'referenced'.
9891 (Goto.Resolve): Use it.
9893 2005-02-05 John Luke <john.luke@gmail.com>
9895 * driver.cs: remove duplicate -doc line in Usage ()
9897 2005-02-04 Raja R Harinath <rharinath@novell.com>
9899 * location.cs (Location.AddFile): Fix CS2002 error report.
9901 2005-02-02 Martin Baulig <martin@ximian.com>
9903 * delegate.cs (Delegate.DefineType): Report an internal error if
9904 TypeManager.multicast_delegate_type is null. See bug #72015 for
9907 2005-02-02 Raja R Harinath <rharinath@novell.com>
9909 Fix a crasher in a variant of #31984.
9910 * const.cs (Constant.CheckBase): New override that defers the
9911 new-or-override check in case the base type hasn't been populated
9913 (Constant.Define): Ensure the new-or-override check is performed.
9915 2005-02-01 Duncan Mak <duncan@ximian.com>
9917 * const.cs (LookupConstantValue): Check that `ce' is not null
9918 before calling GetValue ().
9920 2005-02-01 Raja R Harinath <rharinath@novell.com>
9922 Fix test-334.cs (#69519).
9923 * cs-parser.jay (using_alias_directive): Pass in an expression to
9924 NamespaceEntry.UsingAlias.
9925 (using_namespace_directive): Pass in an expression to
9926 NamespaceEntry.Using.
9927 (namespace_name): Don't flatten to a string.
9928 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
9929 (NamespaceEntry.AliasEntry.Resolve): Lookup using
9931 (NamespaceEntry.UsingEntry): Likewise.
9932 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
9934 (NamespaceEntry.LookupForUsing): Remove.
9935 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
9937 (NamespaceEntry.Lookup): Remove support for dotted names.
9939 2005-02-01 Raja R Harinath <rharinath@novell.com>
9941 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
9943 (NamespaceEntry.ImplicitParent): Compute on demand.
9944 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
9945 parallels the current.
9946 (NamespaceEntry.LookupForUsing): Use it.
9947 (NamespaceEntry.Lookup): If the current namespace-entry is
9948 implicit, don't search aliases and using tables.
9950 2005-02-01 Raja R Harinath <rharinath@novell.com>
9953 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
9955 (TypeContainer.BaseCache): Compute on demand.
9956 (TypeContainer.FindMembers): Define constants and types if they're
9957 not already created.
9958 (FieldMember.Define): Move resetting of ec.InUnsafe before error
9960 * const.cs (Constant.Define): Make idempotent.
9962 2005-01-29 Miguel de Icaza <miguel@novell.com>
9964 * pending.cs: Produce better code (no nops produced by using Ldarg
9967 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
9968 i - 1' it should be arg + 1.
9972 2005-01-28 Raja R Harinath <rharinath@novell.com>
9974 * attribute.cs (Attribute.CheckAttributeType): Make private
9976 (Attribute.ResolveType): Make virtual.
9977 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
9978 handling of RootContext.Tree.Types.
9980 2005-01-27 Raja R Harinath <rharinath@novell.com>
9982 Update attribute-handling to use the SimpleName/MemberAccess
9984 * cs-parser.jay (attribute): Pass in an expression to the
9985 constructors of Attribute and GlobalAttribute.
9986 * attribute.cs (Attribute): Take an expression for the name.
9987 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
9988 passed in attribute name expression.
9989 (Attribute.CheckAttributeType): Use it.
9990 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
9991 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
9992 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
9993 argument to prevent error messages if the lookup fails.
9995 2005-01-27 Marek Safar <marek.safar@seznam.cz>
9997 * expression.cs (Indirection): Implemented IVariable interface
9998 to support indirection in AddressOf operator.
9999 (PointerArithmetic.Emit): Add optimalization for case where
10000 result can be precomputed.
10002 2005-01-26 Martin Baulig <martin@ximian.com>
10004 * class.cs (TypeContainer.AttributeTargets): Return the correct
10005 AttributeTargets depending on our `Kind' instead of throwing an
10006 exception; fixes #71632.
10008 2005-01-26 Marek Safar <marek.safar@seznam.cz>
10011 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
10014 2005-01-25 Raja R Harinath <rharinath@novell.com>
10017 * expression.cs (MemberAccess.DoResolve): Don't complain with
10018 cs0572 when the LHS of a member access has identical name and type
10021 2005-01-25 Marek Safar <marek.safar@seznam.cz>
10024 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
10026 Create custom PermissionSet only for PermissionSetAttribute.
10028 2005-01-24 Marek Safar <marek.safar@seznam.cz>
10031 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
10032 delegates in static class.
10034 2005-01-24 Martin Baulig <martin@ximian.com>
10036 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10037 merging an implicit block, just use its reachability.
10039 * statement.cs (Block.Resolve): Make the unreachable code check
10040 work wrt. implicit blocks; see test-337 from #63842.
10042 2005-01-21 Alp Toker <alp@atoker.com>
10044 * cs-parser.jay: destructor_declaration's container is PartialContainer
10045 not Class when partial types are used, so use Kind prop instead of
10048 2005-01-22 Miguel de Icaza <miguel@ximian.com>
10050 * cs-parser.jay: Improve error reporting when an interface
10051 declares new types.
10053 2005-01-20 Dick Porter <dick@ximian.com>
10055 * support.cs: SeekableStreamReader fix from Sandor Dobos
10056 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
10057 chars are read. Fixes bug 70369.
10059 2005-01-20 Raja R Harinath <rharinath@novell.com>
10061 * cs-parser.jay (catch_clause): Simplify current_block handling
10064 2005-01-17 Miguel de Icaza <miguel@ximian.com>
10066 * convert.cs (ImplicitStandardConversionExists): Synchronize the
10067 code with ImplicitStandardConversion to handle the implicit
10068 conversion of method groups into valid delegate invocations.
10070 The problem is that in parameter handling we were using this code
10071 path. Fixes bug #64698
10073 2005-01-19 Raja R Harinath <rharinath@novell.com>
10075 * cs-parser.jay: Fix several infelicities.
10076 - Avoid assigning to the parser value stack. Code like
10077 '$3 = null' is unclean. Synthesize a value for the code block
10079 - Avoid using oob_stack for storing location information. Use ...
10080 (_mark_): ... this. New (empty) rule. Saves the current location
10082 (foreach_statement): Avoid using oob_stack for current_block
10083 handling. Use technique used in for_statement and
10084 using_statement. Synthesize a value for the code block to store
10085 additional intermediate information.
10087 2005-01-13 Miguel de Icaza <miguel@ximian.com>
10089 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
10090 of a different type is only allowed to private fields of a
10091 containing type, not on fields of a base class.
10093 See test-174.cs and error cs0122-9.cs
10095 2005-01-13 Raja R Harinath <rharinath@novell.com>
10097 Fix test-335.cs (bug #58126).
10098 * cs-parser.jay (argument): Split out non-expression parts of the
10099 rule into 'non_simple_argument'.
10100 (invocation_expression): Support parenthesized invocations with
10101 multiple arguments, and with single non-simple arguments.
10103 2005-01-13 Raja R Harinath <rharinath@novell.com>
10105 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
10108 2005-01-12 Raja R Harinath <rharinath@novell.com>
10110 Fix cs0038-1.cs, cs1640-6.cs.
10111 * ecore.cs (Expression.Resolve): Remove special-case for
10112 SimpleName in error-handling.
10113 (Expression.almostMatchedMembers): Relax access permission to
10115 (Expression.MemberLookupFailed): Handle duplicates in
10116 almostMatchedMembers list.
10117 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
10118 * expression.cs (New.DoResolve): Report CS1540 for more cases.
10119 * typemanager.cs (GetFullNameSignature): Use the MethodBase
10120 overload if the passed in MemberInfo is a MethodBase.
10122 2005-01-12 Marek Safar <marek.safar@seznam.cz>
10125 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
10126 for non-CAS & merge permission sets properly.
10128 2005-01-11 Raja R Harinath <rharinath@novell.com>
10130 Improve standard-compliance of simple name and member access
10131 resolution. Fixes bugs #52697, #57200, #67520, #69519.
10132 * ecore.cs (FullNamedExpression): New abstract base class
10133 for Namespaces and TypeExpressions.
10134 (ResolveFlags.SimpleName): Remove.
10135 (SimpleName): Remove support for dotted names.
10136 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
10137 DeclSpace.FindType and DeclSpace.LookupType.
10138 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
10139 (Expression.ExprClassName): Make member function.
10140 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
10141 a namespace. Remove creation of dotted "SimpleName"s.
10142 (MemberAccess.DoResolve): Likewise.
10143 * decl.cs (DeclSpace.Cache): Make private.
10144 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
10145 (DeclSpace.FindType): Update.
10146 (DeclSpace.LookupType): Move here from RootContext. Return a
10147 FullNamedExpression.
10148 * namespace.cs (Namespace): Derive from FullNamedExpression
10149 so that it can be part of expression resolution.
10150 (Namespace.Lookup): Return an FullNamedExpression.
10151 (NamespaceEntry.LookupAlias): Lookup aliases only in current
10153 * rootcontext.cs (NamespaceLookup): Remove.
10154 (LookupType): Move to DeclSpace.
10155 * attribute.cs (CheckAttributeType): Update.
10156 * doc.cs (FindDocumentedType): Remove allowAlias argument.
10157 (FindDocumentedTypeNonArray): Likewise.
10159 2005-01-11 Raja R Harinath <rharinath@novell.com>
10161 Fix cs0509.cs, cs1632.cs.
10162 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
10163 is the same as IsInterface.
10164 (TypeContainer.GetClassBases): Likewise.
10165 * statement.cs (LabeledStatement.ig): New field.
10166 (LabeledStatement.LabelTarget): Save ILGenerator which created the
10168 (LabeledStatement.DoEmit): Check that the label was created with
10169 the same ILGenerator.
10171 2005-01-10 Marek Safar <marek.safar@seznam.cz>
10174 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
10175 accessors to its properties.
10177 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
10178 from accessors to property.
10180 2005-01-10 Marek Safar <marek.safar@seznam.cz>
10183 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
10184 only for overrides.
10186 2005-01-08 Miguel de Icaza <miguel@ximian.com>
10188 * attribute.cs: Check for null and empty strings.
10190 I have lost another battle to Paolo.
10192 2005-01-07 Marek Safar <marek.safar@seznam.cz>
10195 * class.cs (PropertyMethod): Set Parent field in ctors.
10196 (SetMethod.InternalParameters): Add unsafe switch hack.
10197 Override MarkForDuplicationCheck where it is appropriate.
10199 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
10200 It says whether container allows members with the same name.
10201 Base default is no.
10202 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
10203 Removed is_method parameter.
10205 2005-01-06 Duncan Mak <duncan@ximian.com>
10207 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
10208 because the previous change led to incorrect reporting of CS1032
10209 ("Cannot define/undefine preprocessor symbols after first token in
10210 file"). Instead of using `tokens_seen' as the only flag that
10211 triggers CS1040, introduce `comments_seen'. This new flag is used
10212 to signify having seen comments on the current line, so it is
10213 unset after a newline.
10215 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
10217 * doc.cs : When searching for a type, find nested type too.
10218 This fixes bug #71040.
10220 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
10223 - Warn missing member comment on those classes which also does not
10224 have doc comments. Fixed bug #71041.
10225 - Don't warn missing doc comment on default constructor.
10228 2005-01-06 Duncan Mak <duncan@ximian.com>
10230 * cs-tokenizer.cs (xtoken): After handling traditional C-style
10231 comments, set `tokens_seen' to true. This allows us to detect
10232 misplaced preprocessor directives (i.e. not at the beginning of
10233 the a line, nor after whitespaces). In that case, report error
10234 CS1040. This fixes bug #56460.
10236 * cs-parser.jay (interface_member_declaration): Add checks for
10237 IsExplicitImpl, and report CS0541 error if an interface member is
10238 defined as an explicit interface declaration.
10240 2005-01-06 Marek Safar <marek.safar@seznam.cz>
10243 * class.cs (PropertyMethod): Set Parent field in ctors.
10244 (SetMethod.InternalParameters): Add unsafe switch hack.
10246 * decl.cs (MemberCore.Parent): Cannot be readonly.
10248 2005-01-06 Raja R Harinath <rharinath@novell.com>
10250 * decl.cs (DeclSpace.ResolveType): Remove.
10251 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
10252 Merge in code from ...
10253 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
10254 * class.cs, enum.cs: Update to changes.
10256 2005-01-06 Miguel de Icaza <miguel@ximian.com>
10258 * anonymous.cs: Ensure that we init the scope of our parent if it
10259 has not been initialized yet.
10261 2004-12-30 Duncan Mak <duncan@ximian.com>
10263 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
10264 if field.FieldBuilder is null. Fixes #70758.
10266 * convert.cs: Fixed some typos and updated some of the comments.
10267 (ImplicitStandardConversionExists):
10268 (TryImplicitIntConversion): If `target_type' is an interface and
10269 the type of `ic' implements this interface, return true or a new
10270 BoxedCast instead of null. This fixes #70468.
10272 2004-12-29 Duncan Mak <duncan@ximian.com>
10274 * expression.cs (Argument.Emit): Check that Expr is
10275 IMemoryLocation before casting to it, and report CS1510 otherwise.
10279 2004-12-21 Ben Maurer <bmaurer@ximian.com>
10281 * statement.cs (Block.ThisVariable): remove the recursion here, to
10282 make the --profile more sane.
10284 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
10286 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
10287 assembly, by JB Evain.
10289 2004-12-17 Raja R Harinath <rharinath@novell.com>
10291 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
10292 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
10293 "parent" refers to enclosing type/class. "base" refers to superclass.
10295 2004-12-17 Raja R Harinath <rharinath@novell.com>
10297 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10298 Ensure that we only have GlobalAttributes.
10299 * attribute.cs (Attribute.Emit): Make non-virtual.
10300 (GlobalAttribute.Emit): Remove.
10301 (Attribute.Resolve): Make virtual.
10302 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
10303 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
10304 the argument. Don't create one.
10305 (Attribute.GetObsoleteAttribute): Likewise.
10306 (Attribute.GetClsCompliantAttributeValue): Likewise.
10307 * class.cs, decl.cs: Update to changes.
10309 2004-12-17 Marek Safar <marek.safar@seznam.cz>
10311 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
10313 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
10315 * statement.cs (Foreach.Resolve): Add error 186 report.
10317 2004-12-16 Marek Safar <marek.safar@seznam.cz>
10319 * expression.cs (Conditional.DoResolve): Add warning 429.
10321 * statement.cs (If.Resolve): Add warning 665.
10323 2004-12-16 Raja R Harinath <rharinath@novell.com>
10325 New invariant: RootContext.Tree.Types.NamespaceEntry == null
10326 except when in the parser, and in GlobalAttribute.
10327 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
10328 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
10329 RootContext.Tree.Types.NamespaceEntry once work is done.
10330 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
10331 and resets RootContext.Tree.Types.NamespaceEntry.
10333 2004-12-15 Marek Safar <marek.safar@seznam.cz>
10335 * cs-parser.jay: Don't create a block for every variable.
10337 2004-12-14 Miguel de Icaza <miguel@ximian.com>
10339 * location.cs: Provide extra information.
10341 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
10342 variables from the captured environment, it is the ldarg_0.
10344 2004-12-14 Marek Safar <marek.safar@seznam.cz>
10346 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
10349 * class.cs: Changed warning level for 169 to avoid developer
10350 displeasure from warning flooding. It will be changed back when they
10351 fix most of current BCL warnings.
10353 * RootContext.cs: Pushed default WarningLevel to 3.
10355 * statement.cs: Removed unused variable.
10357 2004-12-14 Marek Safar <marek.safar@seznam.cz>
10359 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
10360 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
10361 Add error 502 report.
10362 (StaticClass.DefineType): Add error 441 report.
10363 (Class.AllowedModifiersProp): New virtual property as temporary
10364 extension to AllowedModifiers.
10365 (Class.DefineType): Add error 418 report. Moved ModFlags check here
10366 to share implementation with StaticClass and don't call virtual
10369 * driver.cs (MainDriver): Add error 1558 test.
10371 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
10372 report. Moved error 36 test here.
10374 * statement.cs (Throw.Resolve): Add error 724 report.
10376 * typemanager.cs: Add out_attribute_type core type.
10378 2004-12-13 Marek Safar <marek.safar@seznam.cz>
10380 * class.cs (TypeContainer.VerifyClsCompliance): Add error
10382 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
10384 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
10387 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
10389 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
10390 Add error 3023 report.
10391 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
10393 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
10396 2004-12-12 John Luke <john.luke@gmail.com>
10398 * driver.cs (AddArgs): take -- into account when
10399 adding arguments, fixes bug 65710
10401 2004-12-12 Martin Baulig <martin@ximian.com>
10403 * expression.cs (Unary.TryReduceNegative): Added support for
10404 SByteConstant and ByteConstant.
10405 (Unary.Reduce): Check error values from TryReduceNegative().
10407 2004-12-10 Marek Safar <marek.safar@seznam.cz>
10409 * attributes.cs (Attribute.Resolve): Avoid multiple error report
10410 and report exception as error 182.
10412 2004-12-10 Raja R Harinath <rharinath@novell.com>
10414 * driver.cs (Main): Fix message when there are warnings.
10416 2004-12-09 Miguel de Icaza <miguel@ximian.com>
10418 * delegate.cs: Fixed my fix from yesterday, sorry about that.
10420 2004-12-09 Marek Safar <marek.safar@seznam.cz>
10422 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
10423 Reduced number of warnings.
10425 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
10427 2004-12-08 Miguel de Icaza <miguel@ximian.com>
10429 * driver.cs: Removed message.
10431 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
10433 2004-12-08 <vargaz@freemail.hu>
10435 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
10437 2004-12-08 Martin Baulig <martin@ximian.com>
10439 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
10440 instead of a CS3002 for properties and indexer.
10442 2004-12-08 Martin Baulig <martin@ximian.com>
10444 * decl.cs (MemberName.ToString): Make this work again.
10446 2004-12-08 Marek Safar <marek.safar@seznam.cz>
10448 * attribute.cs (Resolve): Add error 591 detection.
10450 * class.cs (FieldMember.Define): Add error 1547 detection.
10451 (Indexer.Define): Add error 620 detection.
10452 (Operator.Define): Add error 590 detection.
10454 * ecore.cs: Missing argument for error 79.
10456 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
10459 2004-12-07 Marek Safar <marek.safar@seznam.cz>
10462 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
10465 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
10467 * cs-parser.jay : handle doc comments on implicit/explicit operators.
10468 Some operator comments were suppressed.
10469 * doc.cs : Implicit/explicit operator name in doc comments are like
10470 "op_Explicit(type)~returnType", so added suffix handling.
10472 2004-12-07 Martin Baulig <martin@ximian.com>
10475 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
10476 (MemberCore.GetClsCompliantAttributeValue): Likewise.
10477 (DeclSpace.ec): New protected field; store the EmitContext here.
10478 (DeclSpace.EmitContext): New public property; moved here from
10480 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
10483 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
10484 (Enum.Emit): Don't create a new EmitContext.
10486 * delegate.cs (Delegate.DefineType): Always create the
10489 * iterators.cs (Iterators.DefineIterator): Create a new
10490 EmitContext and store it in `ec'.
10492 2004-08-24 Martin Baulig <martin@ximian.com>
10495 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
10496 this for accessibility checks.
10497 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
10498 IsNestedFamilyAccessible.
10499 (TypeManager.IsSubclassOf): New method, do what the name actually
10502 2004-12-06 Raja R Harinath <rharinath@novell.com>
10504 Fix crash on cs0657-17.cs.
10505 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10506 Use RootContext.Tree.Types, not 'new RootTypes ()'.
10507 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
10508 the case where the NamespaceEntry gets overwritten.
10510 2004-12-06 Marek Safar <marek.safar@seznam.cz>
10512 Fixed #69195, #56821
10513 * ecore.cs (ResolveBoolean): Tiny refactoring.
10515 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
10516 of right expression resolving when left is false constant and
10517 operator is LogicalAnd OR true constant and operator is LogicalOr.
10519 * statement.cs (ResolveUnreachable): Always reports warning.
10521 2004-12-05 Miguel de Icaza <miguel@ximian.com>
10523 * class.cs: Distinguish between 1721 and 1722 (just a little help
10524 for the programmer).
10526 2004-12-03 Miguel de Icaza <miguel@ximian.com>
10528 * delegate.cs: Only allow this on new versions of the language.
10530 2004-12-02 Duncan Mak <duncan@ximian.com>
10532 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
10534 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
10535 here as a static method. Take an additional bool out parameter
10536 `must_do_cs1540_check' for signaling to InstanceResolve.
10537 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
10538 member field from PropertyExpr class and made it an argument of
10539 the method instead.
10540 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
10541 check for MarshalByRefObject, and report CS0122 instead of CS1540.
10542 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
10543 and `remove_accessor' as well as InstanceResolve: report CS0122
10548 2004-12-03 Raja R Harinath <rharinath@novell.com>
10550 Fix test-327.cs, test-328.cs, and put in early infrastructure
10551 for eventually fixing #52697.
10552 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
10553 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
10554 from other methods.
10555 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
10556 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
10557 (VerifyUsing, error246): Update.
10558 * rootcontext.cs (RootContext.NamespaceLookup): Just use
10559 'NamespaceEntry.LookupNamespaceOrType'.
10561 2004-12-03 Martin Baulig <martin@ximian.com>
10563 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10564 method as our child, call AnonymousMethod.Compatible() on it.
10566 2004-12-03 Raja R Harinath <rharinath@novell.com>
10568 Disable XML documentation support in 'basic' profile.
10569 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
10570 Redirect XmlElement to System.Object.
10571 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
10572 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
10573 * mcs.exe.sources: Add doc-bootstrap.cs.
10574 * doc-bootstrap.cs: New file. Contains empty stub implementation
10577 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
10579 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
10580 comments are allowed.
10582 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10584 * delegate.cs: Add checks for subtypes in paramaters and return values
10585 in VerifyMethod () to add support for Covariance/Contravariance
10588 2004-12-02 Miguel de Icaza <miguel@ximian.com>
10590 * report.cs: Remove extra closing parenthesis.
10592 * convert.cs (Error_CannotImplicitConversion): If the name of the
10593 types are the same, provide some extra information.
10595 * class.cs (FieldBase): Use an unused bit field from the field to
10596 encode the `has_offset' property from the FieldMember. This saves
10597 a couple of Ks on bootstrap compilation.
10599 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10600 method as our child, return the AnonymousMethod resolved
10603 * expression.cs (New.DoResolve): Allow return values from
10604 NewDelegate to also include AnonymousMethods.
10608 2004-12-02 Marek Safar <marek.safar@seznam.cz>
10611 * attribute.cs (Resolve): Improved implementation of params
10612 attribute arguments.
10614 * support.cs (ParameterData): Add HasParams to be faster.
10616 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
10618 all things are for /doc support:
10620 * doc.cs: new file that supports XML documentation generation.
10621 * mcs.exe.sources: added doc.cs.
10623 Handle /doc command line option.
10624 Report error 2006 instead of 5 for missing file name for /doc.
10625 Generate XML documentation when required, after type resolution.
10627 Added support for picking up documentation (/// and /** ... */),
10628 including a new XmlCommentState enumeration.
10630 Added lines to fill Documentation element for field, constant,
10631 property, indexer, method, constructor, destructor, operator, event
10632 and class, struct, interface, delegate, enum.
10633 Added lines to warn incorrect comment.
10635 Added Documentation field (passed only when /doc was specified).
10637 Added DocComment, DocCommentHeader, GenerateDocComment() and
10638 OnGenerateDocComment() and some supporting private members for
10639 /doc feature to MemberCore.
10641 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
10643 Added overriden DocCommentHeader.
10645 Added overriden DocCommentHeader and GenerateDocComment().
10647 2004-12-01 Miguel de Icaza <miguel@ximian.com>
10649 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
10650 unwrapping the enumeration values, chain to
10651 DoConstantNumericPromotions again, so we can promote things to the
10652 fundamental types (takes care of enums that are bytes, sbytes).
10656 2004-12-01 Raja R Harinath <rharinath@novell.com>
10658 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
10659 Fix long-standing bug in type-lookup. Use FindType instead of
10660 LookupType when ec.ResolvingTypeTree.
10661 (Attribute.ResolveType, Attribute.Resolve)
10662 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
10664 (Attributes.Search): Remove internal version. Update.
10665 (Attributes.SearchMulti): Update.
10666 (Attributes.GetClsCompliantAttribute): Remove.
10667 (Attributes.GetIndexerNameAttribute): Remove.
10668 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
10669 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
10670 * class.cs (Indexer.Define): Likewise.
10672 2004-12-01 Marek Safar <marek.safar@seznam.cz>
10675 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
10676 MarshallByReference members access.
10678 * expression.cs: Use CheckMarshallByRefAccess;
10679 Better error CS0197 message.
10681 * report.cs: Print whole related error message.
10683 2004-11-30 Raja R Harinath <rharinath@novell.com>
10685 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
10686 the current directory to help debugging.
10688 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10690 * class (GetClassBases): Better error 60 report.
10691 (EventProperty): Disabled warning 67 detection.
10693 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10696 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
10698 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
10701 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10704 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
10706 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
10708 2004-11-26 Miguel de Icaza <miguel@ximian.com>
10710 * attribute.cs (Attribute.Resolve): Refine error reporting and
10711 report a cs0117 if the identifier does not exist, to distinguish
10712 from 0617 which is a miss-use of the actual identifier.
10714 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
10715 between cs0070 and cs0079.
10717 * class.cs (MemberBase.DoDefine): When reporting a wrong
10718 accessibility level, we use MethodCore to compare instead of
10719 Method (this was a regression in some refactoring effort).
10721 So now we correctly report cs0056 again.
10723 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
10724 testing the target_type (which was known to be object_type) and
10725 not the source type (which is anonymous_method).
10727 Fixed reporting of error cs1660.
10729 * expression.cs (UserCast.Source): Expose the underlying cast.
10731 * statement.cs (Switch.SwitchGoverningType): Sort the list of
10732 allowed types to find a match to int32 first (most common).
10734 In addition, it ignores any ImplicitUserConversions that did an
10735 internal implicit conversion (as the switch statement allows only
10736 one integral conversion to exist).
10738 * class.cs (PartialContainer.Create): rename `name' to
10739 `member_name' for clarity. Then replace the string calls with a
10740 call to MemberName.GetPartialName, as now using
10741 MemberName.ToString is an error (this is due to the side effects
10742 it had, that were fixed in the past).
10744 This will restore the error reporting on a number of partial class
10745 errors that were missusing this (and getting an exception as a
10746 results, which is now just a plain textual warning, because
10747 yyparse debug output would crash otherwise).
10749 2004-11-26 Raja R Harinath <rharinath@novell.com>
10751 * Makefile (PROGRAM_INSTALL_DIR): Remove.
10753 2004-11-25 Ben Maurer <bmaurer@ximian.com>
10755 * rootcontext.cs (LookupType): Make sure to cache lookups that
10756 don't give us a negative result. This saves about 5% of corlib
10759 2004-11-25 Miguel de Icaza <miguel@ximian.com>
10761 * report.cs (AbstractMessage.Print): messages are sent to stderr
10763 * class.cs (TypeContainer.GetClassBases): It is an error to have a
10764 non-interface in the list of interfaces (at this point, either
10765 parent was properly set, or a base class is being listed in the
10766 interfaces section).
10768 This flags error 1722, and resolves the crash from bug 69259.
10770 2004-11-25 Ben Maurer <bmaurer@ximian.com>
10772 * statement.cs (Using.EmitExpressionFinally): make this work right
10773 for valuetypes. Fixes 69926.
10775 2004-11-25 Miguel de Icaza <miguel@ximian.com>
10777 * const.cs (Const.ChangeType): Cope with the "0 literal can be
10778 converted to an enum" here, before we try to change the underlying
10779 type. This code exists, but it is a different code path than the
10780 one used while encoding constants.
10782 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
10783 old bug: when converting from the null literal to a pointer,
10784 return an EmptyCast, not the NullLiteral.
10786 This fixes #69921, the recent null_type changes probably made this
10787 bug more prominent.
10789 (ImplicitReferenceConversionExists): In addition, resynchronized
10790 the code here, so it matches the same code in
10791 ImplicitReferenceConversionExists for the `from any class-type S
10792 to any interface-type T'.
10795 2004-11-25 Marek Safar <marek.safar@seznam.cz>
10797 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
10799 2004-11-24 Miguel de Icaza <miguel@ximian.com>
10801 * cs-parser.jay: Use verbosity accordingly.
10803 2004-11-24 Marek Safar <marek.safar@seznam.cz>
10805 * expression.cs (Unary.ResolveOperator): Do not report warning;
10806 AddressOf reads from variable.
10808 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
10810 2004-11-24 Marek Safar <marek.safar@seznam.cz>
10814 * attribute.cs (Attributable): Removed CheckTargets.
10815 (Attributes.Emit): Explicit attribute targets are tested here.
10817 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
10818 not enabled for interfaces.
10820 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
10821 (GetAssemblyName): Ouch next bug there.
10823 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10825 * expression.cs: Error 275 added.
10827 2004-11-23 Marek Safar <marek.safar@seznam.cz>
10829 Fix bug #69177 (Implemented decimal constant support)
10831 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
10832 (BinaryFold): Add DecimalConstant.
10834 * const.cs (Define): Decimal constant
10836 (ChangeType): Add decimal type handling.
10837 (LookupConstantValue): Don't set value for decimal type but
10838 emit DecimalConstantAttribute. Needed for constant optimization.
10840 * constant.cs (ToDecimal): New method.
10841 (ConvertToDecimal): New method.
10842 (IntConstant): Implemented ConvertToDecimal.
10843 (DecimalConstant.Emit): Emit optimized version for decimals in
10846 * expression.cs (ResolveOperator): Changed order of constant
10847 reduction to work correctly with native types which have
10848 overloaded operators.
10849 (ResolveMemberAccess): Extract constant value from attribute
10852 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
10854 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
10855 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
10856 (ChangeType): Decimal is special.
10857 (TypeToCoreType): Add decimal type.
10859 2004-11-22 Marek Safar <marek.safar@seznam.cz>
10861 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
10864 2004-11-22 Marek Safar <marek.safar@seznam.cz>
10866 * class.cs (EventField.ApplyAttributeBuilder): Fix error
10869 2004-11-19 Marek Safar <marek.safar@seznam.cz>
10871 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
10873 * pending.cs (PendingImplementation): Grab only interfaces.
10875 2004-11-19 Marek Safar <marek.safar@seznam.cz>
10877 * statement.cs (ForeachHelperMethods): Add location member and
10878 error 202 detection.
10880 2004-11-19 Raja R Harinath <rharinath@novell.com>
10882 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
10883 automatically handled by executable.make.
10884 (PROGRAM): Make profile-specific.
10886 2004-11-18 Marek Safar <marek.safar@seznam.cz>
10888 * expression.cs (DoResolveBase): Fixed wrong warning for out
10891 2004-11-18 Martin Baulig <martin@ximian.com>
10893 Merged latest changes into gmcs. Please keep this comment in
10894 here, it makes it easier for me to see what changed in MCS since
10895 the last time I merged.
10897 2004-11-17 Raja R Harinath <rharinath@novell.com>
10899 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
10900 (TypeHandle.GetMemberCache): New.
10901 (TypeHandle.TypeHandle): Update.
10902 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
10903 (TypeManager.LookupParentInterfacesCache):
10904 Rename from LookupInterfaceCache. Optimize slightly.
10905 (TypeManager.MemberLookup_FindMembers): Update.
10906 * decl.cs (MemberCache.MemberCache): Set Container to null in the
10907 multi-type variant.
10908 (AddCacheContents): Rename from AddHashtable.
10909 * class.cs (TypeContainer.parent_container): Remove.
10910 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
10911 (TypeContainer.DoDefineMembers): Don't initialize it.
10912 Update to name changes.
10914 2004-11-17 Miguel de Icaza <miguel@ximian.com>
10916 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
10917 that factors the code to check access modifiers on override.
10919 (PropertyBase): Use the code here.
10921 Patch from Lluis S'anchez, fixes bug #69361.
10923 2004-11-15 Miguel de Icaza <miguel@ximian.com>
10925 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
10926 routine that is used to report the use of a captured variable
10927 whose address has been taken.
10929 There are two checks: one when variables are being captured and
10930 the other check is when the address of a variable is taken.
10932 (because an anonymous methods might be resolved before *or* after
10933 the address has been taken) and
10935 * expression.cs (Conditional.DoResolve): Remove the special
10936 casing that Martin added to trueExpr and falseExpr being both
10937 NullLiteral. We get the right behavior now just by introducing
10938 the null_type into the compiler.
10940 * convert.cs (ExplicitConversion): Change the code to use
10941 null_type instead of testing `expr is NullLiteral'.
10942 (ImplicitConversionStandard): use null_type too.
10943 (ImplicitReferenceConversionExists): use null_type too.
10944 (ImplicitReferenceConversion): use null_type too.
10946 * literal.cs: The type of `NullLiteral' is now null_type instead
10948 (Resolve): Set the type here.
10950 * typemanager.cs: Introduce null_type.
10952 2004-11-17 Martin Baulig <martin@ximian.com>
10954 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
10955 direction, like FindMembers() does. Fixes #69546, testcase is in
10958 2004-11-16 Martin Baulig <martin@ximian.com>
10960 This is based on a patch from Marek Safar, see bug #69082.
10961 Fixes bugs #63705 and #67130.
10963 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
10964 method; create a MemberCache for an interface type and cache the
10967 * decl.cs (IMemberContainer.ParentContainer): Removed.
10968 (IMemberContainer.ParentCache): New property.
10969 (MemberCache.SetupCacheForInterface): Removed.
10970 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
10971 to create a cache for an interface's "parent".
10973 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
10976 2004-11-16 Martin Baulig <martin@ximian.com>
10978 Merged back from gmcs; these changes already went into gmcs a
10979 couple of weeks ago.
10982 (TypeManager.AddUserType): Removed the `ifaces' argument.
10983 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
10985 (TypeManager.AddUserInterface): Removed.
10986 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
10988 (TypeManager.GetInterfaces): Likewise.
10989 (TypeManager.GetExplicitInterfaces): Likewise.
10991 * ecore.cs (TypeExpr.GetInterfaces): Removed.
10993 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
10994 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
10996 2004-11-14 Ben Maurer <bmaurer@ximian.com>
10998 * statement.cs: Avoid adding bools to a hashtable.
11000 2004-11-07 Miguel de Icaza <miguel@ximian.com>
11002 * expression.cs (Invocation.OverloadResolve): Flag error if we are
11003 calling an unsafe method from a safe location.
11005 2004-11-06 Marek Safar <marek.safar@seznam.cz>
11008 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
11010 2004-11-06 Miguel de Icaza <miguel@ximian.com>
11012 * namespace.cs (VerifyUsing): use GetPartialName instead of
11015 2004-11-05 Miguel de Icaza <miguel@ximian.com>
11017 * statement.cs (Return.Resolve): Fix regression in typo: if
11018 `in_exc', we have to request a NeedReturnLabel, this was a typo
11019 introduced in the anonymous method check-in. Fixes #69131.
11021 * Indexers were using the ShortName when defining themselves,
11022 causing a regression in the compiler bootstrap when applying the
11023 patch from 2004-11-02 (first part), now they use their full name
11024 and the bug is gone.
11026 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
11028 * driver.cs: Strip the path from the names of embedded resources. Fixes
11031 2004-11-04 Raja R Harinath <rharinath@novell.com>
11033 Fix error message regression: cs0104-2.cs.
11034 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
11035 (AliasEntry.Resolve): Update.
11036 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
11038 (RootContext.LookupType): Update.
11040 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
11042 * cs-parser.jay: Add support for handling accessor modifiers
11043 * class: Add support port accessor modifiers and error checking,
11044 define PropertyMethod.Define as virtual (not abstract anymore)
11045 * ecore.cs: Add checking for proeprties access with access modifiers
11046 * iterators.cs: Modify Accessor constructor call based in the modified
11048 2004-11-02 Ben Maurer <bmaurer@ximian.com>
11050 * expression.cs (StringConcat): Handle being called twice,
11051 as when we have a concat in a field init with more than two
11054 2004-11-02 Miguel de Icaza <miguel@ximian.com>
11056 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
11057 special case explicit implementations, we should always produce
11058 the .property or .event declaration.
11060 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
11061 since it will not return correct data if people use this
11062 unresolved in the presence of using statements (see test-313).
11064 * class.cs (MethodData.Define): If we are an explicit interface
11065 implementation, set the method name to the full name of the
11066 interface plus the name of the method.
11068 Notice that using the method.MethodName.GetFullName() does not
11069 work, as it will only contain the name as declared on the source
11070 file (it can be a shorthand in the presence of using statements)
11071 and not the fully qualifed type name, for example:
11075 class D : ICloneable {
11076 object ICloneable.Clone () {
11080 Would produce a method called `ICloneable.Clone' instead of
11081 `System.ICloneable.Clone'.
11083 * namespace.cs (Alias.Resolve): Use GetPartialName.
11085 2004-11-01 Marek Safar <marek.safar@seznam.cz>
11087 * cs-parser.jay: Add error 1055 report.
11089 2004-11-01 Miguel de Icaza <miguel@ximian.com>
11091 * assign.cs (Assign.DoResolve): Only do the transform of
11092 assignment into a New if the types are compatible, if not, fall
11093 through and let the implicit code deal with the errors and with
11094 the necessary conversions.
11096 2004-11-01 Marek Safar <marek.safar@seznam.cz>
11098 * cs-parser.jay: Add error 1031 report.
11100 * cs-tokenizer.cs: Add location for error 1038.
11102 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11104 * cs-parser.jay: Add error 1016 report.
11106 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11108 * cs-parser.jay: Add errors 1575,1611 report.
11110 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11112 * cs-parser.jay: Add error 1001 report.
11114 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11117 * attribute.cs (GetMarshal): Add method argument for
11118 caller identification.
11120 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
11121 agument for GetMarshal and RuntimeMissingSupport.
11123 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11125 * attribute.cs (ExtractSecurityPermissionSet): Removed
11126 TypeManager.code_access_permission_type.
11128 * typemanager.cs: Removed TypeManager.code_access_permission_type.
11130 2004-10-27 Miguel de Icaza <miguel@ximian.com>
11132 * expression.cs (LocalVariableReference.DoResolveLValue): Check
11133 for obsolete use of a variable here. Fixes regression on errors
11134 cs0619-25 and cs0619-26.
11136 2004-10-27 Marek Safar <marek.safar@seznam.cz>
11138 Fix #62358, implemented security attribute encoding.
11140 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
11141 Tests permitted SecurityAction for assembly or other types.
11142 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
11143 data from SecurityPermissionAttribute to PermisionSet class.
11145 * class.cs (ApplyAttributeBuilder): Added special handling
11146 for System.Security.Permissions.SecurityAttribute based types.
11148 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
11149 special handling for System.Security.Permissions.SecurityAttribute
11152 * enum.cs (ApplyAttributeBuilder): Added special handling
11153 for System.Security.Permissions.SecurityAttribute based types.
11155 * parameter.cs (ApplyAttributeBuilder): Added special handling
11156 for System.Security.Permissions.SecurityAttribute based types.
11158 * rootcontext.cs: Next 2 core types.
11160 * typemanager.cs (TypeManager.security_permission_attr_type):
11161 Built in type for the SecurityPermission Attribute.
11162 (code_access_permission_type): Build in type.
11164 2004-10-17 Miguel de Icaza <miguel@ximian.com>
11166 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
11167 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
11168 all of this information into
11169 EmitContext.EmitCapturedVariableInstance.
11171 * codegen.cs (EmitCapturedVariableInstance): move here the
11172 funcionality of emitting an ldarg.0 in the presence of a
11173 remapping. This centralizes the instance emit code.
11175 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
11176 then emit a load of this: it means that we have reached the
11177 topmost ScopeInfo: the one that contains the pointer to the
11178 instance of the class hosting the anonymous method.
11180 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
11181 captures to the topmost CaptureContext.
11183 2004-10-12 Miguel de Icaza <miguel@ximian.com>
11185 * expression.cs (LocalVariableReference): Move the knowledge about
11186 the iterators into codegen's EmitCapturedVariableInstance.
11188 2004-10-11 Miguel de Icaza <miguel@ximian.com>
11190 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
11191 all code paths return a value from an anonymous method (it is the
11192 same as the 161 error, but for anonymous methods).
11194 2004-10-08 Miguel de Icaza <miguel@ximian.com>
11196 The introduction of anonymous methods in the compiler changed
11197 various ways of doing things in the compiler. The most
11198 significant one is the hard split between the resolution phase
11199 and the emission phases of the compiler.
11201 For instance, routines that referenced local variables no
11202 longer can safely create temporary variables during the
11203 resolution phase: they must do so from the emission phase,
11204 since the variable might have been "captured", hence access to
11205 it can not be done with the local-variable operations from the runtime.
11209 (Block.Flags): New flag `IsTopLevel' to indicate that this block
11210 is a toplevel block.
11212 (ToplevelBlock): A new kind of Block, these are the blocks that
11213 are created by the parser for all toplevel method bodies. These
11214 include methods, accessors and anonymous methods.
11216 These contain some extra information not found in regular blocks:
11217 A pointer to an optional CaptureContext (for tracking captured
11218 local variables and parameters). A pointer to the parent
11221 (Return.Resolve): Catch missmatches when returning a value from an
11222 anonymous method (error 1662).
11223 Invoke NeedReturnLabel from the Resolve phase instead of the emit
11226 (Break.Resolve): ditto.
11228 (SwitchLabel): instead of defining the labels during the
11229 resolution phase, we now turned the public ILLabel and ILLabelCode
11230 labels into methods called GetILLabelCode() and GetILLabel() that
11231 only define the label during the Emit phase.
11233 (GotoCase): Track the SwitchLabel instead of the computed label
11234 (its contained therein). Emit the code by using
11235 SwitchLabel.GetILLabelCode ().
11237 (LocalInfo.Flags.Captured): A new flag has been introduce to track
11238 whether the Local has been captured or not.
11240 (LocalInfo.IsCaptured): New property, used to tell whether the
11241 local has been captured.
11243 * anonymous.cs: Vastly updated to contain the anonymous method
11246 The main classes here are: CaptureContext which tracks any
11247 captured information for a toplevel block and ScopeInfo used to
11248 track the activation frames for various local variables.
11250 Each toplevel block has an optional capture context associated
11251 with it. When a method contains an anonymous method both the
11252 toplevel method and the anonymous method will create a capture
11253 context. When variables or parameters are captured, they are
11254 recorded on the CaptureContext that owns them, for example:
11258 MyDelegate d = delegate {
11263 Here `a' will be recorded as captured on the toplevel
11264 CapturedContext, the inner captured context will not have anything
11265 (it will only have data if local variables or parameters from it
11266 are captured in a nested anonymous method.
11268 The ScopeInfo is used to track the activation frames for local
11269 variables, for example:
11271 for (int i = 0; i < 10; i++)
11272 for (int j = 0; j < 10; j++){
11273 MyDelegate d = delegate {
11278 At runtime this captures a single captured variable `i', but it
11279 captures 10 different versions of the variable `j'. The variable
11280 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
11281 recorded on a child.
11283 The toplevel ScopeInfo will also track information like the `this'
11284 pointer if instance variables were referenced (this is necessary
11285 as the anonymous method lives inside a nested class in the host
11286 type of the method).
11288 (AnonymousMethod): Expanded to track the Toplevel, implement
11289 `AnonymousMethod.Compatible' to tell whether an anonymous method
11290 can be converted to a target delegate type.
11292 The routine now also produces the anonymous method content
11294 (AnonymousDelegate): A helper class that derives from
11295 DelegateCreation, this is used to generate the code necessary to
11296 produce the delegate for the anonymous method that was created.
11298 * assign.cs: API adjustments for new changes in
11299 Convert.ImplicitStandardConversionExists.
11301 * class.cs: Adjustments to cope with the fact that now toplevel
11302 blocks are of type `ToplevelBlock'.
11304 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
11305 insteda of standard blocks.
11307 Flag errors if params arguments are passed to anonymous methods.
11309 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
11310 `CurrentAnonymousMethod' which points to the current Anonymous
11311 Method. The variable points to the AnonymousMethod class that
11312 holds the code being compiled. It is set in the new EmitContext
11313 created for the anonymous method.
11315 (EmitContext.Phase): Introduce a variable and an enumeration to
11316 assist in enforcing some rules about when and where we are allowed
11317 to invoke certain methods (EmitContext.NeedsReturnLabel is the
11318 only one that enfonces this right now).
11320 (EmitContext.HaveCaptureInfo): new helper method that returns
11321 whether we have a CapturedContext initialized.
11323 (EmitContext.CaptureVariable): New method used to register that a
11324 LocalInfo must be flagged for capturing.
11326 (EmitContext.CapturedParameter): New method used to register that a
11327 parameters must be flagged for capturing.
11329 (EmitContext.CapturedField): New method used to register that a
11330 field must be flagged for capturing.
11332 (EmitContext.HaveCapturedVariables,
11333 EmitContext.HaveCapturedFields): Return whether there are captured
11334 variables or fields.
11336 (EmitContext.EmitMethodHostInstance): This is used to emit the
11337 instance for the anonymous method. The instance might be null
11338 (static methods), this (for anonymous methods that capture nothing
11339 and happen to live side-by-side with the current method body) or a
11340 more complicated expression if the method has a CaptureContext.
11342 (EmitContext.EmitTopBlock): Routine that drives the emission of
11343 code: it will first resolve the top block, then emit any metadata
11344 and then emit the code. The split is done so that we can extract
11345 any anonymous methods and flag any captured variables/parameters.
11347 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
11348 during this phase, the ILGenerator should not be used as labels
11349 and local variables declared here might not be accessible to any
11350 code that is part of an anonymous method.
11352 Exceptions to this include the temporary variables that are
11353 created by some statements internally for holding temporary
11356 (EmitContext.EmitMeta): New routine, in charge of emitting all the
11359 (EmitContext.TemporaryReturn): This method is typically called
11360 from the Emit phase, and its the only place where we allow the
11361 ReturnLabel to be defined other than the EmitMeta. The reason is
11362 that otherwise we would have to duplicate a lot of logic in the
11363 Resolve phases of various methods that today is on the Emit
11366 (EmitContext.NeedReturnLabel): This no longer creates the label,
11367 as the ILGenerator is not valid during the resolve phase.
11369 (EmitContext.EmitThis): Extended the knowledge in this class to
11370 work in anonymous methods in addition to iterators.
11372 (EmitContext.EmitCapturedVariableInstance): This emits whatever
11373 code is necessary on the stack to access the instance to a local
11374 variable (the variable will be accessed as a field).
11376 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
11377 EmitContext.EmitAddressOfParameter): Routines to support
11378 parameters (not completed at this point).
11380 Removals: Removed RemapLocal and RemapLocalLValue. We probably
11381 will also remove the parameters.
11383 * convert.cs (Convert): Define a `ConstantEC' which points to a
11384 null. This is just to prefity some code that uses
11385 ImplicitStandardConversion code and do not have an EmitContext
11388 The idea is to flag explicitly that at that point in time, it is
11389 known that the conversion will not trigger the delegate checking
11390 code in implicit conversions (which requires a valid
11393 Everywhere: pass new EmitContext parameter since
11394 ImplicitStandardConversionExists now requires it to check for
11395 anonymous method conversions.
11397 (Convert.ImplicitStandardConversionExists): If the type of an
11398 expression is the anonymous_method_type, and the type is a
11399 delegate, we invoke the AnonymousMethod.Compatible method to check
11400 whether an implicit conversion is possible.
11402 (Convert.ImplicitConversionStandard): Only do implicit method
11403 group conversions if the language level is not ISO_1.
11405 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
11406 MethodInfo for the Invoke method. used by Delegate and
11409 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
11410 method conversions if the target type is a delegate.
11412 Removed extra debugging nops.
11414 (LocalVariableReference): Turn the `local_info' into a public
11417 Add `prepared' field, the same hack used for FieldExprs to cope
11418 with composed assignments, as Local variables do not necessarily
11419 operate purely on the stack as they used to: they can be captured
11422 Add `temp' for a temporary result, like fields.
11424 Refactor DoResolve and DoResolveLValue into DoResolveBase.
11426 It now copes with Local variables that are captured and emits the
11427 proper instance variable to load it from a field in the captured
11430 (ParameterReference.DoResolveBase): During the resolve phase,
11431 capture parameters if we are in an anonymous method.
11433 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
11434 anonymous method, use the EmitContext helper routines to emit the
11435 parameter reference.
11437 * iterators.cs: Set RemapToProxy to true/false during the
11440 * parameters.cs (GetParameterByName): New helper method.
11442 * typemanager.cs (anonymous_method_type) a new type that
11443 represents an anonyous method. This is always an internal type,
11444 used as a fencepost to test against the anonymous-methodness of an
11447 2004-10-20 Marek Safar <marek.safar@seznam.cz>
11449 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
11451 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
11453 2004-10-18 Martin Baulig <martin@ximian.com>
11455 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
11456 `Type' directly, but call ResolveType() on it.
11457 (Catch.Resolve): Likewise.
11458 (Foreach.Resolve): Likewise.
11460 2004-10-18 Martin Baulig <martin@ximian.com>
11462 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
11463 `Type' directly, but call ResolveType() on it.
11464 (Probe.DoResolve): Likewise.
11465 (ArrayCreation.LookupType): Likewise.
11466 (TypeOf.DoResolve): Likewise.
11467 (SizeOf.DoResolve): Likewise.
11469 2004-10-18 Martin Baulig <martin@ximian.com>
11471 * expression.cs (Invocation.BetterFunction): Put back
11472 TypeManager.TypeToCoreType().
11474 2004-10-18 Raja R Harinath <rharinath@novell.com>
11476 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
11479 2004-10-18 Martin Baulig <martin@ximian.com>
11481 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
11482 `Type' directly, but call ResolveType() on it.
11484 2004-10-18 Martin Baulig <martin@ximian.com>
11486 * class.cs (FieldMember.Define): Don't access the TypeExpr's
11487 `Type' directly, but call ResolveType() on it.
11488 (MemberBase.DoDefine): Likewise.
11490 * expression.cs (New.DoResolve): Don't access the TypeExpr's
11491 `Type' directly, but call ResolveType() on it.
11492 (ComposedCast.DoResolveAsTypeStep): Likewise.
11494 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
11495 `Type' directly, but call ResolveType() on it.
11497 2004-10-17 John Luke <john.luke@gmail.com>
11499 * class.cs (Operator.GetSignatureForError): use CSharpName
11501 * parameter.cs (Parameter.GetSignatureForError): Returns
11502 correct name even if was not defined.
11504 2004-10-13 Raja R Harinath <rharinath@novell.com>
11507 * class.cs (TypeContainer.EmitContext): New property.
11508 (DefineNestedTypes): Create an emitcontext for each part.
11509 (MethodCore.DoDefineParameters): Use container's emitcontext.
11510 Pass type array to InternalParameters.
11511 (MemberBase.DoDefine): Use container's emitcontext.
11512 (FieldMember.Define): Likewise.
11513 (Event.Define): Likewise.
11514 (SetMethod.GetParameterInfo): Change argument to EmitContext.
11515 Pass type array to InternalParameters.
11516 (SetIndexerMethod.GetParameterInfo): Likewise.
11517 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
11518 * delegate.cs (Define): Pass emitcontext to
11519 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
11520 array to InternalParameters.
11521 * expression.cs (ParameterReference.DoResolveBase): Pass
11522 emitcontext to GetParameterInfo.
11523 (ComposedCast.DoResolveAsTypeStep): Remove check on
11524 ec.ResolvingTypeTree.
11525 * parameter.cs (Parameter.Resolve): Change argument to
11526 EmitContext. Use ResolveAsTypeTerminal.
11527 (Parameter.GetSignature): Change argument to EmitContext.
11528 (Parameters.ComputeSignature): Likewise.
11529 (Parameters.ComputeParameterTypes): Likewise.
11530 (Parameters.GetParameterInfo): Likewise.
11531 (Parameters.ComputeAndDefineParameterTypes): Likewise.
11532 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
11533 * support.cs (InternalParameters..ctor): Remove variant that takes
11535 * typemanager.cs (system_intptr_expr): New.
11536 (InitExpressionTypes): Initialize it.
11538 2004-10-12 Chris Toshok <toshok@ximian.com>
11540 * cs-parser.jay: fix location for try_statement and catch_clause.
11542 2004-10-11 Martin Baulig <martin@ximian.com>
11544 * report.cs: Don't make --fatal abort on warnings, we have
11545 -warnaserror for that.
11547 2004-10-07 Raja R Harinath <rharinath@novell.com>
11549 More DeclSpace.ResolveType avoidance.
11550 * decl.cs (MemberCore.InUnsafe): New property.
11551 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
11552 with newly created EmitContext.
11553 (FieldMember.Define): Likewise.
11554 * delegate.cs (Delegate.Define): Likewise.
11555 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
11556 only if normal name-lookup fails.
11557 (TypeExpr.DoResolve): Enable error-checking.
11558 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
11559 (SizeOf.DoResolve): Likewise.
11560 (ComposedCast.DoResolveAsTypeStep): Likewise.
11561 (StackAlloc.DoResolve): Likewise.
11562 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
11563 (Block.Unsafe): New property.
11564 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
11565 (Unsafe): Set 'unsafe' flag of contained block.
11566 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
11567 (Fixed.Resolve): Likewise.
11568 (Catch.Resolve): Likewise.
11569 (Using.ResolveLocalVariableDecls): Likewise.
11570 (Foreach.Resolve): Likewise.
11572 2004-10-05 John Luke <john.luke@gmail.com>
11574 * cs-parser.jay: add location to error CS0175
11576 2004-10-04 Miguel de Icaza <miguel@ximian.com>
11578 * ecore.cs (Expression.Constantity): Add support for turning null
11581 * const.cs (Const.Define): Allow constants to be reference types
11582 as long as the value is Null.
11584 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
11586 * namespace.cs (NamespaceEntry.Using): No matter which warning
11587 level is set, check if this namespace name has already been added.
11589 2004-10-03 Ben Maurer <bmaurer@ximian.com>
11591 * expression.cs: reftype [!=]= null should always use br[true,false].
11594 2004-10-03 Marek Safar <marek.safar@seznam.cz>
11597 * attribute.cs: Enum conversion moved to
11598 GetAttributeArgumentExpression to be applied to the all
11601 2004-10-01 Raja R Harinath <rharinath@novell.com>
11603 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
11604 * class.c (TypeContainer.DefineType): Flag error if
11605 base types aren't accessible due to access permissions.
11606 * decl.cs (DeclSpace.ResolveType): Move logic to
11607 Expression.ResolveAsTypeTerminal.
11608 (DeclSpace.ResolveTypeExpr): Thin layer over
11609 Expression.ResolveAsTypeTerminal.
11610 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
11611 Refactor code into NestedAccess. Use it.
11612 (DeclSpace.NestedAccess): New.
11613 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
11614 argument to silence errors. Check access permissions.
11615 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
11616 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
11617 (Cast.DoResolve): Likewise.
11618 (New.DoResolve): Likewise.
11619 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
11620 (TypeOf.DoResolve): Likewise.
11622 * expression.cs (Invocation.BetterConversion): Return the Type of
11623 the better conversion. Implement section 14.4.2.3 more faithfully.
11624 (Invocation.BetterFunction): Make boolean. Make correspondence to
11625 section 14.4.2.2 explicit.
11626 (Invocation.OverloadResolve): Update.
11627 (Invocation): Remove is_base field.
11628 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
11629 (Invocation.Emit): Likewise.
11631 2004-09-27 Raja R Harinath <rharinath@novell.com>
11633 * README: Update to changes.
11635 2004-09-24 Marek Safar <marek.safar@seznam.cz>
11637 * cs-parser.jay: Reverted 642 warning fix.
11639 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11642 * decl.cs (FindMemberWithSameName): Indexer can have more than
11645 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11647 * expression.cs (LocalVariableReference.DoResolveLValue):
11648 Do not report warning 219 for out values.
11649 (EmptyExpression.Null): New member to avoid extra allocations.
11651 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11653 * cs-parser.jay: Fix wrong warning 642 report.
11655 * cs-tokenizer.cs (CheckNextToken): New helper;
11656 Inspect next character if is same as expected.
11658 2004-09-23 Martin Baulig <martin@ximian.com>
11660 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
11661 (Convert.ImplicitReferenceConversionExists): Likewise.
11663 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11665 * class.cs (Operator.Define): Add error 448 and 559 report.
11667 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11669 * class.cs (MemberBase.IsTypePermitted): New protected
11670 method for checking error CS0610.
11672 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11674 * class.cs (TypeContainer.HasExplicitLayout): New property
11675 Returns whether container has StructLayout attribute set Explicit.
11676 (FieldMember): New abstract class for consts and fields.
11677 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
11678 (Field): Reuse FieldMember.
11680 * const.cs (Const): Reuse FieldMember.
11682 * rootcontext.cs: EmitConstants call moved to class.
11684 2004-09-22 Martin Baulig <martin@ximian.com>
11686 Thanks to Peter Sestoft for this bug report.
11688 * expression.cs (Conditional): If both the `trueExpr' and the
11689 `falseExpr' is a NullLiteral, return a NullLiteral.
11691 2004-09-22 Martin Baulig <martin@ximian.com>
11693 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
11694 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
11695 for the "get_Current" call.
11697 2004-09-22 Martin Baulig <martin@ximian.com>
11699 Marek and me just fixed one of our oldest bugs: #28562 :-)
11701 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
11703 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
11704 we're an EnumConstant, just return that.
11705 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
11706 an EnumConstant. In this case, we need to use GetValueAsEnumType()
11707 to get the value which'll actually be written into the attribute.
11708 However, we have to use GetValue() to access the attribute's value
11711 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11713 * constant.cs (Constant.IsNegative): New abstract property
11716 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
11717 (StackAlloc.DoResolve): Reused IsNegative.
11719 2004-09-21 Martin Baulig <martin@ximian.com>
11721 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
11722 if we're used in an iterator, we may be called from different
11725 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
11726 we actually have an exception block.
11728 2004-09-20 John Luke <jluke@cfl.rr.com>
11730 * class.cs, cs-parser.jay: Improve the error report for 1520:
11731 report the actual line where the error happens, not where the
11732 class was declared.
11734 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
11735 Pass location information that was available elsewhere.
11737 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
11739 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
11740 runtime to delay sign assemblies.
11742 2004-09-19 Miguel de Icaza <miguel@ximian.com>
11744 * cs-parser.jay: Do not report the stack trace, this is barely
11747 2004-08-22 John Luke <john.luke@gmail.com>
11749 * driver.cs : check that a resource id is not already used
11750 before adding it, report CS1508 if it is, bug #63637
11752 2004-09-19 Miguel de Icaza <miguel@ximian.com>
11754 * ecore.cs: Removed dead code.
11756 2004-09-18 Marek Safar <marek.safar@seznam.cz>
11758 * class.cs: Do not report warning CS0067 on the interfaces.
11760 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11762 * cs-parser.jay: Add error 504 report.
11764 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11766 * rootcontext.cs: WarningLevel is 4 by default now.
11768 * statement.cs (Fixed.Resolve): Do not null
11771 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11774 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
11775 deep search when property is not virtual.
11776 (PropertyExpr.ResolveAccessors): Make one call for both
11779 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11782 * statement.cs: Error 152 report constains also location.
11784 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11787 * const.cs: Explicitly set constant as static.
11789 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11792 * cs-parser.jay: Add error 1017 report.
11794 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11796 Fixed bug #59980, #64224
11797 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
11799 * typemanager.cs (IsSpecialMethod): Simplified
11801 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11803 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
11804 condition with better params.
11806 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11809 * attribute.cs (Resolve): Property has to have both
11812 2004-09-14 Martin Baulig <martin@ximian.com>
11814 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
11816 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11819 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
11820 called and is obsolete then this member suppress message
11821 when call is inside next [Obsolete] method or type.
11823 * expression.cs: Use TestObsoleteMethodUsage member.
11825 2004-09-14 Martin Baulig <martin@ximian.com>
11827 * cs-parser.jay: Sync a bit with the GMCS version.
11829 2004-09-14 Martin Baulig <martin@ximian.com>
11831 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
11832 (CSharpParser.yacc_verbose_flag): New public field.
11834 * genericparser.cs: Removed.
11836 2004-09-14 Raja R Harinath <rharinath@novell.com>
11838 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
11840 2004-09-13 Marek Safar <marek.safar@seznam.cz>
11842 * class.cs (MethodCore.CheckBase): Fix bug #65757.
11844 2004-09-10 Martin Baulig <martin@ximian.com>
11846 Backported my MemberName changes from GMCS into MCS.
11848 - we are now using a special `MemberName' class instead of using
11849 strings; in GMCS, the `MemberName' also contains the type
11852 - changed the grammar rules a bit:
11853 * the old `member_name' is now a `namespace_or_type_name':
11854 The rule is that we use `namespace_or_type_name' everywhere
11855 where we expect either a "member name" (GetEnumerator) or a
11856 "member name" with an explicit interface name
11857 (IEnumerable.GetEnumerator).
11858 In GMCS, the explicit interface name may include type arguments
11859 (IEnumerable<T>.GetEnumerator).
11860 * we use `member_name' instead of just `IDENTIFIER' for
11862 The rule is that we use `member_name' wherever a member may
11863 have type parameters in GMCS.
11865 * decl.cs (MemberName): New public class.
11866 (MemberCore.MemberName): New public readonly field.
11867 (MemberCore.ctor): Take a `MemberName' argument, not a string.
11868 (DeclSpace): Likewise.
11870 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
11871 * enum.cs (Enum.ctor): Likewise.
11873 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
11875 (AliasEntry.ctor): Take a MemberName, not an Expression.
11876 (AliasEntry.UsingAlias): Likewise.
11878 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
11879 (IMethodData.MemberName): Changed type from string to MemberName.
11880 (MemberBase.ExplicitInterfaceName): Likewise.
11881 (AbstractPropertyEventMethod.SetupName): Make this private.
11882 (AbstractPropertyEventMethod.ctor): Added `string prefix'
11883 argument; compute the member name here.
11884 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
11885 on the `member.MemberName' and the `prefix'.
11887 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
11889 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
11890 thus, we get a `MemberName' instead of a `string'. These
11891 declarations may have type parameters in GMCS.
11892 (interface_method_declaration, delegate_declaration): Likewise.
11893 (class_declaration, interface_declaration): Likewise.
11894 (method_header): Use `namespace_or_type_name' instead of
11895 `member_name'. We may be an explicit interface implementation.
11896 (property_declaration, event_declaration): Likewise.
11897 (member_name): This is now just an `IDENTIFIER', not a
11898 `namespace_or_type_name'.
11899 (type_name, interface_type): Removed.
11900 (namespace_or_type_name): Return a MemberName, not an Expression.
11901 (primary_expression): Use `member_name' instead of `IDENTIFIER';
11902 call GetTypeExpression() on the MemberName to get an expression.
11903 (IndexerDeclaration.interface_type): Changed type from string to
11905 (MakeName): Operate on MemberName's instead of string's.
11907 2004-09-13 Raja R Harinath <rharinath@novell.com>
11910 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
11911 (NamespaceEntry.Lookup): Add new argument to flag if we want the
11912 lookup to avoid symbols introduced by 'using'.
11913 * rootcontext.cs (NamespaceLookup): Update.
11915 2004-09-12 Marek Safar <marek.safar@seznam.cz>
11917 * class.cs (TypeContainer.DoDefineMembers): Do not call
11918 DefineDefaultConstructor for static classes.
11920 2004-09-12 Marek Safar <marek.safar@seznam.cz>
11922 * attribute.cs (Attribute.Resolve): Add error 653 report.
11924 * class.cs (Class.ApplyAttributeBuilder): Add error 641
11926 (Method.ApplyAttributeBuilder): Add error 685 report.
11927 (Operator.Define): Add error 564 report.
11929 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
11931 * expression.cs (Invocation.DoResolve): Add error
11932 245 and 250 report.
11934 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
11937 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11939 * class.cs (ConstructorInitializer.Resolve):
11940 Wrong error number (515->516).
11942 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11944 * class.cs (Indexer.Define): Add error 631 report.
11946 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11948 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
11950 2004-09-11 Marek Safar <marek.safar@seznam.cz>
11952 * expression.cs (Probe.DoResolve): Add error CS0241 report.
11954 2004-09-10 Marek Safar <marek.safar@seznam.cz>
11956 * cs-parser.jay: Added error CS0241 report.
11958 2004-09-10 Raja R Harinath <rharinath@novell.com>
11960 * cs-parser.jay (fixed_statement): Introduce a scope for the
11961 declaration in the 'fixed' statement.
11963 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11965 * cs-parser.jay: Added CS0230 error report.
11967 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11969 * cs-parser.jay: Added errors CS0231 and CS0257 report.
11971 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11973 * expression.cs (Argument.Resolve): Added error CS0192 and
11976 2004-09-09 Marek Safar <marek.safar@seznam.cz>
11978 C# 2.0 #pragma warning feature
11980 * cs-tokenizer.cs (PreProcessPragma): New method;
11981 Handles #pragma directive.
11983 * report.cs (WarningRegions): New class; Support
11984 class for #pragma warning directive. It tests whether
11985 warning is enabled for a given line.
11987 2004-09-08 Miguel de Icaza <miguel@ximian.com>
11989 * const.cs: Add more descriptive error report, tahnks to
11992 2004-09-08 Marek Safar <marek.safar@seznam.cz>
11994 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
11996 2004-09-07 Miguel de Icaza <miguel@ximian.com>
11998 * expression.cs: Apply patch from Ben: Remove dead code from
11999 ArrayCreation, and remove the TurnintoConstant call in const.cs,
12000 as that code just threw an exception anwyays.
12002 * const.cs: Remove the call to the turnintoconstant, for details
12005 * literal.cs: The type of the null-literal is the null type; So
12006 we use a placeholder type (literal.cs:System.Null, defined here)
12009 * expression.cs (Conditional.DoResolve): Remove some old code that
12010 is no longer needed, conversions have been fixed.
12012 (ArrayCreationExpression.DoResolve): Return false if we fail to
12013 resolve the inner expression.
12015 2004-09-07 Raja R Harinath <rharinath@novell.com>
12018 * cs-parser.jay (delegate_declaration): Record a delegate
12019 declaration as a type declaration.
12020 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
12022 2004-09-06 Miguel de Icaza <miguel@ximian.com>
12024 * parameter.cs: Do not crash if the type can not be resolved.
12026 * expression.cs: Report errors with unsafe pointers, fixes #64896
12028 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
12030 * expression.cs: Pointer arith always needs to do a conv.i
12031 if the operand is a long. fix 65320
12033 2004-09-04 Marek Safar <marek.safar@seznam.cz>
12035 Fixed cs0619-37.cs, cs0619-38.cs
12037 * enum.cs (GetObsoleteAttribute): Removed.
12039 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
12040 on Enum member is double staged. The first is tested member
12043 2004-09-04 Marek Safar <marek.safar@seznam.cz>
12045 Fixed #56986, #63631, #65231
12047 * class.cs: (TypeContainer.AddToMemberContainer): New method,
12048 adds member to name container.
12049 (TypeContainer.AddToTypeContainer): New method, adds type to
12051 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
12052 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
12053 AddOperator): Simplified by reusing AddToMemberContainer.
12054 (TypeContainer.UserDefinedStaticConstructor): Changed to property
12056 (Method.CheckForDuplications): Fixed implementation to test all
12058 (MemberBase): Detection whether member is explicit interface
12059 implementation is now in constructor.
12060 (MemberBase.UpdateMemberName): Handles IndexerName.
12061 (Accessor): Changed to keep also location information.
12062 (AbstractPropertyEventMethod): Is derived from MemberCore.
12063 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
12064 will be emited or not.
12065 (PropertyBase.AreAccessorsDuplicateImplementation):
12066 Tests whether accessors are not in collision with some method.
12067 (Operator): Is derived from MethodCore to simplify common
12070 * decl.cs (Flags.TestMethodDuplication): Test for duplication
12072 (DeclSpace.AddToContainer): Adds the member to defined_names
12073 table. It tests for duplications and enclosing name conflicts.
12075 * enum.cs (EnumMember): Clean up to reuse the base structures
12077 2004-09-03 Martin Baulig <martin@ximian.com>
12079 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
12080 into TypeContainer, to make partial classes work again.
12082 2004-09-03 Martin Baulig <martin@ximian.com>
12084 * rootcontext.cs (RootContext.V2): Removed.
12086 2004-03-23 Martin Baulig <martin@ximian.com>
12088 * expression.cs (Invocation.OverloadResolve): Added `bool
12089 may_fail' argument and use it instead of the Location.IsNull() hack.
12091 2004-09-03 Martin Baulig <martin@ximian.com>
12093 Merged latest changes into gmcs. Please keep this comment in
12094 here, it makes it easier for me to see what changed in MCS since
12095 the last time I merged.
12097 2004-09-03 Raja R Harinath <rharinath@novell.com>
12100 * expression.cs (BetterConversion): Don't allow either conversion
12101 to be null. Remove redundant implicit conversion test when 'q ==
12102 null' -- when this function is invoked, we already know that the
12103 implicit conversion exists.
12104 (BetterFunction): Assume that 'best' is non-null. Remove
12105 redundant reimplementation of IsApplicable when 'best' is null.
12106 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
12107 number of arguments.
12108 (IsAncestralType): Extract from OverloadResolve.
12109 (OverloadResolve): Make robust to the MethodGroupExpr being
12110 unsorted. Implement all the logic of Section 14.5.5.1, and
12111 support overloading of methods from multiple applicable types.
12112 Clean up logic somewhat. Don't pass null methods to BetterFunction.
12114 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
12115 (RealError, Warning): Append type of report to related symbol.
12117 2004-09-03 Marek Safar <marek.safar@seznam.cz>
12119 * enum.cs: Fixed CLS-Compliance checks for enum members.
12120 Error tests cs3008-8.cs, cs3014-8.cs
12122 2004-09-02 Marek Safar <marek.safar@seznam.cz>
12124 Fixed bug #62342, #63102
12125 * class.cs: ImplementIndexer uses member.IsExplicitImpl
12126 like ImplementMethod.
12128 2004-09-02 Marek Safar <marek.safar@seznam.cz>
12130 * attribute.cs (Attribute.GetAttributeArgumentExpression):
12133 2004-09-02 Martin Baulig <martin@ximian.com>
12135 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
12136 TypeManager.GetArgumentTypes() rather than calling GetParameters()
12139 2004-09-01 Marek Safar <marek.safar@seznam.cz>
12141 C# 2.0 Static classes implemented
12143 * class.cs (TypeContainer): instance_constructors,
12144 initialized_fields, initialized_static_fields,
12145 default_constructor, base_inteface_types are protected to be
12146 accessible from StaticClass.
12147 (TypeContainer.DefineDefaultConstructor): New virtual method
12148 for custom default constructor generating
12149 (StaticClass): New class to handle "Static classes" feature.
12151 * cs-parser.jay: Handle static keyword on class like instance
12154 * driver.cs: Added "/langversion" command line switch with two
12155 options (iso-1, default).
12157 2004-08-31 Marek Safar <marek.safar@seznam.cz>
12159 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
12161 2004-08-31 Miguel de Icaza <miguel@ximian.com>
12163 * delegate.cs: Style.
12165 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
12167 * delegate.cs: Add seperate instance expr field for miguel.
12169 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
12171 * PointerArithmetic (Resolve): make sure we are not doing
12172 pointer arith on void*. Also, make sure we are resolved
12173 by not setting eclass until resolve.
12175 All callers: Make sure that PointerArithmetic gets resolved.
12177 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
12179 * ArrayCreation (LookupType): If the type does not resolve
12180 to an array, give an error.
12182 2004-08-27 Marek Safar <marek.safar@seznam.cz>
12184 * statement.cs (Try.Resolve): Fixed bug #64222
12186 2004-08-27 Martin Baulig <martin@ximian.com>
12189 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
12192 2004-08-26 Marek Safar <marek.safar@seznam.cz>
12194 * ecore.cs (Constantify): Get underlying type via
12195 System.Enum.GetUnderlyingType to avoid StackOverflow on the
12196 Windows in special cases.
12198 2004-08-26 Marek Safar <marek.safar@seznam.cz>
12200 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
12201 for obtaining also private methods.
12202 (GetRemoveMethod): Used GetRemoveMethod (true)
12203 for obtaining also private methods.
12205 2004-08-24 Martin Baulig <martin@ximian.com>
12207 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
12208 MethodAttributes.HideBySig for operators.
12210 2004-08-23 Martin Baulig <martin@ximian.com>
12212 Back to the old error reporting system :-)
12214 * report.cs (Message): Removed.
12215 (Report.MessageData, ErrorData, WarningData): Removed.
12216 (Report.Error, Warning): Back to the old system.
12218 2004-08-23 Martin Baulig <martin@ximian.com>
12220 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
12222 * class.cs (TypeContainer.ParentContainer): New public virtual
12223 method; replaces the explicit interface implementation.
12224 (ClassPart.ParentContainer): Override.
12226 2004-08-23 Martin Baulig <martin@ximian.com>
12228 * statement.cs (Switch): Added support for constant switches; see
12229 #59428 or test-285.cs.
12231 2004-08-22 Marek Safar <marek.safar@seznam.cz>
12234 * statement.cs (GetEnumeratorFilter): Removed useless
12235 logic because C# specs is strict. GetEnumerator must be
12238 2004-08-22 Martin Baulig <martin@ximian.com>
12240 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12241 a switch and may break, reset the barrier. Fixes #59867.
12243 2004-08-22 Marek Safar <marek.safar@seznam.cz>
12245 CLS-Compliance speed up (~5% for corlib)
12247 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
12248 New method. Tests container for CLS-Compliant names
12250 * class.cs (TypeContainer.VerifyClsName): New method.
12251 Checks whether container name is CLS Compliant.
12252 (Constructor): Implements IMethodData.
12254 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
12255 low-case table for CLS Compliance test.
12256 (MemberCache.VerifyClsParameterConflict): New method.
12257 Checks method parameters for CS3006 error.
12259 * enum.cs (EnumMember): Is derived from MemberCore.
12260 (Enum.VerifyClsName): Optimized for better performance.
12262 2004-08-06 Marek Safar <marek.safar@seznam.cz>
12264 * report.cs: Renamed Error_T to Error and changed all
12267 2004-08-06 Marek Safar <marek.safar@seznam.cz>
12269 * class.cs (TypeContainer.IndexerArrayList): New inner class
12270 container for indexers.
12271 (TypeContainer.DefaultIndexerName): New constant for default
12272 indexer name. Replaced all "Item" with this constant.
12273 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
12275 * typemanager.cs (TypeManager.default_member_ctor): Cache here
12276 DefaultMemberAttribute constructor.
12278 2004-08-05 Martin Baulig <martin@ximian.com>
12280 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12283 2004-08-05 Marek Safar <marek.safar@seznam.cz>
12285 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
12286 multi platforms problem.
12288 * compiler.csproj: Included shared files.
12290 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12292 Fix bug 60333, 55971 in the more general way
12293 * attribute.cs (Attribute.GetAttributeArgumentExpression):
12294 Added arg_type argument for constant conversion.
12295 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
12297 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12300 * class.cs (TypeContainer ): New inner classes MethodArrayList,
12301 OperatorArrayList, MethodCoreArrayList for typecontainer
12302 containers. Changed class member types to these new types.
12303 (MethodArrayList.DefineMembers): Added test for CS0659.
12305 2004-08-04 Miguel de Icaza <miguel@ximian.com>
12307 * cfold.cs: Synchronize the folding with the code in expression.cs
12308 Binary.DoNumericPromotions for uint operands.
12310 * attribute.cs: Revert patch from Raja, it introduced a regression
12311 while building Blam-1.2.1 (hard to isolate a test case).
12313 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12317 (TypeContainer.Define): Renamed to DefineContainerMembers because of
12319 (MethodCore.parent_method): New member. The method we're overriding
12320 if this is an override method.
12321 (MethodCore.CheckBase): Moved from Method class and made common.
12322 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
12324 (MethodCore.CheckForDuplications): New abstract method. For custom
12325 member duplication search in a container
12326 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
12327 method and its return type.
12328 (Event.conflict_symbol): New member. Symbol with same name in the
12332 (MemberCache.FindMemberWithSameName): New method. The method
12333 is looking for conflict with inherited symbols.
12335 2004-08-04 Martin Baulig <martin@ximian.com>
12337 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
12339 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
12341 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12343 * report.cs (Message): New enum for better error, warning reference in
12345 (MessageData): New inner abstract class. It generally handles printing of
12346 error and warning messages.
12347 Removed unused Error, Warning, Message methods.
12349 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12351 Fix for cs0592-8.cs test
12353 (Attributable.ValidAttributeTargets): Made public.
12354 (Attribute.ExplicitTarget): New member for explicit target value.
12355 (Attribute.CheckTargets): Now we translate explicit attribute
12356 target to Target here.
12358 2004-08-03 Ben Maurer <bmaurer@ximian.com>
12360 * ecore.cs (MethodGroupExpr): new IsBase property.
12362 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
12364 * delegate.cs (DelegateCreation): store a MethodGroupExpr
12365 rather than an instance expr.
12367 (DelegateCreation.Emit): Use the method group rather than
12368 the instance expression. Also, if you have base.Foo as the
12369 method for a delegate, make sure to emit ldftn, not ldftnvirt.
12371 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
12373 (NewDelegate.DoResolve): Only check for the existance of Invoke
12374 if the method is going to be needed. Use MethodGroupExpr.
12376 (NewDelegate.Emit): Remove, DelegateCreation implements this.
12378 * expression.cs: For pointer arith., make sure to use
12379 the size of the type, not the size of the pointer to
12382 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12385 * class.cs (Class): Added error CS0502 test.
12387 2004-08-03 John Luke <jluke@cfl.rr.com>
12388 Raja R Harinath <rharinath@novell.com>
12391 * attribute.cs (Attribute.complained_before): New flag.
12392 (Attribute.ResolveType, Attribute.Resolve),
12393 (Attribute.DefinePInvokeMethod): Set it.
12394 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
12396 2004-08-03 Martin Baulig <martin@ximian.com>
12398 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
12399 use a user-defined operator; we still need to do numeric
12400 promotions in case one argument is a builtin type and the other
12401 one has an implicit conversion to that type. Fixes #62322.
12403 2004-08-02 Martin Baulig <martin@ximian.com>
12405 * statement.cs (LocalInfo.Flags): Added `IsThis'.
12406 (LocalInfo.IsThis): New public property.
12407 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
12409 2004-08-01 Martin Baulig <martin@ximian.com>
12411 * class.cs (TypeContainer.GetClassBases): Don't set the default
12412 here since we may get called from GetPartialBases().
12413 (TypeContainer.DefineType): If GetClassBases() didn't return a
12414 parent, use the default one.
12416 2004-07-30 Duncan Mak <duncan@ximian.com>
12418 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
12420 2004-07-30 Martin Baulig <martin@ximian.com>
12422 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
12424 * class.cs (SourceMethod): New public class, derive from the
12425 symbol writer's ISourceMethod.
12426 (Method): Use the new symbol writer API.
12428 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
12429 as argument and use the new symbol writer.
12432 (SourceFile): Implement the symbol writer's ISourceFile.
12433 (Location.SymbolDocument): Removed.
12434 (Location.SourceFile): New public property.
12436 * symbolwriter.cs: Use the new symbol writer API.
12438 2004-07-30 Raja R Harinath <rharinath@novell.com>
12440 * Makefile (install-local): Remove. Functionality moved to
12443 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
12445 * Makefile: Install mcs.exe.config file together with mcs.exe.
12446 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
12447 correct runtime version.
12449 2004-07-25 Martin Baulig <martin@ximian.com>
12452 (TypeContainer.RegisterOrder): Removed, this was unused.
12453 (TypeContainer, interface_order): Removed.
12454 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
12455 TypeContainer as argument since we can also be called with a
12456 `PartialContainer' for a partial class/struct/interface.
12457 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
12458 of checking whether we're an `Interface' - we could be a
12459 `PartialContainer'.
12460 (PartialContainer.Register): Override; call
12461 AddClass()/AddStruct()/AddInterface() on our parent.
12463 * cs-parser.jay (interface_member_declaration): Add things to the
12464 `current_container', not the `current_class'.
12466 * rootcontext.cs (RegisterOrder): The overloaded version which
12467 takes an `Interface' was unused, removed.
12469 * typemanager.cs (TypeManager.LookupInterface): Return a
12470 `TypeContainer', not an `Interface'.
12471 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
12472 contain a `PartialContainer' for an interface, so check it's
12473 `Kind' to figure out what it is.
12475 2004-07-25 Martin Baulig <martin@ximian.com>
12477 * class.cs (Class.DefaultTypeAttributes): New public constant.
12478 (Struct.DefaultTypeAttributes): Likewise.
12479 (Interface.DefaultTypeAttributes): Likewise.
12480 (PartialContainer.TypeAttr): Override this and add the
12481 DefaultTypeAttributes.
12483 2004-07-25 Martin Baulig <martin@ximian.com>
12485 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
12486 we can just use the `Parent' field instead.
12488 2004-07-25 Martin Baulig <martin@ximian.com>
12490 * class.cs (TypeContainer.Emit): Renamed to EmitType().
12492 2004-07-25 Martin Baulig <martin@ximian.com>
12494 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
12495 our parts before defining any methods.
12496 (TypeContainer.VerifyImplements): Make this virtual.
12497 (ClassPart.VerifyImplements): Override and call VerifyImplements()
12498 on our PartialContainer.
12500 2004-07-25 Martin Baulig <martin@ximian.com>
12502 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
12504 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
12505 argument, we can just use the `Parent' field instead.
12508 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
12509 (MemberBase.DoDefine): Likewise.
12511 2004-07-24 Martin Baulig <martin@ximian.com>
12513 * decl.cs (MemberCore.Parent): New public field.
12514 (DeclSpace.Parent): Moved to MemberCore.
12516 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
12517 (MemberBase.ctor): Added TypeContainer argument, pass it to our
12519 (FieldBase, Field, Operator): Likewise.
12520 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
12521 (EventField, Event): Likewise.
12523 2004-07-23 Martin Baulig <martin@ximian.com>
12525 * class.cs (PartialContainer): New public class.
12526 (ClassPart): New public class.
12527 (TypeContainer): Added support for partial classes.
12528 (TypeContainer.GetClassBases): Splitted some of the functionality
12529 out into GetNormalBases() and GetPartialBases().
12531 * cs-tokenizer.cs (Token.PARTIAL): New token.
12532 (Tokenizer.consume_identifier): Added some hacks to recognize
12533 `partial', but only if it's immediately followed by `class',
12534 `struct' or `interface'.
12536 * cs-parser.jay: Added support for partial clases.
12538 2004-07-23 Martin Baulig <martin@ximian.com>
12540 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
12541 a `DeclSpace' and also made it readonly.
12542 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
12543 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
12544 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
12546 * cs-parser.jay: Pass the `current_class', not the
12547 `current_container' (at the moment, this is still the same thing)
12548 to a new Method, Property, Event, Indexer or Constructor.
12550 2004-07-23 Martin Baulig <martin@ximian.com>
12552 * cs-parser.jay (CSharpParser): Added a new `current_class' field
12553 and removed the `current_interface' one.
12554 (struct_declaration, class_declaration, interface_declaration):
12555 Set `current_class' to the newly created class/struct/interface;
12556 set their `Bases' and call Register() before parsing their body.
12558 2004-07-23 Martin Baulig <martin@ximian.com>
12560 * class.cs (Kind): New public enum.
12561 (TypeContainer): Made this class abstract.
12562 (TypeContainer.Kind): New public readonly field.
12563 (TypeContainer.CheckDef): New public method; moved here from
12565 (TypeContainer.Register): New public abstract method.
12566 (TypeContainer.GetPendingImplementations): New public abstract
12568 (TypeContainer.GetClassBases): Removed the `is_class' and
12569 `is_iface' parameters.
12570 (TypeContainer.DefineNestedTypes): Formerly known as
12572 (ClassOrStruct): Made this class abstract.
12574 * tree.cs (RootTypes): New public type.
12576 2004-07-20 Martin Baulig <martin@ximian.com>
12578 * tree.cs (Tree.RecordNamespace): Removed.
12579 (Tree.Namespaces): Removed.
12581 * rootcontext.cs (RootContext.IsNamespace): Removed.
12583 * cs-parser.jay (namespace_declaration): Just create a new
12584 NamespaceEntry here.
12586 2004-07-20 Martin Baulig <martin@ximian.com>
12588 * statement.cs (ExceptionStatement): New abstract class. This is
12589 now used as a base class for everyone who's using `finally'.
12590 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
12591 our local variables before using them.
12593 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
12594 virtual method. This is used by Yield.Resolve() to "steal" an
12595 outer block's `finally' clauses.
12596 (FlowBranchingException): The .ctor now takes an ExceptionStatement
12599 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
12600 version which takes an ExceptionStatement. This version must be
12601 used to create exception branchings.
12604 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
12605 (Iterator.EmitMoveNext): Added exception support; protect the
12606 block with a `fault' clause, properly handle 'finally' clauses.
12607 (Iterator.EmitDispose): Run all the `finally' clauses here.
12609 2004-07-20 Martin Baulig <martin@ximian.com>
12611 * iterator.cs: This is the first of a set of changes in the
12612 iterator code. Match the spec more closely: if we're an
12613 IEnumerable, then GetEnumerator() must be called. The first time
12614 GetEnumerator() is called, it returns the current instance; all
12615 subsequent invocations (if any) must create a copy.
12617 2004-07-19 Miguel de Icaza <miguel@ximian.com>
12619 * expression.cs: Resolve the constant expression before returning
12622 2004-07-19 Martin Baulig <martin@ximian.com>
12624 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
12625 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
12626 the return type of the new EmitContext.
12628 2004-07-18 Martin Baulig <martin@ximian.com>
12630 * class.cs (Property.Define): Fix iterators.
12632 * iterators.cs (Iterator.Define): Moved the
12633 `container.AddInterator (this)' call here from the .ctor; only do
12634 it if we resolved successfully.
12636 2004-07-17 Miguel de Icaza <miguel@ximian.com>
12638 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
12639 `true' for preprocessing directives that we parse. The return
12640 value indicates whether we should return to regular tokenizing or
12641 not, not whether it was parsed successfully.
12643 In the past if we were in: #if false ... #line #endif, we would
12644 resume parsing after `#line'. See bug 61604.
12646 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
12647 building: IsEnumType should return true only for enums, not for
12648 enums or System.Enum itself. This fixes #61593.
12650 Likely what happened is that corlib was wrong: mcs depended on
12651 this bug in some places. The bug got fixed, we had to add the
12652 hack, which caused bug 61593.
12654 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
12655 that was a workaround for the older conditions.
12657 2004-07-16 Ben Maurer <bmaurer@ximian.com>
12659 * assign.cs: IAssignMethod has a new interface, as documented
12660 inline. All assignment code now uses this new api.
12662 * ecore.cs, expression.cs: All classes which implement
12663 IAssignMethod now use the new interface.
12665 * expression.cs (Invocation): add a hack to EmitCall so that
12666 IndexerAccess can be the target of a compound assignment without
12667 evaluating its arguments twice.
12669 * statement.cs: Handle changes in Invocation api.
12671 2004-07-16 Martin Baulig <martin@ximian.com>
12673 * iterators.cs: Rewrote this. We're now using one single Proxy
12674 class for both the IEnumerable and the IEnumerator interface and
12675 `Iterator' derives from Class so we can use the high-level API.
12677 * class.cs (TypeContainer.AddIterator): New method.
12678 (TypeContainer.DoDefineType): New protected virtual method, which
12679 is called from DefineType().
12680 (TypeContainer.DoDefineMembers): Call DefineType() and
12681 DefineMembers() on all our iterators.
12682 (TypeContainer.Emit): Call Emit() on all our iterators.
12683 (TypeContainer.CloseType): Call CloseType() on all our iterators.
12685 * codegen.cs (EmitContext.CurrentIterator): New public field.
12687 2004-07-15 Martin Baulig <martin@ximian.com>
12690 (TypeManager.not_supported_exception_type): New type.
12692 2004-07-14 Martin Baulig <martin@ximian.com>
12694 * iterators.cs: Use real error numbers.
12696 2004-07-14 Martin Baulig <martin@ximian.com>
12698 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
12699 requires this to be a System.Collection.IEnumerable and not a
12700 class implementing that interface.
12701 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
12703 2004-07-13 Marek Safar <marek.safar@seznam.cz>
12705 * class.cs: Fixed previous fix, it broke some error tests.
12707 2004-07-12 Martin Baulig <martin@ximian.com>
12709 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
12712 2004-07-09 Miguel de Icaza <miguel@ximian.com>
12714 * assign.cs (LocalTemporary): Add new argument: is_address,If
12715 `is_address' is true, then the value that we store is the address
12716 to the real value, and not the value itself.
12718 * ecore.cs (PropertyExpr): use the new local temporary
12719 stuff to allow us to handle X.Y += z (where X is a struct)
12721 2004-07-08 Martin Baulig <martin@ximian.com>
12723 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
12724 not always return, just like we're doing in Using.Resolve().
12726 2004-07-07 Miguel de Icaza <miguel@ximian.com>
12728 * cs-parser.jay (fixed_statement): flag this as Pinned.
12730 2004-07-06 Miguel de Icaza <miguel@ximian.com>
12732 * typemanager.cs (TypeManager): Removed MakePinned method, this
12733 mechanism is replaced with the .NET 2.x compatible mechanism of
12734 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
12736 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
12737 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
12738 `IsFixed' property which has a different meaning.
12740 2004-07-02 Raja R Harinath <rharinath@novell.com>
12742 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
12743 visible from inside a nested class, not just the names of the
12744 immediately enclosing class.
12745 Fix for bug #60730.
12747 2004-06-24 Raja R Harinath <rharinath@novell.com>
12749 * expression.cs (BetterConversion): Remove buggy special-case
12750 handling of "implicit constant expression conversions". At this
12751 point, we already know that the conversion is possible -- we're
12752 only checking to see which is better.
12754 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12756 * cs-parser.jay: Added error CS0210 test.
12758 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12760 * cs-parser.jay: Added error CS0134 test.
12762 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12765 * cs-parser.jay: Added error CS0145 test.
12767 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12769 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
12771 2004-06-23 Ben Maurer <bmaurer@ximian.com>
12773 * expression.cs (StackAlloc.Resolve): The argument may not
12774 be a constant; deal with this case.
12776 2004-06-23 Marek Safar <marek.safar@seznam.cz>
12778 * attribute.cs (IndexerName_GetIndexerName): Renamed to
12779 GetIndexerAttributeValue.
12780 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
12782 * class.cs (Indexer.Define): Added error tests for CS0415,
12785 2004-06-23 Miguel de Icaza <miguel@ximian.com>
12787 * attribute.cs (Attribute.Resolve): Keep field code in sync with
12790 2004-06-23 Martin Baulig <martin@ximian.com>
12792 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
12793 neither return nor throw, reset the barrier as well. Fixes #60457.
12795 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
12797 * class.cs : EventAttributes is now set to None by default.
12798 This fixes bug #60459.
12800 2004-06-18 Marek Safar <marek.safar@seznam.cz>
12803 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12804 Don't throw exception but return null (it's sufficient now).
12806 2004-06-18 Marek Safar <marek.safar@seznam.cz>
12808 * typemanager.cs (GetArgumentTypes): Faster implementation.
12810 2004-06-18 Martin Baulig <martin@ximian.com>
12812 * attribute.cs (Attribute.Resolve): Check whether we're an
12813 EmptyCast which a Constant child. Fixes #60333.
12815 2004-06-17 Ben Maurer <bmaurer@ximian.com>
12817 * statement.cs (EmitCollectionForeach): Account for the fact that
12818 not all valuetypes are in areas which we can take the address of.
12819 For these variables, we store to a temporary variable. Also, make
12820 sure that we dont emit a `callvirt' on a valuetype method.
12822 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12824 * expression.cs (StackAlloc.DoReSolve): Added test for
12825 negative parameter (CS0247).
12827 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12830 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
12832 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12835 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
12838 2004-06-14 Marek Safar <marek.safar@seznam.cz>
12840 Fix bug #58254 & cs1555.cs, cs1556.cs
12841 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
12843 2004-06-14 Marek Safar <marek.safar@seznam.cz>
12845 * cs-parser.jay: Added error CS1669 test for indexers.
12847 2004-06-11 Martin Baulig <martin@ximian.com>
12849 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
12850 call this twice: for params and varargs methods.
12852 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12855 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
12857 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12859 * attribute.cs (Attribute.GetValidTargets): Made public.
12862 (AbstractPropertyEventMethod): New class for better code sharing.
12863 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
12865 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
12867 2004-06-11 Raja R Harinath <rharinath@novell.com>
12870 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
12871 that the call to Resolve is part of a MemberAccess.
12872 (Expression.Resolve): Use it for SimpleName resolution.
12873 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
12874 Add 'intermediate' boolean argument.
12875 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
12876 error message when the SimpleName can be resolved ambiguously
12877 between an expression and a type.
12878 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
12880 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
12881 call on the left-side.
12883 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12886 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
12888 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12890 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
12892 2004-06-11 Martin Baulig <martin@ximian.com>
12894 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
12895 varargs methods if applicable.
12897 2004-06-11 Martin Baulig <martin@ximian.com>
12899 * expression.cs (Invocation.EmitCall): Don't use
12900 `method.CallingConvention == CallingConventions.VarArgs' since the
12901 method could also have `CallingConventions.HasThis'.
12903 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12905 * class.cs (Event.GetSignatureForError): Implemented.
12906 Fixed crash in error test cs3010.cs
12908 2004-06-10 Miguel de Icaza <miguel@ximian.com>
12910 * cs-tokenizer.cs: Change the way we track __arglist to be
12911 consistent with the other keywords.
12913 2004-06-09 Miguel de Icaza <miguel@ximian.com>
12915 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
12918 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
12920 * codegen.cs: Check that all referenced assemblies have a strongname
12921 before strongnaming the compiled assembly. If not report error CS1577.
12922 Fix bug #56563. Patch by Jackson Harper.
12923 * typemanager.cs: Added a method to return all referenced assemblies.
12924 Fix bug #56563. Patch by Jackson Harper.
12926 2004-06-08 Marek Safar <marek.safar@seznam.cz>
12929 (Method.ApplyAttributeBuilder): Moved and added conditional
12930 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
12933 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
12935 2004-06-08 Marek Safar <marek.safar@seznam.cz>
12938 * class.cs: (EventField.attribute_targets): Changed default target.
12940 2004-06-08 Martin Baulig <martin@ximian.com>
12942 * expression.cs (Invocation.EmitCall): Enable varargs methods.
12944 2004-06-08 Martin Baulig <martin@ximian.com>
12946 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
12948 2004-06-07 Martin Baulig <martin@ximian.com>
12950 Added support for varargs methods.
12952 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
12955 * cs-parser.jay: Added support for `__arglist'.
12957 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
12959 * expression.cs (Argument.AType): Added `ArgList'.
12960 (Invocation): Added support for varargs methods.
12961 (ArglistAccess): New public class.
12962 (Arglist): New public class.
12964 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
12966 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
12967 a method's top-level block if the method has varargs.
12969 * support.cs (ReflectionParameters, InternalParameters): Added
12970 support for varargs methods.
12972 2004-06-07 Miguel de Icaza <miguel@ximian.com>
12974 * class.cs: Provide location in indexer error report.
12976 * driver.cs: Use standard names.
12978 * namespace.cs: Catch the use of using after a namespace has been
12979 declared also on using aliases.
12981 2004-06-03 Raja R Harinath <rharinath@novell.com>
12984 * typemanager.cs (closure_private_ok, closure_invocation_type)
12985 (closure_qualifier_type, closure_invocation_assembly)
12986 (FilterWithClosure): Move to ...
12987 (Closure): New internal nested class.
12988 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
12989 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
12990 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
12991 (MemberLookup, MemberLookupFailed): Use it.
12992 * expression.cs (New.DoResolve): Treat the lookup for the
12993 constructor as being qualified by the 'new'ed type.
12994 (Indexers.GetIndexersForTypeOrInterface): Update.
12996 2004-06-03 Marek Safar <marek.safar@seznam.cz>
12999 (GetConditionalAttributeValue): New method. Returns
13000 condition of ConditionalAttribute.
13001 (SearchMulti): New method. Returns all attributes of type 't'.
13002 Use it when attribute is AllowMultiple = true.
13003 (IsConditionalMethodExcluded): New method.
13006 (Method.IsExcluded): Implemented. Returns true if method has conditional
13007 attribute and the conditions is not defined (method is excluded).
13008 (IMethodData): Extended interface for ConditionalAttribute support.
13009 (PropertyMethod.IsExcluded): Implemented.
13012 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
13015 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
13018 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
13020 * expression.cs (ArrayCreationExpression): Make this just an
13021 `expression'. It can't be a statement, so the code here was
13024 2004-06-02 Marek Safar <marek.safar@seznam.cz>
13027 * typemanager.cs (GetFullNameSignature): New method for
13030 2004-06-02 Marek Safar <marek.safar@seznam.cz>
13033 * class.cs (MemberBase.GetSignatureForError): New virtual method.
13034 Use this method when MethodBuilder is null.
13035 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
13036 Added test for error CS0626 (MONO reports error for this situation).
13037 (IMethodData.GetSignatureForError): Extended interface.
13039 2004-06-01 Marek Safar <marek.safar@seznam.cz>
13042 (AttributeTester.GetObsoleteAttribute): Returns instance of
13043 ObsoleteAttribute when type is obsolete.
13046 (TypeContainer.VerifyObsoleteAttribute): Override.
13047 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
13048 (MethodCode.VerifyObsoleteAttribute): Override.
13049 (MemberBase.VerifyObsoleteAttribute): Override.
13052 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
13053 and report proper error.
13056 Delegate.VerifyObsoleteAttribute): Override.
13059 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
13060 and report proper error.
13061 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
13064 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
13068 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
13069 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
13070 Added test for ObsoleteAttribute.
13073 (Catch): Derived from Statement.
13075 2004-06-01 Marek Safar <marek.safar@seznam.cz>
13077 Fixed bug #59071 & cs0160.cs
13079 * statement.cs (Try.Resolve): Check here whether order of catch
13080 clauses matches their dependencies.
13082 2004-05-31 Miguel de Icaza <miguel@ximian.com>
13084 * Reverted patch to namespace.cs (Use lookuptypedirect). This
13085 caused a regression: #59343. Referencing nested classes from an
13086 assembly stopped working.
13088 2004-05-31 Martin Baulig <martin@ximian.com>
13090 MCS is now frozen for beta 2.
13092 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
13094 * convert.cs: add a trivial cache for overload operator resolution.
13096 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
13098 * decl.cs: If possible, use lookuptypedirect here. We can only do
13099 this if there is no `.' after the namespace. Avoids using
13100 LookupType, which does lots of slow processing.
13101 (FindNestedType) New method, does what it says :-).
13102 * namespace.cs: use LookupTypeDirect.
13103 * rootcontext.cs: use membercache, if possible.
13104 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
13106 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
13109 According to the spec,
13111 In a member access of the form E.I, if E is a single identifier,
13112 and if the meaning of E as a simple-name (§7.5.2) is a constant,
13113 field, property, localvariable, or parameter with the same type as
13114 the meaning of E as a type-name (§3.8), then both possible
13115 meanings of E are permitted.
13117 We did not check that E as a simple-name had the same type as E as
13120 This trivial check gives us 5-7% on bootstrap time.
13122 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
13124 * expression.cs (Invocation.OverloadResolve): Avoid the
13125 use of hashtables and boxing here by allocating on demand.
13127 2004-05-30 Martin Baulig <martin@ximian.com>
13129 * rootcontext.cs (RootContext.LookupType): Don't cache things if
13130 we're doing a silent lookup. Don't try to lookup nested types in
13131 TypeManager.object_type (thanks to Ben Maurer).
13133 2004-05-30 Martin Baulig <martin@ximian.com>
13135 Committing a patch from Ben Maurer.
13137 * rootcontext.cs (RootContext.LookupType): Cache negative results.
13139 2004-05-29 Martin Baulig <martin@ximian.com>
13141 * class.cs (IMethodData.ShouldIgnore): New method.
13143 * typemanager.cs (TypeManager.MethodFlags): Don't take a
13144 `Location' argument, we don't need it anywhere. Use
13145 `IMethodData.ShouldIgnore ()' instead of
13146 `MethodData.GetMethodFlags ()'.
13147 (TypeManager.AddMethod): Removed.
13148 (TypeManager.AddMethod2): Renamed to AddMethod.
13150 2004-05-29 Martin Baulig <martin@ximian.com>
13152 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
13154 * convert.cs (Convert.ImplicitReferenceConversion): If we're
13155 converting from a class type S to an interface type and we already
13156 have an object on the stack, don't box it again. Fixes #52578.
13158 2004-05-29 Martin Baulig <martin@ximian.com>
13160 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
13161 Added support for `params' parameters. Fixes #59267.
13163 2004-05-29 Martin Baulig <martin@ximian.com>
13165 * literal.cs (NullPointer): Provide a private .ctor which sets
13166 `type' to TypeManager.object_type. Fixes #59048.
13168 2004-05-29 Martin Baulig <martin@ximian.com>
13170 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
13171 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
13173 * ecore.cs (EventExpr.instance_expr): Make the field private.
13175 2004-05-26 Marek Safar <marek.safar@seznam.cz>
13177 Fixed bug #50080 & cs0214-2.cs
13178 * expression.cs (Cast.DoResolve): Check unsafe context here.
13180 * statement.cs (Resolve.DoResolve): Likewise.
13182 2004-05-26 Martin Baulig <martin@ximian.com>
13184 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
13186 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
13187 (RootContext.LookupType): Pass down the `silent' flag.
13189 2004-05-25 Martin Baulig <martin@ximian.com>
13192 (MethodGroupExpr.IdenticalTypeName): New public property.
13193 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
13194 expression actually refers to a type.
13196 2004-05-25 Martin Baulig <martin@ximian.com>
13198 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
13199 for #56176 and made it actually work.
13201 2004-05-25 Martin Baulig <martin@ximian.com>
13203 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
13204 (FieldExpr, PropertyExpr): Override and implement
13205 CacheTemporaries. Fixes #52279.
13207 2004-05-25 Miguel de Icaza <miguel@ximian.com>
13209 * location.cs: In the new compiler listing a file twice is a
13210 warning, not an error.
13212 2004-05-24 Martin Baulig <martin@ximian.com>
13214 * enum.cs (Enum.DefineType): For the `BaseType' to be a
13215 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
13217 2004-05-24 Martin Baulig <martin@ximian.com>
13219 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
13220 walking the `using' list. Fixes #53921.
13222 2004-05-24 Martin Baulig <martin@ximian.com>
13224 * const.cs (Const.LookupConstantValue): Added support for
13225 EmptyCast's; fixes #55251.
13227 2004-05-24 Martin Baulig <martin@ximian.com>
13229 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
13230 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
13231 which does the CS0135 check. The reason is that we first need to
13232 check whether the variable actually exists.
13234 2004-05-24 Martin Baulig <martin@ximian.com>
13236 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
13237 than RootContext.LookupType() to find the explicit interface
13238 type. Fixes #58584.
13240 2004-05-24 Raja R Harinath <rharinath@novell.com>
13242 * Makefile: Simplify. Use executable.make.
13243 * mcs.exe.sources: New file. List of sources of mcs.exe.
13245 2004-05-24 Anders Carlsson <andersca@gnome.org>
13249 Use the invariant culture when doing String.Compare for CLS case
13252 2004-05-23 Martin Baulig <martin@ximian.com>
13254 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
13255 don't have any dots. Fixes #52622, added cs0246-8.cs.
13257 * namespace.cs (NamespaceEntry.Lookup): Likewise.
13259 2004-05-23 Marek Safar <marek.safar@seznam.cz>
13261 * class.cs (MemberBase.Define): Reuse MemberType member for
13262 resolved type. Other methods can use it too.
13264 2004-05-23 Martin Baulig <martin@ximian.com>
13266 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
13267 the variable also exists in the current block (otherwise, we need
13268 to report a CS0103). Fixes #58670.
13270 2004-05-23 Martin Baulig <martin@ximian.com>
13272 * flowanalysis.cs (Reachability.Reachable): Compute this
13273 on-the-fly rather than storing it as a field.
13275 2004-05-23 Martin Baulig <martin@ximian.com>
13277 * flowanalysis.cs (Reachability.And): Manually compute the
13278 resulting `barrier' from the reachability.
13280 2004-05-23 Marek Safar <marek.safar@seznam.cz>
13283 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
13284 instance of ObsoleteAttribute when symbol is obsolete.
13287 (IMethodData): Extended interface for ObsoleteAttribute support.
13289 2004-05-22 Marek Safar <marek.safar@seznam.cz>
13291 * attribute.cs: Fix bug #55970
13293 2004-05-22 Marek Safar <marek.safar@seznam.cz>
13297 (GetObsoleteAttribute): New method. Creates the instance of
13299 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
13300 ObsoleteAttribute when member is obsolete.
13301 (AttributeTester.Report_ObsoleteMessage): Common method for
13302 Obsolete error/warning reporting.
13305 (TypeContainer.base_classs_type): New member for storing parent type.
13308 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
13309 for this MemberCore.
13311 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13313 * attribute.cs, const.cs: Fix bug #58590
13315 2004-05-21 Martin Baulig <martin@ximian.com>
13317 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
13318 out parameters if the end of the method is unreachable. Fixes
13321 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13323 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
13324 Hari was right, why extra method.
13326 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13328 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
13330 2004-05-20 Martin Baulig <martin@ximian.com>
13332 Merged this back from gmcs to keep the differences to a minumum.
13334 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
13335 instead of a Declspace.
13336 (Attribute.ResolveType): Likewise.
13337 (Attributes.Search): Likewise.
13338 (Attributes.Contains): Likewise.
13339 (Attributes.GetClsCompliantAttribute): Likewise.
13341 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
13343 (MethodData.ApplyAttributes): Take an EmitContext instead of a
13346 2004-05-19 Marek Safar <marek.safar@seznam.cz>
13348 Fix bug #58688 (MCS does not report error when the same attribute
13351 * attribute.cs (Attribute.Emit): Distinction between null and default.
13353 2004-05-19 Raja R Harinath <rharinath@novell.com>
13355 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
13356 of a top-level attribute without an attribute target.
13357 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
13359 (Attribute.Conditional_GetConditionName),
13360 (Attribute.Obsolete_GetObsoleteMessage): Update.
13361 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
13362 part of ScanForIndexerName.
13363 (Attribute.CanIgnoreInvalidAttribute): New function.
13364 (Attribute.ScanForIndexerName): Move to ...
13365 (Attributes.ScanForIndexerName): ... here.
13366 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
13367 (Attributes.Search): New internal variant that can choose not to
13368 complain if types aren't resolved. The original signature now
13370 (Attributes.GetClsCompliantAttribute): Use internal variant, with
13371 complaints suppressed.
13372 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
13373 only if it not useful.
13374 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
13375 top-level for attributes that are shared between the assembly
13376 and a top-level class.
13377 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
13378 * class.cs: Update to reflect changes.
13379 (DefineIndexers): Fuse loops.
13380 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
13381 a couple more variants of attribute names.
13383 2004-05-18 Marek Safar <marek.safar@seznam.cz>
13385 Fix bug #52585 (Implemented explicit attribute declaration)
13388 (Attributable.ValidAttributeTargets): New abstract method. It gets
13389 list of valid attribute targets for explicit target declaration.
13390 (Attribute.Target): It holds target itself.
13391 (AttributeSection): Removed.
13392 (Attribute.CheckTargets): New method. It checks whether attribute
13393 target is valid for the current element.
13396 (EventProperty): New class. For events that are declared like
13397 property (with add and remove accessors).
13398 (EventField): New class. For events that are declared like field.
13401 * cs-parser.jay: Implemented explicit attribute target declaration.
13403 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
13404 Override ValidAttributeTargets.
13407 (ReturnParameter): Class for applying custom attributes on
13409 (ParameterAtribute): New class. Class for applying custom
13410 attributes on the parameter type.
13412 2004-05-17 Miguel de Icaza <miguel@ximian.com>
13414 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
13417 (Method): Allow UNSAFE here.
13419 * modifiers.cs: Support unsafe reporting.
13421 2004-05-17 Marek Safar <marek.safar@seznam.cz>
13423 * decl.cs: Fix bug #58478.
13425 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13427 * statement.cs: When checking for unreachable code on an EmptyStatement,
13428 set the location. Fixes bug #58488.
13430 2004-05-13 Miguel de Icaza <miguel@ximian.com>
13432 * driver.cs: Add -pkg handling.
13434 From Gonzalo: UseShelLExecute=false
13436 2004-05-12 Marek Safar <marek.safar@seznam.cz>
13439 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
13441 (Attribute.IsClsCompliaceRequired): Moved to base for better
13443 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
13444 when attribute is AttributeUsageAttribute.
13445 (Attribute.GetValidTargets): Simplified.
13446 (Attribute.GetAttributeUsage): New method returns AttributeUsage
13447 attribute for this type.
13448 (Attribute.ApplyAttributes): Method renamed to Emit and make
13450 (GlobalAttributeSection): New class for special handling of global
13451 attributes (assembly, module).
13452 (AttributeSection.Emit): New method.
13454 * class.cs: Implemented Attributable abstract methods.
13455 (MethodCore.LabelParameters): Moved to Parameter class.
13456 (Accessor): Is back simple class.
13457 (PropertyMethod): Implemented Attributable abstract class.
13458 (DelegateMethod): Implemented Attributable abstract class.
13459 (Event): New constructor for disctintion between normal Event
13460 and Event with accessors.
13462 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
13464 * codegen.cs, const.cs, decl.cs, delegate.cs:
13465 (CommonAssemblyModulClass): Implemented Attributable abstract class
13468 * enum.cs: Implement IAttributeSupport interface.
13469 (EnumMember): New class for emum members. Implemented Attributable
13473 (ParameterBase): Is abstract.
13474 (ReturnParameter): New class for easier [return:] attribute handling.
13476 * typemanager.cs: Removed builder_to_attr.
13478 2004-05-11 Raja R Harinath <rharinath@novell.com>
13481 * attribute.cs (Attribute.GetPositionalValue): New function.
13482 * class.cs (TypeContainer.VerifyMembers): New function.
13483 (TypeContainer.Emit): Use it.
13484 (ClassOrStruct): New base class for Class and Struct.
13485 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
13486 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
13488 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
13489 then each non-static field should have a FieldOffset attribute.
13490 Otherwise, none of the fields should have a FieldOffset attribute.
13491 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
13492 and FieldOffset attributes.
13493 * typemanager.cs (TypeManager.struct_layout_attribute_type)
13494 (TypeManager.field_offset_attribute_type): New core types.
13495 (TypeManager.InitCoreTypes): Initialize them.
13497 2004-05-11 Michal Moskal <malekith@pld-linux.org>
13499 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
13500 Return correct type.
13503 2004-05-09 Miguel de Icaza <miguel@ximian.com>
13505 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
13506 be implicitly converted to ulong.
13508 * expression.cs: The logic for allowing operator &, | and ^ worked
13509 was wrong, it worked before because we did not report an error in
13510 an else branch. Fixes 57895.
13512 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
13513 allow volatile fields to be reference types.
13515 2004-05-07 Miguel de Icaza <miguel@ximian.com>
13517 * driver.cs: Add support for /debug-
13519 2004-05-07 Raja R Harinath <rharinath@novell.com>
13521 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
13522 Add a 'complain' parameter to silence errors.
13523 (Attribute.Resolve): Update to changes. Put in sanity check to catch
13524 silently overlooked type-resolutions.
13525 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
13526 to reflect changes.
13527 (Attributes.Search): New function.
13528 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
13529 (Attributes.GetAttributeFullName): Remove hack.
13530 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
13531 Update to reflect changes.
13532 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13533 Use Attributes.Search instead of nested loops.
13535 2004-05-07 Marek Safar <marek.safar@seznam.cz>
13538 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
13539 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
13540 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
13542 * report.cs: (Report.Warning): Renamed to Warning_T because of
13543 parameter collision.
13545 2004-05-05 Raja R Harinath <rharinath@novell.com>
13547 * expression.cs (MemberAccess.ResolveMemberAccess):
13548 Exit with non-zero status after Report.Error.
13549 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
13551 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
13553 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
13555 * support.cs: Don't hang when the file is empty.
13557 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
13559 * support.cs: In SeekableStreamReader, compute the preamble size of the
13560 underlying stream. Position changes should take into account that initial
13563 2004-05-03 Todd Berman <tberman@sevenl.net>
13565 * driver.cs: remove unused GetSysVersion function.
13567 2004-05-03 Todd Berman <tberman@sevenl.net>
13569 * driver.cs: Remove the hack from saturday, as well as the hack
13570 from jackson (LoadAssemblyFromGac), also adds the CWD to the
13571 link_paths to get that bit proper.
13573 2004-05-01 Todd Berman <tberman@sevenl.net>
13575 * driver.cs: Try a LoadFrom before a Load, this checks the current
13576 path. This is currently a bug in mono that is be fixed, however, this
13577 provides a workaround for now. This will be removed when the bug
13580 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
13582 * CryptoConvert.cs: Updated to latest version. Fix issue with
13583 incomplete key pairs (#57941).
13585 2004-05-01 Todd Berman <tberman@sevenl.net>
13587 * driver.cs: Remove '.' from path_chars, now System.* loads properly
13590 2004-04-30 Jackson Harper <jackson@ximian.com>
13592 * codegen.cs: Open keys readonly.
13594 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13596 * typemanager.cs: don't report cyclic struct layout when a struct
13597 contains 2 or more fields of the same type. Failed for Pango.AttrShape
13598 which has 2 Pango.Rectangle fields.
13600 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
13602 * expression.cs: Handle IntPtr comparisons with IL code
13603 rather than a method call.
13605 2004-04-29 Martin Baulig <martin@ximian.com>
13607 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
13608 the list of PropertyInfo's in class hierarchy and find the
13609 accessor. Fixes #56013.
13611 2004-04-29 Martin Baulig <martin@ximian.com>
13613 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
13615 2004-04-29 Martin Baulig <martin@ximian.com>
13617 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13619 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
13621 2004-04-29 Martin Baulig <martin@ximian.com>
13623 * class.cs (ConstructorInitializer.Resolve): Check whether the
13624 parent .ctor is accessible. Fixes #52146.
13626 2004-04-29 Martin Baulig <martin@ximian.com>
13628 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13630 * statement.cs (Using.EmitLocalVariableDecls): Use
13631 TypeManager.idisposable_type, not typeof (IDisposable).
13632 (Foreach.EmitCollectionForeach): Added support for valuetypes.
13634 2004-04-29 Martin Baulig <martin@ximian.com>
13636 * class.cs (Event.Define): Don't emit the field and don't set
13637 RTSpecialName and SpecialName for events on interfaces. Fixes
13640 2004-04-29 Raja R Harinath <rharinath@novell.com>
13642 Refactor Attribute.ApplyAttributes.
13643 * attribute.cs (Attributable): New base class for objects that can
13644 have Attributes applied on them.
13645 (Attribute): Make AttributeUsage fields public.
13646 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
13647 (Attribute.IsInternalCall): New property.
13648 (Attribute.UsageAttr): Convert to a public read-only property.
13649 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
13650 (Attribute.ResolveType, Attribute.Resolve)
13651 (Attribute.ScanForIndexerName): Update to reflect changes.
13652 (Attribute.CheckAttributeTarget): Re-format.
13653 (Attribute.ApplyAttributes): Refactor, to various
13654 Attributable.ApplyAttributeBuilder methods.
13655 * decl.cs (MemberCore): Make Attributable.
13656 * class.cs (Accessor): Make Attributable.
13657 (MethodData.ApplyAttributes): Use proper attribute types, not
13659 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
13660 (TypeContainer.ApplyAttributeBuilder)
13661 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
13662 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
13663 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
13664 (Operator.ApplyAttributeBuilder): New factored-out methods.
13665 * const.cs (Const.ApplyAttributeBuilder): Likewise.
13666 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
13667 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
13668 * parameter.cs (ParameterBase): New Attributable base class
13669 that can also represent Return types.
13670 (Parameter): Update to the changes.
13672 2004-04-29 Jackson Harper <jackson@ximian.com>
13674 * driver.cs: Prefer the corlib system version when looking for
13675 assemblies in the GAC. This is still a hack, but its a better hack
13678 2004-04-29 Marek Safar <marek.safar@seznam.cz>
13680 * decl.cs, enum.cs: Improved error 3005 reporting.
13682 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
13683 (related_symbols): New private member for list of symbols
13684 related to reported error/warning.
13686 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
13688 2004-04-29 Martin Baulig <martin@ximian.com>
13690 * ecore.cs (Expression.Constantify): If we're an enum and
13691 TypeManager.TypeToCoreType() doesn't give us another type, use
13692 t.UnderlyingSystemType. Fixes #56178.
13694 2004-04-29 Martin Baulig <martin@ximian.com>
13696 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
13697 interfaces and for each interface, only add members directly
13698 declared in that interface. Fixes #53255.
13700 2004-04-28 Martin Baulig <martin@ximian.com>
13702 * expression.cs (ConditionalLogicalOperator): Use a temporary
13703 variable for `left' to avoid that we evaluate it more than once;
13706 2004-04-28 Martin Baulig <martin@ximian.com>
13708 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
13711 2004-04-28 Martin Baulig <martin@ximian.com>
13713 * statement.cs (LocalInfo.Resolve): Check whether the type is not
13716 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
13717 whether the type is not void (CS1547).
13719 2004-04-28 Martin Baulig <martin@ximian.com>
13721 * expression.cs (Unary.DoResolveLValue): Override this and report
13722 CS0131 for anything but Operator.Indirection.
13724 2004-04-28 Martin Baulig <martin@ximian.com>
13726 Committing a patch from Ben Maurer; see bug #50820.
13728 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13731 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13734 2004-04-28 Martin Baulig <martin@ximian.com>
13736 Committing a patch from Ben Maurer; see bug #50820.
13738 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13741 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13744 2004-04-28 Martin Baulig <martin@ximian.com>
13746 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
13747 (Block.AddLabel): Call DoLookupLabel() to only search in the
13750 2004-04-28 Martin Baulig <martin@ximian.com>
13752 * cfold.cs (ConstantFold.BinaryFold): Added special support for
13753 comparing StringConstants and NullLiterals in Equality and Inequality.
13755 2004-04-28 Jackson Harper <jackson@ximian.com>
13757 * driver.cs: Attempt to load referenced assemblies from the
13758 GAC. This is the quick and dirty version of this method that
13759 doesnt take into account versions and just takes the first
13760 canidate found. Will be good enough for now as we will not have more
13761 then one version installed into the GAC until I update this method.
13763 2004-04-28 Martin Baulig <martin@ximian.com>
13765 * typemanager.cs (TypeManager.CheckStructCycles): New public
13766 static method to check for cycles in the struct layout.
13768 * rootcontext.cs (RootContext.PopulateTypes): Call
13769 TypeManager.CheckStructCycles() for each TypeContainer.
13770 [Note: We only need to visit each type once.]
13772 2004-04-28 Martin Baulig <martin@ximian.com>
13774 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
13776 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
13777 success and added `out object value'. Use a `bool resolved' field
13778 to check whether we've already been called rather than
13779 `ConstantValue != null' since this breaks for NullLiterals.
13781 2004-04-28 Raja R Harinath <rharinath@novell.com>
13783 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
13784 setting of this flag, since the 'set' method may be non-public.
13786 2004-04-28 Raja R Harinath <rharinath@novell.com>
13788 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
13789 check on current_vector.Block.
13791 2004-04-27 Martin Baulig <martin@ximian.com>
13793 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
13794 a field initializer. Fixes #56459.
13796 2004-04-27 Martin Baulig <martin@ximian.com>
13798 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
13799 we're not attempting to use an indexer. Fixes #52154.
13801 2004-04-27 Martin Baulig <martin@ximian.com>
13803 * statement.cs (Return): Don't create a return label if we don't
13804 need it; reverts my change from January 20th. Thanks to Ben
13807 2004-04-27 Martin Baulig <martin@ximian.com>
13809 According to the spec, `goto' can only leave a nested scope, but
13812 * statement.cs (Block.LookupLabel): Only lookup in the current
13813 block, don't recurse into parent or child blocks.
13814 (Block.AddLabel): Check in parent and child blocks, report
13815 CS0140/CS0158 if we find a duplicate.
13816 (Block): Removed this indexer for label lookups.
13817 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
13818 this already does the error reporting for us.
13821 (FlowBranching.UsageVector.Block): New public variable; may be null.
13822 (FlowBranching.CreateSibling): Added `Block' argument.
13823 (FlowBranching.LookupLabel): New public virtual method. Lookup a
13824 label for the target of a `goto' and check whether we're not
13825 leaving a `finally'.
13827 2004-04-27 Martin Baulig <martin@ximian.com>
13829 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13830 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
13833 2004-04-27 Martin Baulig <martin@ximian.com>
13835 * statement.cs (Block.AddLabel): Also check for implicit blocks
13836 and added a CS0158 check.
13838 2004-04-27 Martin Baulig <martin@ximian.com>
13840 * flowanalysis.cs (FlowBranchingLoop): New class.
13841 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
13842 UsageVector's instead of an ArrayList.
13843 (FlowBranching.Label): Likewise.
13844 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
13845 (FlowBranching.AddBreakVector): New method.
13847 2004-04-27 Miguel de Icaza <miguel@ximian.com>
13849 * attribute.cs: Small regression fix: only convert the type if we
13850 the type is different, fixes System.Drawing build.
13852 2004-04-27 Martin Baulig <martin@ximian.com>
13854 * attribute.cs (Attribute.Resolve): If we have a constant value
13855 for a named field or property, implicity convert it to the correct
13858 2004-04-27 Raja R Harinath <rharinath@novell.com>
13860 * statement.cs (Block.Block): Implicit blocks share
13861 'child_variable_names' fields with parent blocks.
13862 (Block.AddChildVariableNames): Remove.
13863 (Block.AddVariable): Mark variable as "used by a child block" in
13864 every surrounding block.
13865 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
13866 been used in a child block, complain about violation of "Invariant
13867 meaning in blocks" rule.
13868 * cs-parser.jay (declare_local_variables): Don't use
13869 AddChildVariableNames.
13870 (foreach_statement): Don't create an implicit block: 'foreach'
13871 introduces a scope.
13873 2004-04-23 Miguel de Icaza <miguel@ximian.com>
13875 * convert.cs (ImplicitNumericConversion): 0 is also positive when
13876 converting from 0L to ulong. Fixes 57522.
13878 2004-04-22 Marek Safar <marek.safar@seznam.cz>
13880 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
13881 derived class hides via 'new' keyword field from base class (test-242.cs).
13882 TODO: Handle this in the more general way.
13884 * class.cs (CheckBase): Ditto.
13886 2004-04-22 Marek Safar <marek.safar@seznam.cz>
13888 * decl.cs (caching_flags): New member for storing cached values
13890 (MemberCore.Flags): New enum where bit flags for caching_flags
13892 (MemberCore.cls_compliance): Moved to caching_flags.
13893 (DeclSpace.Created): Moved to caching_flags.
13895 * class.cs: Use caching_flags instead of DeclSpace.Created
13897 2004-04-21 Miguel de Icaza <miguel@ximian.com>
13899 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
13900 if we are only a derived class, not a nested class.
13902 * typemanager.cs: Same as above, but do this at the MemberLookup
13903 level (used by field and methods, properties are handled in
13904 PropertyExpr). Allow for the qualified access if we are a nested
13907 2004-04-21 Marek Safar <marek.safar@seznam.cz>
13909 * class.cs: Refactoring.
13910 (IMethodData): New inteface; Holds links to parent members
13911 to avoid member duplication (reduced memory allocation).
13912 (Method): Implemented IMethodData interface.
13913 (PropertyBase): New inner classes for get/set methods.
13914 (PropertyBase.PropertyMethod): Implemented IMethodData interface
13915 (Event): New inner classes for add/remove methods.
13916 (Event.DelegateMethod): Implemented IMethodData interface.
13918 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
13919 EmitContext (related to class.cs refactoring).
13921 2004-04-21 Raja R Harinath <rharinath@novell.com>
13923 * delegate.cs (Delegate.VerifyApplicability): If the number of
13924 arguments are the same as the number of parameters, first try to
13925 verify applicability ignoring any 'params' modifier on the last
13929 2004-04-16 Raja R Harinath <rharinath@novell.com>
13931 * class.cs (TypeContainer.AddIndexer): Use
13932 'ExplicitInterfaceName' to determine if interface name was
13933 explicitly specified. 'InterfaceType' is not initialized at this time.
13934 (TypeContainer.DefineIndexers): Remove use of temporary list. The
13935 Indexers array is already in the required order. Initialize
13936 'IndexerName' only if there are normal indexers.
13937 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
13938 (TypeContainer.Emit): Emit DefaultMember attribute only if
13939 IndexerName is initialized.
13942 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
13944 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
13947 2004-04-15 Raja R Harinath <rharinath@novell.com>
13949 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
13953 * attribute.cs (Attribute.Resolve): Check for duplicate named
13957 2004-04-15 Miguel de Icaza <miguel@ximian.com>
13959 * iterators.cs (MarkYield): track whether we are in an exception,
13960 and generate code accordingly. Use a temporary value to store the
13961 result for our state.
13963 I had ignored a bit the interaction of try/catch with iterators
13964 since their behavior was not entirely obvious, but now it is
13965 possible to verify that our behavior is the same as MS .NET 2.0
13969 2004-04-14 Miguel de Icaza <miguel@ximian.com>
13971 * iterators.cs: Avoid creating temporaries if there is no work to
13974 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
13975 Enumerations, use TypeManager.EnumToUnderlying and call
13978 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
13981 (This.Emit): Use EmitContext.EmitThis to emit our
13984 (This.EmitAssign): Ditto.
13986 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
13987 codepaths, we will move all the functionality into
13990 (FieldExpr.EmitAssign): Ditto.
13992 This fixes several hidden bugs that I uncovered while doing a code
13993 review of this today.
13995 * codegen.cs (EmitThis): reworked so the semantics are more clear
13996 and also support value types "this" instances.
13998 * iterators.cs: Changed so that for iterators in value types, we
13999 do not pass the value type as a parameter.
14001 Initialization of the enumerator helpers is now done in the caller
14002 instead of passing the parameters to the constructors and having
14003 the constructor set the fields.
14005 The fields have now `assembly' visibility instead of private.
14007 2004-04-11 Miguel de Icaza <miguel@ximian.com>
14009 * expression.cs (Argument.Resolve): Check if fields passed as ref
14010 or out are contained in a MarshalByRefObject.
14012 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
14013 another compiler type.
14015 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
14017 * class.cs (Indexer.Define): use the new name checking method.
14018 Also, return false on an error.
14019 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
14020 (is_identifier_[start/part]_character): make static.
14022 2004-04-10 Miguel de Icaza <miguel@ximian.com>
14024 * expression.cs (Binary.ResolveOperator): Do no append strings
14025 twice: since we can be invoked more than once (array evaluation)
14026 on the same concatenation, take care of this here. Based on a fix
14027 from Ben (bug #56454)
14029 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
14031 * codegen.cs: Fix another case where CS1548 must be reported (when
14032 delay-sign isn't specified and no private is available #56564). Fix
14033 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
14034 error when MCS is used on the MS runtime and we need to delay-sign
14035 (which seems unsupported by AssemblyBuilder - see #56621).
14037 2004-04-08 Marek Safar <marek.safar@seznam.cz>
14039 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
14040 (TypeManager.ComputeNamespaces): Faster implementation for
14043 * compiler.csproj: Updated AssemblyName to mcs.
14045 2004-04-07 Miguel de Icaza <miguel@ximian.com>
14047 * rootcontext.cs: Add new types to the boot resolution.
14049 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
14050 MulticastDelegate is not allowed.
14052 * typemanager.cs: Add new types to lookup: System.TypedReference
14055 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
14056 check for TypedReference or ArgIterator, they are not allowed.
14058 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
14059 makes us properly catch 1510 in some conditions (see bug 56016 for
14062 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
14064 * CryptoConvert.cs: update from corlib version
14067 2004-04-05 Miguel de Icaza <miguel@ximian.com>
14069 * class.cs (Indexer.Define): Check indexername declaration
14071 2004-04-05 Marek Safar <marek.safar@seznam.cz>
14073 * attribute.cs (IsClsCompliant): Fixed problem with handling
14074 all three states (compliant, not-compliant, undetected).
14076 2004-03-30 Marek Safar <marek.safar@seznam.cz>
14078 * attribute.cs (Attribute): Location is now public.
14079 (Resolve): Store resolved arguments (pos_values) in attribute class.
14080 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
14081 (GetClsCompliantAttributeValue): New method that gets
14082 CLSCompliantAttribute value.
14083 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
14084 if exists else null.
14085 (AttributeTester): New class for CLS-Compliant verification routines.
14087 * class.cs (Emit): Add CLS-Compliant verification.
14088 (Method.GetSignatureForError): Implemented.
14089 (Constructor.GetSignatureForError): Implemented
14090 (Constructor.HasCompliantArgs): Returns if constructor has
14091 CLS-Compliant arguments.
14092 (Constructor.Emit): Override.
14093 (Construcor.IsIdentifierClsCompliant): New method; For constructors
14094 is needed to test only parameters.
14095 (FieldBase.GetSignatureForError): Implemented.
14096 (TypeContainer): New member for storing base interfaces.
14097 (TypeContainer.FindMembers): Search in base interfaces too.
14099 * codegen.cs (GetClsComplianceAttribute): New method that gets
14100 assembly or module CLSCompliantAttribute value.
14101 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
14103 (ModuleClass.Emit): Add error 3012 test.
14105 * const.cs (Emit): Override and call base for CLS-Compliant tests.
14107 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
14108 state for all decl types.
14109 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
14110 if CLS-Compliant tests are required.
14111 (IsClsCompliaceRequired): New method. Analyze whether code
14112 must be CLS-Compliant.
14113 (IsExposedFromAssembly): New method. Returns true when MemberCore
14114 is exposed from assembly.
14115 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
14116 value or gets cached value.
14117 (HasClsCompliantAttribute): New method. Returns true if MemberCore
14118 is explicitly marked with CLSCompliantAttribute.
14119 (IsIdentifierClsCompliant): New abstract method. This method is
14120 used to testing error 3005.
14121 (IsIdentifierAndParamClsCompliant): New method. Common helper method
14122 for identifier and parameters CLS-Compliant testing.
14123 (VerifyClsCompliance): New method. The main virtual method for
14124 CLS-Compliant verifications.
14125 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
14126 null. I don't know why is null (too many public members !).
14127 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
14128 and get value of first CLSCompliantAttribute that found.
14130 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
14131 (VerifyClsCompliance): Override and add extra tests.
14133 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
14134 clscheck- disable CLS-Compliant verification event if assembly is has
14135 CLSCompliantAttribute(true).
14137 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
14138 ApllyAttribute is now called in emit section as in the other cases.
14139 Possible future Emit integration.
14140 (IsIdentifierClsCompliant): New override.
14141 (VerifyClsCompliance): New override.
14142 (GetEnumeratorName): Returns full enum name.
14144 * parameter.cs (GetSignatureForError): Implemented.
14146 * report.cs (WarningData): New struct for Warning message information.
14147 (LocationOfPreviousError): New method.
14148 (Warning): New method. Reports warning based on the warning table.
14149 (Error_T): New method. Reports error based on the error table.
14151 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
14152 verifications are done here.
14154 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
14156 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
14157 CLSCompliantAttribute.
14158 (all_imported_types): New member holds all imported types from other
14160 (LoadAllImportedTypes): New method fills static table with exported types
14161 from all referenced assemblies.
14162 (Modules): New property returns all assembly modules.
14164 2004-03-30 Miguel de Icaza <miguel@ximian.com>
14166 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
14167 throwing a parser error.
14169 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
14170 which removes the hardcoded get_/set_ prefixes for properties, as
14171 IL allows for the properties to be named something else.
14175 * expression.cs: Do not override operand before we know if it is
14176 non-null. Fix 56207
14178 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
14180 * typemanager.cs: support for pinned variables.
14182 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
14184 * decl.cs, typemanager.cs: Avoid using an arraylist
14185 as a buffer if there is only one result set.
14187 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
14189 * expression.cs: Make sure you cant call a static method
14190 with an instance expression, bug #56174.
14192 2004-03-29 Miguel de Icaza <miguel@ximian.com>
14194 * class.cs (IsDuplicateImplementation): Improve error reporting to
14195 flag 663 (method only differs in parameter modifier).
14197 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
14198 in preprocessor directives.
14200 * location.cs (LookupFile): Allow for the empty path.
14202 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
14203 better approach for some of that patch, but its failing with the
14204 CharSet enumeration. For now try/catch will do.
14206 * typemanager.cs: Do not crash if a struct does not have fields.
14209 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
14211 * expression.cs: cs0213, cant fix a fixed expression.
14214 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
14216 * cs-parser.jay: detect invalid embeded statements gracefully.
14219 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
14221 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
14224 the invocation type may not be a subclass of the tye of the item/
14225 The type of the item must be a subclass of the invocation item.
14230 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
14232 * attribute.cs: Added methods to get a string and a bool from an
14233 attribute. Required to information from AssemblyKeyFileAttribute,
14234 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
14235 * codegen.cs: Modified AssemblyName creation to include support for
14236 strongnames. Catch additional exceptions to report them as CS1548.
14237 * compiler.csproj: Updated include CryptoConvert.cs.
14238 * compiler.csproj.user: Removed file - user specific configuration.
14239 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
14240 Mono.Security assembly. The original class is maintained and tested in
14241 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
14242 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
14243 like CSC 8.0 (C# v2) supports.
14244 * Makefile: Added CryptoConvert.cs to mcs sources.
14245 * rootcontext.cs: Added new options for strongnames.
14247 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
14249 * driver.cs: For --expect-error, report error code `2'
14250 if the program compiled with no errors, error code `1' if
14251 it compiled with an error other than the one expected.
14253 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
14255 * compiler.csproj: Updated for Visual Studio .NET 2003.
14256 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
14257 * compiler.sln: Updated for Visual Studio .NET 2003.
14259 2004-03-24 Ravi Pratap M <ravi@ximian.com>
14261 * expression.cs: Fix bug #47234. We basically need to apply the
14262 rule that we prefer the conversion of null to a reference type
14263 when faced with a conversion to 'object' (csc behaviour).
14265 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14267 * statement.cs: Shorter form for foreach, eliminates
14268 a local variable. r=Martin.
14270 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14272 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
14273 checks if we can use brtrue/brfalse to test for 0.
14274 * expression.cs: use the above in the test for using brtrue/brfalse.
14275 cleanup code a bit.
14277 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14279 * expression.cs: Rewrite string concat stuff. Benefits:
14281 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
14282 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
14283 rather than a concat chain.
14285 * typemanager.cs: Add lookups for more concat overloads.
14287 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14289 * expression.cs: Emit shorter il code for array init.
14306 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
14308 * statement.cs: Before, two switch blocks would be merged if the
14309 total size of the blocks (end_item - begin_item + 1) was less than
14310 two times the combined sizes of the blocks.
14312 Now, it will only merge if after the merge at least half of the
14317 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
14319 * class.cs : csc build fix for GetMethods(). See bug #52503.
14321 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
14323 * expression.cs: Make sure fp comparisons work with NaN.
14324 This fixes bug #54303. Mig approved this patch a long
14325 time ago, but we were not able to test b/c the runtime
14328 2004-03-19 Miguel de Icaza <miguel@ximian.com>
14330 * ecore.cs (TypExpr.GetHashCode): implement this overload.
14332 2004-03-19 Martin Baulig <martin@ximian.com>
14334 * class.cs (MemberCore.IsDuplicateImplementation): Report the
14335 error here and not in our caller.
14337 2004-03-19 Martin Baulig <martin@ximian.com>
14339 * interface.cs: Completely killed this file.
14340 (Interface): We're now a TypeContainer and live in class.cs.
14342 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
14343 argument; we're now also called for interfaces.
14344 (TypeContainer.DefineMembers): Allow this method being called
14346 (TypeContainer.GetMethods): New public method; formerly known as
14347 Interface.GetMethod(). This is used by PendingImplementation.
14348 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
14349 it's now private and non-static.
14350 (Interface): Moved this here; it's now implemented similar to
14352 (Method, Property, Event, Indexer): Added `bool is_interface'
14353 argument to their .ctor's.
14354 (MemberBase.IsInterface): New public field.
14356 * cs-parser.jay: Create normal Method, Property, Event, Indexer
14357 instances instead of InterfaceMethod, InterfaceProperty, etc.
14358 (opt_interface_base): Removed; we now use `opt_class_base' instead.
14359 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
14361 2004-03-19 Martin Baulig <martin@ximian.com>
14363 * class.cs (MethodCore.IsDuplicateImplementation): New private
14364 method which does the CS0111 checking.
14365 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
14366 Use IsDuplicateImplementation().
14368 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
14370 * decl.cs (FindMemberToOverride): New method to find the correct
14371 method or property to override in the base class.
14373 - Make Method/Property use the above method to find the
14374 version in the base class.
14375 - Remove the InheritableMemberSignatureCompare as it is now
14378 This patch makes large code bases much faster to compile, as it is
14379 O(n) rather than O(n^2) to do this validation.
14381 Also, it fixes bug 52458 which is that nested classes are not
14382 taken into account when finding the base class member.
14384 Reviewed/Approved by Martin.
14386 2004-03-17 Marek Safar <marek.safar@seznam.cz>
14388 * interface.cs: In all interface classes removed redundant
14389 member initialization.
14391 2004-03-16 Martin Baulig <martin@ximian.com>
14393 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
14395 2004-03-15 Miguel de Icaza <miguel@ximian.com>
14397 * decl.cs (DefineTypeAndParents): New helper method to define a
14398 type's containers before the type itself is defined; This is a
14399 bug exposed by the recent changes to Windows.Forms when an
14400 implemented interface was defined inside a class that had not been
14403 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
14405 (Check): Loop correctly to report errors modifiers
14406 (UNSAFE was not in the loop, since it was the same as TOP).
14408 * interface.cs: Every interface member now takes a ModFlags,
14409 instead of a "is_new" bool, which we set on the base MemberCore.
14411 Every place where we called "UnsafeOk" in the interface, now we
14412 call the proper member (InterfaceMethod.UnsafeOK) instead to get
14413 the unsafe settings from the member declaration instead of the
14414 container interface.
14416 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
14418 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
14419 `set_indexer_name' to the pending bits (one per type).
14421 We fixed a bug today that was picking the wrong method to
14422 override, since for properties the existing InterfaceMethod code
14423 basically ignored the method name. Now we make sure that the
14424 method name is one of the valid indexer names.
14426 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
14428 * support.cs (SeekableStreamReader): Keep track of stream byte
14429 positions and don't mix them with character offsets to the buffer.
14431 Patch from Gustavo Giráldez
14433 2004-03-15 Marek Safar <marek.safar@seznam.cz>
14435 * interface.cs (InterfaceSetGetBase): Removed double member
14436 initialization, base class does it as well.
14438 2004-03-13 Martin Baulig <martin@ximian.com>
14440 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
14441 when compiling corlib.
14443 2004-03-13 Miguel de Icaza <miguel@ximian.com>
14445 * convert.cs (ExplicitConversion): We were reporting an error on
14446 certain conversions (object_type source to a value type, when the
14447 expression was `null') before we had a chance to pass it through
14448 the user defined conversions.
14450 * driver.cs: Replace / and \ in resource specifications to dots.
14453 * class.cs: Add check for duplicate operators. Fixes 52477
14455 2004-03-11 Miguel de Icaza <miguel@ximian.com>
14457 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
14458 that are in the middle of the statements, not only at the end.
14461 * class.cs (TypeContainer.AddField): No longer set the
14462 `HaveStaticConstructor' flag, now we call it
14463 `UserDefineStaticConstructor' to diferentiate the slightly
14464 semantic difference.
14466 The situation is that we were not adding BeforeFieldInit (from
14467 Modifiers.TypeAttr) to classes that could have it.
14468 BeforeFieldInit should be set to classes that have no static
14473 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
14475 And most importantly Zoltan's comment:
14477 http://bugzilla.ximian.com/show_bug.cgi?id=44229
14479 "I think beforefieldinit means 'it's ok to initialize the type sometime
14480 before its static fields are used', i.e. initialization does not need
14481 to be triggered by the first access to the type. Setting this flag
14482 helps the JIT to compile better code, since it can run the static
14483 constructor at JIT time, and does not need to generate code to call it
14484 (possibly lots of times) at runtime. Unfortunately, mcs does not set
14485 this flag for lots of classes like String.
14487 csc sets this flag if the type does not have an explicit static
14488 constructor. The reasoning seems to be that if there are only static
14489 initalizers for a type, and no static constructor, then the programmer
14490 does not care when this initialization happens, so beforefieldinit
14493 This bug prevents the AOT compiler from being usable, since it
14494 generates so many calls to mono_runtime_class_init that the AOT code
14495 is much slower than the JITted code. The JITted code is faster,
14496 because it does not generate these calls if the vtable is type is
14497 already initialized, which is true in the majority of cases. But the
14498 AOT compiler can't do this."
14500 2004-03-10 Miguel de Icaza <miguel@ximian.com>
14502 * class.cs (MethodData.Emit): Refactor the code so symbolic
14503 information is generated for destructors; For some reasons we
14504 were taking a code path that did not generate symbolic information
14507 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
14509 * class.cs: Create a Constructor.CheckBase method that
14510 takes care of all validation type code. The method
14511 contains some code that was moved from Define.
14513 It also includes new code that checks for duplicate ctors.
14514 This fixes bug #55148.
14516 2004-03-09 Joshua Tauberer <tauberer@for.net>
14518 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
14519 a { ... }-style array creation invokes EmitStaticInitializers
14520 which is not good for reference-type arrays. String, decimal
14521 and now null constants (NullCast) are not counted toward
14522 static initializers.
14524 2004-03-05 Martin Baulig <martin@ximian.com>
14526 * location.cs (SourceFile.HasLineDirective): New public field;
14527 specifies whether the file contains or is referenced by a "#line"
14529 (Location.DefineSymbolDocuments): Ignore source files which
14530 either contain or are referenced by a "#line" directive.
14532 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
14534 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
14535 direct access to our parent, so check the method inline there.
14537 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
14539 * expression.cs (Invocation.EmitCall): Miguel's last commit
14540 caused a regression. If you had:
14545 In Foo the implict this would be null.
14547 2004-02-27 Miguel de Icaza <miguel@ximian.com>
14549 * expression.cs (Invocation.EmitCall): If the method is not
14550 virtual, do not emit a CallVirt to it, use Call.
14552 * typemanager.cs (GetFullNameSignature): Improve the method to
14553 cope with ".ctor" and replace it with the type name.
14555 * class.cs (ConstructorInitializer.Resolve): Now the method takes
14556 as an argument the ConstructorBuilder where it is being defined,
14557 to catch the recursive constructor invocations.
14559 2004-02-26 Miguel de Icaza <miguel@ximian.com>
14561 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
14562 routines to check if a type is an enumerable/enumerator allow
14563 classes that implement the IEnumerable or IEnumerator interfaces.
14565 * class.cs (Property, Operator): Implement IIteratorContainer, and
14566 implement SetYields.
14568 (Property.Define): Do the block swapping for get_methods in the
14569 context of iterators. We need to check if Properties also
14570 include indexers or not.
14572 (Operator): Assign the Block before invoking the
14573 OperatorMethod.Define, so we can trigger the Iterator code
14576 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
14577 Property and Operator classes are not created when we parse the
14578 declarator but until we have the block completed, so we use a
14579 singleton SimpleIteratorContainer.Simple to flag whether the
14580 SetYields has been invoked.
14582 We propagate this setting then to the Property or the Operator to
14583 allow the `yield' to function.
14585 2004-02-25 Marek Safar <marek.safar@seznam.cz>
14587 * codegen.cs: Implemented attribute support for modules.
14588 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
14589 Assembly/Module functionality.
14591 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
14592 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
14593 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
14595 2004-02-16 Marek Safar <marek.safar@seznam.cz>
14597 * interface.cs (FindMembers): The operation is performed on all base
14598 interfaces and not only on the first. It is required for future CLS Compliance patch.
14600 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
14602 * statement.cs, codegen.cs:
14603 This patch deals with patterns such as:
14605 public class List : IEnumerable {
14607 public MyEnumerator GetEnumerator () {
14608 return new MyEnumerator(this);
14611 IEnumerator IEnumerable.GetEnumerator () {
14615 public struct MyEnumerator : IEnumerator {
14620 Before, there were a few things we did wrong:
14621 1) we would emit callvirt on a struct, which is illegal
14622 2) we emited ldarg when we needed to emit ldarga
14623 3) we would mistakenly call the interface methods on an enumerator
14624 type that derived from IEnumerator and was in another assembly. For example:
14626 public class MyEnumerator : IEnumerator
14628 Would have the interface methods called, even if there were public impls of the
14629 method. In a struct, this lead to invalid IL code.
14631 2004-02-11 Marek Safar <marek.safar@seznam.cz>
14633 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
14636 * delegate.cs (Define): Fixed crash when delegate type is undefined.
14638 2004-02-11 Miguel de Icaza <miguel@ximian.com>
14640 * cs-parser.jay: Fix small regression: we were not testing V2
14641 compiler features correctly.
14643 * interface.cs: If the emit context is null, then create one
14645 2004-02-09 Marek Safar <marek.safar@seznam.cz>
14647 * decl.cs (GetSignatureForError): New virtual method to get full name
14648 for error messages.
14650 * attribute.cs (IAttributeSupport): New interface for attribute setting.
14651 Now it is possible to rewrite ApplyAttributes method to be less if/else.
14653 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
14654 Duplicated members and code in these classes has been removed.
14655 Better encapsulation in these classes.
14657 2004-02-07 Miguel de Icaza <miguel@ximian.com>
14659 * assign.cs (Assign.DoResolve): When dealing with compound
14660 assignments, there is a new rule in ECMA C# 2.4 (might have been
14661 there before, but it is documented here) that states that in:
14665 If b is of type int, and the `op' is a shift-operator, then the
14666 above is evaluated as:
14670 * expression.cs (Binary.ResolveOperator): Instead of testing for
14671 int/uint/long/ulong, try to implicitly convert to any of those
14672 types and use that in pointer arithmetic.
14674 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
14675 method to print information for from the type, not from the
14676 null-method we were given.
14678 2004-02-01 Duncan Mak <duncan@ximian.com>
14680 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
14681 parsing for cmd, fixes bug #53694.
14683 2004-02-04 Marek Safar <marek.safar@seznam.cz>
14685 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
14686 in the member name duplication tests. Property and operator name duplication
14687 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
14689 2004-02-03 Marek Safar <marek.safar@seznam.cz>
14691 * interface.cs (PopulateMethod): Fixed crash when interface method
14692 returns not existing type (error test cs0246-3.cs).
14694 2004-02-02 Ravi Pratap M <ravi@ximian.com>
14696 * cs-parser.jay (interface_accessors): Re-write actions to also
14697 store attributes attached to get and set methods. Fix spelling
14700 (inteface_property_declaration): Modify accordingly.
14702 (InterfaceAccessorInfo): New helper class to store information to pass
14703 around between rules that use interface_accessors.
14705 * interface.cs (Emit): Apply attributes on the get and set
14706 accessors of properties and indexers too.
14708 * attribute.cs (ApplyAttributes): Modify accordingly to use the
14709 right MethodBuilder when applying attributes to the get and set accessors.
14711 2004-01-31 Miguel de Icaza <miguel@ximian.com>
14713 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
14715 2004-01-26 Miguel de Icaza <miguel@ximian.com>
14717 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
14719 2004-01-25 Miguel de Icaza <miguel@ximian.com>
14721 * cs-parser.jay: Remove YIELD token, instead use the new grammar
14722 changes that treat `yield' specially when present before `break'
14723 or `return' tokens.
14725 * cs-tokenizer.cs: yield is no longer a keyword.
14727 2004-01-23 Marek Safar <marek.safar@seznam.cz>
14729 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
14730 setting for default constructors.
14731 For default constructors are almost every time set wrong Modifier. The
14732 generated IL code has been alright. But inside mcs this values was
14733 wrong and this was reason why several of my CLS Compliance tests
14736 2004-01-22 Martin Baulig <martin@ximian.com>
14738 * cs-parser.jay (namespace_or_type_name): Return an Expression,
14739 not a QualifiedIdentifier. This is what `type_name_expression'
14740 was previously doing.
14741 (type_name_expression): Removed; the code is now in
14742 `namespace_or_type_name'.
14743 (qualified_identifier): Removed, use `namespace_or_type_name'
14745 (QualifiedIdentifier): Removed this class.
14747 2004-01-22 Martin Baulig <martin@ximian.com>
14749 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
14750 not a string as alias name.
14752 2004-01-21 Miguel de Icaza <miguel@ximian.com>
14754 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
14755 #52730 bug, and instead compute correctly the need to use a
14756 temporary variable when requesting an address based on the
14757 static/instace modified of the field and the constructor.
14759 2004-01-21 Martin Baulig <martin@ximian.com>
14761 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
14762 class and namespace before looking up aliases. Fixes #52517.
14764 2004-01-21 Martin Baulig <martin@ximian.com>
14766 * flowanalysis.cs (UsageVector.Merge): Allow variables being
14767 assinged in a 'try'; fixes exception4.cs.
14769 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14770 * class.cs : Implemented parameter-less constructor for TypeContainer
14772 * decl.cs: Attributes are now stored here. New property OptAttributes
14774 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
14776 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
14778 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14780 * typemanager.cs (CSharpSignature): Now reports also inner class name.
14781 (CSharpSignature): New method for indexer and property signature.
14783 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14785 * pending.cs (IsVirtualFilter): Faster implementation.
14787 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14789 * typemanager.cs: Avoid inclusion of same assembly more than once.
14791 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14793 * cs-parser.jay: Fixed problem where the last assembly attribute
14794 has been applied also to following declaration (class, struct, etc.)
14796 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14798 * class.cs: Added error CS0538, CS0539 reporting.
14799 Fixed crash on Microsoft runtime when field type is void.
14801 * cs-parser.jay: Added error CS0537 reporting.
14803 * pending.cs: Added error CS0535 reporting.
14804 Improved error report for errors CS0536, CS0534.
14806 2004-01-20 Miguel de Icaza <miguel@ximian.com>
14808 Merge a few bits from the Anonymous Method MCS tree.
14810 * statement.cs (ToplevelBlock): New class for toplevel methods,
14811 will hold anonymous methods, lifted variables.
14813 * cs-parser.jay: Create toplevel blocks for delegates and for
14814 regular blocks of code.
14816 2004-01-20 Martin Baulig <martin@ximian.com>
14818 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
14819 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
14820 and `NeedExplicitReturn'; added `IsLastStatement'.
14821 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
14822 have a `ReturnLabel' or we're not unreachable.
14824 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
14825 child's reachability; don't just override ours with it. Fixes
14826 #58058 (lluis's example).
14827 (FlowBranching): Added public InTryOrCatch(), InCatch(),
14828 InFinally(), InLoop(), InSwitch() and
14829 BreakCrossesTryCatchBoundary() methods.
14831 * statement.cs (Return): Do all error checking in Resolve().
14832 Unless we are the last statement in a top-level block, always
14833 create a return label and jump to it.
14834 (Break, Continue): Do all error checking in Resolve(); also make
14835 sure we aren't leaving a `finally'.
14836 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
14837 statement in a top-level block.
14838 (Block.Flags): Added `IsDestructor'.
14839 (Block.IsDestructor): New public property.
14841 2004-01-20 Martin Baulig <martin@ximian.com>
14843 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
14845 2004-01-20 Martin Baulig <martin@ximian.com>
14847 * statement.cs (Statement.ResolveUnreachable): New public method.
14848 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
14849 (Block.Resolve): Resolve unreachable statements.
14851 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
14853 * expression.cs: We need to fix the case where we do
14854 not have a temp variable here.
14856 * assign.cs: Only expression compound assignments need
14857 temporary variables.
14859 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
14861 * flowanalysis.cs: Reduce memory allocation in a few ways:
14862 - A block with no variables should not allocate a bit
14864 - A method with no out parameters does not need any tracking
14865 for assignment of the parameters, so we need not allocate
14868 public readonly Type[] VariableTypes;
14869 public readonly string[] VariableNames;
14870 Are redundant. The data is already stored in the variable
14871 map, so we need not allocate another array for it.
14872 - We need to add alot of checks for if (params | locals) == null
14873 due to the first two changes.
14875 2004-01-18 Miguel de Icaza <miguel@ximian.com>
14877 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
14878 implement IMemoryLocation, we store a copy on a local variable and
14879 take the address of it. Patch from Benjamin Jemlich
14881 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
14882 to use a special "type_name_expression" rule which reduces the
14883 number of "QualifiedIdentifier" classes created, and instead
14884 directly creates MemberAccess expressions.
14886 2004-01-17 Miguel de Icaza <miguel@ximian.com>
14888 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
14889 that fixes #52853. Null literal assignment to ValueType
14891 * class.cs (MethodData.Emit): Instead of checking the name of the
14892 method to determine if its a destructor, create a new derived
14893 class from Method called Destructor, and test for that.
14895 * cs-parser.jay: Create a Destructor object instead of a Method.
14897 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
14901 2004-01-16 Miguel de Icaza <miguel@ximian.com>
14903 * expression.cs (Binary.ResolveOperator): Perform an implicit
14904 conversion from MethodGroups to their delegate types on the
14905 Addition operation.
14907 * delegate.cs: Introduce a new class DelegateCreation that is the
14908 base class for `NewDelegate' and `ImplicitDelegateCreation',
14909 factor some code in here.
14911 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
14912 conversion from MethodGroups to compatible delegate types.
14914 * ecore.cs (Expression.Resolve): Do not flag error 654
14915 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
14916 we allow conversions from MethodGroups to delegate types now.
14918 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
14919 assignments in v2 either.
14921 2004-01-10 Miguel de Icaza <miguel@ximian.com>
14923 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
14924 static read-only fields in ctors.
14926 Applied patch from Benjamin Jemlich
14928 * expression.cs (UnaryMutator): Avoid leaking local variables.
14930 2004-01-09 Miguel de Icaza <miguel@ximian.com>
14932 * cs-tokenizer.cs (IsCastToken): Allow the various native types
14933 here to return true, as they can be used like this:
14935 (XXX) int.MEMBER ()
14937 Fixed 49836 and all the other dups
14939 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
14941 * driver.cs: Implement /win32res and /win32icon.
14943 2004-01-08 Miguel de Icaza <miguel@ximian.com>
14945 * cs-parser.jay: Add a rule to improve error handling for the
14946 common mistake of placing modifiers after the type.
14948 2004-01-07 Miguel de Icaza <miguel@ximian.com>
14950 * cs-parser.jay (interface_event_declaration): Catch
14951 initialization of events on interfaces, and report cs0068
14953 * cs-parser.jay (interface_event_declaration): Catch
14954 initialization of events.
14956 * ecore.cs: Better report missing constructors.
14958 * expression.cs (Binary.ResolveOperator): My previous bug fix had
14959 the error reporting done in the wrong place. Fix.
14961 * expression.cs (Binary.ResolveOperator): Catch the
14962 operator + (E x, E y) error earlier, and later allow for implicit
14963 conversions in operator +/- (E e, U x) from U to the underlying
14966 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
14967 52596, if the container class is abstract, the default constructor
14968 is protected otherwise its public (before, we were always public).
14970 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
14973 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
14974 Jemlich that fixes bug #52597, MCS was generating invalid code for
14975 idisposable structs. Thanks to Ben for following up with this
14978 2004-01-06 Miguel de Icaza <miguel@ximian.com>
14980 * driver.cs: Allow assemblies without code to be generated, fixes
14983 2004-01-07 Nick Drochak <ndrochak@gol.com>
14985 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
14987 2004-01-05 Miguel de Icaza <miguel@ximian.com>
14989 * cs-parser.jay: Add rules to improve error reporting if fields or
14990 methods are declared at the namespace level (error 116)
14992 * Add rules to catch event add/remove
14994 2004-01-04 David Sheldon <dave-mono@earth.li>
14996 * expression.cs: Added matching ")" to error message for
14999 2004-01-03 Todd Berman <tberman@gentoo.org>
15001 * ecore.cs, attribute.cs:
15002 Applying fix from #52429.
15004 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
15006 * ecore.cs, expression.cs, statement.cs:
15007 Total rewrite of how we handle branching. We
15008 now handle complex boolean expressions with fewer
15009 jumps. As well if (x == 0) no longer emits a ceq.
15011 if (x is Foo) is much faster now, because we generate
15014 Overall, we get a pretty big improvement on our benchmark
15015 tests. The code we generate is smaller and more readable.
15017 I did a full two-stage bootstrap. The patch was reviewed
15018 by Martin and Miguel.
15020 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
15022 * cs-parser.jay: Make primary_expression not take a QI.
15023 we dont need this because the member_access rule covers
15024 us here. So we replace the rule with just IDENTIFIER.
15026 This has two good effects. First, we remove a s/r conflict.
15027 Second, we allocate many fewer QualifiedIdentifier objects.
15029 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
15031 * attribute.cs: Handle MarshalAs attributes as pseudo, and
15032 set the correct information via SRE. This prevents
15033 hanging on the MS runtime. Fixes #29374.
15035 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
15037 * convert.cs: correctly handle conversions to value types
15038 from Enum and ValueType as unboxing conversions.
15040 Fixes bug #52569. Patch by Benjamin Jemlich.
15042 2004-01-02 Ravi Pratap <ravi@ximian.com>
15044 * expression.cs (BetterConversion): Prefer int -> uint
15045 over int -> ulong (csc's behaviour). This fixed bug #52046.
15047 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
15049 * decl.cs (MemberCache.FindMembers): now returns a
15052 * typemanager.cs: In general, go with with ^^.
15053 (CopyNewMethods): take an IList.
15054 (RealMemberLookup): Only allocate an arraylist
15055 if we copy from two sets of methods.
15057 This change basically does two things:
15058 1) Fewer array lists allocated due to CopyNewMethods.
15059 2) the explicit cast in MemberList costed ALOT.
15061 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
15063 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
15064 a hashtable to avoid needless string allocations when an identifier is
15065 used more than once (the common case).
15067 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
15069 * pending.cs: MS's TypeBuilder.GetInterfaces ()
15070 is broken, it will not return anything. So, we
15071 have to use the information we have in mcs to
15074 * typemanager.cs: Add a cache for GetInterfaces,
15075 since this will now be used more often (due to ^^)
15077 (GetExplicitInterfaces) New method that gets the
15078 declared, not effective, interfaces on a type
15079 builder (eg, if you have interface IFoo, interface
15080 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
15083 This patch makes MCS able to bootstrap itself on
15086 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
15088 * expression.cs: Remove the Nop's that Miguel put
15091 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
15093 * report.cs, codegen.cs: Give the real stack trace to
15094 the error when an exception is thrown.
15096 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
15098 * decl.cs: only allocate hashtables for ifaces if
15101 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
15103 * expression.cs: fix the error from cs0121-2.cs
15104 (a parent interface has two child interfaces that
15105 have a function with the same name and 0 params
15106 and the function is called through the parent).
15108 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
15110 * class.cs, rootcontext.cs, typmanager.cs: do not
15113 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
15115 * codegen.cs: remove stack for the ec flow branching.
15116 It is already a linked list, so no need.
15118 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
15120 * Makefile: Allow custom profiler here.
15122 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
15124 * typemanager.cs (LookupType):
15125 - Use a static char [], because split takes
15126 a param array for args, so it was allocating
15128 - Do not store true in a hashtable, it boxes.
15130 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
15132 * flowanalysis.cs: bytify common enums.
15134 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
15136 * modifiers.cs: Add a new set of flags for the
15137 flags allowed on explicit interface impls.
15138 * cs-parser.jay: catch the use of modifiers in
15139 interfaces correctly.
15140 * class.cs: catch private void IFoo.Blah ().
15142 All related to bug #50572.
15144 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
15146 * decl.cs: Rewrite the consistant accessability checking.
15147 Accessability is not linear, it must be implemented in
15148 a tableish way. Fixes #49704.
15150 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
15152 * expression.cs: Handle negation in a checked context.
15153 We must use subtraction from zero. Fixes #38674.
15155 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
15157 * class.cs: Ignore static void main in DLLs.
15158 * rootcontext.cs: Handle the target type here,
15159 since we are have to access it from class.cs
15160 * driver.cs: account for the above.
15162 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
15164 * report.cs: Give line numbers and files if available.
15166 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
15168 * driver.cs: Implement /addmodule.
15170 * typemanager.cs: Change 'modules' field so it now contains Modules not
15173 2003-12-20 Martin Baulig <martin@ximian.com>
15175 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
15176 (FieldBase.IsAssigned): Removed this field.
15177 (FieldBase.SetAssigned): New public method.
15178 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
15180 2003-12-20 Martin Baulig <martin@ximian.com>
15182 * expression.cs (LocalVariableReference.DoResolve): Don't set
15183 `vi.Used' if we're called from DoResolveLValue().
15185 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
15186 returns the usage vector it just merged into the current one -
15187 pass this one to UsageWarning().
15188 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
15189 of the `EmitContext', don't call this recursively on our children.
15191 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
15193 * driver.cs: Implement /target:module.
15195 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
15197 * support.cs (CharArrayHashtable): New helper class.
15199 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
15200 char arrays, not strings, so we can avoid creating a string in
15201 consume_identifier if the identifier is a keyword.
15203 2003-12-16 Martin Baulig <martin@ximian.com>
15205 * statement.cs (LocalInfo.Assigned): Removed this property.
15206 (LocalInfo.Flags): Removed `Assigned'.
15207 (LocalInfo.IsAssigned): New public method; takes the EmitContext
15208 and uses flow analysis.
15209 (Block.UsageWarning): Made this method private.
15210 (Block.Resolve): Call UsageWarning() if appropriate.
15212 * expression.cs (LocalVariableReference.DoResolve): Always set
15213 LocalInfo.Used here.
15215 2003-12-13 Martin Baulig <martin@ximian.com>
15217 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
15218 any value here; we're now using flow analysis to figure out
15219 whether a statement/block returns a value.
15221 2003-12-13 Martin Baulig <martin@ximian.com>
15223 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
15225 (FlowBranching.MergeFinally): Don't call
15226 `branching.CheckOutParameters()' here, this is called in
15228 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
15229 when adding the `finally' vector.
15231 2003-12-13 Martin Baulig <martin@ximian.com>
15234 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
15235 actually work and also fix #48962.
15237 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
15239 * decl.cs: Do not check System.Object for nested types,
15240 since we know it does not have any. Big bang for buck:
15243 Run 1: 8.35 seconds
15244 Run 2: 8.32 seconds
15245 corlib: 17.99 seconds
15247 Run 1: 8.17 seconds
15248 Run 2: 8.17 seconds
15249 corlib: 17.39 seconds
15251 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
15253 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
15254 time we are returning 0 members, so we save alot here.
15256 2003-12-11 Martin Baulig <martin@ximian.com>
15258 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
15259 `MergeChild()', also just take the `FlowBranching' as argument;
15260 call Merge() on it and return the result.
15261 (FlowBranching.Merge): We don't need to do anything if we just
15264 2003-12-11 Martin Baulig <martin@ximian.com>
15266 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
15267 them in an `ArrayList' to reduce memory usage. Thanks to Ben
15268 Maurer for this idea.
15270 2003-12-11 Martin Baulig <martin@ximian.com>
15272 * flowanalysis.cs (MergeResult): This class is now gone; we now
15273 use the `UsageVector' for this. The reason for this is that if a
15274 branching just has one sibling, we don't need to "merge" them at
15275 all - that's the next step to do.
15276 (FlowBranching.Merge): We now return a `UsageVector' instead of a
15279 2003-12-11 Martin Baulig <martin@ximian.com>
15281 Reworked flow analyis and made it more precise and bug-free. The
15282 most important change is that we're now using a special `Reachability'
15283 class instead of having "magic" meanings of `FlowReturns'. I'll
15284 do some more cleanups and optimizations and also add some more
15285 documentation this week.
15287 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
15288 largely reworked this class.
15289 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
15290 the new `Reachability' class instead of having "magic" values here.
15291 (FlowBranching): We're now using an instance of `Reachability'
15292 instead of having separate `Returns', `Breaks' etc. fields.
15294 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
15295 based on flow analysis; ignore the return value of block.Emit ().
15297 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
15299 * driver.cs typemanager.cs: Find the mono extensions to corlib even
15300 if they are private.
15302 2003-12-09 Martin Baulig <martin@ximian.com>
15304 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
15305 call them directly on the UsageVector.
15307 2003-12-09 Martin Baulig <martin@ximian.com>
15309 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
15310 Changed return type from `FlowReturns' to `Reachability'.
15312 2003-12-09 Martin Baulig <martin@ximian.com>
15314 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
15315 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
15316 `Reachable' fields with a single `Reachability' one.
15318 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15320 * class.cs (FindMembers): Remove foreach's.
15325 Run 1: 8.74 seconds
15326 Run 2: 8.71 seconds
15329 Run 1: 8.64 seconds
15330 Run 2: 8.58 seconds
15333 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15338 This patch does a few things:
15339 1. EmptyStatement is now a singleton, so it is never reallocated.
15340 2. All blah is EmptyStatement constructs have been changed to
15341 blah == EmptyStatement.Value, which is much faster and valid
15342 now that EmptyStatement is a singleton.
15343 3. When resolving a block, rather than allocating a new array for
15344 the non-empty statements, empty statements are replaced with
15345 EmptyStatement.Value
15346 4. Some recursive functions have been made non-recursive.
15347 Mainly the performance impact is from (3), however (1) and (2) are needed for
15348 this to work. (4) does not make a big difference in normal situations, however
15349 it makes the profile look saner.
15354 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15355 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15356 Total memory allocated: 56397 KB
15359 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
15360 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
15361 Total memory allocated: 55666 KB
15363 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15365 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
15366 than the hashtable in a hashtable version
15368 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
15369 we always end up concating a string. This results in a huge perf
15370 loss, because many strings have to be tracked by the GC. In this
15371 patch, we first use a hashtable that works with two keys, so that
15372 the strings do not need to be concat'ed.
15376 Run 1: 8.74 seconds
15377 Run 2: 8.71 seconds
15380 Run 1: 8.65 seconds
15381 Run 2: 8.56 seconds
15383 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15385 * Makefile: Add a new target `do-time' that does a quick and simple
15386 profile, leaving easy to parse output.
15388 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
15390 * codegen.cs (Init): Create the dynamic assembly with
15391 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
15393 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
15395 * support.cs: Make the PtrHashtable use only one
15396 instance of its comparer.
15398 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
15400 * typemanager.cs: Fix lookup of GetNamespaces.
15402 2003-11-29 Miguel de Icaza <miguel@ximian.com>
15404 * expression.cs: Removed redundant line.
15406 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
15407 ArrayLists, use for loops with bounds.
15409 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
15412 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
15413 arraylists, use for loop with bounds.
15415 The above three changes give us a 0.071 second performance
15416 improvement out of 3.294 seconds down to 3.223. On my machine
15417 the above changes reduced the memory usage by 1,387 KB during
15418 compiler bootstrap.
15420 * cs-parser.jay (QualifiedIdentifier): New class used to represent
15421 QualifiedIdentifiers. Before we created a new string through
15422 concatenation, and mostly later on, the result would be
15423 manipulated by DecomposeQI through string manipulation.
15425 This reduced the compiler memory usage for bootstrapping from
15426 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
15427 compile times in 0.05 seconds.
15429 2003-11-28 Dick Porter <dick@ximian.com>
15431 * support.cs: Do string compares with the Invariant culture.
15439 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
15440 the comparison is done with the Invariant culture.
15442 2003-11-27 Miguel de Icaza <miguel@ximian.com>
15444 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
15445 GetEnumerator method.
15447 (ProbeCollectionType): Iterate starting at the most specific type
15448 upwards looking for a GetEnumerator
15450 * expression.cs: Shift count can be up to 31 for int/uint and 63
15453 2003-11-26 Miguel de Icaza <miguel@ximian.com>
15455 * statement.cs (Block.LookupLabel): Also look for the label on the
15456 children blocks. Use a hash table to keep track of visited
15459 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
15460 we actually did transform the other operand, otherwise fall back
15461 to the common codepath that casts to long.
15463 * cs-tokenizer.cs: Use the same code pattern as the int case.
15464 Maybe I should do the parsing myself, and avoid depending on the
15465 Parse routines to get this done.
15467 2003-11-25 Miguel de Icaza <miguel@ximian.com>
15469 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
15470 which fixes bug 51347. This time test it.
15472 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
15473 attributes for example can not tell the difference between these.
15474 The difference was only a syntax feature of the language.
15476 * attribute.cs: Apply attributes to delegates.
15478 * delegate.cs: Call the apply attributes method.
15480 2003-11-24 Miguel de Icaza <miguel@ximian.com>
15482 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
15483 comparing 0 vs Byte.MinValue, not the value
15485 (ImplicitConversionRequired): When reporting a conversion error,
15486 use error 31 to print out the constant error instead of the
15489 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
15490 which fixes bug 51347.
15492 2003-11-22 Miguel de Icaza <miguel@ximian.com>
15494 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
15495 which fixes the -warnaserror command line option.
15497 2003-11-21 Miguel de Icaza <miguel@ximian.com>
15499 * cfold.cs (DoNumericPromotions): During constant folding of
15500 additions on UIntConstant, special case intconstants with
15501 IntConstants like we do on the expression binary operator.
15503 2003-11-12 Miguel de Icaza <miguel@ximian.com>
15505 * convert.cs (ImplicitReferenceConversion): We were missing a case
15506 (System.Enum are not value types or class types, so we need to
15507 classify them separatedly).
15509 * driver.cs: We do not support error 2007.
15511 2003-11-12 Jackson Harper <jackson@ximian.com>
15513 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
15514 system directory. Also use the full file name so users can
15515 libraries names mscorlib-o-tron.dll in a non system dir.
15517 2003-11-10 Martin Baulig <martin@ximian.com>
15519 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
15520 (TypeManager.InitCoreTypes): Initialize them here, but instead of
15521 calling `ResolveType()' on them, directly assign their `Type'.
15523 2003-11-08 Martin Baulig <martin@ximian.com>
15525 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
15526 return value and the `out parent' parameter.
15527 (TypeContainer.DefineType): Moved the CS0644 check into
15528 GetClassBases(). Don't pass the interface types to the
15529 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
15530 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
15532 * ecore.cs (TypeExpr.IsAttribute): New property.
15533 (TypeExpr.GetInterfaces): New method.
15535 * interface.cs (Interface.GetInterfaceTypeByName): Return a
15536 TypeExpr instead of a Type.
15537 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
15538 (Interface.DefineType): Don't pass the interface types to the
15539 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
15540 them later and then call `TypeBulider.AddInterfaceImplementation()'.
15542 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
15543 instead of a `Type[]'.
15544 (TypeManager.RegisterBuilder): Likewise.
15545 (TypeManager.AddUserInterface): Likewise.
15546 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
15547 `Type[]' and also return a `TypeExpr[]'.
15548 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
15550 2003-11-08 Martin Baulig <martin@ximian.com>
15552 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
15555 2003-11-08 Martin Baulig <martin@ximian.com>
15557 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
15558 TypeManager.ResolveExpressionTypes().
15560 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
15561 instead of an Expression.
15562 (TypeExpr): This is now an abstract base class for `TypeExpression'.
15563 (TypeExpression): New public class; formerly known as `TypeExpr'.
15565 * expression.cs (ComposedCast): Derive from TypeExpr.
15567 * typemanager.cs (TypeManager.system_*_expr): These are now
15568 TypExpr's instead of Expression's.
15569 (TypeManager.ResolveExpressionTypes): New public static function;
15570 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
15573 2003-11-06 Miguel de Icaza <miguel@ximian.com>
15575 * expression.cs (New.DoResolve): Do not dereference value that
15576 might be a null return.
15578 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
15579 sure that the constant value has the right type. Fixes an
15580 unreported bug, similar to 50425.
15582 * const.cs (Const.LookupConstantValue): Call
15583 ImplicitStandardConversionExists before doing a conversion to
15584 avoid havng the TypeManager.ChangeType do conversions.
15586 Reduced the number of casts used
15588 (Const.ChangeType): New routine to enable reuse of the constant
15589 type changing code from statement.
15591 * typemanager.cs (ChangeType): Move common initialization to
15592 static global variables.
15596 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
15597 every value type to go through, even if it was void. Fix that.
15599 * cs-tokenizer.cs: Use is_identifier_start_character on the start
15600 character of the define, and the is_identifier_part_character for
15601 the rest of the string.
15603 2003-11-05 Miguel de Icaza <miguel@ximian.com>
15605 * expression.cs (UnaryMutator.EmitCode): When I updated
15606 LocalVariableReference.DoResolve, I overdid it, and dropped an
15607 optimization done on local variable references.
15609 2003-11-04 Miguel de Icaza <miguel@ximian.com>
15611 * ecore.cs: Convert the return from Ldlen into an int.
15613 2003-10-20 Miguel de Icaza <miguel@ximian.com>
15615 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
15616 the accessibility, this is a special case for toplevel non-public
15617 classes (internal for instance).
15619 2003-10-20 Nick Drochak <ndrochak@gol.com>
15621 * ecore.cs: Fix typo and build. Needed another right paren.
15623 2003-10-19 Miguel de Icaza <miguel@ximian.com>
15625 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
15626 `internal' case regular and protected, but not allowing protected
15627 to be evaluated later. Bug 49840
15629 2003-10-15 Miguel de Icaza <miguel@ximian.com>
15631 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
15632 to kb.Nlast, and not the kb.nFirst to isolate the switch
15635 Extract the underlying type, so enumerations of long/ulong are
15636 treated like long/ulong.
15638 2003-10-14 Miguel de Icaza <miguel@ximian.com>
15640 * expression.cs (New): Overload the meaning of RequestedType to
15641 track the possible creation of the NewDelegate type, since
15642 DoResolve is invoked more than once for new constructors on field
15645 See bugs: #48800 and #37014
15647 * cs-parser.jay (declare_local_constants): Take an arraylist
15648 instead of a single constant.
15650 (local_constant_declaration): It should take a
15651 constant_declarators, not a constant_declarator. Fixes 49487
15653 * convert.cs: Fix error report.
15655 2003-10-13 Jackson Harper <jackson@ximian.com>
15657 * typemanager.cs (TypeToCoreType): Add float and double this fixes
15660 2003-10-09 Martin Baulig <martin@ximian.com>
15662 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
15664 (MethodCore.DoDefineParameters): Removed the TypeContainer
15665 argument; use the DeclSpace which was passed to the .ctor instead.
15666 (MethodCore.CheckParameter): Take a DeclSpace instead of a
15667 TypeContainer; we only need a DeclSpace here.
15669 2003-10-09 Martin Baulig <martin@ximian.com>
15671 * class.cs (MethodData): Added additional `DeclSpace ds' argument
15673 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
15674 EmitContext's .ctor.
15676 2003-10-09 Martin Baulig <martin@ximian.com>
15678 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
15679 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
15680 AsAccessible(), moved them as well.
15682 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
15684 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
15686 * cs-parser.jay : Renamed yyName to yyNames related to jay.
15688 2003-10-07 Miguel de Icaza <miguel@ximian.com>
15690 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
15691 generation for >=, as spotted by Paolo, bug 48679.
15692 Patch from David Waite.
15694 * cs-tokenizer.cs: Add handling for #pragma.
15696 * cs-parser.jay: Allow for both yield and yield return in the
15697 syntax. The anti-cobolization of C# fight will go on!
15699 * class.cs (TypeBuilder.DefineType): Catch error condition here
15700 (Parent.DefineType erroring out and returning null).
15702 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15703 coping with enumerations variables, we were mistakenly processing
15704 them as a regular value type instead of built-in types. Fixes the
15707 * typemanager.cs (IsBuiltinOrEnum): New method.
15709 2003-09-30 Miguel de Icaza <miguel@ximian.com>
15711 * cs-parser.jay: Upgrade: yield now needs the return clause.
15713 2003-09-19 Martin Baulig <martin@ximian.com>
15715 * decl.cs (MemberCache.SetupCacheForInterface): Take a
15716 `MemberCache parent' argument. Normally, an interface doesn't
15717 have a parent type except System.Object, but we use this in gmcs
15718 for generic type parameters.
15720 2003-09-18 Martin Baulig <martin@ximian.com>
15722 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
15723 on `type.IsInterface'; don't check whether the type has a parent
15724 to determine whether it's an interface.
15726 2003-09-15 Martin Baulig <martin@ximian.com>
15728 * class.cs (TypeContainer.DefineType): Added an error flag to
15729 avoid reporting duplicate CS0146's ("class definition is
15732 * driver.cs (Driver.MainDriver): Abort if
15733 RootContext.ResolveTree() reported any errors.
15735 2003-09-07 Martin Baulig <martin@ximian.com>
15737 * report.cs (Error, Warning): Added overloaded versions which take
15738 a `params object[] args' and call String.Format().
15740 2003-09-07 Martin Baulig <martin@ximian.com>
15742 * decl.cs (DeclSpace..ctor): Don't call
15743 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
15744 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
15745 (DeclSpace.RecordDecl): New method.
15747 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
15749 2003-09-02 Ravi Pratap <ravi@ximian.com>
15751 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
15752 value attributes to be applied to ParameterBuilders.
15754 * class.cs (MethodCore.LabelParameters): Make static and more
15755 generic so that it can be used from other places - like interface
15756 methods, for instance.
15758 * interface.cs (Interface.Emit): Call LabelParameters before
15759 emitting attributes on the InterfaceMethod.
15761 2003-08-26 Martin Baulig <martin@ximian.com>
15763 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
15764 resolving aliases; fixes #47927.
15766 2003-08-26 Martin Baulig <martin@ximian.com>
15768 * statement.cs (Using.DoResolve): This is internally emitting a
15769 try/finally clause, so we need to set ec.NeedExplicitReturn if we
15770 do not always return. Fixes #47681.
15772 2003-08-26 Martin Baulig <martin@ximian.com>
15774 * decl.cs (MemberCore): Moved WarningNotHiding(),
15775 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
15777 (AdditionResult): Make this nested in DeclSpace.
15778 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
15779 argument; call NamespaceEntry.Define() unless we're nested in a
15782 * namespace.cs (Namespace.DefineName): New public function. This
15783 is called from DeclSpace's .ctor to add
15784 (Namespace.Lookup): Include DeclSpaces in the lookup.
15786 * class.cs (Operator): Derive from MemberBase, not MemberCore.
15788 * const.cs (Const): Derive from MemberBase, not MemberCore.
15790 2003-08-25 Martin Baulig <martin@ximian.com>
15792 * convert.cs (Convert.ExplicitReferenceConversion): When
15793 converting from an interface type to a class, unbox if the target
15794 type is a struct type. Fixes #47822.
15796 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15798 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
15801 2003-08-22 Martin Baulig <martin@ximian.com>
15803 * class.cs (TypeManager.DefineType): When defining a nested type,
15804 call DefineType() on our parent; fixes #47801.
15806 2003-08-22 Martin Baulig <martin@ximian.com>
15808 * class.cs (MethodData.Define): While checking if a method is an
15809 interface implementation, improve the test a bit more to fix #47654.
15811 2003-08-22 Martin Baulig <martin@ximian.com>
15813 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
15814 correctly; fixes #47722.
15816 2003-08-22 Martin Baulig <martin@ximian.com>
15818 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
15819 LocalVariableReference, ensure it's not read-only. Fixes #47536.
15821 * statement.cs (Fixed.DoResolve): Make all variables read-only.
15823 2003-08-22 Martin Baulig <martin@ximian.com>
15825 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
15826 can only be assigned in static constructors. Fixes #47161.
15828 2003-08-22 Martin Baulig <martin@ximian.com>
15830 Rewrote and improved the flow analysis code.
15832 * flowbranching.cs (FlowBranching): Make this class abstract.
15833 (FlowBranching.CreateBranching): New static function to create a
15834 new flow branching.
15835 (FlowBranchingBlock, FlowBranchingException): New classes.
15836 (FlowBranching.UsageVector.Type): New public readonly field.
15837 (FlowBranching.UsageVector.Breaks): Removed the setter.
15838 (FlowBranching.UsageVector.Returns): Removed the setter.
15839 (FlowBranching.UsageVector): Added Break(), Return(),
15840 NeverReachable() and Throw() methods to modify the reachability.
15841 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
15842 done by FlowBranching.Merge().
15843 (FlowBranching.UsageVector.MergeChild): New method; merges the
15844 merge result into the current vector.
15845 (FlowBranching.Merge): New abstract method to merge a branching.
15847 2003-08-12 Martin Baulig <martin@ximian.com>
15849 * expression.cs (Indirection.CacheTemporaries): Create the
15850 LocalTemporary with the pointer type, not its element type.
15852 2003-08-10 Miguel de Icaza <miguel@ximian.com>
15854 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
15855 token was a keyword or not.
15857 Add `error' options where an IDENTIFIER was expected; Provide
15858 CheckToken and CheckIdentifierToken convenience error reporting
15861 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
15863 * decl.cs: Rename `NamespaceEntry Namespace' public field into
15864 NameSpaceEntry NameSpaceEntry.
15866 (LookupInterfaceOrClass): Avoid creating a full qualified name
15867 from namespace and name: avoid doing lookups when we know the
15868 namespace is non-existant. Use new Tree.LookupByNamespace which
15869 looks up DeclSpaces based on their namespace, name pair.
15871 * driver.cs: Provide a new `parser verbose' to display the
15872 exception thrown during parsing. This is turned off by default
15873 now, so the output of a failure from mcs is more graceful.
15875 * namespace.cs: Track all the namespaces defined in a hashtable
15878 (IsNamespace): New method
15880 2003-08-09 Miguel de Icaza <miguel@ximian.com>
15882 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
15883 we know that we need to concatenate (full typename can never be
15888 * statement.cs: Use a bitfield; Do not initialize to null things
15889 which are done by the constructor by default.
15891 * cs-parser.jay: bug fix, parameter was 4, not 3.
15893 * expression.cs: Just use the property;
15895 * statement.cs: No need for GetVariableInfo method.
15897 2003-08-08 Martin Baulig <martin@ximian.com>
15899 * flowanalysis.cs (FlowReturns): This is now nested in the
15900 `FlowBranching' class.
15901 (MyBitVector): Moved this here from statement.cs.
15902 (FlowBranching.SiblingType): New enum type.
15903 (FlowBranching.CreateSibling): Added `SiblingType' argument.
15905 2003-08-07 Martin Baulig <martin@ximian.com>
15907 * flowanalysis.cs (FlowBranchingType): This is now nested in the
15908 `FlowBranching' class and called `BranchingType'.
15910 2003-08-07 Martin Baulig <martin@ximian.com>
15912 * flowanalysis.cs: Moved all the control flow analysis code into
15915 2003-08-07 Martin Baulig <martin@ximian.com>
15917 * assign.cs (Assign.DoResolve): `target' must either be an
15918 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
15921 2003-08-07 Miguel de Icaza <miguel@ximian.com>
15923 * expression.cs (BinaryMethod): This kind of expression is created by the
15924 Binary class if it determines that the operator has to be handled
15927 (BinaryDelegate): This kind of expression is created if we are
15928 dealing with a + or - operator on delegates.
15930 (Binary): remove method, argumetns, and DelegateOperator: when
15931 dealing with methods,
15933 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
15935 * statement.cs (Block): use bitfields for the three extra booleans
15936 we had in use. Remove unused topblock parameter.
15938 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
15940 * assign.cs: Drop extra unneeded tests.
15942 2003-08-06 Miguel de Icaza <miguel@ximian.com>
15944 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
15946 * statement.cs (Foreach): Use VariableStorage instead of
15949 * codegen.cs (VariableStorage): New class used by clients that
15950 require a variable stored: locals or fields for variables that
15951 need to live across yield.
15953 Maybe provide a convenience api for EmitThis+EmitLoad?
15955 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
15958 2003-08-05 Miguel de Icaza <miguel@ximian.com>
15960 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
15961 RemapParameterLValue): New methods that are used to turn a
15962 precomputed FieldInfo into an expression like this:
15966 The idea is to use this instead of making LocalVariableReference
15967 have more than one meaning.
15969 * cs-parser.jay: Add error production to BASE.
15971 * ecore.cs: Deal with TypeManager.GetField returning null, which
15972 is now a valid return value.
15974 (FieldExprNoAddress): New expression for Fields whose address can
15977 * expression.cs (LocalVariableReference): During the resolve
15978 phases, create new expressions if we are in a remapping context.
15979 Remove code that dealt with remapping here.
15981 (ParameterReference): same.
15983 (ProxyInstance): New expression, like the `This' expression, but
15984 it is born fully resolved. We know what we are doing, so remove
15985 the errors that are targeted to user-provided uses of `this'.
15987 * statement.cs (Foreach): our variable is now stored as an
15988 Expression; During resolution, follow the protocol, dont just
15989 assume it will return this.
15991 2003-08-06 Martin Baulig <martin@ximian.com>
15993 * support.cs (SeekableStreamReader.cs): New public class.
15995 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
15996 SeekableStreamReader instead of the normal StreamReader.
15998 2003-08-04 Martin Baulig <martin@ximian.com>
16000 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
16001 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
16002 deambiguate casts and delegate invocations.
16003 (parenthesized_expression): Use the new tokens to ensure this is
16004 not a cast of method invocation.
16006 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
16007 when reading a `)' and Deambiguate_CloseParens () was previously
16010 * expression.cs (ParenthesizedExpression): New class. This is
16011 just used for the CS0075 test.
16012 (Binary.DoResolve): Check for CS0075.
16014 2003-07-29 Ravi Pratap <ravi@ximian.com>
16016 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
16017 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
16018 reference comparison.
16020 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
16021 examine the ReturnType for equality - this is necessary in the
16022 cases of implicit and explicit operators whose signature also
16023 includes the return type.
16025 2003-07-26 Miguel de Icaza <miguel@ximian.com>
16027 * namespace.cs: Cache the result of the namespace computation,
16028 instead of computing it every time.
16030 2003-07-24 Miguel de Icaza <miguel@ximian.com>
16032 * decl.cs: Use a global arraylist that we reuse over invocations
16033 to avoid excesive memory consumption. Reduces memory usage on an
16034 mcs compile by one meg (45 average).
16036 * typemanager.cs (LookupTypeReflection): In .NET pointers are
16037 private, work around that.
16039 2003-07-23 Miguel de Icaza <miguel@ximian.com>
16041 * literal.cs (IntLiteral): Define Zero and One static literals.
16043 * cs-parser.jay (integer_literal): use static literals to reduce
16044 memory usage for the most used literals (0, 1 and -1). 211kb
16045 reduced in memory usage.
16047 Replace all calls to `new ArrayList' with `new
16048 ArrayList(4)' which is a good average number for most allocations,
16049 and also requires only 16 bytes of memory for its buffer by
16052 This reduced MCS memory usage in seven megabytes for the RSS after
16055 2003-07-28 Ravi Pratap <ravi@ximian.com>
16057 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
16058 handle params methods the correct way by forming only one
16059 applicable set with params and normal methods in them. Earlier we
16060 were looking at params methods only if we found no normal methods
16061 which was not the correct thing to do.
16063 (Invocation.BetterFunction): Take separate arguments indicating
16064 when candidate and the best method are params methods in their
16067 This fixes bugs #43367 and #46199.
16069 * attribute.cs: Documentation updates.
16071 (CheckAttribute): Rename to CheckAttributeTarget.
16072 (GetValidPlaces): Rename to GetValidTargets.
16074 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
16075 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
16079 2003-07-28 Martin Baulig <martin@ximian.com>
16081 * class.cs (TypeContainer.DefineMembers): Use the base type's full
16082 name when looking up the base class of a nested class. Fixes #46977.
16084 2003-07-26 Martin Baulig <martin@ximian.com>
16086 * expression.cs (Indexers.Indexer): New nested struct; contains
16087 getter, setter and the indexer's type.
16088 (Indexers.Properties): This is now an ArrayList of
16089 Indexers.Indexer's.
16090 (IndexerAccess.DoResolveLValue): Correctly set the type if the
16091 indexer doesn't have any getters.
16093 * assign.cs (Assign.DoResolve): Also do the implicit conversions
16094 for embedded property and indexer assignments.
16096 2003-07-26 Martin Baulig <martin@ximian.com>
16098 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
16099 preprocessor directive is not the first non-whitespace character
16102 2003-07-26 Martin Baulig <martin@ximian.com>
16104 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
16105 namespace parsing, follow the spec more closely.
16107 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
16108 NamespaceEntry.Lookup().
16110 2003-07-25 Martin Baulig <martin@ximian.com>
16112 * MethodCore.cs (OverridesSomething): New public field; it's set
16113 from TypeContainer.DefineMembers if this method overrides
16114 something (which doesn't need to be a method). Fix #39462.
16116 2003-07-25 Ravi Pratap <ravi@ximian.com>
16118 * typemanager.cs (GetMembers): Ensure that the list of members is
16119 reversed. This keeps things in sync.
16121 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
16122 find an AttributeUsage attribute.
16124 * expression.cs (Invocation.OverloadResolve): Perform the check
16125 which disallows Invoke to be directly called on a Delegate.
16127 (Error_InvokeOnDelegate): Report error cs1533.
16129 2003-07-25 Martin Baulig <martin@ximian.com>
16131 * expression.cs (Indexers.GetIndexersForType): Only look in the
16132 interface hierarchy if the requested type is already an
16133 interface. Fixes #46788 while keeping #46502 fixed.
16135 2003-07-25 Martin Baulig <martin@ximian.com>
16137 * class.cs (TypeContainer.DefineMembers): Check whether all
16138 readonly fields have been assigned and report warning CS0649 if
16141 * statement.cs (LocalInfo.IsFixed): Always return true if this is
16144 2003-07-24 Ravi Pratap <ravi@ximian.com>
16146 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
16147 returned from GetMethods to make things consistent with the
16148 assumptions MCS makes about ordering of methods.
16150 This should comprehensively fix bug #45127 and it does :-)
16152 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
16153 ordering is actually reverse.
16155 * Clean up some debug messages I left lying around.
16157 * interface.cs (Populate*): Get rid of code which emits attributes
16158 since the stage in which we emit attributes is the 'Emit' stage,
16159 not the define stage.
16161 (Emit): Move attribute emission for interface members here.
16163 2003-07-22 Ravi Pratap <ravi@ximian.com>
16165 * expression.cs (Invocation.OverloadResolve): Follow the spec more
16166 closely: we eliminate methods in base types when we have an
16167 applicable method in a top-level type.
16169 Please see section 14.5.5.1 for an exact description of what goes
16172 This fixes bug #45127 and a host of other related to corlib compilation.
16174 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
16175 array is the method corresponding to the top-level type (this is
16176 because of the changes made to icall.c) so we change this
16179 (MethodGroupExpr.Name): This too.
16181 * typemanager.cs (GetElementType): New method which does the right
16182 thing when compiling corlib.
16184 * everywhere: Make use of the above in the relevant places.
16186 2003-07-22 Martin Baulig <martin@ximian.com>
16188 * cs-parser.jay (invocation_expression): Moved
16189 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
16190 `cast_expression', but create a InvocationOrCast which later
16191 resolves to either an Invocation or a Cast.
16193 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
16194 method; call this before EmitStatement() to make sure that this
16195 expression can be used as a statement.
16197 * expression.cs (InvocationOrCast): New class; resolves to either
16198 an Invocation or a Cast.
16200 * statement.cs (StatementExpression): Call ResolveStatement() on
16201 the ExpressionStatement before emitting it.
16203 2003-07-21 Martin Baulig <martin@ximian.com>
16205 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
16206 `ref' and `out' attributes match; fixes #46220.
16207 (MemberAccess.ResolveMemberAccess): You can't reference a type
16208 through an expression; fixes #33180.
16209 (Indexers.GetIndexersForType): Don't return the indexers from
16210 interfaces the class implements; fixes #46502.
16212 2003-07-21 Martin Baulig <martin@ximian.com>
16214 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
16215 CS0661 checks; fixes bug #30442.
16217 2003-07-21 Martin Baulig <martin@ximian.com>
16219 * decl.cs (AdditionResult): Added `Error'.
16221 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
16223 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
16224 makes cs0031.cs actually work.
16226 2003-07-20 Martin Baulig <martin@ximian.com>
16228 * namespace.cs: Fixed that bug which caused a crash when compiling
16229 the debugger's GUI.
16231 2003-07-20 Miguel de Icaza <miguel@ximian.com>
16233 * typemanager.cs (LookupTypeReflection): Never expose types which
16234 are NotPublic, NestedPrivate, NestedAssembly, or
16235 NestedFamANDAssem. We used to return these, and later do a check
16236 that would report a meaningful error, but the problem is that we
16237 would not get the real match, if there was a name override.
16239 2003-07-18 Miguel de Icaza <miguel@ximian.com>
16241 * namespace.cs (Namespace, Name): Do not compute the namespace
16242 name dynamically, compute it in the constructor. This reduced
16243 memory usage by 1697 KB.
16245 * driver.cs: Use --pause to pause at the end.
16247 2003-07-17 Peter Williams <peter@newton.cx>
16249 * Makefile: Change the name of the test target so that it doesn't
16250 conflict with the recursive test target.
16252 2003-07-17 Miguel de Icaza <miguel@ximian.com>
16254 * expression.cs (LocalVariableReference.Emit, EmitAssign,
16255 AddressOf): Do not use EmitThis, that was wrong, use the actual
16258 2003-07-15 Miguel de Icaza <miguel@ximian.com>
16260 * class.cs (MethodData.Define): While checking if a method is an
16261 interface implementation, improve the test: If we are not public
16262 (use new test here: use the computed MethodAttributes directly,
16263 instead of the parsed modifier flags) check if the `implementing'
16264 method comes from an interface or not.
16266 * pending.cs (VerifyPendingMethods): Slightly better error
16269 * makefile: add test target that does the mcs bootstrap.
16271 2003-07-16 Ravi Pratap <ravi@ximian.com>
16273 * interface.cs (Define): Do nothing here since there are no
16274 members to populate etc. Move the attribute emission out of here
16275 since this was just totally the wrong place to put it. Attribute
16276 application happens during the 'Emit' phase, not in the 'Define'
16279 (Emit): Add this method and move the attribute emission here
16281 * rootcontext.cs (EmitCode): Call the Emit method on interface
16284 2003-07-14 Ravi Pratap M <ravi@ximian.com>
16286 * expression.cs (OverloadResolve): Report error only if Location
16287 is not 'Null' which means that there was a probe going on.
16289 2003-07-14 Martin Baulig <martin@ximian.com>
16291 * expression.cs (ConditionalLogicalOperator): New public class to
16292 implement user defined conditional logical operators.
16293 This is section 14.11.2 in the spec and bug #40505.
16295 2003-07-14 Martin Baulig <martin@ximian.com>
16297 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
16299 2003-07-14 Martin Baulig <martin@ximian.com>
16301 * codegen.cs (EmitContext.InFixedInitializer): New public field.
16303 * ecore.cs (IVariable.VerifyFixed): New interface method.
16305 * expression.cs (Unary.ResolveOperator): When resolving the `&'
16306 operator, check whether the variable is actually fixed. Fixes bug
16307 #36055. Set a variable definitely assigned when taking its
16308 address as required by the spec.
16310 * statement.cs (LocalInfo.IsFixed): New field.
16311 (LocalInfo.MakePinned): Set `IsFixed' to true.
16313 2003-07-14 Ravi Pratap M <ravi@ximian.com>
16315 * attribute.cs (Attribute.Resolve): While doing a Member lookup
16316 for .ctors, ensure that we only ask for members declared in the
16317 attribute type (BindingFlags.DeclaredOnly).
16321 * expression.cs (Error_WrongNumArguments): Report error 1501
16322 correctly the way CSC does.
16324 2003-07-13 Martin Baulig <martin@ximian.com>
16326 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
16327 lookup on the fully qualified name, to make things like "X.X" work
16328 where "X.X" is a fully qualified type name, but we also have a
16329 namespace "X" in the using list. Fixes #41975.
16331 2003-07-13 Martin Baulig <martin@ximian.com>
16333 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
16334 function. If we're a CompoundAssign, we need to create an embedded
16335 CompoundAssign, not an embedded Assign.
16336 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
16339 2003-07-13 Martin Baulig <martin@ximian.com>
16341 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
16342 work to fix bug #46088.
16344 2003-07-13 Ravi Pratap <ravi@ximian.com>
16346 * class.cs (Operator.Emit): Do not emit attributes here - it is
16347 taken care of by the Method class that we delegate too. This takes
16348 care of bug #45876.
16350 2003-07-10 Martin Baulig <martin@ximian.com>
16352 * expression.cs (TypeOfVoid): New class.
16353 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
16355 2003-07-10 Martin Baulig <martin@ximian.com>
16357 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
16360 2003-07-10 Martin Baulig <martin@ximian.com>
16362 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
16363 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
16365 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
16367 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
16369 2003-07-10 Martin Baulig <martin@ximian.com>
16371 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
16372 of decimal. Fixes #42850.
16374 NOTE: I also fixed the created byte blob, but this doesn't work on
16375 the MS runtime and csc never produces any byte blobs for decimal
16378 2003-07-10 Martin Baulig <martin@ximian.com>
16380 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
16381 structs; fixes #32068.
16382 (Block.AddChildVariableNames): Fixed #44302.
16384 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16386 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
16388 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16390 * attribute.cs: And this test is onger needed.
16392 2003-07-08 Martin Baulig <martin@ximian.com>
16394 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
16395 inaccessible types. Fixes #36313.
16397 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
16399 * namespace.cs (NamespaceEntry): Create implicit entries for all
16400 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
16401 implicit entries for N1.N2 and N1.
16403 2003-07-08 Martin Baulig <martin@ximian.com>
16405 Rewrote the handling of namespaces to fix a lot of the issues
16406 wrt. `using' aliases etc.
16408 * namespace.cs (Namespace): Splitted this class into a
16409 per-assembly `Namespace' and a per-file `NamespaceEntry'.
16411 * typemanager.cs (TypeManager.IsNamespace): Removed.
16412 (TypeManager.ComputeNamespaces): Only compute namespaces from
16413 loaded assemblies here, not the namespaces from the assembly we're
16414 currently compiling.
16416 2003-07-08 Martin Baulig <martin@ximian.com>
16418 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
16420 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16422 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
16425 I thought about the memory savings here, but LookupTypeReflection
16426 is used under already very constrained scenarios. Compiling
16427 corlib or mcs only exposes one hit, so it would not really reduce
16428 any memory consumption.
16430 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16432 * typemanager.cs: fixes bug #45889 by only adding public types from
16433 other assemblies to the list of known types.
16435 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16437 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
16438 on the type we resolved.
16440 2003-07-05 Martin Baulig <martin@ximian.com>
16442 * pending.cs (PendingImplementation.ParentImplements): Don't
16443 create the proxy if the parent is abstract.
16445 * class.cs (TypeContainer.DefineIndexers): Process explicit
16446 interface implementations first. Fixes #37714.
16448 2003-07-04 Miguel de Icaza <miguel@ximian.com>
16450 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
16451 defined recursively; but since we modify the input parameters
16452 (left is set to `this' temporarily), we reset this value if the
16453 left_is_explicit is false, which gives the original semantics to
16456 * literal.cs (NullPointer): new class used to represent a null
16457 literal in a pointer context.
16459 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
16460 type is a pointer, use a NullPointer object instead of a
16461 NullLiteral. Closes 43687
16463 (ExplicitConversion): Convert pointer values using
16464 the conv opcode to the proper type.
16466 * ecore.cs (New): change ValueTypeVariable property into a method,
16467 that returns whether the valuetype is suitable for being used.
16469 * expression.cs (Binary.DoNumericPromotions): Only return if we
16470 the int constant was a valid uint, and we can return both left and
16471 right as uints. If not, we continue processing, to trigger the
16472 type conversion. This fixes 39018.
16474 * statement.cs (Block.EmitMeta): During constant resolution, set
16475 the CurrentBlock property on the emitcontext, so that we resolve
16476 constants propertly.
16478 2003-07-02 Martin Baulig <martin@ximian.com>
16480 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
16481 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
16483 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
16484 than emitting it here.
16486 * statement.cs: Fixed some more flow analysis bugs.
16488 2003-07-02 Martin Baulig <martin@ximian.com>
16490 * class.cs (MethodData.Define): When implementing interface
16491 methods, set Final unless we're Virtual.
16493 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
16494 check work for interface methods.
16496 2003-07-01 Martin Baulig <martin@ximian.com>
16498 * ecore.cs (EmitContext.This): Replaced this property with a
16499 GetThis() method which takes a Location argument. This ensures
16500 that we get the correct error location for a CS0188.
16502 2003-07-01 Miguel de Icaza <miguel@ximian.com>
16504 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
16505 ImplicitStandardConversion.
16507 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
16509 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
16511 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
16514 2003-06-30 Miguel de Icaza <miguel@ximian.com>
16516 * class.cs (Constructor.Define): Turn off initlocals for unsafe
16519 (MethodData.Define): Turn off initlocals for unsafe methods.
16521 2003-06-29 Miguel de Icaza <miguel@ximian.com>
16523 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
16524 complete; Fixes #37521.
16526 * delegate.cs: Use Modifiers.TypeAttr to compute the
16527 TypeAttributes, instead of rolling our own. This makes the flags
16528 correct for the delegates.
16530 2003-06-28 Miguel de Icaza <miguel@ximian.com>
16532 * class.cs (Constructor.Define): Set the private flag for static
16533 constructors as well.
16535 * cs-parser.jay (statement_expression): Set the return value to
16536 null, to avoid a crash when we catch an error.
16538 2003-06-24 Miguel de Icaza <miguel@ximian.com>
16540 * cs-parser.jay: Applied patch from Jackson that adds support for
16541 extern and unsafe modifiers to destructor declarations.
16543 * expression.cs: Report error 21 if the user is trying to index a
16546 * driver.cs: Add an error message, suggested by the bug report.
16548 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
16549 if we do not have a ": this ()" constructor initializer. Fixes 45149
16551 2003-06-14 Miguel de Icaza <miguel@ximian.com>
16553 * namespace.cs: Add some information to reduce FAQs.
16555 2003-06-13 Miguel de Icaza <miguel@ximian.com>
16557 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
16558 underlying enumeration types. Fixes #43915.
16560 * expression.cs: Treat ushort/short as legal values to be used in
16561 bitwise operations.
16563 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
16565 * delegate.cs: transfer custom attributes for paramenters from
16566 the delegate declaration to Invoke and BeginInvoke.
16568 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
16570 * attribute.cs: handle custom marshalers and emit marshal info
16573 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
16575 * makefile.gnu: Added anonymous.cs to the compiler sources.
16577 2003-05-28 Miguel de Icaza <miguel@ximian.com>
16579 * iterators.cs: Change the name of the proxy class to include two
16582 * cs-parser.jay: Update grammar to include anonymous methods.
16584 * anonymous.cs: new file.
16586 2003-05-27 Miguel de Icaza <miguel@ximian.com>
16588 * class.cs (Field.Define): Add missing test for pointers and
16591 2003-05-27 Ravi Pratap <ravi@ximian.com>
16593 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
16594 we use the stobj opcode.
16596 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
16597 since it wasn't the correct fix.
16599 It still is puzzling that we are required to use stobj for IntPtr
16600 which seems to be a ValueType.
16602 2003-05-26 Miguel de Icaza <miguel@ximian.com>
16604 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
16605 during regular simple name resolution. Now, the trick is that
16606 instead of returning for processing the simplename, we do a
16607 TypeManager.LookupType (ie, a rooted lookup as opposed to a
16608 contextual lookup type). If a match is found, return that, if
16609 not, return for further composition.
16611 This fixes long-standing 30485.
16613 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16614 using the address to initialize an object, do an Stobj instead of
16615 using the regular Stelem.
16617 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
16618 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
16619 Because if we are a BaseIndexerAccess that value will be true.
16622 * statement.cs (GotoCase.Resolve): Return after reporting an
16623 error, do not attempt to continue.
16625 * expression.cs (PointerArithmetic.Emit): If our operand is a
16626 long, convert our constants to match the operand before
16627 multiplying. Convert to I type before adding. Fixes 43670.
16629 2003-05-14 Ravi Pratap <ravi@ximian.com>
16631 * enum.cs (ImplicitConversionExists) : Rename to
16632 ImplicitEnumConversionExists to remove ambiguity.
16634 * ecore.cs (NullCast): New type of cast expression class which
16635 basically is very similar to EmptyCast with the difference being
16636 it still is a constant since it is used only to cast a null to
16638 (eg. (string) null)
16640 * convert.cs (ImplicitReferenceConversion): When casting a null
16641 literal, we return a NullCast.
16643 * literal.cs (NullLiteralTyped): Remove - I don't see why this
16644 should be around anymore.
16646 The renaming (reported was slightly wrong). Corrections:
16648 ConvertImplicitStandard -> ImplicitConversionStandard
16649 ConvertExplicitStandard -> ExplicitConversionStandard
16651 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
16652 before passing them in !
16654 * convert.cs (ImplicitConversionStandard): When comparing for
16655 equal expr and target types, ensure that expr is not a
16658 In general, we must not be checking (expr_type ==
16659 target_type) in the top level conversion methods
16660 (ImplicitConversion, ExplicitConversion etc). This checking is
16661 done in the methods that they delegate to.
16663 2003-05-20 Miguel de Icaza <miguel@ximian.com>
16665 * convert.cs: Move Error_CannotConvertType,
16666 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
16667 ImplicitNumericConversion, ImplicitConversionExists,
16668 ImplicitUserConversionExists, StandardConversionExists,
16669 FindMostEncompassedType, FindMostSpecificSource,
16670 FindMostSpecificTarget, ImplicitUserConversion,
16671 ExplicitUserConversion, GetConversionOperators,
16672 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
16673 TryImplicitIntConversion, Error_CannotConvertImplicit,
16674 ConvertImplicitRequired, ConvertNumericExplicit,
16675 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
16676 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
16679 Perform the following renames:
16681 StandardConversionExists -> ImplicitStandardConversionExists
16682 ConvertImplicit -> ImplicitConversion
16683 ConvertImplicitStandard -> ImplicitStandardConversion
16684 TryImplicitIntConversion -> ImplicitIntConversion
16685 ConvertImplicitRequired -> ImplicitConversionRequired
16686 ConvertNumericExplicit -> ExplicitNumericConversion
16687 ConvertReferenceExplicit -> ExplicitReferenceConversion
16688 ConvertExplicit -> ExplicitConversion
16689 ConvertExplicitStandard -> ExplicitStandardConversion
16691 2003-05-19 Martin Baulig <martin@ximian.com>
16693 * statement.cs (TypeInfo.StructInfo): Made this type protected.
16694 (TypeInfo): Added support for structs having structs as fields.
16696 * ecore.cs (FieldExpr): Implement IVariable.
16697 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
16698 VariableInfo for the field.
16700 2003-05-18 Martin Baulig <martin@ximian.com>
16702 * expression.cs (This.DoResolve): Report a CS0027 if we're
16703 emitting a field initializer.
16705 2003-05-18 Martin Baulig <martin@ximian.com>
16707 * expression.cs (This.ResolveBase): New public function.
16708 (This.DoResolve): Check for CS0188.
16710 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
16713 * ecore.cs (MethodGroupExpr.DoResolve): Set the
16714 `instance_expression' to null if we don't have any non-static
16717 2003-05-18 Martin Baulig <martin@ximian.com>
16719 Reworked the way how local variables and parameters are handled by
16720 the flow analysis code.
16722 * statement.cs (TypeInfo, VariableMap): New public classes.
16723 (VariableInfo): New public class. This is now responsible for
16724 checking whether a variable has been assigned. It is used for
16725 parameters and local variables.
16726 (Block.EmitMeta): Take the InternalParameters as argument; compute
16727 the layout of the flow vectors here.
16728 (Block.LocalMap, Block.ParameterMap): New public properties.
16729 (FlowBranching): The .ctor doesn't get the InternalParameters
16730 anymore since Block.EmitMeta() now computes the layout of the flow
16732 (MyStructInfo): This class is now known as `StructInfo' and nested
16733 in `TypeInfo'; we don't access this directly anymore.
16735 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
16736 property and removed IsAssigned(), IsFieldAssigned(),
16737 SetAssigned() and SetFieldAssigned(); we now call them on the
16738 VariableInfo so we don't need to duplicate this code everywhere.
16740 * expression.cs (ParameterReference): Added `Block block' argument
16742 (LocalVariableReference, ParameterReference, This): The new
16743 VariableInfo class is now responsible for all the definite
16746 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
16747 IsParameterAssigned, SetParameterAssigned): Removed.
16749 2003-05-18 Martin Baulig <martin@ximian.com>
16751 * typemanager.cs (InitCoreTypes): Try calling
16752 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
16753 the 3-args-version. Corlib now also needs our `void_type'.
16754 (GetMethod): Added overloaded version which takes an optional
16755 `bool report_errors' to allow lookups of optional methods.
16757 2003-05-12 Martin Baulig <martin@ximian.com>
16759 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
16760 only used for locals and not for parameters.
16762 2003-05-12 Miguel de Icaza <miguel@ximian.com>
16764 * support.cs (InternalParameters.ParameterType): Return the
16765 ExternalType of the parameter.
16767 * parameter.cs (Parameter.ExternalType): drop the two arguments,
16770 2003-05-11 Miguel de Icaza <miguel@ximian.com>
16772 * class.cs (MethodData.Define): Do not set the `newslot' on
16773 interface members, if they are also flagged as "override".
16775 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
16776 better code for ++i and i++. This only works for static fields
16777 and local variables.
16779 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
16780 want to pull the DeclSpace out of the builder_to_declspace instead
16781 of the TypeBuilder (like in TypeContainer.FindMembers).
16783 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
16784 instead of LookupTypeContainer. Fixes the crash on .NET for
16785 looking up interface members.
16787 * const.cs: Create our own emit context during the Definition
16788 stage, so that constants are evaluated in the proper context, when
16789 a recursive definition happens.
16791 2003-05-11 Martin Baulig <martin@ximian.com>
16793 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
16794 new block for a switch section.
16795 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
16796 the adding/lookup in the switch block. Fixes #39828.
16798 2003-05-09 Miguel de Icaza <miguel@ximian.com>
16800 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
16801 functionality: I needed to convert the data after I had performed
16802 the add/sub operation into the operands type size.
16804 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
16805 pass the type for the box operation, otherwise the resulting
16806 object would have been of type object.
16808 (BoxedCast): Add constructor to specify the type to box as.
16810 2003-05-07 Miguel de Icaza <miguel@ximian.com>
16812 * iterators.cs: I was reusing the `count' variable inadvertently,
16813 take steps to not allow this to happen.
16815 2003-05-06 Miguel de Icaza <miguel@ximian.com>
16817 * attribute.cs (Attribute.Resolve): Params attributes are encoded
16818 by creating an array at the point where the params starts and
16819 putting all those arguments there, then adjusting the size of the
16822 2003-05-05 Miguel de Icaza <miguel@ximian.com>
16824 * expression.cs (New.AddressOf): Implement interface
16825 IMemoryLocation. This is used when the `new' operator is used in
16826 the context of an invocation to a method on a value type.
16828 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
16831 * namespace.cs: Also check the using aliases here.
16833 * driver.cs: Move the test for using validity after the types have
16834 been entered, so we do a single pass that also includes the using
16837 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
16838 in the regular case. CreateSiblingForFinally is doing extra
16841 * attribute.cs (GetAttributeArgumentExpression): Store the result
16842 on an out value, and use the return value to indicate failure
16843 instead of using null (which is a valid return for Constant.GetValue).
16845 * statement.cs: Perform the analysis flow for the increment
16846 portion after the statement, because this will be the real flow of
16847 execution. Fixes #42385
16849 * codegen.cs (EmitContext.EmitArgument,
16850 EmitContext.EmitStoreArgument): New helper functions when the
16851 RemapToProxy flag is set.
16853 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
16856 Add support for remapping parameters.
16858 * iterators.cs: Propagate parameter values; Store parameter
16859 values in the proxy classes.
16861 2003-05-04 Miguel de Icaza <miguel@ximian.com>
16863 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
16864 need a proxy reference; I do not know what I was thinking
16866 * cs-parser.jay (constructor_initializer): catch another error,
16867 and display nice message.
16869 (field_declaration): catch void field declaration
16870 to flag a better error.
16872 * class.cs (MemberBase.CheckBase): Report an error instead of a
16873 warning if a new protected member is declared in a struct.
16874 (Field.Define): catch the error of readonly/volatile.
16876 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
16878 (FieldExpr.AddressOf): ditto. Catch error where the address of a
16879 volatile variable is taken
16881 2003-05-02 Miguel de Icaza <miguel@ximian.com>
16883 * statement.cs (Fixed.Resolve): Report an error if we are not in
16886 2003-05-01 Miguel de Icaza <miguel@ximian.com>
16888 * typemanager.cs: reuse the code that handles type clashes for
16889 delegates and enumerations.
16891 * class.cs (Report28): Always report.
16893 * expression.cs (EncodeAsAttribute): Allow nulls here.
16895 2003-04-28 Miguel de Icaza <miguel@ximian.com>
16897 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
16898 the functionality for testing whether an expression is valid for
16899 an attribute here. Also handle the case of arrays of elements
16902 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
16903 encoding a linear array into an array of objects that are suitable
16904 to be passed to an CustomAttributeBuilder.
16906 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
16908 * ecore.cs: (FieldExpr): Handle field remapping here.
16910 * iteratators.cs: Pass the instance variable (if the method is an
16911 instance method) to the constructors, so we can access the field
16912 variables on the class.
16914 TODO: Test this with structs. I think the THIS variable on
16915 structs might have to be a pointer, and not a refenrece
16917 2003-04-27 Miguel de Icaza <miguel@ximian.com>
16919 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
16920 local variables to fields in a proxy class.
16922 * iterators.cs (PopulateProxy): Rename our internal fields to
16924 Create a <THIS> field if we are an instance method, so we can
16925 reference our parent container variables.
16926 (MapVariable): Called back from the EmitContext code to enter a
16927 new variable to field mapping into the proxy class (we just create
16931 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
16932 for using the remapped locals to fields.
16934 I placed the code here, because that gives the same semantics to
16935 local variables, and only changes the Emit code.
16937 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
16938 statements inside iterators.
16939 (VariableInfo): Add a FieldBuilder for the cases when we are
16940 remapping local variables to fields in a proxy class
16942 * ecore.cs (SimpleNameResolve): Avoid testing two times for
16943 current_block != null.
16945 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
16946 not cope with strings, as it has been moved to the
16947 TableSwitchEmit. Fixed bug in switch generation.
16949 * expression.cs (New.DoResolve): Provide more context for the user
16950 when reporting an error.
16952 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
16955 * expression.cs (MemberAccess.DoResolve): When we get a type back,
16956 check the permissions for it. Note than in a type-resolution
16957 context the check was already present in DeclSpace.ResolveType,
16958 but was missing from the MemberAccess.
16960 (ArrayCreation.CheckIndices): warn if the user has
16961 more nested levels of expressions, but there are no more
16962 dimensions specified. Avoids crash on bug 41906.
16964 2003-04-26 Miguel de Icaza <miguel@ximian.com>
16966 * statement.cs (Block): replace Implicit bool, for a generic
16968 New flag: `Unchecked'. This is used during the EmitMeta phase
16969 (which is out-of-line with the regular Resolve/Emit process for a
16970 statement, as this is done ahead of time, but still gets a chance
16971 to call constant resolve).
16973 (Block.Flags): new enum for adding a new flag.
16975 (Block.EmitMeta): track the state of unchecked.
16977 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
16978 to enable constant resolution to work there as well.
16980 2003-04-22 Miguel de Icaza <miguel@ximian.com>
16982 * typemanager.cs (ienumerable_type): Also look up
16983 System.Collections.IEnumerable.
16985 2003-04-21 Miguel de Icaza <miguel@ximian.com>
16987 TODO: Test more than one conditional per method.
16989 * class.cs (Indexer.Define): Report the location where the user is
16990 referencing the unsupported feature.
16992 (MethodData): Overload the use of `conditionals' to
16993 minimize the creation of needless ArrayLists. This saves roughly
16994 212kb on my machine.
16996 (Method): Implement the new IIteratorContainer interface.
16997 (Method.SetYields): Implement the method by setting the ModFlags
16998 to contain METHOD_YIELDS.
17000 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
17001 which just got set to null.
17003 * iterators.cs: New file.
17005 (Yield, YieldBreak): New statements.
17007 * statement.cs (Return.Resolve): Flag an error if we are used in
17008 an iterator method.
17010 * codegen.cs (InIterator): New flag set if the code is being
17011 compiled in an iterator method.
17013 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
17014 internal modifier, and we just use it to avoid adding extra
17015 fields, as this is seldom used.
17017 * cs-parser.jay: Add yield_statement (yield and yield break).
17019 * driver.cs: New flag -v2 to turn on version 2 features.
17021 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
17022 hashtable when v2 is enabled.
17024 2003-04-20 Miguel de Icaza <miguel@ximian.com>
17026 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
17027 there is already a namespace defined with this name.
17029 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
17030 people upgraded their corlibs.
17032 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
17033 always use fully qualified types, no need to use the compiler
17036 (TypeManager.IsNamespace): Use binarysearch.
17038 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
17039 AddDelegate): I did not quite use the new IsValid API properly: I
17040 have to pass the short-name and the fullname. I was passing only
17041 the basename instead of the fullname sometimes.
17043 (TypeContainer.DefineType): call NamespaceClash.
17045 * interface.cs (Interface.DefineType): use NamespaceClash before
17048 * delegate.cs (Delegate.DefineType): use NamespaceClash before
17051 * enum.cs: (Enum.DefineType): use NamespaceClash before
17054 * typemanager.cs (: 3-line patch that gives us some tasty 11%
17055 speed increase. First, use the negative_hits cache when we get a
17056 negative. Second, add the type with its full original name
17057 instead of the new . and + encoded name (reflection uses + to
17058 separate type from a nested type). Use LookupTypeReflection
17059 directly which bypasses the type->name hashtable (that we already
17060 know does not contain the type.
17062 * decl.cs (DeclSpace.ResolveTypeExpr): track the
17063 location/container type.
17065 * driver.cs: When passing utf8, use directly the UTF8Encoding.
17067 2003-04-19 Miguel de Icaza <miguel@ximian.com>
17069 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
17071 * delegate.cs (NewDelegate.Resolve): Test whether an instance
17072 method is being referenced in the method group from a static
17073 context, and report error 120 if so.
17075 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
17078 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
17079 is created, we create the A namespace).
17081 * cs-parser.jay: A namespace also introduces a DeclarationFound.
17084 2003-04-18 Miguel de Icaza <miguel@ximian.com>
17086 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
17087 invocation to ModuleBuilder.GetType with the same values will
17088 return a new type instance, so we need to cache its return
17091 * expression.cs (Binary.ResolveOperator): Only allow the compare
17092 operators on enums if they are of the same type.
17094 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
17095 types of ValueType on their own case. Before we were giving them
17096 the same treatment as objects.
17098 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
17099 fullname. Short name is used to compare against container name.
17100 Fullname is used to check against defined namespace names.
17102 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
17103 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
17105 (Method.CheckBase): Call parent.
17106 (MemberBase.CheckBase): Check for protected members on sealed
17108 (PropertyBase.CheckBase): Call parent.
17109 (Field.Define): Call parent.
17111 * report.cs: Negative error codes are now mapped to 8000 - code,
17112 so that the display is render more nicely.
17114 * typemanager.cs: Do not use try/catch, instead report a regular
17117 (GetPointerType, GetReferenceType): These methods provide
17118 mechanisms to obtain the T* and T& from a T. We had the code
17119 previously scattered around the code base, and it also used
17120 TypeManager.LookupType that would go through plenty of caches.
17121 This one goes directly to the type source.
17123 In some places we did the Type.GetType followed by
17124 ModuleBuilder.GetType, but not in others, so this unifies the
17125 processing as well.
17127 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
17128 statements now that we have namespace information.
17130 * typemanager.cs (IsNamespace): New method, returns whether the
17131 string presented is a namespace or not.
17133 (ComputeNamespaces): New public entry point, computes the list of
17134 available namespaces, using the GetNamespaces API call in Mono, or
17135 the slower version in MS.NET.
17137 Now before we start the semantic analysis phase, we have a
17138 complete list of namespaces including everything that the user has
17141 Deleted old code to cache namespaces in .nsc files.
17143 2003-04-17 Miguel de Icaza <miguel@ximian.com>
17145 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
17146 class/struct location definition Location for the implicit
17147 constructor location.
17149 (Operator.Define): Use the location of the operator for the
17150 implicit Method definition.
17152 (Constructor.Emit): use the constructor location for the implicit
17153 base initializer constructor.
17155 * ecore.cs: Remove ITypeExpression. This interface is now gone,
17156 and the Expression class now contains two new methods:
17158 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
17159 isolate type lookup from the rest of the resolution process.
17161 Since we use Expressions to hold type definitions due to the way
17162 we parse the input we have historically overloaded Resolve to
17163 perform the Type lookups if a special flag is passed. Now this is
17164 eliminated and two methods take their place.
17166 The differences in the two methods between xStep and xTerminal is
17167 that xStep is involved in our current lookup system that uses
17168 SimpleNames to compose a name, while xTerminal is used just to
17169 catch the case where the simplename lookup failed.
17171 2003-04-16 Miguel de Icaza <miguel@ximian.com>
17173 * expression.cs (ResolveMemberAccess): Remove redundant code.
17174 TypeExpr expressions are always born fully resolved.
17176 * interface.cs (PopulateMethod): Do not lookup the types twice.
17177 We were doing it once during SemanticAnalysis and once during
17180 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
17181 in local variable type definitions, were being returned as a
17182 SimpleName (we decomposed everything into a string), that is
17183 because primary_expression was being used instead of a type in the
17184 grammar (reduce/reduce conflicts).
17186 The part that was wrong is that we converted the expression into a
17187 string (an oversimplification in one hand, compounded with primary
17188 expressions doing string concatenation).
17194 Would return "A.B.C[]" as a SimpleName. This stopped things like
17195 using clauses from working on this particular context. And a type
17196 was being matched directly against "A.B.C[]".
17198 We now use the correct approach, and allow for ComposedCast to be
17199 part of the unary expression. So the "A.B.C []" become a composed
17200 cast of "A.B.C" (as a nested group of MemberAccess with a
17201 SimpleName at the end) plus the rank composition "[]".
17205 2003-04-10 Miguel de Icaza <miguel@ximian.com>
17207 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
17208 for the access level checking.
17210 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
17211 `TypeContainer container', because I kept getting confused when I
17212 was debugging this code.
17214 * expression.cs (Indexers): Instead of tracking getters/setters,
17215 we now track them in parallel. We create one arraylist less, but
17216 most importantly it is possible now for the LValue code to find a
17217 matching get for a set.
17219 (IndexerAccess.DoResolveLValue): Update the code.
17220 GetIndexersForType has been modified already to extract all the
17221 indexers from a type. The code assumed it did not.
17223 Also make the code set the correct return type for the indexer.
17224 This was fixed a long time ago for properties, but was missing for
17225 indexers. It used to be void_type.
17227 (Binary.Emit): Test first for doubles instead of
17228 floats, as they are more common.
17230 (Binary.EmitBranchable): Use the .un version of the branch opcodes
17231 when dealing with floats and the <=, >= operators. This fixes bug
17234 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
17235 to load the array value by emitting a load on the foreach variable
17236 type. This was incorrect.
17238 We now emit the code to load an element using the the array
17239 variable type, and then we emit the conversion operator.
17243 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
17245 * attribute.cs: Avoid allocation of ArrayLists in the common case.
17247 2003-04-09 Miguel de Icaza <miguel@ximian.com>
17249 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
17250 test for protection before we test for signatures.
17252 (MethodSignature.ToString): implement.
17254 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
17255 to the case where we reduced into a LongConstant.
17257 * decl.cs (CheckAccessLevel): If the type is an array, we can not
17258 depend on whether the information is acurrate, because the
17259 Microsoft runtime will always claim that the array type is public,
17260 regardless of the real state.
17262 If the type is a pointer, another problem happens: the type is
17263 reported as non-public in Microsoft.
17265 In both cases we have to call CheckAccessLevel recursively with
17266 the underlying type as the argument to be tested.
17268 2003-04-08 Miguel de Icaza <miguel@ximian.com>
17270 * assign.cs (Assign.Emit): If we are dealing with a compound
17271 assignment expression, we should use the code path that stores the
17272 intermediate result in a temporary value. This fixes #40903.
17274 *expression.cs (Indirection.ToString): Provide ToString method for
17277 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
17279 * class.cs: Null out fields holding references to Block objects so
17280 they can be garbage collected.
17282 * expression.cs (OverloadResolve): Remove unused local.
17284 2003-04-07 Martin Baulig <martin@ximian.com>
17286 * codegen.cs (EmitContext.CurrentFile): New public field.
17287 (EmitContext.Mark): Use the CurrentFile to check whether the
17288 location is in the correct file.
17289 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
17291 2003-04-07 Martin Baulig <martin@ximian.com>
17293 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
17295 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
17296 location. [FIXME: The location argument which gets passed to this
17297 method is sometimes wrong!]
17299 2003-04-07 Nick Drochak <ndrochak@gol.com>
17301 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
17303 2003-04-07 Miguel de Icaza <miguel@ximian.com>
17305 * expression.cs (Indirection.EmitAssign): We were using the
17306 temporary, but returning immediately instead of continuing the
17309 2003-04-06 Martin Baulig <martin@ximian.com>
17311 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
17312 if it's a nested child, but also deriving from the outer class.
17315 * typemanager.cs (IsNestedChildOf): Make this work if it's a
17316 nested child, but also deriving from the outer class. See
17318 (FilterWithClosure): We may access private members of the outer
17319 class if we're a nested child and deriving from the outer class.
17320 (RealMemberLookup): Only set `closure_private_ok' if the
17321 `original_bf' contained BindingFlags.NonPublic.
17323 2003-04-05 Martin Baulig <martin@ximian.com>
17325 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
17327 2003-04-02 Miguel de Icaza <miguel@ximian.com>
17329 * class.cs (Event.Define): Do not allow abstract events to have
17332 2003-04-01 Miguel de Icaza <miguel@ximian.com>
17334 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
17335 block in event declarations.
17337 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
17338 value type, get its address.
17340 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
17341 leaving a class on the stack instead of a boolean value (int
17342 0/1). Change the code so we compare against null, and then the
17343 result against zero.
17345 * class.cs (TypeContainer.GetClassBases): We were checking for the
17346 parent class being sealed too late.
17348 * expression.cs (Binary.Emit): For <= and >= when dealing with
17349 floating point values, use cgt.un and clt.un instead of cgt and
17352 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
17354 * statement.cs: Apply the same optimization as MS: skip the
17355 GetEnumerator returning an IEnumerator, and use the one returning a
17356 CharEnumerator instead. This allows us to avoid the try-finally block
17359 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
17361 * cs-parser.jay: Attributes cannot be applied to
17362 namespaces. Fixes #40473
17364 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17367 (Add*): check if the name is valid using the full name for constants,
17368 fields, properties and events.
17370 2003-03-28 Miguel de Icaza <miguel@ximian.com>
17372 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
17373 char constants to be part of the enumeration.
17375 * expression.cs (Conditional.DoResolve): Add support for operator
17376 true. Implements the missing functionality from 14.12
17378 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
17379 operator true/false as required by the spec.
17381 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
17382 implicit conversion to boolean.
17384 * statement.cs (Statement.ResolveBoolean): A boolean expression is
17385 also one where the type implements `operator true'.
17387 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
17388 get an expression that will invoke operator true based on an
17391 (GetConversionOperators): Removed the hack that called op_True
17394 (Expression.ResolveBoolean): Move this from Statement.
17396 2003-03-17 Miguel de Icaza <miguel@ximian.com>
17398 * ecore.cs (FieldExpr): do not allow initialization of initonly
17399 fields on derived classes
17401 2003-03-13 Martin Baulig <martin@ximian.com>
17403 * statement.cs (Block.Emit): Call ig.BeginScope() and
17404 ig.EndScope() when compiling with debugging info; call
17405 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
17407 2003-03-08 Miguel de Icaza <miguel@ximian.com>
17409 * expression.cs (Indexers): Do not construct immediately, allow
17410 for new members to be appended as we go. Fixes 38143
17412 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17414 * expression.cs: save/restore context when resolving an unchecked
17417 2003-03-05 Miguel de Icaza <miguel@ximian.com>
17419 * cfold.cs: Catch division by zero in modulus operator during
17422 2003-03-03 Miguel de Icaza <miguel@ximian.com>
17424 * interface.cs (Interface.DefineMembers): Avoid defining members
17427 2003-02-27 Miguel de Icaza <miguel@ximian.com>
17429 * driver.cs: handle the +/- options for -noconfig
17431 * statement.cs (Unckeched.Resolve): Also track the state of
17432 unchecked in the Resolve phase.
17434 2003-02-27 Martin Baulig <martin@ximian.com>
17436 * ecore.cs (Expression.MemberLookup): Don't create a
17437 MethodGroupExpr for something which is not a method. Fixes #38291.
17439 2003-02-25 Miguel de Icaza <miguel@ximian.com>
17441 * class.cs (MemberBase.CheckParameters): Also check that the type
17442 is unmanaged if it is a pointer.
17444 * expression.cs (SizeOf.Resolve): Add location information.
17446 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
17447 a managed type is declared.
17449 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
17450 parameter modifiers as well. Fixes bug 38606
17452 * class.cs: Very sad. Am backing out the speed up changes
17453 introduced by the ArrayList -> Array in the TypeContainer, as they
17454 were not actually that much faster, and introduced a bug (no error
17455 reports on duplicated methods).
17457 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
17458 source first, this will guarantee that we have a valid expression
17459 before calling in lower levels functions that will require a
17460 resolved object. Then use this original_source in the
17461 target.ResolveLValue instead of the original source that was
17464 Another change. Use target.Resolve instead of LValueResolve.
17465 Although we are resolving for LValues, we will let the Assign code
17466 take care of that (it will be called again from Resolve). This
17467 basically allows code like this:
17469 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
17470 class Y { void A (X x) { x [0] += o; }
17472 The problem was that the indexer was trying to resolve for
17473 set_Item (idx, object o) and never finding one. The real set_Item
17474 was set_Item (idx, X). By delaying the process we get the right
17479 2003-02-23 Martin Baulig <martin@ximian.com>
17481 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
17482 while calling DoEmit ().
17484 * codegen.cs (EmitContext.Mark): Don't mark locations in other
17485 source files; if you use the #line directive inside a method, the
17486 compiler stops emitting line numbers for the debugger until it
17487 reaches the end of the method or another #line directive which
17488 restores the original file.
17490 2003-02-23 Martin Baulig <martin@ximian.com>
17492 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
17494 2003-02-23 Martin Baulig <martin@ximian.com>
17496 * statement.cs (Block.AddChildVariableNames): We need to call this
17497 recursively, not just for our immediate children.
17499 2003-02-23 Martin Baulig <martin@ximian.com>
17501 * class.cs (Event.Define): Always make the field private, like csc does.
17503 * typemanager.cs (TypeManager.RealMemberLookup): Make events
17504 actually work, fixes bug #37521.
17506 2003-02-23 Miguel de Icaza <miguel@ximian.com>
17508 * delegate.cs: When creating the various temporary "Parameters"
17509 classes, make sure that we call the ComputeAndDefineParameterTypes
17510 on those new parameters (just like we do with the formal ones), to
17511 allow them to be resolved in the context of the DeclSpace.
17513 This fixes the bug that Dick observed in Bugzilla #38530.
17515 2003-02-22 Miguel de Icaza <miguel@ximian.com>
17517 * expression.cs (ResolveMemberAccess): When resolving a constant,
17518 do not attempt to pull a constant if the value was not able to
17519 generate a valid constant.
17521 * const.cs (LookupConstantValue): Do not report more errors than required.
17523 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17525 * expression.cs: fixes bug #38328.
17527 2003-02-18 Miguel de Icaza <miguel@ximian.com>
17529 * class.cs: Changed all the various members that can be part of a
17530 class from being an ArrayList to be an Array of the right type.
17531 During the DefineType type_list, interface_list, delegate_list and
17532 enum_list are turned into types, interfaces, delegates and enums
17535 And during the member population, indexer_list, event_list,
17536 constant_list, field_list, instance_constructor_list, method_list,
17537 operator_list and property_list are turned into their real arrays.
17539 Although we could probably perform this operation earlier, for
17540 good error reporting we need to keep the lists and remove the
17541 lists for longer than required.
17543 This optimization was triggered by Paolo profiling the compiler
17544 speed on the output of `gen-sample-program.pl' perl script.
17546 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
17547 not crash in methods like MemberLookupFailed that use this field.
17549 This problem arises when the compiler fails to resolve a type
17550 during interface type definition for example.
17552 2003-02-18 Miguel de Icaza <miguel@ximian.com>
17554 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
17555 inherit from System.Object, so we have to stop at null, not only
17556 when reaching System.Object.
17558 2003-02-17 Miguel de Icaza <miguel@ximian.com>
17560 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
17561 DeclaredOnly because the parent indexer might have had a different
17562 name, but did not loop until the top of the hierarchy was reached.
17564 The problem this one fixes is 35492: when a class implemented an
17565 indexer from an interface, we were getting the interface method
17566 (which was abstract) and we were flagging an error (can not invoke
17569 This also keeps bug 33089 functioning, and test-148 functioning.
17571 * typemanager.cs (IsSpecialMethod): The correct way of figuring
17572 out if a method is special is to see if it is declared in a
17573 property or event, or whether it is one of the predefined operator
17574 names. This should fix correctly #36804.
17576 2003-02-15 Miguel de Icaza <miguel@ximian.com>
17578 The goal here is to remove the dependency on EmptyCast.Peel ().
17579 Killing it completely.
17581 The problem is that currently in a number of places where
17582 constants are expected, we have to "probe" for an EmptyCast, and
17583 Peel, which is not the correct thing to do, as this will be
17584 repetitive and will likely lead to errors.
17586 The idea is to remove any EmptyCasts that are used in casts that
17587 can be reduced to constants, so we only have to cope with
17590 This bug hunt was triggered by Bug 37363 and the desire to remove
17591 the duplicate pattern where we were "peeling" emptycasts to check
17592 whether they were constants. Now constants will always be
17595 * ecore.cs: Use an enumconstant here instead of wrapping with
17598 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
17599 throwing me off. By handling this we can get rid of a few hacks.
17601 * statement.cs (Switch): Removed Peel() code.
17603 2003-02-14 Miguel de Icaza <miguel@ximian.com>
17605 * class.cs: Location information for error 508
17607 * expression.cs (New.DoResolve): Add a guard against double
17608 resolution of an expression.
17610 The New DoResolve might be called twice when initializing field
17611 expressions (see EmitFieldInitializers, the call to
17612 GetInitializerExpression will perform a resolve on the expression,
17613 and later the assign will trigger another resolution
17615 This leads to bugs (#37014)
17617 * delegate.cs: The signature for EndInvoke should contain any ref
17618 or out parameters as well. We were not doing this in the past.
17620 * class.cs (Field.Define): Do not overwrite the type definition
17621 inside the `volatile' group. Turns out that volatile enumerations
17622 were changing the type here to perform a validity test, which
17625 2003-02-12 Miguel de Icaza <miguel@ximian.com>
17627 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
17628 and structs, we do not want to load the instance variable
17630 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
17631 enum_type has to be handled like an object reference (implicit
17632 conversions exists from this to object), but the regular IsClass
17633 and IsValueType tests will never return true for this one.
17635 Also we use TypeManager.IsValueType instead of type.IsValueType,
17636 just for consistency with the rest of the code (this is only
17637 needed if we ever use the construct exposed by test-180.cs inside
17638 corlib, which we dont today).
17640 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
17642 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
17645 2003-02-09 Martin Baulig <martin@ximian.com>
17647 * namespace.cs (Namespace..ctor): Added SourceFile argument.
17648 (Namespace.DefineNamespaces): New static public method; this is
17649 called when we're compiling with debugging to add all namespaces
17650 to the symbol file.
17652 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
17653 pass it to the Namespace's .ctor.
17655 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
17656 and MethodBase arguments; pass the namespace ID to the symwriter;
17657 pass the MethodBase instead of the token to the symwriter.
17658 (SymbolWriter.DefineNamespace): New method to add a namespace to
17661 2003-02-09 Martin Baulig <martin@ximian.com>
17663 * symbolwriter.cs: New file. This is a wrapper around
17664 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
17665 methods here in near future.
17667 2003-02-09 Martin Baulig <martin@ximian.com>
17669 * codegen.cs (EmitContext.Mark): Just pass the arguments to
17670 ILGenerator.MarkSequencePoint() which are actually used by the
17673 2003-02-09 Martin Baulig <martin@ximian.com>
17675 * location.cs (SourceFile): New public sealed class. This
17676 contains the name and an index which is used in the location's token.
17677 (Location): Reserve an appropriate number of bits in the token for
17678 the source file instead of walking over that list, this gives us a
17679 really huge performance improvement when compiling with debugging.
17681 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
17682 `SourceFile' argument instead of a string.
17683 (Driver.ProcessFile): Add all the files via Location.AddFile(),
17684 but don't parse/tokenize here, we need to generate the list of all
17685 source files before we do that.
17686 (Driver.ProcessFiles): New static function. Parses/tokenizes all
17689 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
17690 instead of a string.
17692 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
17695 2003-02-09 Martin Baulig <martin@ximian.com>
17697 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
17698 filename on `#line default'.
17700 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
17702 * statement.cs: don't clear the pinned var when the fixed statement
17703 returns from the method (fixes bug#37752).
17705 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
17707 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
17710 2003-02-07 Martin Baulig <martin@ximian.com>
17712 * driver.cs: Removed the `--debug-args' command line argument.
17714 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
17715 automatically by the AsssemblyBuilder.
17716 (CodeGen.InitializeSymbolWriter): We don't need to call any
17717 initialization function on the symbol writer anymore. This method
17718 doesn't take any arguments.
17720 2003-02-03 Miguel de Icaza <miguel@ximian.com>
17722 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
17723 from referenced assemblies as well.
17725 2003-02-02 Martin Baulig <martin@ximian.com>
17727 * class.cs (MethodData.Emit): Generate debugging info for external methods.
17729 2003-02-02 Martin Baulig <martin@ximian.com>
17731 * class.cs (Constructor.Emit): Open the symbol writer before
17732 emitting the constructor initializer.
17733 (ConstructorInitializer.Emit): Call ec.Mark() to allow
17734 single-stepping through constructor initializers.
17736 2003-01-30 Miguel de Icaza <miguel@ximian.com>
17738 * class.cs: Handle error 549: do not allow virtual methods in
17741 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
17743 * decl.cs: Check access levels when resolving types
17745 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
17747 * statement.cs: Add parameters and locals set in catch blocks that might
17748 return to set vector
17750 2003-01-29 Miguel de Icaza <miguel@ximian.com>
17752 * class.cs (Operator): Set the SpecialName flags for operators.
17754 * expression.cs (Invocation.DoResolve): Only block calls to
17755 accessors and operators on SpecialName methods.
17757 (Cast.TryReduce): Handle conversions from char constants.
17760 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
17762 * statement.cs: small memory and time optimization in FlowBranching.
17764 2003-01-28 Pedro Mart <yoros@wanadoo.es>
17766 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
17767 problem that the last fix but in the other sid (Set).
17769 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
17770 access when there is no indexer in the hierarchy.
17772 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
17774 * class.cs: Combine some if statements.
17776 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17778 * driver.cs: fixed bug #37187.
17780 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
17782 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
17783 any indexer, it's needed to build a list with all the indexers in the
17784 hierarchy (AllGetters), else we have problems. Fixes #35653.
17786 2003-01-23 Miguel de Icaza <miguel@ximian.com>
17788 * class.cs (MethodData.Define): It is wrong for an interface
17789 implementation to be static in both cases: explicit and implicit.
17790 We were only handling this in one case.
17792 Improve the if situation there to not have negations.
17794 * class.cs (Field.Define): Turns out that we do not need to check
17795 the unsafe bit on field definition, only on usage. Remove the test.
17797 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17799 * driver.cs: use assembly.Location instead of Codebase (the latest
17800 patch made mcs fail when using MS assemblies).
17802 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
17804 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
17805 get the path to *corlib.dll.
17807 2003-01-21 Nick Drochak <ndrochak@gol.com>
17811 * typemanager.cs: Remove compiler warnings
17813 2003-01-20 Duncan Mak <duncan@ximian.com>
17815 * AssemblyInfo.cs: Bump the version number to 0.19.
17817 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17819 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
17821 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
17823 * class.cs (Constructor::Emit): Emit debugging info for constructors.
17825 2003-01-17 Miguel de Icaza <miguel@ximian.com>
17827 * cs-parser.jay: Small fix: we were not comparing the constructor
17828 name correctly. Thanks to Zoltan for the initial pointer.
17830 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
17832 * cs-tokenizer.cs: Set file name when specified with #line
17834 2003-01-15 Miguel de Icaza <miguel@ximian.com>
17836 * cs-parser.jay: Only perform the constructor checks here if we
17837 are named like the class; This will help provider a better
17838 error. The constructor path is taken when a type definition is
17839 not found, but most likely the user forgot to add the type, so
17840 report that rather than the constructor error.
17842 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
17844 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
17847 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17849 * cs-parser.jay: Add cleanup call.
17851 2003-01-13 Duncan Mak <duncan@ximian.com>
17853 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
17854 consistent with other methods.
17856 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17858 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
17860 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
17862 * attribute.cs: only set GuidAttr to true when we have a
17865 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17869 * typemanager.cs: fixes to allow mcs compile corlib with the new
17870 Type.IsSubclassOf fix.
17872 2003-01-08 Miguel de Icaza <miguel@ximian.com>
17874 * expression.cs (LocalVariableReference.DoResolve): Classify a
17875 constant as a value, not as a variable. Also, set the type for
17878 * cs-parser.jay (fixed_statement): take a type instead of a
17879 pointer_type, so we can produce a better error message later.
17881 * statement.cs (Fixed.Resolve): Flag types that are not pointers
17884 (For.DoEmit): Make inifinite loops have a
17885 non-conditional branch back.
17887 (Fixed.DoEmit): First populate the pinned variables, then emit the
17888 statement, then clear the variables. Before I was emitting the
17889 code once for each fixed piece.
17892 2003-01-08 Martin Baulig <martin@ximian.com>
17894 * statement.cs (FlowBranching.MergeChild): A break in a
17895 SWITCH_SECTION does not leave a loop. Fixes #36155.
17897 2003-01-08 Martin Baulig <martin@ximian.com>
17899 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
17900 lives in the same number space than `param_map'. Fixes #36154.
17902 2003-01-07 Miguel de Icaza <miguel@ximian.com>
17904 * cs-parser.jay (constructor_declaration): Set the
17905 Constructor.ModFlags before probing for it. This makes the
17906 compiler report 514, 515 and 132 (the code was there, but got
17909 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
17910 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
17911 (GotoCase.Resolve): Set `Returns' to ALWAYS.
17913 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
17915 * enum.cs: create the enum static fields using the enum type.
17917 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
17919 * class.cs: don't try to create the ParamBuilder for the return
17920 type if it's not needed (and handle it breaking for the ms runtime
17923 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
17925 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
17927 2002-12-29 Miguel de Icaza <miguel@ximian.com>
17929 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
17930 the command. This showed up while compiling the JANET source
17931 code, which used \r as its only newline separator.
17933 2002-12-28 Miguel de Icaza <miguel@ximian.com>
17935 * class.cs (Method.Define): If we are an operator (because it
17936 reuses our code), then set the SpecialName and HideBySig. #36128
17938 2002-12-22 Miguel de Icaza <miguel@ximian.com>
17940 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
17941 exception, report error 120 `object reference required'.
17943 * driver.cs: Add --pause option, used during to measure the size
17944 of the process as it goes with --timestamp.
17946 * expression.cs (Invocation.DoResolve): Do not allow methods with
17947 SpecialName to be invoked.
17949 2002-12-21 Miguel de Icaza <miguel@ximian.com>
17951 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
17952 number before adding it.
17954 2002-12-21 Ravi Pratap <ravi@ximian.com>
17956 * ecore.cs (StandardImplicitConversion): When in an unsafe
17957 context, we allow conversion between void * to any other pointer
17958 type. This fixes bug #35973.
17960 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
17962 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
17963 is not thrown when extensionless outputs are used
17965 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17967 * rootcontext.cs: fixed compilation of corlib.
17969 2002-12-19 Miguel de Icaza <miguel@ximian.com>
17971 * attribute.cs (Attributes.Contains): Add new method.
17973 * class.cs (MethodCore.LabelParameters): if the parameter is an
17974 `out' parameter, check that no attribute `[In]' has been passed.
17976 * enum.cs: Handle the `value__' name in an enumeration.
17978 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
17980 * decl.cs: Added special case to allow overrides on "protected
17983 2002-12-18 Ravi Pratap <ravi@ximian.com>
17985 * attribute.cs (Attributes.AddAttributeSection): Rename to this
17986 since it makes much more sense.
17988 (Attributes.ctor): Don't require a Location parameter.
17990 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
17992 * attribute.cs (ApplyAttributes): Remove extra Location parameters
17993 since we already have that information per attribute.
17995 * everywhere : make appropriate changes.
17997 * class.cs (LabelParameters): Write the code which actually
17998 applies attributes to the return type. We can't do this on the MS
17999 .NET runtime so we flag a warning in the case an exception is
18002 2002-12-18 Miguel de Icaza <miguel@ximian.com>
18004 * const.cs: Handle implicit null conversions here too.
18006 2002-12-17 Ravi Pratap <ravi@ximian.com>
18008 * class.cs (MethodCore.LabelParameters): Remove the extra
18009 Type [] parameter since it is completely unnecessary. Instead
18010 pass in the method's attributes so that we can extract
18011 the "return" attribute.
18013 2002-12-17 Miguel de Icaza <miguel@ximian.com>
18015 * cs-parser.jay (parse): Use Report.Error to flag errors instead
18016 of ignoring it and letting the compile continue.
18018 * typemanager.cs (ChangeType): use an extra argument to return an
18019 error condition instead of throwing an exception.
18021 2002-12-15 Miguel de Icaza <miguel@ximian.com>
18023 * expression.cs (Unary.TryReduce): mimic the code for the regular
18024 code path. Perform an implicit cast in the cases where we can
18025 implicitly convert to one of the integral types, and then reduce
18026 based on that constant. This fixes bug #35483.
18028 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18030 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
18032 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18034 * namespace.cs: fixed bug #35489.
18036 2002-12-12 Miguel de Icaza <miguel@ximian.com>
18038 * class.cs: Remove some dead code.
18040 * cs-parser.jay: Estimate the number of methods needed
18041 (RootContext.MethodCount);
18043 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
18044 numbers instead of StringBuilders.
18046 * support.cs (PtrHashtable): Add constructor with initial size;
18047 We can now reduce reallocations of the method table.
18049 2002-12-10 Ravi Pratap <ravi@ximian.com>
18051 * attribute.cs (ApplyAttributes): Keep track of the emitted
18052 attributes on a per-target basis. This fixes bug #35413.
18054 2002-12-10 Miguel de Icaza <miguel@ximian.com>
18056 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
18057 default to the Windows 1252 encoding.
18059 (UnixParseOption): Support version, thanks to Alp for the missing
18062 * AssemblyInfo.cs: Add nice assembly information.
18064 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
18067 * cs-parser.jay: Allow a trailing comma before the close bracked
18068 in the attribute_section production.
18070 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
18071 address of the instance was being taken, I will take this out,
18072 because we take the address of the object immediately here.
18074 2002-12-09 Ravi Pratap <ravi@ximian.com>
18076 * typemanager.cs (AreMultipleAllowed): Take care of the most
18077 obvious case where attribute type is not in the current assembly -
18080 2002-12-08 Miguel de Icaza <miguel@ximian.com>
18082 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
18083 definitions, instead of doing that afterwards.
18085 Also we use a nice little hack, depending on the constructor, we
18086 know if we are a "composed" name or a simple name. Hence, we
18087 avoid the IndexOf test, and we avoid
18089 * codegen.cs: Add code to assist in a bug reporter to track down
18090 the source of a compiler crash.
18092 2002-12-07 Ravi Pratap <ravi@ximian.com>
18094 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
18095 types have been emitted for a given element and flag an error
18096 if something which does not have AllowMultiple set is used more
18099 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
18100 attribute types and their corresponding AllowMultiple properties
18102 (AreMultipleAllowed): Check the property for a given type.
18104 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
18105 property in the case we have a TypeContainer.
18107 (Attributes.AddAttribute): Detect duplicates and just skip on
18108 adding them. This trivial fix catches a pretty gross error in our
18109 attribute emission - global attributes were being emitted twice!
18111 Bugzilla bug #33187 is now fixed.
18113 2002-12-06 Miguel de Icaza <miguel@ximian.com>
18115 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
18116 instead of pp_and).
18118 * expression.cs (Binary.ResolveOperator): I can only use the
18119 Concat (string, string, string) and Concat (string, string,
18120 string, string) if the child is actually a concatenation of
18123 2002-12-04 Miguel de Icaza <miguel@ximian.com>
18125 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
18126 context where we need a 2-character lookahead.
18128 * pending.cs (PendingImplementation): Rework so we can keep track
18129 of interface types all the time, and flag those which were
18130 implemented by parents as optional.
18132 2002-12-03 Miguel de Icaza <miguel@ximian.com>
18134 * expression.cs (Binary.ResolveOperator): Use
18135 String.Concat(string,string,string) or
18136 String.Concat(string,string,string,string) when possible.
18138 * typemanager: More helper methods.
18141 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
18143 * pending.cs: remove the bogus return from GetMissingInterfaces()
18144 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
18146 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18148 * namespace.cs: avoid duplicated 'using xxx' being added to
18149 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
18150 when we get more than one 'using' statement for the same namespace.
18151 Report a CS0105 warning for it.
18153 2002-11-30 Miguel de Icaza <miguel@ximian.com>
18155 * cs-tokenizer.cs (consume_identifier): use read directly, instead
18156 of calling getChar/putback, uses internal knowledge of it.
18158 (xtoken): Reorder tokenizer so most common patterns are checked
18159 first. This reduces the compilation time in another 5% (from 8.11s
18160 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
18162 The parsing time is 22% of the compilation in mcs, and from that
18163 64% is spent on the tokenization process.
18165 I tried using a binary search for keywords, but this is slower
18166 than the hashtable. Another option would be to do a couple of
18169 * Not use a StringBuilder, instead use an array of chars,
18170 with a set value. Notice that this way we could catch
18171 the 645 error without having to do it *afterwards*.
18173 * We could write a hand-parser to avoid the hashtable
18174 compares altogether.
18176 The identifier consumption process takes 37% of the tokenization
18177 time. Another 15% is spent on is_number. 56% of the time spent
18178 on is_number is spent on Int64.Parse:
18180 * We could probably choose based on the string length to
18181 use Int32.Parse or Int64.Parse and avoid all the 64-bit
18184 Another 3% is spend on wrapping `xtoken' in the `token' function.
18186 Handle 0xa0 as whitespace (#34752)
18188 2002-11-26 Miguel de Icaza <miguel@ximian.com>
18190 * typemanager.cs (IsCLRType): New routine to tell whether a type
18191 is one of the builtin types.
18193 Maybe it needs to use TypeCodes to be faster. Maybe we could use
18194 typecode in more places instead of doing pointer comparissions.
18195 We could leverage some knowledge about the way the typecodes are
18198 New code to cache namespaces in assemblies, it is currently not
18199 invoked, to be used soon.
18201 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
18203 * expression.cs (Binary.ResolveOperator): specially handle
18204 strings, and do not perform user-defined operator overloading for
18207 2002-11-24 Miguel de Icaza <miguel@ximian.com>
18209 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
18210 internalcall as it is a pretty simple operation; Avoid whenever
18211 possible to call Char.IsLetter.
18213 (consume_identifier): Cut by half the number of
18214 hashtable calls by merging the is_keyword and GetKeyword behavior.
18216 Do not short-circuit, because if we do, we
18217 report errors (ie, #if false && true would produce an invalid
18221 2002-11-24 Martin Baulig <martin@ximian.com>
18223 * expression.cs (Cast.TryReduce): If we're in checked syntax,
18224 check constant ranges and report a CS0221. Fixes #33186.
18226 2002-11-24 Martin Baulig <martin@ximian.com>
18228 * cs-parser.jay: Make this work for uninitialized variable
18229 declarations in the `for' initializer. Fixes #32416.
18231 2002-11-24 Martin Baulig <martin@ximian.com>
18233 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
18234 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
18236 2002-11-24 Martin Baulig <martin@ximian.com>
18238 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
18239 argument; if true, we also check for user-defined conversions.
18240 This is only needed if both arguments are of a user-defined type.
18241 Fixes #30443, added test-175.cs.
18242 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
18244 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
18246 2002-11-24 Martin Baulig <martin@ximian.com>
18248 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
18249 function to get the store opcode.
18250 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
18251 only emit the Ldelema if the store opcode is Stobj. You must run
18252 both test-34 and test-167 to test this. Fixes #34529.
18254 2002-11-23 Martin Baulig <martin@ximian.com>
18256 * ecore.cs (Expression.MemberLookup): Added additional
18257 `qualifier_type' argument which is used when we're being called
18258 from MemberAccess.DoResolve() and null if we're called from a
18260 (Expression.MemberLookupFailed): New method to report errors; this
18261 does the CS1540 check and reports the correct error message.
18263 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
18264 argument for the CS1540 check and redone the way how we're dealing
18265 with private members. See the comment in the source code for details.
18266 (FilterWithClosure): Reverted this back to revision 1.197; renamed
18267 `closure_start_type' to `closure_qualifier_type' and check whether
18268 it's not null. It was not this filter being broken, it was just
18269 being called with the wrong arguments.
18271 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
18272 and pass it the correct `qualifier_type'; this also does the error
18275 2002-11-22 Miguel de Icaza <miguel@ximian.com>
18277 * expression.cs (Invocation.EmitParams): If the we are dealing
18278 with a non-built-in value type, load its address as well.
18280 (ArrayCreation): Use a a pretty constant instead
18281 of the hardcoded value 2. Use 6 instead of 2 for the number of
18282 static initializers.
18284 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
18285 because they are not really value types, just glorified integers.
18287 * driver.cs: Do not append .exe, the CSC compiler does not do it.
18289 * ecore.cs: Remove redundant code for enumerations, make them use
18290 the same code path as everything else, fixes the casting issue
18291 with enumerations in Windows.Forms.
18293 * attribute.cs: Do only cast to string if it is a string, the
18294 validation happens later.
18296 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
18297 people upgrade their corlibs.
18299 * ecore.cs: Oops, enumerations were not following the entire code path
18301 2002-11-21 Miguel de Icaza <miguel@ximian.com>
18303 * typemanager.cs (FilterWithClosure): Commented out the test for
18304 1540 in typemanager.cs, as it has problems when accessing
18305 protected methods from a parent class (see test-174.cs).
18307 * attribute.cs (Attribute.ValidateGuid): new method.
18308 (Attribute.Resolve): Use above.
18310 2002-11-19 Miguel de Icaza <miguel@ximian.com>
18312 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
18314 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
18315 handling for enumerations, as we only needed the TypeContainer
18316 functionality to begin with (this is required for the fix below to
18317 work for enums that reference constants in a container class for
18320 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
18322 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
18323 a valid TypeBuilder to perform lookups on.o
18325 * class.cs (InheritableMemberSignatureCompare): Use true in the
18326 call to GetGetMethod and GetSetMethod, because we are comparing
18327 the signature, and we need to get the methods *even* if they are
18330 (PropertyBase.CheckBase): ditto.
18332 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
18333 GotoCase.Resolve): Use Peel on EmpytCasts.
18335 * ecore.cs (EmptyCast): drop child, add Peel method.
18337 2002-11-17 Martin Baulig <martin@ximian.com>
18339 * ecore.cs (EmptyCast.Child): New public property.
18341 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
18342 label resolved to an EmptyCast. Fixes #34162.
18343 (GotoCase.Resolve): Likewise.
18344 (Block.EmitMeta): Likewise.
18346 2002-11-17 Martin Baulig <martin@ximian.com>
18348 * expression.cs (Invocation.BetterConversion): Prefer int over
18349 uint; short over ushort; long over ulong for integer literals.
18350 Use ImplicitConversionExists instead of StandardConversionExists
18351 since we also need to check for user-defined implicit conversions.
18352 Fixes #34165. Added test-173.cs.
18354 2002-11-16 Martin Baulig <martin@ximian.com>
18356 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
18357 with the `true' and `false' literals. Fixes #33151.
18359 2002-11-16 Martin Baulig <martin@ximian.com>
18361 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
18362 October 22nd; don't do the cs1540 check for static members.
18364 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
18365 now using our own filter here and doing the cs1540 check again.
18367 2002-11-16 Martin Baulig <martin@ximian.com>
18369 * support.cs (InternalParameters): Don't crash if we don't have
18370 any fixed parameters. Fixes #33532.
18372 2002-11-16 Martin Baulig <martin@ximian.com>
18374 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
18375 when looking up static methods to make this work on Windows.
18378 2002-11-16 Martin Baulig <martin@ximian.com>
18380 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
18381 a setter rather than using PropertyInfo.CanWrite.
18383 2002-11-15 Nick Drochak <ndrochak@gol.com>
18385 * class.cs: Allow acces to block member by subclasses. Fixes build
18388 2002-11-14 Martin Baulig <martin@ximian.com>
18390 * class.cs (Constructor.Emit): Added the extern/block check.
18393 2002-11-14 Martin Baulig <martin@ximian.com>
18395 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
18396 iteration while looking for indexers, this is needed because the
18397 indexer may have a different name in our base classes. Fixed the
18398 error reporting (no indexers at all, not get accessor, no
18399 overloaded match). Fixes bug #33089.
18400 (IndexerAccess.DoResolveLValue): Likewise.
18402 2002-11-14 Martin Baulig <martin@ximian.com>
18404 * class.cs (PropertyBase.CheckBase): Make this work for multiple
18405 indexers. Fixes the first part of bug #33089.
18406 (MethodSignature.InheritableMemberSignatureCompare): Added support
18409 2002-11-13 Ravi Pratap <ravi@ximian.com>
18411 * attribute.cs (Attribute.Resolve): Catch the
18412 NullReferenceException and report it since it isn't supposed to
18415 2002-11-12 Miguel de Icaza <miguel@ximian.com>
18417 * expression.cs (Binary.EmitBranchable): Also handle the cases for
18418 LogicalOr and LogicalAnd that can benefit from recursively
18419 handling EmitBranchable. The code now should be nice for Paolo.
18421 2002-11-08 Miguel de Icaza <miguel@ximian.com>
18423 * typemanager.cs (LookupType): Added a negative-hit hashtable for
18424 the Type lookups, as we perform quite a number of lookups on
18425 non-Types. This can be removed once we can deterministically tell
18426 whether we have a type or a namespace in advance.
18428 But this might require special hacks from our corlib.
18432 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
18433 and double which avoids a conversion from an integer to a double.
18435 * expression.cs: tiny optimization, avoid calling IsConstant,
18436 because it effectively performs the lookup twice.
18438 2002-11-06 Miguel de Icaza <miguel@ximian.com>
18440 But a bogus return here to keep the semantics of the old code
18441 until the Mono runtime is fixed.
18443 * pending.cs (GetMissingInterfaces): New method used to remove all
18444 the interfaces that are already implemented by our parent
18445 classes from the list of pending methods.
18447 * interface.cs: Add checks for calls after ResolveTypeExpr.
18449 2002-11-05 Miguel de Icaza <miguel@ximian.com>
18451 * class.cs (Class.Emit): Report warning 67: event not used if the
18452 warning level is beyond 3.
18454 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
18455 being a NullLiteral.
18457 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
18460 * class.cs (TypeContainer.GetClassBases): Cover a missing code
18461 path that might fail if a type can not be resolved.
18463 * expression.cs (Binary.Emit): Emit unsigned versions of the
18466 * driver.cs: use error 5.
18468 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
18470 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
18472 2002-11-01 Miguel de Icaza <miguel@ximian.com>
18474 * cs-parser.jay (switch_section): A beautiful patch from Martin
18475 Baulig that fixed 33094.
18477 2002-10-31 Miguel de Icaza <miguel@ximian.com>
18479 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
18480 Check whether the base is abstract and report an error if so.
18482 * expression.cs (IndexerAccess.DoResolveLValue,
18483 IndexerAccess.DoResolve): ditto.
18485 (Invocation.DoResolve): ditto.
18487 (Invocation.FullMethodDesc): Improve the report string.
18489 * statement.cs (Block): Eliminate IsVariableDefined as it is
18490 basically just a wrapper for GetVariableInfo.
18492 * ecore.cs (SimpleName): Use new
18494 * support.cs (ReflectionParamter.ParameterType): We unwrap the
18495 type, as we return the actual parameter ref/unref state on a
18498 2002-10-30 Miguel de Icaza <miguel@ximian.com>
18500 * support.cs: Return proper flags REF/OUT fixing the previous
18503 * expression.cs: Reverted last patch, that was wrong. Is_ref is
18504 not used to mean `ref' but `ref or out' in ParameterReference
18506 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
18507 full type signature instead of calling TypeManger.CSharpName
18510 * support.cs (InternalParameters.ParameterDesc): Do not compare
18511 directly to the modflags, because REF/OUT will actually be bitsets
18514 * delegate.cs (VerifyMethod): Check also the modifiers.
18516 * cs-tokenizer.cs: Fix bug where floating point values with an
18517 exponent where a sign was missing was ignored.
18519 * driver.cs: Allow multiple assemblies to be specified in a single
18522 2002-10-28 Miguel de Icaza <miguel@ximian.com>
18524 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
18525 because identifiers after a parenthesis would end up in this kind
18526 of production, and we needed to desamiguate it for having casts
18529 (UserDefinedType *) xxx
18531 2002-10-24 Miguel de Icaza <miguel@ximian.com>
18533 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
18534 we should set on the Bindingflags.NonPublic, but not turn on
18535 private_ok. private_ok controls whether a Private member is
18536 returned (this is chekced on the filter routine), while the
18537 BindingFlags.NonPublic just controls whether private/protected
18538 will be allowed. This fixes the problem part of the problem of
18539 private properties being allowed to be used in derived classes.
18541 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
18542 so we can call the children DoResolveLValue method (this will
18543 properly signal errors on lvalue assignments to base properties)
18545 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
18546 getter are null, and we have a property info, we know that this
18547 happened because the lookup failed, so we report an error 122 for
18548 protection level violation.
18550 We also silently return if setter and getter are null in the
18551 resolve functions, this condition only happens if we have flagged
18552 the error before. This is the other half of the problem.
18554 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
18555 not have accessibility information, that is why we were returning
18556 true in the filter function in typemanager.cs.
18558 To properly report 122 (property is inaccessible because of its
18559 protection level) correctly, we report this error in ResolveAccess
18560 by failing if both the setter and the getter are lacking (ie, the
18563 DoResolve and DoLResolve have been modified to check for both
18564 setter/getter being null and returning silently, the reason being
18565 that I did not want to put the knowledge about this error in upper
18568 int old = Report.Errors;
18569 x = new PropertyExpr (...);
18570 if (old != Report.Errors)
18575 So the property expr is returned, but it is invalid, so the error
18576 will be flagged during the resolve process.
18578 * class.cs: Remove InheritablePropertySignatureCompare from the
18579 class, as we no longer depend on the property signature to compute
18580 whether it is possible to implement a method or not.
18582 The reason is that calling PropertyInfo.GetGetMethod will return
18583 null (in .NET, in Mono it works, and we should change this), in
18584 cases where the Get Method does not exist in that particular
18589 class X { public virtual int A { get { return 1; } } }
18591 class Z : Y { public override int A { get { return 2; } } }
18593 Would fail in Z because the parent (Y) would not have the property
18594 defined. So we avoid this completely now (because the alternative
18595 fix was ugly and slow), and we now depend exclusively on the
18598 (PropertyBase.CheckBase): Use a method-base mechanism to find our
18599 reference method, instead of using the property.
18601 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
18602 routines are gone now.
18604 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
18605 names, they were incorrectly named.
18607 * cs-tokenizer.cs: Return are more gentle token on failure.
18609 * pending.cs (PendingImplementation.InterfaceMethod): This routine
18610 had an out-of-sync index variable, which caused it to remove from
18611 the list of pending methods the wrong method sometimes.
18613 2002-10-22 Miguel de Icaza <miguel@ximian.com>
18615 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
18616 CanWrite, because those refer to this particular instance of the
18617 property, and do not take into account the fact that we can
18618 override single members of a property.
18620 Constructor requires an EmitContext. The resolution process does
18621 not happen here, but we need to compute the accessors before,
18622 because the resolution does not always happen for properties.
18624 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
18625 subclass, before we did not update this flag, but we did update
18628 (GetAccessors): Drop this routine, as it did not work in the
18629 presence of partially overwritten set/get methods.
18631 Notice that this broke the cs1540 detection, but that will require
18634 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18638 * driver.cs: issue a warning instead of an error if we don't support
18639 debugging for the platform. Also ignore a couple of errors that may
18640 arise when trying to write the symbols. Undo my previous patch.
18642 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18644 * driver.cs: ignore /debug switch except for Unix platforms.
18646 2002-10-23 Nick Drochak <ndrochak@gol.com>
18648 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
18650 2002-10-21 Miguel de Icaza <miguel@ximian.com>
18652 * driver.cs: Do not make mcs-debug conditional, so we do not break
18653 builds that use it.
18655 * statement.cs (UsageVector.MergeChildren): I would like Martin to
18656 review this patch. But basically after all the children variables
18657 have been merged, the value of "Breaks" was not being set to
18658 new_breaks for Switch blocks. I think that it should be set after
18659 it has executed. Currently I set this to the value of new_breaks,
18660 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
18661 conservative, but I do not understand this code very well.
18663 I did not break anything in the build, so that is good ;-)
18665 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
18667 2002-10-20 Mark Crichton <crichton@gimp.org>
18669 * cfold.cs: Fixed compile blocker. Really fixed it this time.
18671 2002-10-20 Nick Drochak <ndrochak@gol.com>
18673 * cfold.cs: Fixed compile blocker.
18675 2002-10-20 Miguel de Icaza <miguel@ximian.com>
18677 * driver.cs: I was chekcing the key, not the file.
18679 2002-10-19 Ravi Pratap <ravi@ximian.com>
18681 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
18682 message that we were generating - we just need to silently return
18685 2002-10-19 Miguel de Icaza <miguel@ximian.com>
18687 * class.cs (Event.Define): Change my previous commit, as this
18688 breaks the debugger. This is a temporary hack, as it seems like
18689 the compiler is generating events incorrectly to begin with.
18691 * expression.cs (Binary.ResolveOperator): Added support for
18692 "U operator - (E x, E y)"
18694 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
18697 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
18698 init-only variables, but this path did not take into account that
18699 there might be also instance readonly variables. Correct this
18702 This fixes bug 32253
18704 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
18707 * driver.cs: Change the extension for modules to `netmodule'
18709 * cs-parser.jay: Improved slightly the location tracking for
18710 the debugger symbols.
18712 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
18713 modifiers that were specified instead of the hardcoded value
18714 (FamAndAssem). This was basically ignoring the static modifier,
18715 and others. Fixes 32429.
18717 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
18718 fixed a bug in the process (32476)
18720 * expression.cs (ArrayAccess.EmitAssign): Patch from
18721 hwang_rob@yahoo.ca that fixes bug 31834.3
18723 2002-10-18 Miguel de Icaza <miguel@ximian.com>
18725 * driver.cs: Make the module extension .netmodule.
18727 2002-10-16 Miguel de Icaza <miguel@ximian.com>
18729 * driver.cs: Report an error if the resource file is not found
18730 instead of crashing.
18732 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
18733 false, like Emit does.
18735 2002-10-16 Nick Drochak <ndrochak@gol.com>
18737 * typemanager.cs: Remove unused private member. Also reported mcs
18738 bug to report this as a warning like csc.
18740 2002-10-15 Martin Baulig <martin@gnome.org>
18742 * statement.cs (Statement.Emit): Made this a virtual method; emits
18743 the line number info and calls DoEmit().
18744 (Statement.DoEmit): New protected abstract method, formerly knows
18745 as Statement.Emit().
18747 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
18749 2002-10-11 Miguel de Icaza <miguel@ximian.com>
18751 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
18752 have fixed a remaining problem: not every AddXXXX was adding a
18753 fully qualified name.
18755 Now everyone registers a fully qualified name in the DeclSpace as
18756 being defined instead of the partial name.
18758 Downsides: we are slower than we need to be due to the excess
18759 copies and the names being registered this way.
18761 The reason for this is that we currently depend (on the corlib
18762 bootstrap for instance) that types are fully qualified, because
18763 we dump all the types in the namespace, and we should really have
18764 types inserted into the proper namespace, so we can only store the
18765 basenames in the defined_names array.
18767 2002-10-10 Martin Baulig <martin@gnome.org>
18769 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
18770 from bug #31834, see the bug report for a testcase which is
18773 2002-10-10 Martin Baulig <martin@gnome.org>
18775 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
18776 flow analysis code for this.
18778 * statement.cs (Do, While, For): Tell the flow analysis code about
18780 (FlowBranching.UsageVector): Added support for infinite loops.
18781 (Block.Resolve): Moved the dead code elimination here and use flow
18784 2002-10-09 Miguel de Icaza <miguel@ximian.com>
18786 * class.cs (Field.Define): Catch cycles on struct type
18789 * typemanager.cs (IsUnmanagedtype): Do not recursively check
18790 fields if the fields are static. We only need to check instance
18793 * expression.cs (As.DoResolve): Test for reference type.
18795 * statement.cs (Using.ResolveExpression): Use
18796 ConvertImplicitRequired, not ConvertImplicit which reports an
18798 (Using.ResolveLocalVariableDecls): ditto.
18800 * expression.cs (Binary.ResolveOperator): Report errors in a few
18801 places where we had to.
18803 * typemanager.cs (IsUnmanagedtype): Finish implementation.
18805 2002-10-08 Miguel de Icaza <miguel@ximian.com>
18807 * expression.cs: Use StoreFromPtr instead of extracting the type
18808 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
18810 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
18811 an enumeration value to a System.Enum, but System.Enum is not a
18812 value type, but an class type, so we need to box.
18814 (Expression.ConvertExplicit): One codepath could return
18815 errors but not flag them. Fix this. Fixes #31853
18817 * parameter.cs (Resolve): Do not allow void as a parameter type.
18819 2002-10-06 Martin Baulig <martin@gnome.org>
18821 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
18822 if it's a class type and not a struct. Fixes #31815.
18824 2002-10-06 Martin Baulig <martin@gnome.org>
18826 * statement.cs: Reworked the flow analysis code a bit to make it
18827 usable for dead code elimination.
18829 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18831 * cs-parser.jay: allow empty source files. Fixes bug #31781.
18833 2002-10-04 Miguel de Icaza <miguel@ximian.com>
18835 * expression.cs (ComposedCast.DoResolveType): A quick workaround
18836 to fix the test 165, will investigate deeper.
18838 2002-10-04 Martin Baulig <martin@gnome.org>
18840 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
18841 finally blocks actually work.
18842 (Try.Resolve): We don't need to create a sibling for `finally' if
18843 there is no finally block.
18845 2002-10-04 Martin Baulig <martin@gnome.org>
18847 * class.cs (Constructor.Define): The default accessibility for a
18848 non-default constructor is private, not public.
18850 2002-10-04 Miguel de Icaza <miguel@ximian.com>
18852 * class.cs (Constructor): Make AllowedModifiers public, add
18855 * cs-parser.jay: Perform the modifiers test here, as the
18856 constructor for the Constructor class usually receives a zero
18857 because of the way we create it (first we create, later we
18858 customize, and we were never checking the modifiers).
18860 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
18861 is a version of LookupTypeReflection that includes the type-name
18862 cache. This can be used as a fast path for functions that know
18863 the fully qualified name and are only calling into *.GetType() to
18864 obtain a composed type.
18866 This is also used by TypeManager.LookupType during its type
18869 (LookupType): We now also track the real type name, as sometimes
18870 we can get a quey for the real type name from things like
18871 ComposedCast. This fixes bug 31422.
18873 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
18874 complete type fullname, it does not have to go through the type
18875 resolution system to obtain the composed version of the type (for
18876 obtaining arrays or pointers).
18878 (Conditional.Emit): Use the EmitBoolExpression to
18879 generate nicer code, as requested by Paolo.
18881 (ArrayCreation.CheckIndices): Use the patch from
18882 hwang_rob@yahoo.ca to validate the array initializers.
18884 2002-10-03 Miguel de Icaza <miguel@ximian.com>
18886 * class.cs (ConstructorInitializer.Emit): simplify code by using
18887 Invocation.EmitCall, and at the same time, fix the bugs in calling
18888 parent constructors that took variable arguments.
18890 * ecore.cs (Expression.ConvertNumericExplicit,
18891 Expression.ImplicitNumericConversion): Remove the code that
18892 manually wrapped decimal (InternalTypeConstructor call is now gone
18895 * expression.cs (Cast.TryReduce): Also handle decimal types when
18896 trying to perform a constant fold on the type.
18898 * typemanager.cs (IsUnmanagedtype): Partially implemented.
18900 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
18901 that only turned off an error report, and did nothing else.
18903 2002-10-02 Miguel de Icaza <miguel@ximian.com>
18905 * driver.cs: Handle and ignore /fullpaths
18907 2002-10-01 Miguel de Icaza <miguel@ximian.com>
18909 * expression.cs (Binary.ResolveOperator): Catch the case where
18910 DoNumericPromotions returns true,
18912 (Binary.DoNumericPromotions): Simplify the code, and the tests.
18914 2002-09-27 Miguel de Icaza <miguel@ximian.com>
18916 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
18919 2002-09-26 Miguel de Icaza <miguel@ximian.com>
18921 * ecore.cs (ConvertNumericExplicit): It is not enough that the
18922 conversion exists, but it is also required that the conversion be
18923 performed. This manifested in "(Type64Enum) 2".
18925 * class.cs (TypeManager.AddMethod): The fix is not to change
18926 AddEnum, because that one was using a fully qualified name (every
18927 DeclSpace derivative does), but to change the AddMethod routine
18928 that was using an un-namespaced name. This now correctly reports
18929 the duplicated name.
18931 Revert patch until I can properly fix it. The issue
18932 is that we have a shared Type space across all namespaces
18933 currently, which is wrong.
18935 Options include making the Namespace a DeclSpace, and merge
18936 current_namespace/current_container in the parser.
18938 2002-09-25 Miguel de Icaza <miguel@ximian.com>
18940 * cs-parser.jay: Improve error reporting when we get a different
18941 kind of expression in local_variable_type and
18942 local_variable_pointer_type.
18944 Propagate this to avoid missleading errors being reported.
18946 * ecore.cs (ImplicitReferenceConversion): treat
18947 TypeManager.value_type as a target just like object_type. As
18952 Is valid, and needs to result in the int 1 being boxed before it
18953 is assigned to the value type v.
18955 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
18956 to validate the enumeration name.
18958 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
18959 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
18960 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
18962 * ecore.cs (TryImplicitIntConversion): When doing an
18963 implicit-enumeration-conversion, check if the type is 64-bits and
18964 perform a conversion before passing to EnumConstant.
18966 2002-09-23 Miguel de Icaza <miguel@ximian.com>
18968 * decl.cs (Error_AmbiguousTypeReference); New routine used to
18969 report ambiguous type references. Unlike the MS version, we
18970 report what the ambiguity is. Innovation at work ;-)
18972 (DeclSpace.FindType): Require a location argument to
18973 display when we display an ambiguous error.
18975 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
18977 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
18979 * expression.cs (EmitDynamicInitializers): Apply patch from
18980 hwang_rob@yahoo.ca that fixes the order in which we emit our
18983 2002-09-21 Martin Baulig <martin@gnome.org>
18985 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
18986 delegate takes no arguments.
18988 2002-09-20 Miguel de Icaza <miguel@ximian.com>
18990 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
18993 * expression.cs: Extract the underlying type.
18995 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
18997 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
18999 2002-09-19 Miguel de Icaza <miguel@ximian.com>
19001 * class.cs (TypeContainer.DefineType): We can not use the nice
19002 PackingSize with the size set to 1 DefineType method, because it
19003 will not allow us to define the interfaces that the struct
19006 This completes the fixing of bug 27287
19008 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
19009 means also structs. This fixes part of the problem.
19010 (Expresion.ImplicitReferenceConversionExists): ditto.
19012 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
19013 error if there were no errors reported during the type lookup
19014 process, to avoid duplicates or redundant errors. Without this
19015 you would get an ambiguous errors plus a type not found. We have
19016 beaten the user enough with the first error.
19018 (DeclSparce.FindType): Emit a warning if we have an ambiguous
19021 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
19022 during the resolution process, stop the lookup, this avoids
19023 repeated error reports (same error twice).
19025 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
19027 * typemanager.cs (LookupType): Redo the type lookup code to match
19028 the needs of System.Reflection.
19030 The issue is that System.Reflection requires references to nested
19031 types to begin with a "+" sign instead of a dot. So toplevel
19032 types look like: "NameSpace.TopLevelClass", and nested ones look
19033 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
19036 2002-09-19 Martin Baulig <martin@gnome.org>
19038 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
19039 says that a method always returns or always throws an exception,
19040 don't report the CS0161.
19042 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
19043 set `Returns = new_returns'.
19045 2002-09-19 Martin Baulig <martin@gnome.org>
19047 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
19048 to an enum constant, check for a CS0176.
19050 2002-09-18 Miguel de Icaza <miguel@ximian.com>
19052 * class.cs (TypeContainer.CheckPairedOperators): Now we check
19053 for operators that must be in pairs and report errors.
19055 * ecore.cs (SimpleName.DoResolveType): During the initial type
19056 resolution process, when we define types recursively, we must
19057 check first for types in our current scope before we perform
19058 lookups in the enclosing scopes.
19060 * expression.cs (MakeByteBlob): Handle Decimal blobs.
19062 (Invocation.VerifyArgumentsCompat): Call
19063 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
19064 I thought we were supposed to always call this, but there are a
19065 few places in the code where we dont do it.
19067 2002-09-17 Miguel de Icaza <miguel@ximian.com>
19069 * driver.cs: Add support in -linkres and -resource to specify the
19070 name of the identifier.
19072 2002-09-16 Miguel de Icaza <miguel@ximian.com>
19074 * ecore.cs (StandardConversionExists): Sync with the conversion
19075 code: allow anything-* to void* conversions.
19077 (FindMostSpecificSource): Use an Expression argument
19078 instead of a Type, because we might be handed over a Literal which
19079 gets a few more implicit conversions that plain types do not. So
19080 this information was being lost.
19082 Also, we drop the temporary type-holder expression when not
19085 2002-09-17 Martin Baulig <martin@gnome.org>
19087 * class.cs (PropertyBase.CheckBase): Don't check the base class if
19088 this is an explicit interface implementation.
19090 2002-09-17 Martin Baulig <martin@gnome.org>
19092 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
19093 different `IndexerName' attributes.
19095 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
19096 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
19097 virtual CommonResolve().
19099 2002-09-16 Miguel de Icaza <miguel@ximian.com>
19101 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
19102 and convert that to the UnderlyingType.
19104 * statement.cs (Foreach.Resolve): Indexers are just like variables
19105 or PropertyAccesses.
19107 * cs-tokenizer.cs (consume_string): Track line numbers and columns
19108 inside quoted strings, we were not doing this before.
19110 2002-09-16 Martin Baulig <martin@gnome.org>
19112 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
19113 resolve it. This is needed for the definite assignment check of the
19114 instance expression, fixes bug #29846.
19115 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
19117 2002-09-16 Nick Drochak <ndrochak@gol.com>
19119 * parameter.cs: Fix compile error. Cannot reference static member
19120 from an instance object. Is this an mcs bug?
19122 2002-09-14 Martin Baulig <martin@gnome.org>
19124 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
19125 multiple times. Fixes bug #30295, added test-166.cs.
19127 2002-09-14 Martin Baulig <martin@gnome.org>
19129 * statement.cs (Block.Emit): Don't emit unreachable code.
19130 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
19131 `break' statements.
19132 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
19134 2002-09-14 Martin Baulig <martin@gnome.org>
19136 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
19139 2002-09-14 Martin Baulig <martin@gnome.org>
19141 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
19142 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
19143 be false on the ms runtime.
19145 2002-09-13 Martin Baulig <martin@gnome.org>
19147 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
19148 the CS0038 error message.
19150 2002-09-12 Miguel de Icaza <miguel@ximian.com>
19152 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
19153 constant inside, return it.
19155 2002-09-12 Martin Baulig <martin@gnome.org>
19157 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
19158 implicit conversion can be done between enum types.
19160 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
19161 check whether an implicit conversion to the current enum's UnderlyingType
19162 exists and report an error if not.
19164 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
19165 without debugging support.
19167 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
19168 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
19170 2002-09-12 Martin Baulig <martin@gnome.org>
19172 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
19174 * ecore.cs (IMemberExpr.DeclaringType): New property.
19175 (SimpleName.SimpleNameResolve): Check whether we're accessing a
19176 nonstatic member of an outer type (CS0038).
19178 2002-09-11 Miguel de Icaza <miguel@ximian.com>
19180 * driver.cs: Activate the using-error detector at warning level
19181 4 (at least for MS-compatible APIs).
19183 * namespace.cs (VerifyUsing): Small buglett fix.
19185 * pending.cs (PendingImplementation): pass the container pointer.
19187 * interface.cs (GetMethods): Allow for recursive definition. Long
19188 term, I would like to move every type to support recursive
19189 definitions, not the current ordering mechanism that we have right
19192 The situation is this: Attributes are handled before interfaces,
19193 so we can apply attributes to interfaces. But some attributes
19194 implement interfaces, we will now handle the simple cases
19195 (recursive definitions will just get an error).
19197 * parameter.cs: Only invalidate types at the end if we fail to
19200 2002-09-09 Martin Baulig <martin@gnome.org>
19202 * ecore.cs (PropertyExpr.Emit): Also check for
19203 TypeManager.system_int_array_get_length so this'll also work when
19204 compiling corlib. Fixes #30003.
19206 2002-09-09 Martin Baulig <martin@gnome.org>
19208 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
19209 and throw an exception if we can't get the type's size. Fixed #30040,
19212 2002-09-09 Martin Baulig <martin@gnome.org>
19214 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
19216 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
19217 context. Fixes bug #30027.
19219 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
19220 virtual functions. Fixes bug #30043, added test-164.cs.
19222 2002-09-08 Ravi Pratap <ravi@ximian.com>
19224 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
19226 2002-09-08 Nick Drochak <ndrochak@gol.com>
19228 * driver.cs: Use an object to get the windows codepage since it's not a
19231 2002-09-08 Miguel de Icaza <miguel@ximian.com>
19233 * statement.cs (For.Emit): for infinite loops (test == null)
19234 return whether there is a break inside, not always "true".
19236 * namespace.cs (UsingEntry): New struct to hold the name of the
19237 using definition, the location where it is defined, and whether it
19238 has been used in a successful type lookup.
19240 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
19245 2002-09-06 Ravi Pratap <ravi@ximian.com>
19247 * attribute.cs : Fix incorrect code which relied on catching
19248 a NullReferenceException to detect a null being passed in
19249 where an object was expected.
19251 2002-09-06 Miguel de Icaza <miguel@ximian.com>
19253 * statement.cs (Try): flag the catch variable as assigned
19255 * expression.cs (Cast): Simplified by using ResolveType instead of
19256 manually resolving.
19258 * statement.cs (Catch): Fix bug by using ResolveType.
19260 2002-09-06 Ravi Pratap <ravi@ximian.com>
19262 * expression.cs (BetterConversion): Special case for when we have
19263 a NullLiteral as the argument and we have to choose between string
19264 and object types - we choose string the way csc does.
19266 * attribute.cs (Attribute.Resolve): Catch the
19267 NullReferenceException and report error #182 since the Mono
19268 runtime no more has the bug and having this exception raised means
19269 we tried to select a constructor which takes an object and is
19272 2002-09-05 Ravi Pratap <ravi@ximian.com>
19274 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
19275 message (1502, 1503) when we can't locate a method after overload
19276 resolution. This is much more informative and closes the bug
19279 * interface.cs (PopulateMethod): Return if there are no argument
19280 types. Fixes a NullReferenceException bug.
19282 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
19283 expressions too. Previously we were checking only in one place for
19284 positional arguments leaving out named arguments.
19286 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
19287 type to the enum type is not allowed. Remove code corresponding to
19290 (ConvertNumericExplicit): Allow explicit conversions from
19291 the underlying type to enum type. This precisely follows the spec
19292 and closes a bug filed by Gonzalo.
19294 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19297 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
19299 2002-09-03 Miguel de Icaza <miguel@ximian.com>
19301 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
19302 it was important that we stored the right value after the
19303 reduction in `converted'.
19305 2002-09-04 Martin Baulig <martin@gnome.org>
19307 * location.cs (Location.SymbolDocument): Use full pathnames for the
19310 2002-08-30 Miguel de Icaza <miguel@ximian.com>
19312 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
19313 of the expression resolve mechanism, because that will catch the
19314 SimpleName error failures.
19316 (Conditional): If we can not resolve the
19317 expression, return, do not crash.
19319 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19322 (location): display token name instead of its number.
19324 2002-08-28 Martin Baulig <martin@gnome.org>
19326 * expression.cs (Binary.ResolveOperator): Don't silently return
19327 but return an error if an operator cannot be applied between two
19330 2002-08-28 Martin Baulig <martin@gnome.org>
19332 * class.cs (Constructor.Define): Set the permission attributes
19333 correctly instead of making all constructors public.
19335 2002-08-28 Martin Baulig <martin@gnome.org>
19337 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
19338 for private members before reporting a CS0103; if we find anything,
19341 2002-08-28 Martin Baulig <martin@gnome.org>
19343 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
19344 to check whether `closure_start_type == closure_invocation_type',
19345 we also need to check whether `m.DeclaringType == closure_invocation_type'
19346 before bypassing the permission checks. We might be accessing
19347 protected/private members from the base class.
19348 (TypeManager.RealMemberLookup): Only set private_ok if private
19349 members were requested via BindingFlags.NonPublic.
19351 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
19353 * expression.cs (MemberAccess.ResolveMemberAccess): Set
19354 MethodGroupExpr.IsExplicitImpl if appropriate.
19355 (Invocation.DoResolve): Don't report the CS0120 for explicit
19356 interface implementations.
19358 2002-08-27 Martin Baulig <martin@gnome.org>
19360 * expression.cs (Invocation.DoResolve): If this is a static
19361 method and we don't have an InstanceExpression, we must report
19364 2002-08-25 Martin Baulig <martin@gnome.org>
19366 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
19367 `==' between a valuetype and an object.
19369 2002-08-25 Miguel de Icaza <miguel@ximian.com>
19371 * ecore.cs (TypeExpr): Provide a ToString method.
19373 2002-08-24 Martin Baulig <martin@gnome.org>
19375 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
19376 now called proggie.dbg and it's a binary file.
19378 2002-08-23 Martin Baulig <martin@gnome.org>
19380 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
19382 2002-08-23 Martin Baulig <martin@gnome.org>
19384 * struct.cs (MyStructInfo.ctor): Make this work with empty
19385 structs; it's not allowed to use foreach() on null.
19387 2002-08-23 Martin Baulig <martin@gnome.org>
19389 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
19390 writer the full pathname of the generated assembly.
19392 2002-08-23 Martin Baulig <martin@gnome.org>
19394 * statements.cs (FlowBranching.UsageVector.MergeChildren):
19395 A `finally' block never returns or breaks; improved handling of
19398 2002-08-23 Martin Baulig <martin@gnome.org>
19400 * statement.cs (Throw.Resolve): Allow `throw null'.
19402 2002-08-23 Martin Baulig <martin@gnome.org>
19404 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
19405 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
19406 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
19407 MemberLookup would return a wrong event if this is an explicit
19408 interface implementation and the class has an event with the same
19411 2002-08-23 Martin Baulig <martin@gnome.org>
19413 * statement.cs (Block.AddChildVariableNames): New public method.
19414 (Block.AddChildVariableName): Likewise.
19415 (Block.IsVariableNameUsedInChildBlock): Likewise.
19416 (Block.AddVariable): Check whether a variable name has already
19417 been used in a child block.
19419 * cs-parser.jay (declare_local_variables): Mark all variable names
19420 from the current block as being used in a child block in the
19423 2002-08-23 Martin Baulig <martin@gnome.org>
19425 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
19426 find the symbol writer.
19428 * driver.cs: csc also allows the arguments to /define being
19429 separated by commas, not only by semicolons.
19431 2002-08-23 Martin Baulig <martin@gnome.org>
19433 * interface.cs (Interface.GetMembers): Added static check for events.
19435 2002-08-15 Martin Baulig <martin@gnome.org>
19437 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
19438 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
19440 * ecore.cs (Expression.MemberLookup): Added documentation and explained
19441 why the MethodData.EmitDestructor() change was necessary.
19443 2002-08-20 Martin Baulig <martin@gnome.org>
19445 * class.cs (TypeContainer.FindMembers): Added static check for events.
19447 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
19449 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
19450 use Type.GetEvents(), not Type.FindMembers().
19452 2002-08-20 Martin Baulig <martin@gnome.org>
19454 * decl.cs (MemberCache): Added a special method cache which will
19455 be used for method-only searched. This ensures that a method
19456 search will return a MethodInfo with the correct ReflectedType for
19459 2002-08-20 Martin Baulig <martin@gnome.org>
19461 * decl.cs (DeclSpace.FindMembers): Made this public.
19463 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19465 * delegate.cs: fixed build on windows.
19466 [FIXME: Filed as bug #29150: MCS must report these errors.]
19468 2002-08-19 Ravi Pratap <ravi@ximian.com>
19470 * ecore.cs (StandardConversionExists): Return a false
19471 if we are trying to convert the void type to anything else
19472 since that is not allowed.
19474 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
19475 we flag error 70 in the event an event is trying to be accessed
19476 directly from outside the declaring type.
19478 2002-08-20 Martin Baulig <martin@gnome.org>
19480 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
19481 MemberCache from typemanager.cs to decl.cs.
19483 2002-08-19 Martin Baulig <martin@gnome.org>
19485 * class.cs (TypeContainer): Implement IMemberContainer.
19486 (TypeContainer.DefineMembers): Create the MemberCache.
19487 (TypeContainer.FindMembers): Do better BindingFlags checking; only
19488 return public members if BindingFlags.Public was given, check
19489 whether members are static.
19491 2002-08-16 Martin Baulig <martin@gnome.org>
19493 * decl.cs (DeclSpace.Define): Splitted this in Define and
19494 DefineMembers. DefineMembers is called first and initializes the
19497 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
19498 DefineMembers() on all our DeclSpaces.
19500 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
19501 but call DefineMembers() on all nested interfaces. We call their
19502 Define() in our new Define() function.
19504 * interface.cs (Interface): Implement IMemberContainer.
19505 (Interface.Define): Moved all code except the attribute stuf to
19507 (Interface.DefineMembers): Initialize the member cache.
19509 * typemanager.cs (IMemberFinder): Removed this interface, we don't
19510 need this anymore since we can use MemberCache.FindMembers directly.
19512 2002-08-19 Martin Baulig <martin@gnome.org>
19514 * typemanager.cs (MemberCache): When creating the cache for an
19515 interface type, add all inherited members.
19516 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
19517 to `out bool used_cache' and documented it.
19518 (TypeManager.MemberLookup): If we already used the cache in the first
19519 iteration, we don't need to do the interfaces check.
19521 2002-08-19 Martin Baulig <martin@gnome.org>
19523 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
19524 here from IMemberFinder and don't implement this interface anymore.
19525 (DeclSpace.MemberCache): Moved here from IMemberFinder.
19527 * typemanager.cs (IMemberFinder): This interface is now only used by
19528 classes which actually support the member cache.
19529 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
19530 since we only put DeclSpaces into this Hashtable.
19531 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
19532 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
19534 2002-08-16 Martin Baulig <martin@gnome.org>
19536 * typemanager.cs (ICachingMemberFinder): Removed.
19537 (IMemberFinder.MemberCache): New property.
19538 (TypeManager.FindMembers): Merged this with RealFindMembers().
19539 This function will never be called from TypeManager.MemberLookup()
19540 so we can't use the cache here, just the IMemberFinder.
19541 (TypeManager.MemberLookup_FindMembers): Check whether the
19542 IMemberFinder has a MemberCache and call the cache's FindMembers
19544 (MemberCache): Rewrote larger parts of this yet another time and
19545 cleaned it up a bit.
19547 2002-08-15 Miguel de Icaza <miguel@ximian.com>
19549 * driver.cs (LoadArgs): Support quoting.
19551 (Usage): Show the CSC-like command line arguments.
19553 Improved a few error messages.
19555 2002-08-15 Martin Baulig <martin@gnome.org>
19557 * typemanager.cs (IMemberContainer.Type): New property.
19558 (IMemberContainer.IsInterface): New property.
19560 The following changes are conditional to BROKEN_RUNTIME, which is
19561 defined at the top of the file.
19563 * typemanager.cs (MemberCache.MemberCache): Don't add the base
19564 class'es members, but add all members from TypeHandle.ObjectType
19565 if we're an interface.
19566 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
19567 is the current type.
19568 (MemberCache.CacheEntry.Container): Removed this field.
19569 (TypeHandle.GetMembers): Include inherited members.
19571 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19573 * typemanager.cs: fixed compilation and added a comment on a field that
19576 2002-08-15 Martin Baulig <martin@gnome.org>
19578 * class.cs (ConstructorInitializer.Resolve): In the
19579 Expression.MemberLookup call, use the queried_type as
19582 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
19583 declared' attribute, it's always true.
19584 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
19585 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
19586 temporary wrapper for FindMembers which tells MemberLookup whether
19587 members from the base classes are included in the return value.
19588 This will go away soon.
19589 (TypeManager.MemberLookup): Use this temporary hack here; once the
19590 new MemberCache is completed, we don't need to do the DeclaredOnly
19591 looping here anymore since the MemberCache will take care of this.
19592 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
19593 (MemberCache): When creating the MemberCache for a class, get
19594 members from the current class and all its base classes.
19595 (MemberCache.CacheEntry.Container): New field. This is a
19596 temporary hack until the Mono runtime is fixed to distinguish
19597 between ReflectedType and DeclaringType. It allows us to use MCS
19598 with both the MS runtime and the unfixed Mono runtime without
19599 problems and without accecting performance.
19600 (MemberCache.SearchMembers): The DeclaredOnly looping from
19601 TypeManager.MemberLookup is now done here.
19603 2002-08-14 Martin Baulig <martin@gnome.org>
19605 * statement.cs (MyStructInfo.MyStructInfo): Don't call
19606 Type.GetFields on dynamic types but get the fields from the
19607 corresponding TypeContainer.
19608 (MyStructInfo.GetStructInfo): Added check for enum types.
19610 * typemanager.cs (MemberList.IsSynchronized): Implemented.
19611 (MemberList.SyncRoot): Implemented.
19612 (TypeManager.FilterWithClosure): No need to check permissions if
19613 closure_start_type == closure_invocation_type, don't crash if
19614 closure_invocation_type is null.
19616 2002-08-13 Martin Baulig <martin@gnome.org>
19618 Rewrote TypeContainer.FindMembers to use a member cache. This
19619 gives us a speed increase of about 35% for the self-hosting MCS
19620 build and of about 15-20% for the class libs (both on GNU/Linux).
19622 * report.cs (Timer): New class to get enhanced profiling. This
19623 whole class is "TIMER" conditional since it remarkably slows down
19626 * class.cs (MemberList): New class. This is an IList wrapper
19627 which we're now using instead of passing MemberInfo[]'s around to
19628 avoid copying this array unnecessarily.
19629 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
19630 (ICachingMemberFinder, IMemberContainer): New interface.
19631 (TypeManager.FilterWithClosure): If `criteria' is null, the name
19632 has already been checked, otherwise use it for the name comparision.
19633 (TypeManager.FindMembers): Renamed to RealMemberFinder and
19634 provided wrapper which tries to use ICachingMemberFinder.FindMembers
19635 if possible. Returns a MemberList, not a MemberInfo [].
19636 (TypeHandle): New class, implements IMemberContainer. We create
19637 one instance of this class per type, it contains a MemberCache
19638 which is used to do the member lookups.
19639 (MemberCache): New class. Each instance of this class contains
19640 all members of a type and a name-based hash table.
19641 (MemberCache.FindMembers): This is our new member lookup
19642 function. First, it looks up all members of the requested name in
19643 the hash table. Then, it walks this list and sorts out all
19644 applicable members and returns them.
19646 2002-08-13 Martin Baulig <martin@gnome.org>
19648 In addition to a nice code cleanup, this gives us a performance
19649 increase of about 1.4% on GNU/Linux - not much, but it's already
19650 half a second for the self-hosting MCS compilation.
19652 * typemanager.cs (IMemberFinder): New interface. It is used by
19653 TypeManager.FindMembers to call FindMembers on a TypeContainer,
19654 Enum, Delegate or Interface.
19655 (TypeManager.finder_to_member_finder): New PtrHashtable.
19656 (TypeManager.finder_to_container): Removed.
19657 (TypeManager.finder_to_delegate): Removed.
19658 (TypeManager.finder_to_interface): Removed.
19659 (TypeManager.finder_to_enum): Removed.
19661 * interface.cs (Interface): Implement IMemberFinder.
19663 * delegate.cs (Delegate): Implement IMemberFinder.
19665 * enum.cs (Enum): Implement IMemberFinder.
19667 * class.cs (TypeContainer): Implement IMemberFinder.
19669 2002-08-12 Martin Baulig <martin@gnome.org>
19671 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
19673 2002-08-12 Martin Baulig <martin@gnome.org>
19675 * ecore.cs (ITypeExpression): New interface for expressions which
19677 (TypeExpression): Renamed to TypeLookupExpression.
19678 (Expression.DoResolve): If we're doing a types-only lookup, the
19679 expression must implement the ITypeExpression interface and we
19680 call DoResolveType() on it.
19681 (SimpleName): Implement the new ITypeExpression interface.
19682 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
19683 hack, the situation that we're only looking up types can't happen
19684 anymore when this method is called. Moved the type lookup code to
19685 DoResolveType() and call it.
19686 (SimpleName.DoResolveType): This ITypeExpression interface method
19687 is now doing the types-only lookup.
19688 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
19689 (ResolveFlags): Added MaskExprClass.
19691 * expression.cs (MemberAccess): Implement the ITypeExpression
19693 (MemberAccess.DoResolve): Added support for a types-only lookup
19694 when we're called via ITypeExpression.DoResolveType().
19695 (ComposedCast): Implement the ITypeExpression interface.
19697 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
19698 Expression.Resolve() with ResolveFlags.Type instead.
19700 2002-08-12 Martin Baulig <martin@gnome.org>
19702 * interface.cs (Interface.Define): Apply attributes.
19704 * attribute.cs (Attribute.ApplyAttributes): Added support for
19705 interface attributes.
19707 2002-08-11 Martin Baulig <martin@gnome.org>
19709 * statement.cs (Block.Emit): Only check the "this" variable if we
19710 do not always throw an exception.
19712 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
19713 whether the property has a set accessor.
19715 2002-08-11 Martin Baulig <martin@gnome.org>
19717 Added control flow analysis support for structs.
19719 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
19720 with control flow analysis turned off.
19721 (IVariable): New interface.
19722 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
19723 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
19724 (FieldExpr.DoResolve): Resolve the instance expression with flow
19725 analysis turned off and do the definite assignment check after the
19726 resolving when we know what the expression will resolve to.
19728 * expression.cs (LocalVariableReference, ParameterReference):
19729 Implement the new IVariable interface, only call the flow analysis
19730 code if ec.DoFlowAnalysis is true.
19731 (This): Added constructor which takes a Block argument. Implement
19732 the new IVariable interface.
19733 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
19734 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
19735 This does the definite assignment checks for struct members.
19737 * class.cs (Constructor.Emit): If this is a non-static `struct'
19738 constructor which doesn't have any initializer, call
19739 Block.AddThisVariable() to tell the flow analysis code that all
19740 struct elements must be initialized before control returns from
19743 * statement.cs (MyStructInfo): New public class.
19744 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
19745 argument to this indexer. If non-zero, check an individual struct
19746 member, not the whole struct.
19747 (FlowBranching.CheckOutParameters): Check struct members.
19748 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
19749 overloaded versions of these methods which take an additional
19750 `int field_idx' argument to check struct members.
19751 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
19752 overloaded versions of these methods which take an additional
19753 `string field_name' argument to check struct member.s
19754 (VariableInfo): Implement the IVariable interface.
19755 (VariableInfo.StructInfo): New public property. Returns the
19756 MyStructInfo instance of the variable if it's a struct or null.
19757 (Block.AddThisVariable): New public method. This is called from
19758 Constructor.Emit() for non-static `struct' constructor which do
19759 not have any initializer. It creates a special variable for the
19760 "this" instance variable which will be checked by the flow
19761 analysis code to ensure that all of the struct's fields are
19762 initialized before control returns from the constructor.
19763 (UsageVector): Added support for struct members. If a
19764 variable/parameter is a struct with N members, we reserve a slot
19765 in the usage vector for each member. A struct is considered fully
19766 initialized if either the struct itself (slot 0) or all its
19767 members are initialized.
19769 2002-08-08 Martin Baulig <martin@gnome.org>
19771 * driver.cs (Driver.MainDriver): Only report an error CS5001
19772 if there were no compilation errors.
19774 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
19775 `UnsafeContext' property to determine whether the parent is in
19776 unsafe context rather than checking the parent's ModFlags:
19777 classes nested in an unsafe class are unsafe as well.
19779 2002-08-08 Martin Baulig <martin@gnome.org>
19781 * statement.cs (UsageVector.MergeChildren): Distinguish between
19782 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
19783 we return. Added test17() and test18() to test-154.cs.
19785 2002-08-08 Martin Baulig <martin@gnome.org>
19787 * typemanager.cs (TypeManager.FilterWithClosure): If we have
19788 Family access, make sure the invoking type isn't a subclass of the
19789 queried type (that'd be a CS1540).
19791 * ecore.cs (Expression.MemberLookup): Added overloaded version of
19792 this method which takes an additional `Type invocation_type'.
19794 * expression.cs (BaseAccess.DoResolve): Use the base type as
19795 invocation and query type.
19796 (MemberAccess.DoResolve): If the lookup failed and we're about to
19797 report a CS0122, try a lookup with the ec.ContainerType - if this
19798 succeeds, we must report a CS1540.
19800 2002-08-08 Martin Baulig <martin@gnome.org>
19802 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
19803 (MethodGroupExpr): Implement the IMemberExpr interface.
19805 * expression (MemberAccess.ResolveMemberAccess): No need to have
19806 any special code for MethodGroupExprs anymore, they're now
19809 2002-08-08 Martin Baulig <martin@gnome.org>
19811 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
19812 Family, FamANDAssem and FamORAssem permissions.
19813 (TypeManager.IsSubclassOrNestedChildOf): New public method.
19815 2002-08-08 Martin Baulig <martin@gnome.org>
19817 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
19818 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
19821 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
19823 * driver.cs: implemented /resource option to embed managed resources.
19825 2002-08-07 Martin Baulig <martin@gnome.org>
19827 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
19828 (FieldBase.HasFieldInitializer): New public property.
19829 (FieldBase.GetInitializerExpression): New public method. Resolves and
19830 returns the field initializer and makes sure it is only resolved once.
19831 (TypeContainer.EmitFieldInitializers): Call
19832 FieldBase.GetInitializerExpression to get the initializer, this ensures
19833 that it isn't resolved multiple times.
19835 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
19836 the resolving process (SimpleName/MemberLookup) that we're currently
19837 emitting a field initializer (which must not access any instance members,
19838 this is an error CS0236).
19840 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
19841 argument, if the `IsFieldInitializer' flag is set, we must report and
19842 error CS0236 and not an error CS0120.
19844 2002-08-07 Martin Baulig <martin@gnome.org>
19846 * ecore.cs (IMemberExpr): New public interface.
19847 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
19848 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
19849 if the expression is an IMemberExpr.
19851 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
19852 to be null, implicitly default to `this' if we're non-static in
19853 this case. Simplified the code a lot by using the new IMemberExpr
19854 interface. Also fixed bug #28176 here.
19856 2002-08-06 Martin Baulig <martin@gnome.org>
19858 * cs-parser.jay (SimpleLookup): Removed. We need to create
19859 ParameterReferences during semantic analysis so that we can do a
19860 type-only search when resolving Cast, TypeOf and SizeOf.
19861 (block): Pass the `current_local_parameters' to the Block's
19864 * class.cs (ConstructorInitializer): Added `Parameters parameters'
19865 argument to the constructor.
19866 (ConstructorInitializer.Resolve): Create a temporary implicit
19867 block with the parameters.
19869 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
19870 references here if we aren't doing a type-only search.
19872 * statement.cs (Block): Added constructor which takes a
19873 `Parameters parameters' argument.
19874 (Block.Parameters): New public property.
19876 * support.cs (InternalParameters.Parameters): Renamed `parameters'
19877 to `Parameters' and made it public readonly.
19879 2002-08-06 Martin Baulig <martin@gnome.org>
19881 * ecore.cs (Expression.Warning): Made this public as well.
19883 * report.cs (Report.Debug): Print the contents of collections.
19885 2002-08-06 Martin Baulig <martin@gnome.org>
19887 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
19888 used to tell Resolve() which kinds of expressions it may return.
19889 (Expression.Resolve): Added overloaded version of this method which
19890 takes a `ResolveFlags flags' argument. This can be used to tell
19891 Resolve() which kinds of expressions it may return. Reports a
19893 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
19894 ResolveFlags.SimpleName.
19895 (Expression.Error118): Added overloaded version of this method which
19896 takes a `ResolveFlags flags' argument. It uses the flags to determine
19897 which kinds of expressions are allowed.
19899 * expression.cs (Argument.ResolveMethodGroup): New public method.
19900 Resolves an argument, but allows a MethodGroup to be returned.
19901 This is used when invoking a delegate.
19903 * TODO: Updated a bit.
19905 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19907 Fixed compilation with csc.
19909 * ecore.cs: Expression.Error made public. Is this correct? Should
19910 Warning be made public too?
19912 * expression.cs: use ea.Location instead of ea.loc.
19913 [FIXME: Filed as bug #28607: MCS must report these errors.]
19915 2002-08-06 Martin Baulig <martin@gnome.org>
19917 * ecore.cs (Expression.loc): Moved the location here instead of
19918 duplicating it in all derived classes.
19919 (Expression.Location): New public property.
19920 (Expression.Error, Expression.Warning): Made them non-static and
19921 removed the location argument.
19922 (Expression.Warning): Added overloaded version which takes an
19923 `int level' argument.
19924 (Expression.Error118): Make this non-static and removed the
19925 expression and location arguments.
19926 (TypeExpr): Added location argument to the constructor.
19928 * expression.cs (StaticCallExpr): Added location argument to
19930 (Indirection, PointerArithmetic): Likewise.
19931 (CheckedExpr, UnCheckedExpr): Likewise.
19932 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
19933 (StringPtr): Likewise.
19936 2002-08-05 Martin Baulig <martin@gnome.org>
19938 * expression.cs (BaseAccess.DoResolve): Actually report errors.
19940 * assign.cs (Assign.DoResolve): Check whether the source
19941 expression is a value or variable.
19943 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
19944 while resolving the corresponding blocks.
19946 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
19947 an error, don't silently return null.
19949 * statement.cs (Block.AddVariable): Do the error reporting here
19950 and distinguish between CS0128 and CS0136.
19951 (Block.DoResolve): Report all unused labels (warning CS0164).
19952 (LabeledStatement): Pass the location to the constructor.
19953 (LabeledStatement.HasBeenReferenced): New property.
19954 (LabeledStatement.Resolve): Set it to true here.
19956 * statement.cs (Return.Emit): Return success even after reporting
19957 a type mismatch error (CS0126 or CS0127), this is what csc does and
19958 it avoids confusing the users with any consecutive errors.
19960 2002-08-05 Martin Baulig <martin@gnome.org>
19962 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
19964 * const.cs (Const.LookupConstantValue): Catch circular definitions.
19966 * expression.cs (MemberAccess.DoResolve): Silently return if an
19967 error has already been reported.
19969 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
19970 error has already been reported.
19972 2002-08-05 Martin Baulig <martin@gnome.org>
19974 * statement.cs (UsageVector): Only initialize the `parameters'
19975 vector if we actually have any "out" parameters.
19977 2002-08-05 Martin Baulig <martin@gnome.org>
19979 * expression.cs (Binary.ResolveOperator): When combining delegates,
19980 they must have the same type.
19982 2002-08-05 Martin Baulig <martin@gnome.org>
19984 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
19985 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
19986 work with the ms runtime and we also don't need it: if we're a
19987 PropertyBuilder and not in the `indexer_arguments' hash, then we
19988 are a property and not an indexer.
19990 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
19991 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
19992 since the latter one doesn't work with the ms runtime.
19994 2002-08-03 Martin Baulig <martin@gnome.org>
19996 Fixed bugs #27998 and #22735.
19998 * class.cs (Method.IsOperator): New public field.
19999 (Method.CheckBase): Report CS0111 if there's already a method
20000 with the same parameters in the current class. Report CS0508 when
20001 attempting to change the return type of an inherited method.
20002 (MethodData.Emit): Report CS0179 if a method doesn't have a body
20003 and it's not marked abstract or extern.
20004 (PropertyBase): New abstract base class for Property and Indexer.
20005 (PropertyBase.CheckBase): Moved here from Property and made it work
20007 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
20008 the same so we can reuse it there.
20009 (Property, Indexer): Derive from PropertyBase.
20010 (MethodSignature.inheritable_property_signature_filter): New delegate
20011 to find properties and indexers.
20013 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
20014 argument and improved error reporting.
20016 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
20017 EmptyReadOnlyParameters and made it a property.
20019 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
20020 version of this method which takes a `PropertyInfo indexer'.
20021 (TypeManager.RegisterIndexer): New method.
20023 * class.cs: Added myself as author of this file :-)
20025 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20027 * class.cs: fixed compilation on windoze.
20029 2002-08-03 Martin Baulig <martin@gnome.org>
20031 * interface.cs (Interface.GetInterfaceBases): Check whether all
20032 base interfaces are at least as accessible than the current one.
20034 * class.cs (TypeContainer.GetClassBases): Check whether base types
20035 are at least as accessible than the current type.
20036 (TypeContainer.AsAccessible): Implemented and made non-static.
20037 (MemberBase.CheckParameters): Report errors if the accessibility
20040 * delegate.cs (Delegate.Delegate): The default visibility is
20041 internal for top-level types and private for nested types.
20042 (Delegate.Define): Report errors if the accessibility checks fail.
20044 * enum.cs (Enum.Enum): The default visibility is internal for
20045 top-level types and private for nested types.
20046 (Enum.DefineType): Compute the correct visibility.
20048 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
20049 function which takes a `bool is_toplevel' instead of a TypeContainer.
20051 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
20054 2002-08-02 Martin Baulig <martin@gnome.org>
20056 * expression.cs (LocalVariableReferenc): Added constructor which
20057 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
20058 (LocalVariableReference.IsReadOnly): New property.
20059 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
20060 variable is readonly, use our own readonly flag to do this; you can
20061 use the new constructor to get a writable reference to a read-only
20064 * cs-parser.jay (foreach_statement, using_statement): Get a writable
20065 reference to the local variable.
20067 2002-08-01 Miguel de Icaza <miguel@ximian.com>
20069 * rootcontext.cs (ResolveCore): Also include System.Exception
20071 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
20072 we reach an EmptyStatement.
20074 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
20077 * expression.cs (Binary.ResolveOperator): Check error result in
20080 use brtrue/brfalse directly and avoid compares to null.
20082 2002-08-02 Martin Baulig <martin@gnome.org>
20084 * class.cs (TypeContainer.Define): Define all nested interfaces here.
20085 Fixes bug #28407, added test-155.cs.
20087 2002-08-01 Martin Baulig <martin@gnome.org>
20089 * class.cs (Event.EmitDefaultMethod): Make this work with static
20090 events. Fixes #28311, added verify-3.cs.
20092 2002-08-01 Martin Baulig <martin@gnome.org>
20094 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
20095 `is_disposable' fields.
20096 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
20097 `hm.is_disposable' if we're using the collection pattern.
20098 (Foreach.EmitCollectionForeach): Use the correct type for the
20099 enumerator's local variable, only emit the try/finally block if
20100 necessary (fixes #27713).
20102 2002-08-01 Martin Baulig <martin@gnome.org>
20104 * ecore.cs (Expression.report118): Renamed to Error118 and made
20107 * statement.cs (Throw.Resolve): Check whether the expression is of
20108 the correct type (CS0118) and whether the type derives from
20109 System.Exception (CS0155).
20110 (Catch.Resolve): New method. Do the type lookup here and check
20111 whether it derives from System.Exception (CS0155).
20112 (Catch.CatchType, Catch.IsGeneral): New public properties.
20114 * typemanager.cs (TypeManager.exception_type): Added.
20116 2002-07-31 Miguel de Icaza <miguel@ximian.com>
20118 * driver.cs: Updated About function.
20120 2002-07-31 Martin Baulig <martin@gnome.org>
20122 Implemented Control Flow Analysis.
20124 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
20125 (EmitContext.CurrentBranching): Added.
20126 (EmitContext.StartFlowBranching): Added.
20127 (EmitContext.EndFlowBranching): Added.
20128 (EmitContext.KillFlowBranching): Added.
20129 (EmitContext.IsVariableAssigned): Added.
20130 (EmitContext.SetVariableAssigned): Added.
20131 (EmitContext.IsParameterAssigned): Added.
20132 (EmitContext.SetParameterAssigned): Added.
20133 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
20134 Added control flow analysis stuff here.
20136 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
20137 resolve the expression as lvalue.
20138 (LocalVariableReference.DoResolve): Check whether the variable has
20139 already been assigned.
20140 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
20141 the parameter as assigned here.
20142 (ParameterReference.DoResolve): Check whether the parameter has already
20144 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
20145 expression as lvalue.
20147 * statement.cs (FlowBranching): New class for the flow analysis code.
20148 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
20149 (LabeledStatement.IsDefined): New public property.
20150 (LabeledStatement.AddUsageVector): New public method to tell flow
20151 analyis that the label may be reached via a forward jump.
20152 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
20154 (VariableInfo.Number): New public field. This is used by flow analysis
20155 to number all locals of a block.
20156 (Block.CountVariables): New public property. This is the number of
20157 local variables in this block (including the locals from all parent
20159 (Block.EmitMeta): Number all the variables.
20161 * statement.cs: Added flow analysis support to all classes.
20163 2002-07-31 Martin Baulig <martin@gnome.org>
20165 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
20166 To get debugging messages, compile mcs with /define:MCS_DEBUG and
20167 then use this argument.
20169 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
20171 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
20172 use this to specify /define options.
20174 2002-07-29 Martin Baulig <martin@gnome.org>
20176 * statement.cs (Fixed): Moved all code that does variable lookups
20177 and resolvings from Emit to Resolve.
20179 * statement.cs (For): Moved all code that does variable lookups
20180 and resolvings from Emit to Resolve.
20182 * statement.cs (Using): Moved all code that does variable lookups
20183 and resolvings from Emit to Resolve.
20185 2002-07-29 Martin Baulig <martin@gnome.org>
20187 * attribute.cs (Attribute.Resolve): Explicitly catch a
20188 System.NullReferenceException when creating the
20189 CustromAttributeBuilder and report a different warning message.
20191 2002-07-29 Martin Baulig <martin@gnome.org>
20193 * support.cs (ParameterData.ParameterName): Added method to
20194 get the name of a parameter.
20196 * typemanager.cs (TypeManager.IsValueType): New public method.
20198 2002-07-29 Martin Baulig <martin@gnome.org>
20200 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
20201 is a flag which specifies that it's either ref or out.
20202 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
20203 the out parameter to `out Parameter.Modifier mod', also set the
20204 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
20206 * support.cs (InternalParameters.ParameterModifier): Distinguish
20207 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20208 Parameter.Modifier.ISBYREF flag if it's either ref or out.
20210 * expression.cs (Argument.GetParameterModifier): Distinguish
20211 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20212 Parameter.Modifier.ISBYREF flag if it's either ref or out.
20214 2002-07-29 Martin Baulig <martin@gnome.org>
20216 * expression.cs (ParameterReference.ParameterReference): Added
20217 `Location loc' argument to the constructor.
20219 * cs-parser.jay: Pass location to ParameterReference.
20221 2002-07-28 Miguel de Icaza <miguel@ximian.com>
20223 * statement.cs (Try): Initialize the location.
20225 * cs-parser.jay: pass location to Try.
20227 * expression.cs (Unary.Reduce): Change the prototype to return
20228 whether a constant fold could be performed or not. The result is
20229 returned in an out parameters. In the case of Indirection and
20230 AddressOf, we want to perform the full tests.
20232 2002-07-26 Miguel de Icaza <miguel@ximian.com>
20234 * statement.cs (Statement.Emit): Flag dead code.
20236 2002-07-27 Andrew Birkett <andy@nobugs.org>
20238 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
20240 2002-07-27 Martin Baulig <martin@gnome.org>
20242 * class.cs (MethodData.Define): Put back call to
20243 TypeManager.AddMethod(), accidentally commented this out.
20245 * report.cs (Debug): New public method to print debugging information,
20246 this is `[Conditional ("DEBUG")]'.
20248 2002-07-26 Martin Baulig <martin@gnome.org>
20250 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
20251 (switch_statement): Push the current_block to the switch_stack and
20252 pop it again when we're done with the switch.
20253 (switch_section): The new block is a child of the current_block.
20254 Fixes bug #24007, added test-152.cs.
20256 2002-07-27 Martin Baulig <martin@gnome.org>
20258 * expression.cs (Invocation.EmitArguments): When calling a varargs
20259 function with only its fixed arguments, we need to pass an empty
20262 2002-07-27 Martin Baulig <martin@gnome.org>
20264 Mono 0.13 has been released.
20266 2002-07-25 Miguel de Icaza <miguel@ximian.com>
20268 * driver.cs: Rename --resource to --linkres, because that is what
20269 we do currently, we dont support --resource yet.
20271 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
20273 2002-07-25 Martin Baulig <martin@gnome.org>
20275 * class.cs (MethodData): New public class. This is a `method builder'
20276 class for a method or one accessor of a Property/Indexer/Event.
20277 (MethodData.GetMethodFlags): Moved here from MemberBase.
20278 (MethodData.ApplyAttributes): Likewise.
20279 (MethodData.ApplyObsoleteAttribute): Likewise.
20280 (MethodData.ApplyConditionalAttribute): Likewise.
20281 (MethodData.ApplyDllImportAttribute): Likewise.
20282 (MethodData.CheckAbstractAndExternal): Likewise.
20283 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
20284 (MethodData.Emit): Formerly known as Method.Emit().
20285 (MemberBase): Moved everything which was specific to a single
20286 accessor/method to MethodData.
20287 (Method): Create a new MethodData and call Define() and Emit() on it.
20288 (Property, Indexer, Event): Create a new MethodData objects for each
20289 accessor and call Define() and Emit() on them.
20291 2002-07-25 Martin Baulig <martin@gnome.org>
20293 Made MethodCore derive from MemberBase to reuse the code from there.
20294 MemberBase now also checks for attributes.
20296 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
20297 (MemberBase.GetMethodFlags): Moved here from class Method and marked
20299 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
20300 `CallingConventions cc' and `Attributes opt_attrs' arguments.
20301 (MemberBase.ApplyAttributes): New virtual method; applies the
20302 attributes to a method or accessor.
20303 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
20304 (MemberBase.ApplyConditionalAttribute): Likewise.
20305 (MemberBase.ApplyDllImportAttribute): Likewise.
20306 (MemberBase.CheckAbstractAndExternal): Likewise.
20307 (MethodCore.ParameterTypes): This is now a property instead of a
20308 method, it's initialized from DoDefineParameters().
20309 (MethodCore.ParameterInfo): Removed the set accessor.
20310 (MethodCore.DoDefineParameters): New protected virtual method to
20311 initialize ParameterTypes and ParameterInfo.
20312 (Method.GetReturnType): We can now simply return the MemberType.
20313 (Method.GetMethodFlags): Override the MemberBase version and add
20314 the conditional flags.
20315 (Method.CheckBase): Moved some code from Define() here, call
20316 DoDefineParameters() here.
20317 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
20318 here to avoid some larger code duplication.
20319 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
20320 ensure that abstract and external accessors don't declare a body.
20322 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
20323 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
20324 lookup in the attribute's parent classes, so we need to abort as soon
20325 as we found the first match.
20326 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
20327 the attribute has no arguments.
20329 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
20332 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20334 * cs-parser.jay: reverted previous patch.
20336 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20338 * cs-parser.jay: fixed bug #22119.
20340 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20342 * attribute.cs: fixed compilation. The error was:
20343 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
20344 be assigned to before control leaves the current method."
20345 [FIXME: Filed as bug #28186: MCS must report this error.]
20347 2002-07-25 Martin Baulig <martin@gnome.org>
20349 * attribute.cs (Attribute.Conditional_GetConditionName): New static
20350 method to pull the condition name ouf of a Conditional attribute.
20351 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
20352 the obsolete message and error flag out of an Obsolete attribute.
20354 * class.cs (Method.GetMethodFlags): New public method to get the
20355 TypeManager.MethodFlags for this method.
20356 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
20358 (Method.Define): Get and apply the Obsolete and Conditional attributes;
20359 if we're overriding a virtual function, set the new private variable
20360 `parent_method'; call the new TypeManager.AddMethod().
20362 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
20363 the MethodBuilder and the Method in a PtrHashtable.
20364 (TypeManager.builder_to_method): Added for this purpose.
20365 (TypeManager.MethodFlags): Added IsObsoleteError.
20366 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
20367 Obsolete and Conditional arguments in MethodBuilders. If we discover
20368 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
20369 the message from the attribute.
20371 2002-07-24 Martin Baulig <martin@gnome.org>
20373 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
20374 preprocessor directives, ensure that the argument to #define/#undef is
20375 exactly one identifier and that it's actually an identifier.
20377 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
20380 2002-07-24 Martin Baulig <martin@gnome.org>
20382 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
20383 initialize it to TypeManager.object_type in the constructor.
20384 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
20385 of the `hm.get_current' method if we're using the collection pattern.
20386 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
20387 for the explicit conversion to make it work when we're using the collection
20388 pattern and the `Current' property has a different return type than `object'.
20391 2002-07-24 Martin Baulig <martin@gnome.org>
20393 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
20394 does not match, but don't report any errors. This method is called in
20395 order for all methods in a MethodGroupExpr until a matching method is
20396 found, so we don't want to bail out if the first method doesn't match.
20397 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
20398 matches, report the 123. Fixes #28070.
20400 2002-07-24 Martin Baulig <martin@gnome.org>
20402 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
20403 TypeManager.TypeToCoreType() to the top of the method so the
20404 following equality checks will work. Fixes #28107.
20406 2002-07-24 Martin Baulig <martin@gnome.org>
20408 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
20409 operand is of type uint, and the other operand is of type sbyte,
20410 short or int, the operands are converted to type long." -
20411 Actually do what this comment already told us. Fixes bug #28106,
20414 2002-07-24 Martin Baulig <martin@gnome.org>
20416 * class.cs (MethodBase): New abstract class. This is now a base
20417 class for Property, Indexer and Event to avoid some code duplication
20418 in their Define() and DefineMethods() methods.
20419 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
20420 generic methods for Define() and DefineMethods().
20421 (FieldBase): Derive from MemberBase, not MemberCore.
20422 (Property): Derive from MemberBase, not MemberCore.
20423 (Property.DefineMethod): Moved all the code from this method to the
20424 new MethodBase.DefineAccessor(), just call it with appropriate
20426 (Property.Define): Call the new Property.DoDefine(), this does some
20427 sanity checks and we don't need to duplicate the code everywhere.
20428 (Event): Derive from MemberBase, not MemberCore.
20429 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
20430 accessors, this will also make them work with interface events.
20431 (Indexer): Derive from MemberBase, not MemberCore.
20432 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
20433 (Indexer.Define): Use the new MethodBase functions.
20435 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
20436 argument to the constructor.
20437 (Interface.FindMembers): Added support for interface events.
20438 (Interface.PopluateEvent): Implemented.
20440 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
20442 2002-07-22 Miguel de Icaza <miguel@ximian.com>
20444 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
20445 but this is required to check for a method name being the same as
20446 the containing class.
20450 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20452 * interface.cs: initialize variable.
20454 2002-07-23 Martin Baulig <martin@gnome.org>
20456 Implemented the IndexerName attribute in interfaces.
20458 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
20459 name if this is an explicit interface implementation.
20460 (Indexer.InterfaceIndexerName): New public variable. If we're
20461 implementing an interface indexer, this is the IndexerName in that
20462 interface. Otherwise, it's the IndexerName.
20463 (Indexer.DefineMethod): If we're implementing interface indexer,
20464 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
20465 and Pending.ImplementIndexer methods.
20466 (Indexer.Define): Also define the PropertyBuilder if we're
20467 implementing an interface indexer and this is neither an explicit
20468 interface implementation nor do the IndexerName match the one in
20471 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
20472 If a method is defined here, then we always need to create a proxy
20473 for it. This is used when implementing interface indexers.
20474 (Pending.IsInterfaceIndexer): New public method.
20475 (Pending.ImplementIndexer): New public method.
20476 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
20477 This is used when implementing interface indexers to define a proxy
20479 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
20480 define a proxy if necessary.
20482 * interface.cs (Interface.IndexerName): New public variable.
20483 (Interface.PopulateIndexer): Set the IndexerName.
20484 (Interface.DefineIndexers): New private method. Populate all the
20485 indexers and make sure their IndexerNames match.
20487 * typemanager.cs (IndexerPropertyName): Added support for interface
20490 2002-07-22 Martin Baulig <martin@gnome.org>
20492 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
20493 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
20494 ret if HasReturnLabel.
20495 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
20498 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
20499 and set the ec.LoopBeginTryCatchLevel.
20500 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
20501 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
20502 the current ec.TryCatchLevel, the branch goes out of an exception
20503 block. In this case, we need to use Leave and not Br.
20505 2002-07-22 Martin Baulig <martin@gnome.org>
20507 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
20508 block unless the block does not always return or it is contained in
20509 another try { ... } catch { ... } block. Fixes bug #26506.
20510 Added verify-1.cs to the test suite.
20512 2002-07-22 Martin Baulig <martin@gnome.org>
20514 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
20515 then we do not always return. Fixes bug #24985.
20517 2002-07-22 Martin Baulig <martin@gnome.org>
20519 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
20520 lookup on a per-class level; ie. walk up the class hierarchy until we
20521 found at least one applicable method, then choose the best among them.
20522 Fixes bug #24463 and test-29.cs.
20524 2002-07-22 Martin Baulig <martin@gnome.org>
20526 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
20527 return types of the methods. The return type is not part of the
20528 signature and we must not check it to make the `new' modifier work.
20529 Fixes bug #27999, also added test-147.cs.
20530 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
20532 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
20533 on the method's return type.
20535 2002-07-21 Martin Baulig <martin@gnome.org>
20537 * assign.cs: Make this work if the rightmost source is a constant and
20538 we need to do an implicit type conversion. Also adding a few more tests
20539 to test-38.cs which should have caught this.
20541 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
20542 target in the makefile for this. The makefile.gnu is primarily intended
20543 for end-users who don't want to debug the compiler.
20545 2002-07-21 Martin Baulig <martin@gnome.org>
20547 * assign.cs: Improved the Assign class so it can now handle embedded
20548 assignments (X = Y = Z = something). As a side-effect this'll now also
20549 consume less local variables. test-38.cs now passes with MCS, added
20550 a few new test cases to that test.
20552 2002-07-20 Martin Baulig <martin@gnome.org>
20554 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
20555 instructions. Fixes bug #27977, also added test-146.cs.
20557 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20559 * cs-tokenizer.cs: fixed getHex ().
20561 2002-07-19 Martin Baulig <martin@gnome.org>
20563 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
20564 not Type.GetType() to lookup the array type. This is needed when
20565 we're constructing an array of a user-defined type.
20566 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
20567 single-dimensional arrays, but also for single-dimensial arrays of
20570 2002-07-19 Martin Baulig <martin@gnome.org>
20572 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
20573 this function is called, it's not allowed to share LocalBuilders
20574 among ILGenerators.
20576 2002-07-19 Martin Baulig <martin@gnome.org>
20578 * expression.cs (Argument.Resolve): Report an error 118 when trying
20579 to pass a type as argument.
20581 2002-07-18 Martin Baulig <martin@gnome.org>
20583 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
20584 Conv_R_Un for the signed `long' type.
20586 2002-07-15 Miguel de Icaza <miguel@ximian.com>
20588 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
20589 `expr' for the temporary result, as that will fail if we do
20590 multiple resolves on the same expression.
20592 2002-07-05 Miguel de Icaza <miguel@ximian.com>
20594 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
20595 ec.TypeContainer for looking up aliases.
20597 * class.cs (TypeContainer): Remove LookupAlias from here.
20599 * decl.cs (DeclSpace); Move here.
20601 2002-07-01 Miguel de Icaza <miguel@ximian.com>
20603 * class.cs (FindMembers): Only call filter if the constructor
20604 bulider is not null.
20606 Also handle delegates in `NestedTypes' now. Now we will perform
20607 type lookups using the standard resolution process. This also
20610 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
20611 This uses Expressions (the limited kind that can be parsed by the
20612 tree) instead of strings.
20614 * expression.cs (ComposedCast.ToString): Implement, used to flag
20615 errors since now we have to render expressions.
20617 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
20620 * ecore.cs (SimpleName.ToString): ditto.
20622 * cs-parser.jay: Instead of using strings to assemble types, use
20623 Expressions to assemble the type (using SimpleName, ComposedCast,
20624 MemberAccess). This should fix the type lookups in declarations,
20625 because we were using a different code path for this.
20627 * statement.cs (Block.Resolve): Continue processing statements
20628 even when there is an error.
20630 2002-07-17 Miguel de Icaza <miguel@ximian.com>
20632 * class.cs (Event.Define): Also remove the `remove' method from
20633 the list of pending items.
20635 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
20636 generate more compact code.
20638 2002-07-17 Martin Baulig <martin@gnome.org>
20640 * const.cs (Const.LookupConstantValue): Add support for constant
20641 `unchecked' and `checked' expressions.
20642 Also adding test case test-140.cs for this.
20644 2002-07-17 Martin Baulig <martin@gnome.org>
20646 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
20647 check whether mi.ReturnType implements the IEnumerator interface; the
20648 `==' and the IsAssignableFrom() will fail in this situation.
20650 2002-07-16 Ravi Pratap <ravi@ximian.com>
20652 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
20655 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20657 * expression.cs: fixed bug #27811.
20659 2002-07-14 Miguel de Icaza <miguel@ximian.com>
20661 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
20662 Molaro: when we are a ref, the value already contains a pointer
20663 value, do not take the address of it.
20665 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
20666 * removed mb-parser.jay and mb-tokenizer.cs
20668 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20670 * expression.cs: check against the building corlib void type.
20672 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
20674 * ecore.cs: fix for valuetype static readonly fields: when
20675 initializing them, we need their address, not the address of a copy.
20677 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
20679 * typemanager.cs: register also enum_type in corlib.
20681 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20683 * class.cs: allow calling this (but not base) initializers in structs.
20685 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
20687 * ecore.cs: make sure we compare against the building base types
20690 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
20692 * typemanager.cs: fix TypeToCoreType() to handle void and object
20693 (corlib gets no more typerefs after this change).
20695 2002-07-12 Miguel de Icaza <miguel@ximian.com>
20697 * expression.cs (ArrayCreation.EmitArrayArguments): use
20698 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
20700 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
20701 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
20702 array indexes, the runtime actually forbids them.
20704 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
20705 for array arguments here.
20707 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
20708 instead of the default for ValueTypes.
20710 (New.DoEmit): Use IsValueType instead of
20711 IsSubclassOf (value_type)
20712 (New.DoResolve): ditto.
20713 (Invocation.EmitCall): ditto.
20715 * assign.cs (Assign): ditto.
20717 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
20718 Statements *are* currently doing part of their resolution during
20721 Expressions do always resolve during resolve, but statements are
20722 only required to propagate resolution to their children.
20724 2002-07-11 Miguel de Icaza <miguel@ximian.com>
20726 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
20728 (LoadAssembly): Do not add the dll if it is already specified
20730 (MainDriver): Add the System directory to the link path at the end,
20731 after all the other -L arguments.
20733 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
20734 wrong opcode for loading bytes and bools (ldelem.i1 instead of
20735 ldelem.u1) and using the opposite for sbytes.
20737 This fixes Digger, and we can finally run it.
20739 * driver.cs (UnixParseOption): Move the option parsing here.
20740 (CSCParseOption): Implement CSC-like parsing of options.
20742 We now support both modes of operation, the old Unix way, and the
20743 new CSC-like way. This should help those who wanted to make cross
20744 platform makefiles.
20746 The only thing broken is that /r:, /reference: and /lib: are not
20747 implemented, because I want to make those have the same semantics
20748 as the CSC compiler has, and kill once and for all the confussion
20749 around this. Will be doing this tomorrow.
20751 * statement.cs (Unsafe.Resolve): The state is checked during
20752 resolve, not emit, so we have to set the flags for IsUnsfe here.
20754 2002-07-10 Miguel de Icaza <miguel@ximian.com>
20756 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
20757 not catch the Error_ObjectRefRequired in SimpleName (as it is
20758 possible to have a class/instance variable name that later gets
20759 deambiguated), we have to check this here.
20761 2002-07-10 Ravi Pratap <ravi@ximian.com>
20763 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
20764 make static and put into Expression.
20766 (Event.Define): Register the private field of the event with the
20767 TypeManager so that GetFieldFromEvent can get at it.
20769 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
20770 keep track of the private field associated with an event which
20773 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
20776 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
20778 2002-07-10 Miguel de Icaza <miguel@ximian.com>
20780 * expression.cs (Binary.EmitBranchable): this routine emits the
20781 Binary expression in a branchable context. This basically means:
20782 we need to branch somewhere, not just get the value on the stack.
20784 This works together with Statement.EmitBoolExpression.
20786 * statement.cs (Statement.EmitBoolExpression): Use
20789 2002-07-09 Miguel de Icaza <miguel@ximian.com>
20791 * statement.cs (For): Reduce the number of jumps in loops.
20793 (For): Implement loop inversion for the For statement.
20795 (Break): We can be breaking out of a Try/Catch controlled section
20796 (foreach might have an implicit try/catch clause), so we need to
20797 use Leave instead of Br.
20799 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
20800 now). If the instace expression supports IMemoryLocation, we use
20801 the AddressOf method from the IMemoryLocation to extract the
20802 address instead of emitting the instance.
20804 This showed up with `This', as we were emitting the instance
20805 always (Emit) instead of the Address of This. Particularly
20806 interesting when This is a value type, as we dont want the Emit
20807 effect (which was to load the object).
20809 2002-07-08 Miguel de Icaza <miguel@ximian.com>
20811 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
20813 * statement.cs (Checked): Set the CheckedState during the resolve
20814 process too, as the ConvCast operations track the checked state on
20815 the resolve process, and not emit.
20817 * cs-parser.jay (namespace_member_declaration): Flag that we have
20818 found a declaration when we do. This is used to flag error 1529
20820 * driver.cs: Report ok when we display the help only.
20822 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
20824 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
20826 2002-07-04 Miguel de Icaza <miguel@ximian.com>
20828 * cs-tokenizer.cs (define): We also have to track locally the
20829 defines. AllDefines is just used for the Conditional Attribute,
20830 but we also need the local defines for the current source code.
20832 2002-07-03 Miguel de Icaza <miguel@ximian.com>
20834 * statement.cs (While, For, Do): These loops can exit through a
20835 Break statement, use this information to tell whether the
20836 statement is the last piece of code.
20838 (Break): Flag that we break.
20840 * codegen.cs (EmitContexts): New `Breaks' state variable.
20842 2002-07-03 Martin Baulig <martin@gnome.org>
20844 * class.cs (TypeContainer.MethodModifiersValid): Allow override
20845 modifiers in method declarations in structs. Otherwise, you won't
20846 be able to override things like Object.Equals().
20848 2002-07-02 Miguel de Icaza <miguel@ximian.com>
20850 * class.cs (Method, Property, Indexer): Do not allow the public
20851 modifier to be used in explicit interface implementations.
20853 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
20854 override modifiers in method declarations in structs
20856 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
20858 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
20859 integer or real overflow, report an error
20861 2002-07-02 Martin Baulig <martin@gnome.org>
20863 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
20864 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
20865 to tell the runtime about our newly created System.Object and
20866 System.ValueType types.
20868 2002-07-02 Miguel de Icaza <miguel@ximian.com>
20870 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
20871 struct instead of Ldarg/Starg.
20873 2002-07-02 Martin Baulig <martin@gnome.org>
20875 * expression.cs (Indirection.Indirection): Call
20876 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
20878 2002-07-02 Martin Baulig <martin@gnome.org>
20880 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
20881 ValueType, call TypeManager.TypeToCoreType() on it.
20882 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
20883 the OpCodes.Newarr argument.
20885 2002-07-02 Martin Baulig <martin@gnome.org>
20887 * expression.cs (Invocation.EmitCall): When compiling corlib,
20888 replace all calls to the system's System.Array type to calls to
20889 the newly created one.
20891 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
20892 System.Array methods.
20893 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
20894 from the system's System.Array type which must be replaced.
20896 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
20898 * typemanager.cs: load unverifiable_code_ctor so we can build
20899 corlib using the correct type. Avoid using GetTypeCode() with
20901 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
20902 TypeManager.object_type to allow building corlib.
20904 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
20906 * ecore.cs: handle System.Enum separately in LoadFromPtr().
20908 2002-07-01 Martin Baulig <martin@gnome.org>
20910 * class.cs: Make the last change actually work, we need to check
20911 whether `ifaces != null' to avoid a crash.
20913 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20915 * class.cs: when we build structs without fields that implement
20916 interfaces, we need to add the interfaces separately, since there is
20917 no API to both set the size and add the interfaces at type creation
20920 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20922 * expression.cs: the dimension arguments to the array constructors
20923 need to be converted if they are a long.
20925 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
20927 * class.cs: don't emit ldarg.0 if there is no parent constructor
20928 (fixes showstopper for corlib).
20930 2002-06-29 Martin Baulig <martin@gnome.org>
20932 MCS now compiles corlib on GNU/Linux :-)
20934 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
20935 ie. check for MethodImplOptions.InternalCall.
20937 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
20938 and TypeManager.attribute_type are null, so we must explicitly check
20939 whether parent is not null to find out whether it's an attribute type.
20940 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
20941 and SetBuilder, not only if the property is neither abstract nor external.
20942 This is necessary to set the MethodImplOptions on the accessor methods.
20943 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
20944 SetBuilder, see Property.Emit().
20946 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
20947 populate "System.Object", "System.ValueType" and "System.Attribute" since
20948 they've already been populated from BootCorlib_PopulateCoreTypes().
20950 2002-06-29 Martin Baulig <martin@gnome.org>
20952 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
20953 is the NullLiteral, we also need to make sure that target_type is not
20956 2002-06-29 Martin Baulig <martin@gnome.org>
20958 * rootcontext.cs (RootContext.ResolveCore): We must initialize
20959 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
20960 before calling BootstrapCorlib_ResolveDelegate ().
20962 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20964 * statement.cs: fixed build-breaker. All tests passed ok.
20966 2002-06-27 Martin Baulig <martin@gnome.org>
20968 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
20969 for System.Decimal when compiling corlib.
20971 2002-06-27 Martin Baulig <martin@gnome.org>
20973 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
20974 switch blocks which contain nothing but a default clause.
20976 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
20978 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
20980 2002-06-27 Martin Baulig <martin@gnome.org>
20982 * ecore.cs (PropertyExpr.PropertyExpr): Call
20983 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
20985 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
20986 is already a TypeBuilder.
20988 2002-06-27 Martin Baulig <martin@gnome.org>
20990 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
20991 `target_type == TypeManager.array_type', not IsAssignableFrom() in
20992 the "from an array-type to System.Array" case. This makes it work
20993 when compiling corlib.
20995 2002-06-27 Martin Baulig <martin@gnome.org>
20997 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
20998 non-static PropertyExpr, set its InstanceExpression. This makes
20999 the `ICollection.Count' property work in System/Array.cs.
21001 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
21003 * driver.cs: Made error handling more consistent. Errors now
21004 tracked by Report class, so many methods which used to return int
21005 now return void. Main() now prints success/failure and
21006 errors/warnings message.
21008 Renamed '--probe' compiler argument to '--expect-error'. Removed
21009 the magic number return values (123 and 124). Now, if the
21010 expected error occurs, the compiler exits with success (exit value
21011 0). If the compilation completes without seeing that particular
21012 error, the compiler exits with failure (exit value 1). The
21013 makefile in mcs/errors has been changed to handle the new behaviour.
21015 * report.cs: Made 'expected error' number a property and renamed
21016 it from 'Probe' to 'ExpectedError'.
21018 * genericparser.cs: Removed error handling support, since it is
21019 now all done by Report class.
21021 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
21022 class, so parse() no longer returns an int.
21024 * namespace.cs: Use Report.Error instead of GenericParser.error
21026 2002-06-22 Miguel de Icaza <miguel@ximian.com>
21028 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
21029 TypeContainer.AddOperator): At the front of the list put the
21030 explicit implementations, so they get resolved/defined first.
21032 2002-06-21 Miguel de Icaza <miguel@ximian.com>
21034 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
21035 interface type is implemented by this TypeContainer. Used during
21036 explicit interface implementation.
21038 (Property.Define, Indexer.Define, Method.Define): Validate that
21039 the given interface in the explicit implementation is one of the
21040 base classes for the containing type.
21042 Also if we are explicitly implementing an interface, but there is
21043 no match in the pending implementation table, report an error.
21045 (Property.Define): Only define the property if we are
21046 not explicitly implementing a property from an interface. Use the
21047 correct name also for those properties (the same CSC uses,
21048 although that is really not needed).
21050 (Property.Emit): Do not emit attributes for explicitly implemented
21051 properties, as there is no TypeBuilder.
21053 (Indexer.Emit): ditto.
21055 Hiding then means that we do not really *implement* a pending
21056 implementation, which makes code fail.
21058 2002-06-22 Martin Baulig <martin@gnome.org>
21060 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
21061 the return value of Object.GetType(). [FIXME: we need to do this whenever
21062 we get a type back from the reflection library].
21064 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
21066 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
21068 2002-06-20 Miguel de Icaza <miguel@ximian.com>
21070 * attribute.cs: Return null if we can not look up the type.
21072 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
21073 the interface types found.
21075 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
21076 interface types found.
21078 * typemanager.cs (GetInterfaces): Make this routine returns alll
21079 the interfaces and work around the lame differences between
21080 System.Type and System.Reflection.Emit.TypeBuilder in the results
21081 result for GetInterfaces.
21083 (ExpandInterfaces): Given an array of interface types, expand and
21084 eliminate repeated ocurrences of an interface. This expands in
21085 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
21088 2002-06-21 Martin Baulig <martin@gnome.org>
21090 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
21093 2002-06-21 Martin Baulig <martin@gnome.org>
21095 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
21096 and called with one of the core types, return the corresponding typebuilder for
21099 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
21102 2002-06-21 Martin Baulig <martin@gnome.org>
21104 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
21105 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
21106 (Expression.ConvertReferenceExplicit): Likewise.
21108 * expression.cs (ElementAccess.DoResolve): Likewise.
21109 (ElementAccess.DoResolveLValue): Likewise.
21111 2002-06-10 Martin Baulig <martin@gnome.org>
21113 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
21114 add the "value" parameter to the parameter list.
21116 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
21119 2002-06-19 Miguel de Icaza <miguel@ximian.com>
21121 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
21122 the argument to an int, uint, long or ulong, per the spec. Also
21123 catch negative constants in array creation.
21125 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
21127 * class.cs: do not allow the same interface to appear twice in
21128 the definition list.
21130 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
21132 * ecore.cs: don't use ldlen with System.Array.
21134 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
21136 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
21138 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
21140 * modifiers.cs: produce correct field attributes for protected
21141 internal. Easy fix so miguel can work on ther harder stuff:-)
21143 2002-06-18 Miguel de Icaza <miguel@ximian.com>
21145 * pending.cs: New file. Move the code from class.cs here.
21146 Support clearning the pending flag for all methods (when not doing
21147 explicit interface implementation).
21149 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
21151 * rootcontext.cs: added a couple more types needed to bootstrap.
21153 2002-06-17 Miguel de Icaza <miguel@ximian.com>
21155 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
21156 constructor in the type, instead of any constructor in the type
21157 hierarchy. Thanks to Paolo for finding this bug (it showed up as
21158 a bug in the Mono runtime when applying the params attribute).
21160 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
21161 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
21163 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
21165 * expression.cs (Unary.ResolveOperator): Use TypeManager
21166 to resolve the type.
21168 2002-06-13 Ravi Pratap <ravi@ximian.com>
21170 * cs-parser.jay (enum_member_declaration): Pass in the attributes
21173 * enum.cs (AddEnumMember): Add support to store the attributes associated
21174 with each member too.
21176 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
21177 field builders too - this takes care of the enum member case.
21179 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
21181 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
21182 address-of operator on both value types and pointers.
21184 2002-06-10 Martin Baulig <martin@gnome.org>
21186 * interface.cs (Interface.PopulateIndexer): Add the indexer's
21187 PropertyBuilder to the `property_builders' list.
21189 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
21190 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
21191 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
21192 find any indexers which are inherited from an interface.
21194 2002-06-09 Martin Baulig <martin@gnome.org>
21196 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
21197 the same type as the constant if necessary. There's also a test-130.cs
21200 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
21202 * typemanager.cs (TypeManager.ChangeType): Previously known as
21203 Enum.ChangeEnumType().
21205 2002-06-09 Martin Baulig <martin@gnome.org>
21207 * expression.cs (Cast.TryReduce): Added support for consts.
21209 2002-06-08 Ravi Pratap <ravi@ximian.com>
21211 * class.cs (Accessor): Hold attributes information so we can pass
21214 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
21215 Modify to pass in attributes attached to the methods.
21217 (add_accessor_declaration, remove_accessor_declaration): Ditto.
21219 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
21220 to handle the Accessor kind :-)
21222 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
21224 2002-06-08 Martin Baulig <martin@gnome.org>
21226 * expression.cs (Unary.TryReduceNegative): Added support for
21229 2002-06-08 Martin Baulig <martin@gnome.org>
21231 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
21232 name can't be found in the `defined_names' - the caller will do a
21233 MemberLookup in this case and thus find methods in System.Enum
21234 such as Enum.IsDefined().
21236 2002-06-08 Martin Baulig <martin@gnome.org>
21238 * enum.cs (Enum.ChangeEnumType): This is a custom version of
21239 Convert.ChangeType() which works with TypeBuilder created types.
21240 (Enum.LookupEnumValue, Enum.Define): Use it here.
21242 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
21243 `TypeBuilder.BaseType != null' check.
21244 (TypeContainer.FindMembers): Only lookup parent members if we
21245 actually have a parent.
21246 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
21247 (ConstructorInitializer.Resolve): Likewise.
21249 * interface.cs (Interface.FindMembers): Added
21250 `TypeBuilder.BaseType != null' check.
21252 * rootcontext.cs (RootContext.ResolveCore): Added
21253 "System.Runtime.CompilerServices.IndexerNameAttribute" to
21254 classes_second_stage.
21256 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
21257 debug_type and trace_type when compiling with --nostdlib.
21259 2002-06-07 Martin Baulig <martin@gnome.org>
21261 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
21262 (AddField): Set it to true when adding a non-static field.
21263 (DefineType): Use `have_nonstatic_fields' to find out whether we
21264 have non-static fields, not `Fields != null'.
21266 2002-06-02 Miguel de Icaza <miguel@ximian.com>
21268 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
21269 dereferencing a null on the static-field code path)
21271 2002-05-30 Martin Baulig <martin@gnome.org>
21273 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
21274 to take command line arguments. Use reflection to call the new
21275 custom `Initialize' function on the symbol writer and pass it the
21276 command line arguments.
21278 * driver.cs (--debug-args): New command line argument to pass command
21279 line arguments to the symbol writer.
21281 2002-05-28 Miguel de Icaza <miguel@ximian.com>
21283 * assign.cs (DoResolve): Forgot to do the implicit conversion to
21284 the target type for indexers and properties. Thanks to Joe for
21287 2002-05-27 Miguel de Icaza <miguel@ximian.com>
21289 * typemanager.cs (MethodFlags): returns the method flags
21290 (Obsolete/ShouldIgnore) that control warning emission and whether
21291 the invocation should be made, or ignored.
21293 * expression.cs (Invocation.Emit): Remove previous hack, we should
21294 not do this on matching a base type, we should do this based on an attribute
21296 Only emit calls to System.Diagnostics.Debug and
21297 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
21298 on the command line.
21300 * rootcontext.cs: Global settings for tracing and debugging.
21302 * cs-tokenizer.cs (define): New utility function to track
21303 defines. Set the global settings for TRACE and DEBUG if found.
21305 2002-05-25 Ravi Pratap <ravi@ximian.com>
21307 * interface.cs (Populate*): Pass in the TypeContainer as well as
21308 the DeclSpace as parameters so that we can create EmitContexts and
21309 then use that to apply attributes etc.
21311 (PopulateMethod, PopulateEvent, PopulateProperty)
21312 (PopulateIndexer): Apply attributes everywhere.
21314 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
21317 (ApplyAttributes): Update accordingly.
21319 We now apply interface attributes for all members too.
21321 2002-05-26 Miguel de Icaza <miguel@ximian.com>
21323 * class.cs (Indexer.Define); Correctly check if we are explicit
21324 implementation (instead of checking the Name for a ".", we
21325 directly look up if the InterfaceType was specified).
21327 Delay the creation of the PropertyBuilder.
21329 Only create the PropertyBuilder if we are not an explicit
21330 interface implementation. This means that explicit interface
21331 implementation members do not participate in regular function
21332 lookups, and hence fixes another major ambiguity problem in
21333 overload resolution (that was the visible effect).
21335 (DefineMethod): Return whether we are doing an interface
21338 * typemanager.cs: Temporary hack until we get attributes in
21339 interfaces (Ravi is working on that) and we get IndexerName
21340 support in interfaces.
21342 * interface.cs: Register the indexers as properties.
21344 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
21345 warning, I have verified that this is a bug in the .NET runtime
21346 (JavaScript suffers of the same problem).
21348 * typemanager.cs (MemberLookup): When looking up members for
21349 interfaces, the parent of an interface is the implicit
21350 System.Object (so we succeed in searches of Object methods in an
21351 interface method invocation. Example: IEnumerable x; x.ToString
21354 2002-05-25 Miguel de Icaza <miguel@ximian.com>
21356 * class.cs (Event): Events should also register if they do
21357 implement the methods that an interface requires.
21359 * typemanager.cs (MemberLookup); use the new GetInterfaces
21362 (GetInterfaces): The code used to lookup interfaces for a type is
21363 used in more than one place, factor it here.
21365 * driver.cs: Track the errors at the bottom of the file, we kept
21368 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
21369 instance if the method we are calling is static!
21371 2002-05-24 Miguel de Icaza <miguel@ximian.com>
21373 * attribute.cs (ApplyAttributes): Make this function filter out
21374 the IndexerName attribute (as that attribute in reality is never
21375 applied) and return the string constant for the IndexerName
21378 * class.cs (TypeContainer.Emit): Validate that all the indexers
21379 have the same IndexerName attribute, and if so, set the
21380 DefaultName attribute on the class.
21382 * typemanager.cs: The return value might contain other stuff (not
21383 only methods). For instance, consider a method with an "Item"
21384 property and an Item method.
21386 * class.cs: If there is a problem with the parameter types,
21389 2002-05-24 Ravi Pratap <ravi@ximian.com>
21391 * ecore.cs (ImplicitConversionExists): Wrapper function which also
21392 looks at user defined conversion after making a call to
21393 StandardConversionExists - we need this for overload resolution.
21395 * expression.cs : Update accordingly the various method calls.
21397 This fixes 2 bugs filed against implicit user defined conversions
21399 2002-05-22 Miguel de Icaza <miguel@ximian.com>
21401 * statement.cs: Track the result of the assignment.
21403 2002-05-21 Miguel de Icaza <miguel@ximian.com>
21405 * expression.cs (MemberAccess): Improved error reporting for
21406 inaccessible members.
21408 2002-05-22 Martin Baulig <martin@gnome.org>
21410 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
21411 itself with debugging support.
21413 2002-05-22 Martin Baulig <martin@gnome.org>
21415 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
21416 Removed, this isn't needed anymore.
21418 2002-05-20 Martin Baulig <martin@gnome.org>
21420 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
21421 be underlying type for an enum.
21423 2002-05-20 Miguel de Icaza <miguel@ximian.com>
21425 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
21426 that splits out the loading of just the core types.
21428 * rootcontext.cs (ResolveCore): Split the struct resolution in
21429 two, so we can load the enumeration underlying types before any
21432 * expression.cs (Is): Bandaid until we fix properly Switch (see
21433 bug #24985 for details).
21435 * typemanager.cs (ImplementsInterface): The hashtable will contain
21436 a null if there are no interfaces implemented.
21438 2002-05-18 Miguel de Icaza <miguel@ximian.com>
21440 * cs-parser.jay (indexer_declarator): It is fine to have array
21443 2002-05-17 Miguel de Icaza <miguel@ximian.com>
21445 * typemanager.cs: (RegisterBuilder): New function used to register
21446 TypeBuilders that implement interfaces. Since
21447 TypeBuilder.GetInterfaces (as usual) does not work with lame
21449 (AddUserType): register interfaces.
21451 (ImplementsInterface): Use the builder_to_ifaces hash if we are
21452 dealing with TypeBuilder. Also, arrays are showing up as
21453 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
21454 methods can not be invoked on them!
21456 * ecore.cs (ExplicitReferenceConversionExists): Made public.
21457 (ImplicitReferenceConversionExists): Split out from
21458 StandardConversionExists.
21460 * expression.cs (As): We were only implementing one of the three
21461 cases for the as operator. We now implement them all.
21462 (Is): Implement the various other cases for Is as well.
21464 * typemanager.cs (CACHE): New define used to control if we want or
21465 not the FindMembers cache. Seems to have a negative impact on
21466 performance currently
21468 (MemberLookup): Nested types have full acess to
21469 enclosing type members
21471 Remove code that coped with instance/static returns for events, we
21472 now catch this in RealFindMembers.
21474 (RealFindMembers): only perform static lookup if the instance
21475 lookup did not return a type or an event.
21477 2002-05-17 Miguel de Icaza <miguel@ximian.com>
21479 * assign.cs (CompoundAssign): We pass more semantic information
21480 now to Compound Assignments than we did before: now we have all
21481 the information at hand, and now we resolve the target *before* we
21482 do the expression expansion, which allows the "CacheValue" method
21483 to have the effect we intended (before, a [x] += 1 would generate
21484 two differen ArrayAccess expressions from the ElementAccess,
21485 during the resolution process).
21487 (CompoundAssign.DoResolve): Resolve target and original_source here.
21489 2002-05-16 Miguel de Icaza <miguel@ximian.com>
21491 * expression.cs (ArrayAccess): dropped debugging information.
21493 * typemanager.cs: Small bug fix: I was always returning i_members,
21494 instead of one of i_members or s_members (depending on which had
21497 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
21498 method is invoked before any code generation takes place, and it
21499 is a mechanism to inform that the expression will be invoked more
21500 than once, and that the method should use temporary values to
21501 avoid having side effects
21503 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
21505 * ecore.cs (Expression.CacheTemporaries): Provide empty default
21508 * expression.cs (Indirection, ArrayAccess): Add support for
21509 CacheTemporaries in these two bad boys.
21511 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
21512 ldobj or ldind_ref.
21513 (StoreFromPtr): Handle stobj as well.
21515 * expression.cs (UnaryMutator): Share more code.
21517 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
21518 down: I was not tracking the Filter function as well, which
21519 was affecting the results of the cache.
21521 2002-05-15 Miguel de Icaza <miguel@ximian.com>
21523 * attribute.cs: Remove the hack to handle the CharSet property on
21526 2002-05-14 Miguel de Icaza <miguel@ximian.com>
21528 * attribute.cs (DoResolve): More uglyness, we now only try to
21529 resolve the attribute partially, to extract the CharSet
21530 information (only if we are a StructLayout attribute). Otherwise
21532 (GetExtraTypeInfo): Add some code to conditionally kill in the
21533 future this. I am more and more convinced that the .NET
21534 framework has special code to handle the attribute setting on
21537 * expression.cs (IsParamsMethodApplicable): Revert my previous
21538 foreach change here, it was wrong.
21540 2002-05-13 Miguel de Icaza <miguel@ximian.com>
21542 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
21543 (pp_expr): do not abort on unknown input, just return.
21544 (eval): abort if there are pending chars.
21546 * attribute.cs (Attribute.Resolve): Positional parameters are
21547 optional. Deal with that case.
21549 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
21550 the Ansi/Unicode/Auto information for the type.
21552 (TypeContainer.DefineType): instantiate the EmitContext here, as
21553 we will be using it during the type definition (to resolve
21554 attributes) and during the emit phase.
21556 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
21557 to pull type information out of the attributes
21559 (Attribute.Resolve): track the constructor builder, and allow for
21560 multiple invocations (structs and classes will use this).
21562 * ecore.cs (MemberLookupFinal): new version with all the
21563 parameters customizable.
21565 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
21566 constructors. Return if the result value is null (as the error
21567 would have been flagged already by MemberLookupFinal)
21569 Do not allow instances of abstract classes or interfaces to be
21572 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
21573 We have to compare the assembly property here when dealing with
21574 FamANDAssem and Assembly access modifiers, because we might be
21575 creating an assembly from *modules* (that means that we are not
21576 getting TypeBuilders for types defined in other modules that are
21577 part of this assembly).
21579 (Method.Emit): If the method is marked abstract and has a body,
21582 (TypeContainer.DefineMembers): If both the defined member and the
21583 parent name match are methods, then do not emit any warnings: let
21584 the Method.Define routine take care of flagging warnings. But if
21585 there is a mismatch (method overrides something else, or method is
21586 overriwritten by something, then emit warning).
21588 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
21589 set to null, this means `do not check for the return type on the
21592 (Method.Define): set the return type for the method signature to
21593 null, so that we get methods with the same name and parameters and
21594 different return types. This is used to flag warning 114 (you are
21595 hiding a method, and you probably want to use the new/override
21598 * typemanager.cs (MemberLookup): Implemented proper access
21599 control, closing a long standing set of bug reports. The problem
21600 was that the Framework only has two bits: Public and NonPublic,
21601 and NonPublic includes private and protected methods, but we need
21602 to enforce the FamANDAssem, FamOrAssem and Family.
21604 2002-05-11 Miguel de Icaza <miguel@ximian.com>
21606 * statement.cs (GotoCase): Return true: Ammounts to giving up
21607 knowledge on whether we return or not, and letting the other case
21608 be responsible for it.
21610 2002-05-10 Miguel de Icaza <miguel@ximian.com>
21612 * driver.cs: Do not load directories for each file processed, only
21613 do it if there is a pattern.
21615 * ecore.cs: Report readonly assigns here as well, as we might have
21616 been resolved only by MemberAccess.
21618 (SimpleName.SimpleNameResolve): Also be useful for LValue
21619 resolution. We need this to propagate assign to local readonly variables
21621 * typemanager.cs: Use a ptrhashtable for the criteria, because we
21622 do not want to reuse potential criteria memory.
21624 * class.cs (MyEventBuilder): Set reflected_type;
21626 * ecore.cs (Constantify): Added support for constifying bools.
21628 (RootContext.LookupType): Added a cache for values looked up in
21629 the declaration space.
21631 * typemanager.cs (FindMembers): Now is a front-end to
21632 RealFindMembers, and provides a two-level hashtable-based cache to
21635 15% performance improvement: from 22.5 to 19.2 seconds.
21637 * expression.cs (IsParamsMethodApplicable): use foreach.
21638 (Invocation.DoResolve): ditto.
21639 (New.DoResolve): ditto.
21640 (ArrayCreation.DoResolve): ditto.
21642 * ecore.cs (FindMostEncompassingType): use foreach.
21644 * delegate.cs (NewDelegate.DoResolve): Use foreach
21646 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
21647 (RemoveMethods): use foreach.
21649 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
21650 nested foreach statements instead of for, and also break out of
21651 the inner loop once a match is found.
21653 (Invocation.OverloadResolve): Use foreach, simplify the code.
21655 2002-05-08 Miguel de Icaza <miguel@ximian.com>
21657 * cfold.cs (BinaryFold): During an enumeration evaluation context,
21658 we actually unwrap the expression to allow for extra information
21661 * expression.cs: Use Shr_Un on unsigned operations.
21663 2002-05-08 Ravi Pratap <ravi@ximian.com>
21665 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
21666 applicable operators was not being considered correctly. This closes
21667 the bug Miguel reported.
21669 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
21671 * attribute.cs: check that the type derives from System.Attribute
21672 and report the correct error in that case (moved the duplicate code to
21673 its own method, too).
21675 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
21677 * attribute.cs: lookup attribute type name as the spec says: first the
21678 bare attribute name and then name + "Attribute" (nant compiles with
21679 mcs after this fix).
21681 2002-05-07 Miguel de Icaza <miguel@ximian.com>
21683 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
21684 Because of the way we parse things, we should try to see if a
21685 UIntConstant can fit in an integer.
21687 2002-05-07 Ravi Pratap <ravi@ximian.com>
21689 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
21690 when we are in an explicit context.
21692 (ConvertReferenceExplicit): When converting from Iface type S to Class
21693 T make sure the rules are implemented as an OR.
21695 * parameter.cs (ParameterType): Make it a property for now although the
21696 purpose really isn't anything immediate.
21698 * expression.cs (Is*Applicable): Do better checking on the parameter type
21699 of a ref/out parameter. The ones from the system assemblies are already
21700 marked with the correct type so we don't need to do any correction.
21702 * ecore.cs (StandardConversionExists): Conversion from Interface types to
21703 the object type is standard too so include that.
21705 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21707 * ecore.cs (StandardConversionExists): Augment with missing code:
21708 deal with IntConstant, LongConstants and Enumerations.
21710 * assign.cs: Report the error, instead of failing silently
21712 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
21713 typecontainer that they are declared, because the
21714 typecontainer/namespace will have the list of using clauses that
21715 need to be applied.
21717 Assembly Attributes were escaping the normal registration
21720 (EmitCode): Apply attributes within an EmitContext that represents
21721 the container they were declared on.
21723 * cs-parser.jay: Track bases for structs. How did I get this wrong?
21725 2002-05-06 Ravi Pratap <ravi@ximian.com>
21727 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
21728 Revamp completely - make much cleaner as we now operate only
21731 (FindMostSpecificSource, FindMostSpecificTarget): New methods
21732 to implement the logic detailed in the spec more correctly.
21734 (UserDefinedConversion): Update accordingly.
21736 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21738 * statement.cs: Return flow analysis information up.
21740 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
21743 (token): Do not consume an extra character before calling
21746 2002-05-06 Piers Haken <piersh@friskit.com>
21748 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
21750 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21752 * class.cs (Constructor.Emit): Set the IsStatic flag in the
21753 EmitContext during the instance constructor initializer
21754 resolution, to stop access to instance variables.
21756 This is mandated by the spec, last paragraph of the `constructor
21757 initializers' section.
21759 2002-05-05 Miguel de Icaza <miguel@ximian.com>
21761 * cs-parser.jay, class.cs (Accessor): new class used to represent
21762 an accessor (get or set). In the past we used `null' to represent
21763 a missing accessor. But this is ambiguous because there was no
21764 way to tell in abstract indexers/properties if one of them was
21767 Now there is a way of addressing that.
21769 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
21770 instead of FindMembers.
21772 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
21773 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
21775 * attribute.cs: Treat indexers and properties as the same in terms
21776 of applying attributes
21778 * ecore.cs (FindMostEncompassedType): Use statically initialized
21779 EmptyExpressions()s like we do elsewhere to avoid creating useless
21780 objects (and we take this out of the tight loop).
21782 (GetConversionOperators): Move the code to extract the actual
21783 operators to a separate routine to clean things up.
21785 2002-05-04 Miguel de Icaza <miguel@ximian.com>
21787 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
21788 events are always registered FieldBuilders.
21790 * class.cs (FieldBase): New class shared by Fields
21792 * delegate.cs: If we are a toplevel delegate, use our full name.
21793 If we are a nested delegate, then only use our tail name.
21795 2002-05-02 Ravi Pratap <ravi@ximian.com>
21797 * expression.cs (IsApplicable): Ensure that we add the "&" to
21798 ref/out types before comparing it with the type of the argument.
21800 (IsParamsMethodApplicable): Ditto.
21802 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
21805 * delegate.cs : Handle the case when we have more than one applicable
21806 method. Flag an error only when we finish checking all.
21808 2002-05-02 Miguel de Icaza <miguel@ximian.com>
21810 * expression.cs: Add support for boolean static initializers.
21812 2002-05-01 Miguel de Icaza <miguel@ximian.com>
21814 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
21816 * parameter.cs (ComputeParameterTypes,
21817 ComputeAndDefineParameterTypes): Better error handling: now we
21818 clear the `types' cache if we fail during any of the type lookups.
21819 We also return the status code correctly to our caller
21821 * delegate.cs: If we fail to define a delegate, abort the extra
21824 * expression.cs (Binary.ResolveOperator): for
21825 operator==(object,object) and operator !=(object, object) we also
21826 have to verify that there is an implicit conversion from one to
21829 (ArrayAccess.DoResolve): Array Access can operate on
21832 2002-04-30 Miguel de Icaza <miguel@ximian.com>
21834 * assign.cs (CompoundAssign): A new class used as a "flag" that
21835 the assignment actually is happening as part of a compound
21836 assignment operator.
21838 During compound assignment, a few new rules exist to enable things
21845 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
21846 to the type of x) if y is implicitly convertible to the type of x,
21847 and the operator is a builtin operator and the return type of the
21848 operator is explicitly convertible to the type of x.
21850 * rootcontext.cs: Reset warning level to 2. 4 catches various
21851 "interesting" features in mcs, we must clean this up at some
21852 point, but currently am trying to kill other bugs ;-)
21854 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
21855 in container classes as well.
21857 * expression.cs (Binary.ResolveOperator): Handle string case
21858 before anything else (as operator overloading does emit an error
21859 before doing anything else).
21861 This code could go away when we move to a table driven model, but
21862 i could not come up with a good plan last night.
21864 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
21866 * typemanager.cs (CSharpName): reimplementation using regex.
21867 * class.cs: added null check for fields in Emit
21868 * rootcontext.cs: set warninglevel to 4
21870 2002-04-29 Miguel de Icaza <miguel@ximian.com>
21872 * typemanager.cs (CSharpName): reimplemented with Lupus
21875 2002-04-28 Miguel de Icaza <miguel@ximian.com>
21877 * statement.cs (If): correclty implement Resolve, because we were
21878 not catching sem errors in there. The same process is needed
21880 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
21883 (Statement.Warning_DeadCodeFound): Factorize code.
21884 (While): Report dead code here too.
21886 (Statement): Added Resolve virtual method to allow
21887 for resolution split from the emit code.
21889 2002-04-26 Miguel de Icaza <miguel@ximian.com>
21891 * statement.cs (EmitBoolExpression): No longer try to resolve the
21893 (MakeBoolean): New utility function that resolve, implicitly
21894 converts to boolean and tags the expression.
21897 (If, Do): Implement dead code elimination.
21898 (While): Implement loop inversion
21900 (Do, While, For, If): Resolve the expression prior to calling our
21903 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
21906 - added method Report28 (warning: program has more than one entry point)
21907 - added method IsEntryPoint, implements paragraph 10.1 of the spec
21908 - modified method Method.Define, the part at the end of the method
21910 * rootcontext.cs: added static public Location EntryPointLocation;
21912 * ../errors/cs0028.cs : Add test case for the above warning.
21915 - modified method CSharpName to allow arrays of primitive type to
21916 be printed nicely (e.g. instead of System.Int32[][] it now prints
21918 - added method CSharpSignature: returns the signature of a method
21919 in string format to be used in reporting errors, warnings, etc.
21921 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
21924 2002-04-26 Ravi Pratap <ravi@ximian.com>
21926 * delegate.cs (Define): Fix extremely silly bug where I was
21927 setting the type of the 'object' parameter of the BeginInvoke
21928 method to System.IAsyncResult instead of System.Object ;-)
21930 2002-04-26 Miguel de Icaza <miguel@ximian.com>
21932 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
21935 (Constructor.Emit): return if we fail to initialize the
21936 constructor. Another door closed!
21938 * expression.cs (New.DoResolve): Improve error message (from -6 to
21939 1501). Use DeclaredOnly lookup to find the exact constructor.
21941 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
21942 loop. This is useful.
21944 * cs-parser.jay: Adjust the default parameters so that destructors
21945 have the proper signature.
21947 2002-04-26 Martin Baulig <martin@gnome.org>
21949 * driver.cs (LoadAssembly): If `assembly' contains any characters
21950 which are only valid in path names and not in assembly names
21951 (currently slash, backslash and point), use Assembly.LoadFrom ()
21952 instead of Assembly.Load () on the `assembly' (before iteration
21953 over the link_paths).
21955 2002-04-26 Martin Baulig <martin@gnome.org>
21957 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
21959 2002-04-25 Miguel de Icaza <miguel@ximian.com>
21961 * class.cs (Property): use the new typemanager.MemberLookup
21963 (TypeContainer.MemberLookup): Implement using the
21964 TypeManager.MemberLookup now.
21966 * typemanager.cs: Make MemberLookup a function of the TypeManager,
21967 and return MemberInfos, so that these can be used without an
21968 EmitContext (what we had before).
21970 2002-04-24 Miguel de Icaza <miguel@ximian.com>
21972 * expression.cs: Fix the case where the argument to params if the
21973 type of the params. I omitted handling this before. Fixed
21975 2002-04-22 Miguel de Icaza <miguel@ximian.com>
21977 * driver.cs: Call BootCorlib_PopulateCoreType
21979 * class.cs (Property.CheckBase): Check for properties only, not
21982 * interface.cs: Temporary hack: try/catch around the
21983 CustomAttributeBuilder, because I am getting an exception that I
21986 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
21987 types whose definitions are required to be there (attributes are
21988 defined before standard types).
21990 Compute definitions as we boot the various types, as they are used
21991 immediately (value_type class will need object_type, but if we do
21992 not initialize object_type, we will pass a null, which will let
21993 the runtime pick the System.Object from the existing corlib, which
21994 is not what we want).
21996 2002-04-22 Patrik Torstensson <totte@labs2.com>
21998 * cs-tokenizer.cs: fixed a number of trim() issues.
22000 2002-04-22 Ravi Pratap <ravi@ximian.com>
22002 * expression.cs (Argument.Type): Ensure that we return the correct
22003 type when we have out or ref parameters [in which case we
22006 2002-04-22 Miguel de Icaza <miguel@ximian.com>
22008 * class.cs (Property, Indexer): Allow extern modifier in there.
22010 * typemanager.cs (InitBaseTypes): Initializes object_type and
22011 value_type, since those will be used early on during the bootstrap
22012 process to compile corlib.
22014 (InitCoreTypes): Move code from here to InitBaseTypes.
22016 2002-04-21 Miguel de Icaza <miguel@ximian.com>
22018 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
22019 single-dimension arrays as using the ldlen opcode.
22021 Daniel Lewis discovered this optimization.
22023 * typemanager.cs: Add signature for System.Array::get_Length
22025 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22027 * statement.cs: report the error when the foreach does not apply to an
22028 array nor a collection.
22030 2002-04-19 Miguel de Icaza <miguel@ximian.com>
22032 * expression.cs: Add implicit conversions to the operator ~.
22034 * constant.cs (DecimalConstant.Emit): Emit decimal value.
22036 * typemanager.cs: Locate the decimal constructor.
22038 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22040 * attribute.cs: use the new property of TypeOf.
22041 * expression.cs: added 'get' property around typearg.
22043 These changes fix a build breaker reported by NickD. Is this the
22044 correct way to fix? If not, please, revert my changes and make it
22047 2002-04-17 Miguel de Icaza <miguel@ximian.com>
22049 * attribute.cs: Add support for typeof in attribute invocations.
22050 I am not sure that this is right though.
22052 2002-04-14 Duncan Mak <duncan@ximian.com>
22054 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
22055 Binary.Operator.Division case.
22057 2002-04-13 Ravi Pratap <ravi@ximian.com>
22059 * class.cs (DefineType): Ensure that we do a proper check on
22060 attribute types and also register it with the TypeManager.
22062 (TypeContainer.Targets): The default for attribute types is
22063 AttributeTargets.All.
22065 * attribute.cs (ApplyAttributes): Registering the attribute type
22066 is done elsewhere, not when we discover we have a Usage attribute.
22068 2002-04-12 Ravi Pratap <ravi@ximian.com>
22070 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
22071 and get rid of is_delegate parameter.
22073 * everywhere : update.
22075 2002-04-12 Ravi Pratap <ravi@ximian.com>
22077 * cs-parser.jay (compilation_unit): Revamp completely to use
22078 some new ideas that I got from Rhys' grammar to solve the problems
22079 with assembly level attributes.
22081 (outer_declaration): New grammar production.
22083 (attribute_sections): Add.
22085 (opt_attributes): Base on attribute_sections
22087 (namespace_declaration): Allow opt_attributes to tackle the case
22088 when we have assembly level attributes - we are clever in this
22091 * attribute.cs (ApplyAttributes): Do not worry about assembly
22092 attributes in the non-global context.
22094 * rootcontext.cs (AddGlobalAttributes): Go back to using this
22095 instead of SetGlobalAttributes.
22097 * class.cs, rootcontext.cs : Ensure we define and generate
22098 attribute types before anything else.
22100 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
22101 and flag the new error -20 for the case when the attribute type
22102 does not have valid targets specified. csc does not catch this.
22104 * ../errors/errors.txt : update for error # -20
22106 2002-04-11 Ravi Pratap <ravi@ximian.com>
22108 * support.cs (InternalParameters.ParameterModifier): Do some null
22109 checking and return sane values.
22111 * class.cs (Method.Define): If we are a PInvoke method, ensure
22112 that we are static and extern. Report error # 601
22114 * ../errors/cs0601.cs : Add test case for the above error.
22116 2002-04-07 Ravi Pratap <ravi@ximian.com>
22118 * rootcontext.cs (attribute_types): We need to keep type of
22119 all attribute types separately and emit code for them first.
22121 (RegisterAttribute) : Implement.
22123 * class.cs (DefineType): Check if the current Type is a custom
22124 attribute type and register it accordingly.
22126 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
22127 adding the first attribute twice and rename to
22129 (SetGlobalAttributes): this.
22131 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
22134 * attribute.cs (ApplyAttributes): Take an additional argument telling us
22135 if we are processing global arguments. Hmm, I am unsure of this.
22137 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22139 * expression.cs: added static array of strings to avoid calling
22140 Enum.ToString () for Operator in Binary. Significant recover of
22143 2002-04-10 Miguel de Icaza <miguel@ximian.com>
22145 * class.cs (FindMembers): Allow the Builders of the various
22146 members to be null. If they are skip them. This only happens
22147 during the PInvoke declaration.
22149 2002-04-09 Miguel de Icaza <miguel@ximian.com>
22151 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
22152 failure, so we do not keep going afterwards.
22154 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
22155 wanted to pass `false' as the `is_delegate' argument. If this is
22156 the case, why not use delegate_type == null to mean `is_delegate =
22157 false' and anything else as is_delegate = true.
22159 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
22161 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
22162 code for the section, not the beginning of the tests.
22164 2002-04-08 Miguel de Icaza <miguel@ximian.com>
22166 * cfold.cs: Handle operator + (Enum x, Underlying x)
22168 * expression.cs (Binary): same. Warn about errors where we have
22169 Enum/Enum in operator + as well.
22171 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
22174 - added support for switch(bool)
22175 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
22176 - add TableSwitchEmit() to handle table-based switch statements
22178 2002-04-05 Ravi Pratap <ravi@ximian.com>
22180 * expression.cs (Invocation.OverloadResolve): Factor out code which
22181 does parameter compatibility checking with arguments so that we can
22182 re-use the code even from Delegate.VerifyApplicability
22184 (VerifyArgumentsCompat): Move above code here.
22186 * delegate.cs (VerifyApplicability): Get rid of duplicate code
22187 and instead make a call to the above method.
22189 2002-03-31 Ravi Pratap <ravi@ximian.com>
22191 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
22192 We use it to keep track of classes which are attribute types.
22194 2002-04-02 Miguel de Icaza <miguel@ximian.com>
22196 * delegate.cs (Delegate.Define): Correctly define the types in the
22197 presence of fixed and array parameters.
22199 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
22202 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
22203 include NonPublic after the first iteration.
22205 * class.cs (Indexer.CheckBase): Only check if both parents are
22208 * cs-parser.jay (accessor_body): If empty, set to null.
22210 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
22211 same code path here to resolve constants names that we did have in
22212 MemberAccess.DoResolve. There is too much code duplicated here.
22214 2002-04-01 Miguel de Icaza <miguel@ximian.com>
22216 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
22218 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
22221 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
22222 tokens, numbers and strings.
22224 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
22227 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
22228 asyncronous parameters and the regular parameters.
22230 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
22231 specify the target directory.
22233 * expression.cs: (This.DoResolve): Simplify
22234 (As.Emit): Optimize, do not generate IsInst if the expression is
22235 always of the given type.
22237 (Is.DoResolve): Bug fix, we were reporting both always/never for
22240 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
22241 creating too many unnecessary arrays.
22243 2002-03-31 Miguel de Icaza <miguel@ximian.com>
22245 * class.cs (EmitFieldInitializer): Use Assign expression to assign
22246 fields instead of rolling our own initializer. Takes care of all
22247 implicit conversions, and drops unnecessary static checks/argument.
22249 2002-03-31 Dick Porter <dick@ximian.com>
22251 * driver.cs: use the GetDirectories() return values properly, and
22252 use "/" as path separator.
22254 2002-03-30 Miguel de Icaza <miguel@ximian.com>
22256 * expression.cs (Unary): Optimize - - expr into expr.
22257 (Binary): Optimize a + (-b) into a -b.
22259 * codegen.cs (CodeGen): Made all methods static.
22261 2002-03-29 Miguel de Icaza <miguel@ximian.com>
22265 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
22266 TypeBuilder property.
22268 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
22271 * tree.cs: Removed the various RecordXXXX, and replaced with a
22272 single RecordDecl. Removed all the accessor methods, and just
22273 left a single access point Type
22275 * enum.cs: Rename DefineEnum to DefineType.
22277 * decl.cs: New abstract method `DefineType' used to unify the
22278 Defines for Enumerations, Interfaces, TypeContainers and
22281 (FindType): Moved LookupInterfaceOrClass here. Moved the
22282 LookupBaseClasses method that used to live in class.cs and
22283 interface.cs here, and renamed to FindType.
22285 * delegate.cs: Implement DefineType. Take advantage of the
22286 refactored pattern for locating the parent builder without taking
22287 the parent_builder argument (which we know does not work if we are
22288 nested, and triggering a toplevel definition).
22290 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22292 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
22293 accessibility of a member has changed during override and report
22296 * class.cs (Method.Define, Property.Define): Only complain on
22297 overrides if the method is private, any other accessibility is
22298 fine (and since we just checked the permission is the same, we are
22301 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
22302 and elif are processed always. The other pre-processing
22303 directives are only processed if we are "taking" the path
22305 2002-03-29 Martin Baulig <martin@gnome.org>
22307 * class.cs (Method.Emit): Only emit symbolic debugging info if the
22308 current location is not Null.
22310 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
22311 a separate method so we can profile it.
22313 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
22314 `span.Seconds' are just seconds, but no minutes or hours.
22315 (MainDriver): Profile the CodeGen.SaveSymbols calls.
22317 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22319 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
22320 Remove the gratuitous set of Final:
22322 // If an interface implementation, then we can set Final.
22323 if (((flags & MethodAttributes.Abstract) == 0) &&
22324 implementing.DeclaringType.IsInterface)
22325 flags |= MethodAttributes.Final;
22327 I do not know what I was smoking when I used that.
22330 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
22331 step into fixing the name resolution issues for delegates and
22332 unifying the toplevel name resolution.
22334 2002-03-28 Martin Baulig <martin@gnome.org>
22336 * class.cs (Method.Emit): If we have a symbol writer, call its
22337 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
22338 tell it about the current method.
22340 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
22341 writer that we're going to emit the first byte of IL code for a new
22342 statement (a new source line).
22343 (EmitContext.EmitTopBlock): If we have a symbol writer, call
22344 EmitContext.Mark() before emitting any code.
22346 * location.cs (SymbolDocument): Return null when we're Null.
22348 * statement.cs (Statement): Moved the `Location loc' variable here.
22349 (Statement.EmitBoolExpression): If we have a symbol writer, call
22350 ec.Mark() before emitting any code to tell it that we're at the
22351 beginning of a new statement.
22352 (StatementExpression): Added `Location' argument to the constructor.
22353 (Block): Added public readonly variable `StartLocation' and public
22354 variable `EndLocation'. The latter is to be set using SetEndLocation().
22355 (Block): Added constructor which takes a start and end location.
22356 (Block.SetEndLocation): New method. This sets the end location.
22357 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
22358 local variables we create.
22359 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
22360 each statement and do also mark the begin and end of the block.
22362 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
22363 tell it the current lexer.Location, use Location.Null for the end of the
22365 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
22366 current block, set its end location using SetEndLocation().
22367 (statement_expression): StatementExpression constructor now takes the
22368 lexer.Location as additional argument.
22369 (for_statement, declare_local_variables): Likewise.
22370 (declare_local_variables): When creating a new implicit block, use the
22371 new Block constructor and pass it the lexer.Location.
22373 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22375 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
22376 members also on the parent interfaces recursively.
22378 2002-03-27 Miguel de Icaza <miguel@ximian.com>
22380 * report.cs: Use new formats, since Gonzalo finished the missing
22383 * expression.cs (Binary.ResolveOperator): added missing operator|
22384 operator& and operator^ for bool/bool.
22386 * cs-parser.jay: CheckDef now takes a Location argument that is
22387 used to report errors more precisly (instead of reporting the end
22388 of a definition, we try to track something which is a lot closer
22389 to the source of the problem).
22391 * cs-tokenizer.cs: Track global token use, so we can properly flag
22392 the use of #define/#undef after the first token has been seen.
22394 Also, rename the reportXXXX to Error_DescriptiveName
22396 * decl.cs (DeclSpace.IsTopLevel): Move property here from
22397 TypeContainer, so that Enum and Interface can use this too.
22399 * class.cs (TypeContainer.LookupInterfaceOrClass,
22400 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
22401 `builder' argument. Typically this was used to pass the parent
22402 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
22405 The problem is that a nested class could trigger the definition of
22406 a toplevel class, and the builder would be obviously wrong in that
22409 So we drop this argument, and we compute dynamically the
22410 TypeBuilder/ModuleBuilder (the correct information was available
22411 to us anyways from DeclSpace.Parent)
22413 * interface.cs (Interface.DefineInterface): Drop builder
22414 parameter cleanup like class.cs
22416 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
22419 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
22422 (Try.Emit): Propagate the returns value from the statement.
22424 (Return.Emit): Even if we are leavning
22426 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
22428 * modifiers.cs: Fix the computation of MethodAttributes flags.
22430 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
22432 * driver.cs: allow compilation of files that start with '/'.
22433 Add a default case when checking the argument of --target.
22435 2002-03-25 Miguel de Icaza <miguel@ximian.com>
22437 * interface.cs: Implement the same search algorithm for types in
22438 the interface code.
22440 * delegate.cs: Do not allow multiple definition.
22442 * Recovered ChangeLog that got accidentally amputated
22444 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
22446 * rootcontext.cs: Load manually enum to allow core classes to
22447 contain enumerations.
22449 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
22450 Update to new static methods in TypeManager.
22452 * typemanager.cs (GetMethod, GetConstructor): Use our
22453 implementation of FindMembers to find the members, since during
22454 corlib compilation, the types are TypeBuilders and GetMethod and
22455 GetConstructor do not work.
22457 Make all methods in TypeManager static.
22459 (InitCodeHelpers): Split the functionality from
22460 the InitCodeTypes function.
22462 * driver.cs: Call InitCodeHelpers after we have populated the
22465 * cs-parser.jay (delegate_declaration): we did not used to compute
22466 the delegate name correctly for void delegates.
22468 2002-03-24 Miguel de Icaza <miguel@ximian.com>
22470 * rootcontext.cs (RootContext): Init the interface_resolve_order
22471 and type_container_resolve_order always.
22473 (ResolveCore, BootstrapCorlib_ResolveClass,
22474 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
22475 compiler when compiling with --nostdlib
22477 * class.cs (TypeContainer.DefineType): Check that our parent is
22478 not null. This test is most important when we are bootstraping
22481 * codegen.cs: Split out the symbol writing code.
22483 2002-03-25 Martin Baulig <martin@gnome.org>
22485 * driver.cs (-g): Made -g an alias for --debug.
22487 2002-03-24 Martin Baulig <martin@gnome.org>
22489 * codegen.cs (SymbolWriter): New public variable. Returns the
22490 current symbol writer.
22491 (CodeGen): Added `bool want_debugging_support' argument to the
22492 constructor. If true, tell the ModuleBuild that we want debugging
22493 support and ask it for the ISymbolWriter.
22494 (Save): If we have a symbol writer, call it's Close() method after
22495 saving the assembly.
22497 * driver.c (--debug): New command line argument to create a
22498 debugger information file.
22500 * location.cs (SymbolDocument): New public property. Returns an
22501 ISymbolDocumentWriter object for the current source file or null
22502 if we don't have a symbol writer.
22504 2002-03-21 Miguel de Icaza <miguel@ximian.com>
22506 * driver.cs (LoadAssembly): Correctly return when all the paths
22507 have been tried and not before.
22509 * statement.cs (Switch.Emit): return the actual coverage for this
22510 statement (returns/not-returns)
22512 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
22513 switch of the statement if we are the last switch section. That
22514 kills two problems: try/catch problems (we used to emit an empty
22515 nop at the end) and switch statements where all branches would
22518 2002-03-19 Miguel de Icaza <miguel@ximian.com>
22520 * driver.cs: Add default assemblies (the equivalent to the
22521 Microsoft CSC.RSP file)
22523 * cs-tokenizer.cs: When updating `cols and setting it to zero,
22524 also update tokens_seen and set it to false.
22526 * driver.cs: Implement --recurse for Mike.
22528 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
22529 correctly splitting out the paths.
22531 2002-03-18 Miguel de Icaza <miguel@ximian.com>
22533 * interface.cs (Interface.PopulateProperty): Instead of using
22534 `parent' as the declaration space for the set parameters, use
22537 * support.cs (InternalParameters): InternalParameters constructor
22538 takes a DeclSpace instead of a TypeContainer.
22540 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
22541 types are being initialized, load the address of it before calling
22544 (New): Provide a mechanism to disable the generation of local
22545 value type temporaries when the caller will be providing us with
22546 an address to store it.
22548 (ArrayCreation.EmitDynamicInitializers): Use it.
22550 2002-03-17 Miguel de Icaza <miguel@ximian.com>
22552 * expression.cs (Invocation.EmitArguments): Only probe for array
22553 property if there is more than one argument. Sorry about that.
22555 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
22556 empty param arrays.
22558 * class.cs (Method.LabelParameters): Fix incorrect code path that
22559 prevented the `ParamArrayAttribute' from being applied to the
22562 2002-03-16 Miguel de Icaza <miguel@ximian.com>
22564 * support.cs (ReflectionParameters): Correctly compute whether the
22565 last argument is a params array. Fixes the problem with
22568 * typemanager.cs: Make the assemblies array always be non-null
22569 (empty, but non-null)
22571 * tree.cs (RecordDecl): New function that abstracts the recording
22572 of names. This reports error 101, and provides a pointer to the
22573 previous declaration. Fixes a crash in the compiler.
22575 * cs-parser.jay (constructor_declaration): Update to new grammar,
22576 and provide a constructor_body that can be empty.
22578 2002-03-15 Miguel de Icaza <miguel@ximian.com>
22580 * driver.cs: Add support for --resources.
22582 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
22583 Make all types for the various array helper methods be integer.
22585 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
22586 CheckState to ConvCast.
22588 (ConvCast): Now it takes a `checked' state argument, to avoid
22589 depending on the emit context for the conversion, and just using
22590 the resolve time setting.
22592 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
22593 instead of Invocation.EmitArguments. We do not emit the original
22594 arguments, instead we emit those which have been converted to
22595 unsigned int expressions.
22597 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
22599 * codegen.cs: ditto.
22601 * expression.cs (LocalVariableReference): Drop the use of the
22602 Store function that depended on the variable index.
22604 * statement.cs (VariableInfo): Drop the `Idx' property from this
22605 class, as this is not taking into account the indexes for
22606 temporaries tat we generate during the execution, getting the
22609 * class.cs: First emit class initializers, then call the parent
22612 * expression.cs (Binary): Fix opcode emision.
22613 (UnaryMutator.EmitCode): Support checked code generation
22615 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
22616 matches for events for both the Static and Instance scans,
22617 pointing to the same element. Fix that.
22619 2002-03-14 Miguel de Icaza <miguel@ximian.com>
22621 * rootcontext.cs (ResolveTree): Always set the
22622 interface_resolve_order, because nested interfaces will be calling
22625 * class.cs (GetInterfaceOrClass): Track the same resolution
22626 process used by TypeManager.LookupType. This fixes the nested
22627 type lookups in class declarations (separate path from
22630 (TypeContainer.DefineType): Also define nested interfaces.
22631 (TypeContainer.RegisterOrder): New public function used to
22632 register the order in which child interfaces need to be closed.
22634 Nested interfaces need to be closed after their parents have been
22637 * interface.cs (InterfaceAttr): Put all the logic for computing
22638 the interface attribute here.
22640 (DefineInterface): Register our interface order with the
22641 RootContext or with the TypeContainer depending on the case.
22643 2002-03-12 Miguel de Icaza <miguel@ximian.com>
22645 * cs-parser.jay: rework foreach statement to work with the new
22646 changes to the policy on SimpleNames.
22648 * report.cs: support Stacktrace on warnings as well.
22650 * makefile: drop --unsafe and /unsafe from the compile.
22652 2002-03-13 Ravi Pratap <ravi@ximian.com>
22654 * ecore.cs (StandardConversionExists): Modify to take an Expression
22655 as the first parameter. Ensure we do null -> reference type conversion
22658 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
22659 temporary Expression objects.
22661 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
22663 * interface.cs: workaround bug in method overloading resolution
22664 (there is already a bugzilla bug for it).
22666 2002-03-12 Miguel de Icaza <miguel@ximian.com>
22668 We could also solve this problem by having a separate path for
22669 performing type lookups, instead of DoResolve, we could have a
22670 ResolveType entry point, and only participating pieces of the
22671 production (simplename, deref, array) would implement this.
22673 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
22674 signal SimpleName to only resolve type names and not attempt to
22675 resolve anything else.
22677 * expression.cs (Cast): Set the flag.
22679 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
22681 * class.cs: Only report 108 if there is no `new' modifier.
22683 * cs-parser.jay: rework foreach statement to work with the new
22684 changes to the policy on SimpleNames.
22686 * report.cs: support Stacktrace on warnings as well.
22688 * makefile: drop --unsafe and /unsafe from the compile.
22690 2002-03-11 Miguel de Icaza <miguel@ximian.com>
22692 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22693 lookups here, instead of doing that at parse time. This means
22694 that our grammar will not introduce `LocalVariableReferences' as
22695 expressions at this point. That solves the problem of code like
22699 static void Main ()
22703 This is only half the fix. The full fix requires parameters to
22704 also be handled in this way.
22706 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
22707 makes the use more obvious of the DeclSpace. The
22708 ec.TypeContainer.TypeBuilder is now only used to pull the
22709 TypeBuilder for it.
22711 My theory is that I can get rid of the TypeBuilder completely from
22712 the EmitContext, and have typecasts where it is used (from
22713 DeclSpace to where it matters).
22715 The only pending problem is that the code that implements Aliases
22716 is on TypeContainer, and probably should go in DeclSpace.
22718 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22719 lookups here, instead of doing that at parse time. This means
22720 that our grammar will not introduce `LocalVariableReferences' as
22721 expressions at this point. That solves the problem of code like
22725 static void Main ()
22729 This is only half the fix. The full fix requires parameters to
22730 also be handled in this way.
22732 * class.cs (Property.DefineMethod): When implementing an interface
22733 method, set newslot, when implementing an abstract method, do not
22734 set the flag (before we tried never setting it, or always setting
22735 it, which is the difference).
22736 (Indexer.DefineMethod): same.
22737 (Method.DefineMethod): same.
22739 * ecore.cs: Only set the status used flag if we get back a Field.
22741 * attribute.cs: Temporary hack, so Paolo can keep working.
22743 2002-03-08 Ravi Pratap <ravi@ximian.com>
22745 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
22746 the unmanaged type in the case we have a MarshalAs attribute.
22748 (Resolve): Handle the case when we are parsing the special MarshalAs
22749 attribute [we need to store the unmanaged type to use later]
22751 * typemanager.cs (marshal_as_attr_type): Built in type for the
22752 MarshalAs Attribute.
22754 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
22755 on parameters and accordingly set the marshalling info.
22757 2002-03-09 Miguel de Icaza <miguel@ximian.com>
22759 * class.cs: Optimizing slightly by removing redundant code after
22760 we switched to the `NoTypes' return value.
22761 (Property.DefineMethod): use NoTypes here too.
22763 This fixes the bug I introduced in my last batch of changes.
22765 2002-03-05 Ravi Pratap <ravi@ximian.com>
22767 * tree.cs (RecordEnum): Add. We now keep track of enums too.
22769 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
22770 Enums since those are types too.
22772 * cs-parser.jay (enum_declaration): Record enums as we parse them.
22774 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
22775 thanks to a call during the lookup process.
22777 2002-03-07 Miguel de Icaza <miguel@ximian.com>
22779 * statement.cs (Foreach): Lots of work to accomodate a particular
22780 kind of foreach statement that I had not kept in mind. It is
22781 possible to have foreachs on classes that provide a GetEnumerator
22782 method that return objects that implement the "pattern" for using
22783 a foreach, there is no need to support GetEnumerator
22786 This is needed to compile nant.
22788 * decl.cs: Only report 114 if the member is not `Finalize' and if
22789 the warning level is at least 2.
22791 * class.cs: Moved the compare function from Method to
22794 (MethodSignature.InheritableMemberSignatureCompare): Add new
22795 filter function that is used to extract inheritable methods from a
22798 (Method.Define): Use the new `inheritable_method_signature_filter'
22801 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
22804 2002-03-06 Miguel de Icaza <miguel@ximian.com>
22806 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
22808 * cs-parser.jay: Add opt_semicolon to the interface declaration.
22810 * expression.cs: Pass location information to
22811 ConvertImplicitStandard.
22813 * class.cs: Added debugging code to track return values from
22816 2002-03-05 Miguel de Icaza <miguel@ximian.com>
22818 * expression.cs (Is.DoResolve): If either side of the `is' is an
22819 interface, do not flag the warning.
22821 * ecore.cs (ImplicitReferenceConversion): We need a separate test
22824 * report.cs: Allow for --fatal to be used with --probe.
22826 * typemanager.cs (NoTypes): Move the definition for the empty Type
22829 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
22831 (TypeContainer.DefineProxy): New function used to proxy to parent
22832 implementations when implementing interfaces.
22833 (TypeContainer.ParentImplements): used to lookup if our parent
22834 implements a public function that is required by an interface.
22835 (TypeContainer.VerifyPendingMethods): Hook this up.
22837 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
22838 `modules' and `assemblies' arraylists into arrays. We only grow
22839 these are the very early start up of the program, so this improves
22840 the speedof LookupType (nicely measured).
22842 * expression.cs (MakeByteBlob): Replaced unsafe code with
22843 BitConverter, as suggested by Paolo.
22845 * cfold.cs (ConstantFold.Binary): Special case: perform constant
22846 folding of string concatenation, but if either side is a string,
22847 and the other is not, then return null, and let the runtime use
22848 the concatenation on the string plus the object (using
22849 `Object.ToString').
22851 2002-03-04 Miguel de Icaza <miguel@ximian.com>
22853 Constant Folding has been implemented now.
22855 * expression.cs (Unary.Reduce): Do not throw an exception, catch
22856 the error instead on types that are not supported in one's
22859 * constant.cs (Constant and all children): New set of functions to
22860 perform implict and explicit conversions.
22862 * ecore.cs (EnumConstant): Implement the new functions to perform
22863 conversion by proxying to the child expression.
22865 * codegen.cs: (ConstantCheckState): Constant evaluation has its
22866 own separate setting that can not be turned off from the command
22867 line using --unchecked or --checked and is only controlled using
22868 the checked/unchecked statements and expressions. This setting is
22869 used by the constant folder to flag errors.
22871 * expression.cs (CheckedExpr, UncheckedExpr): Set the
22872 ConstantCheckState as well.
22874 During Resolve, they also have to flag the state, because the
22875 constant folder runs completely in the Resolve phase.
22877 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
22880 2002-03-01 Miguel de Icaza <miguel@ximian.com>
22882 * cfold.cs: New file, this file contains the constant folder.
22884 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
22885 argument to track whether we are using the resulting address to
22886 load or store a value and provide better error messages.
22888 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
22889 new AddressOf arguments.
22891 * statement.cs (Foreach.EmitCollectionForeach): Update
22893 * expression.cs (Argument.Emit): Call AddressOf with proper
22894 arguments to track usage.
22896 (New.DoEmit): Call AddressOf with new arguments.
22898 (Unary.Emit): Adjust AddressOf call.
22900 2002-03-01 Ravi Pratap <ravi@ximian.com>
22902 * cs-parser.jay (member_access): Change the case for pre-defined types
22903 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
22906 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
22909 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
22910 essentially like methods and apply attributes like MethodImplOptions to them too.
22912 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
22915 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
22916 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
22919 * Update code everywhere accordingly.
22921 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
22923 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
22925 2002-02-28 Ravi Pratap <ravi@ximian.com>
22927 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
22928 try performing lookups against those instead of jumping straight into using
22929 the 'using' clauses.
22931 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
22933 (LookupType): Perform lookups in implicit parents too.
22935 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
22936 sequence as RootContext.LookupType.
22938 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
22939 the various cases of namespace lookups into this method.
22941 2002-03-01 Miguel de Icaza <miguel@ximian.com>
22943 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
22944 in positional arguments)
22946 * class.cs (Operator): Update the AllowedModifiers to contain
22949 * cs-parser.jay: Update operator declaration to allow for the
22950 operator body to be empty.
22952 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
22955 2002-02-27 Miguel de Icaza <miguel@ximian.com>
22957 * class.cs (Method.Emit): Label parameters.
22959 * driver.cs: Return 1 or 0 as the program exit code.
22961 2002-02-26 Miguel de Icaza <miguel@ximian.com>
22963 * expression.cs: Special case the `null' object when trying to
22964 auto-compute the type, as anything can be explicitly converted to
22967 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
22968 spotting this Paolo.
22970 (Expression.ImplicitNumericConversion): Perform comparissions of
22971 the type using the underlying type in the case of an enumeration
22972 rather than using the enumeration type for the compare.
22974 Cope with the underlying == type case, which is not possible to
22977 (Expression.ConvertNumericExplicit): Perform comparissions of
22978 the type using the underlying type in the case of an enumeration
22979 rather than using the enumeration type for the compare.
22981 * driver.cs: If the user does not supply an extension, assume .exe
22983 * cs-parser.jay (if_statement): Rewrote so that we can track the
22984 location for the if statement.
22986 * expression.cs (Binary.ConstantFold): Only concat strings when
22987 the operation is "+", not everything ;-)
22989 * statement.cs (Statement.EmitBoolExpression): Take a location
22991 (If, While, Do): Track location.
22993 * expression.cs (Binary.ResolveOperator): In the object + string
22994 case, I was missing a call to ConvertImplicit
22996 2002-02-25 Ravi Pratap <ravi@ximian.com>
22998 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
22999 Location arguments. Ensure we use RootContext.LookupType to do our work
23000 and not try to do a direct Type.GetType and ModuleBuilder.GetType
23002 * interface.cs (PopulateMethod): Handle the type of the parameter being
23005 * expression.cs (Invocation.BetterFunction): Handle the case when we
23006 have a params method with no fixed arguments and a call is made with no
23009 2002-02-25 Miguel de Icaza <miguel@ximian.com>
23011 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
23012 the verbatim-string-literal
23014 * support.cs (InternalParameters.ParameterModifier): handle null
23016 (InternalParameters.ParameterType): ditto.
23018 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
23019 duplicating the name of the variable parameter.
23020 (GetParameterByName): Fix bug where we were not looking up array
23021 paramters if they were the only present (thanks Paolo!).
23022 (GetParameterInfo): We only have an empty set of types if both
23023 fixed and array are set to null.
23024 (GetParameterInfo-idx): Handle FixedParameter == null
23026 * cs-parser.jay: Handle the case where there is no catch
23027 statements (missing null test).
23029 2002-02-22 Miguel de Icaza <miguel@ximian.com>
23031 * driver.cs (MainDriver): Be conservative on our command line
23034 Catch DirectoryNotFoundException when calling GetFiles.
23036 (SplitPathAndPattern): Used to split the input specification into
23037 a path and a pattern that we can feed to Directory.GetFiles.
23039 2002-02-21 Miguel de Icaza <miguel@ximian.com>
23041 * statement.cs (Fixed): Implement the last case of the Fixed
23042 statement (string handling).
23044 * expression.cs (StringPtr): New class used to return a char * to
23045 a string; Used by the Fixed statement.
23047 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
23049 * expression.cs (Binary.ResolveOperator): Remove redundant
23050 MemberLookup pn parent type.
23051 Optimize union call, we do not need a union if the types are the same.
23052 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
23055 Specialize the use of MemberLookup everywhere, instead of using
23056 the default settings.
23058 (StackAlloc): Implement stackalloc keyword.
23060 * cs-parser.jay: Add rule to parse stackalloc.
23062 * driver.cs: Handle /h, /help, /?
23064 * expression.cs (MakeByteBlob): Removed the hacks we had in place
23065 before we supported unsafe code.
23067 * makefile: add --unsafe to the self compilation of mcs.
23069 2002-02-20 Miguel de Icaza <miguel@ximian.com>
23071 * expression.cs (PointerArithmetic): New class that is used to
23072 perform pointer arithmetic.
23073 (Binary.Resolve): Handle pointer arithmetic
23074 Handle pointer comparission.
23075 (ArrayPtr): Utility expression class that is used to take the
23076 address of an array.
23078 (ElementAccess): Implement array access for pointers
23080 * statement.cs (Fixed): Implement fixed statement for arrays, we
23081 are missing one more case before we are done.
23083 * expression.cs (Indirection): Implement EmitAssign and set the
23084 ExprClass to Variable. This allows pointer dereferences to be
23085 treated as variables, and to have values assigned to them.
23087 * ecore.cs (Expression.StoreFromPtr): New utility function to
23088 store values dereferencing.
23090 2002-02-20 Ravi Pratap <ravi@ximian.com>
23092 * expression.cs (Binary.ResolveOperator): Ensure that we are
23093 not trying to operate on a void type - this fixes the reported
23096 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
23097 the parent implementation is sealed.
23099 * ../errors/cs0239.cs : Add.
23101 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
23103 * typemanager.cs (unverifiable_code_type): Corresponds to
23104 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
23105 which have unsafe code in them.
23107 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
23110 2002-02-19 Miguel de Icaza <miguel@ximian.com>
23112 * cs-tokenizer.cs: Add support for @"litreal strings"
23114 Make tokenizer accept pre-processor directives
23115 on any column (remove the old C-like limitation).
23117 * rootcontext.cs (EmitCode): Emit any global attributes.
23118 (AddGlobalAttributes): Used to keep track of assembly attributes.
23120 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
23122 * cs-parser.jay: Add support for global attributes.
23124 2002-02-17 Miguel de Icaza <miguel@ximian.com>
23126 * expression.cs (Indirection): New helper class. Unary will
23127 create Indirection classes to be able to implement the
23128 IMemoryLocation interface on it.
23130 2002-02-16 Miguel de Icaza <miguel@ximian.com>
23132 * cs-parser.jay (fixed_statement): reference the right statement.
23134 * statement.cs (Fixed.Emit): Finish implementing the fixed
23135 statement for the &x case.
23137 2002-02-14 Miguel de Icaza <miguel@ximian.com>
23139 * class.cs (Property.Define, Method.Define): Remove newslot when
23142 * modifiers.cs: My use of NewSlot when `Abstract' was set was
23143 wrong. NewSlot should only be used if the `new' keyword is present.
23145 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
23146 locating our system dir. Sorry about this.
23148 2002-02-13 Miguel de Icaza <miguel@ximian.com>
23150 * driver.cs (GetSystemDir): Compute correctly the location of our
23151 system assemblies. I was using the compiler directory instead of
23152 the library directory.
23154 2002-02-13 Ravi Pratap <ravi@ximian.com>
23156 * expression.cs (BetterFunction): Put back in what Miguel commented out
23157 since it is the correct fix. The problem is elsewhere ;-)
23159 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
23160 parameters of the parms method are themselves compatible or not !
23162 (StandardConversionExists): Fix very dangerous bug where we were forgetting
23163 to check that a class implements an interface before saying that an implicit
23164 conversion was allowed. Use ImplementsInterface to do the checking.
23166 2002-02-13 Miguel de Icaza <miguel@ximian.com>
23168 * class.cs (Method.Define): Track whether we are an explicit
23169 implementation or not. And only call DefineMethodOverride if we
23170 are an explicit implementation.
23172 (Property.DefineMethod): Ditto.
23174 2002-02-11 Ravi Pratap <ravi@ximian.com>
23176 * expression.cs (BetterFunction): Catch hideous bug which was
23177 preventing us from detecting ambiguous calls due to implicit casts i.e
23180 2002-01-29 Miguel de Icaza <miguel@ximian.com>
23182 * support.cs (Pair): Remove un-needed method. I figured why I was
23183 getting the error in cs-parser.jay, the variable in a foreach loop
23184 is readonly, and the compiler does not really treat this as a variable.
23186 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
23187 instead of EQUALS in grammar.
23189 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
23191 * expression.cs (Unary.DoResolve): Check whether the argument is
23194 2002-01-28 Miguel de Icaza <miguel@ximian.com>
23196 * support.cs: Api for Pair to set a value. Despite the fact that
23197 the variables are public the MS C# compiler refuses to compile
23198 code that accesses the field if the variable is part of a foreach
23201 * statement.cs (Fixed): Begin implementation of the fixed
23204 (Block.AddVariable): Return the VariableInfo on success and null
23205 on failure instead of true/false.
23207 * cs-parser.jay (foreach): Catch errors on variables already
23208 defined (we were ignoring this value before) and properly unwind
23209 the block hierarchy
23211 (fixed_statement): grammar for the fixed statement.
23213 2002-01-25 Miguel de Icaza <miguel@ximian.com>
23215 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
23216 pointer types to be incretemented.
23218 (SizeOf): Implement.
23220 * cs-parser.jay (pointer_member_access): Implement
23221 expr->IDENTIFIER production.
23223 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
23224 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
23227 (Unary): Implement indirection.
23229 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
23230 use in non-unsafe context).
23232 (SimpleName.DoResolve): Check for pointers in field access on safe
23235 (Expression.LoadFromPtr): Factor the load-indirect code in this
23236 function. This was duplicated in UnboxCast and ParameterReference
23238 2002-01-24 Miguel de Icaza <miguel@ximian.com>
23240 * expression.cs (ComposedCast): report an error if a pointer cast
23241 is used in a safe region.
23243 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
23244 pointer type casts in unsafe context.
23246 * codegen.cs (EmitContext): Set up IsUnsafe.
23248 * cs-parser.jay (non_expression_type): Add productions for pointer
23251 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
23252 code. We should not use force into static mode if the method is
23253 not virtual. Fixes bug in MIS
23255 * statement.cs (Do.Emit, While.Emit, For.Emit,
23256 Statement.EmitBoolExpression): Add support to Do and While to
23257 propagate infinite loop as `I do return' semantics.
23259 Improve the For case to also test for boolean constants.
23261 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
23262 to the list of attributes we can add.
23264 Remove `EmitContext' argument.
23266 * class.cs (Method.Define): Apply parameter attributes.
23267 (Constructor.Define): Apply parameter attributes.
23268 (MethodCore.LabelParameters): Move here the core of labeling
23271 * support.cs (ReflectionParameters.ParameterModifier,
23272 InternalParameters.ParameterModifier): Use IsByRef on the type and
23273 only return the OUT bit for these parameters instead of in/out/ref
23276 This is because I miss-understood things. The ParameterInfo.IsIn
23277 and IsOut represent whether the parameter has the [In] and [Out]
23280 2002-01-22 Miguel de Icaza <miguel@ximian.com>
23282 * ecore.cs (FieldExpr.Emit): Release temporaries.
23284 * assign.cs (LocalTemporary.Release): new function.
23286 * codegen.cs (EmitContext.GetTemporaryStorage,
23287 EmitContext.FreeTemporaryStorage): Rework the way we deal with
23288 temporary storage. Now we can "put back" localbuilders when we
23291 2002-01-21 Miguel de Icaza <miguel@ximian.com>
23293 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
23294 need to make a copy of the variable to generate verifiable code.
23296 2002-01-19 Miguel de Icaza <miguel@ximian.com>
23298 * driver.cs: Compute dynamically the system directory.
23300 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
23301 Slower, but more generally useful. Used by the abstract
23302 registering implementation.
23304 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
23305 the rules for the special rule on Type/instances. First check if
23306 we have the same name, and if so, try that special static path
23307 rather than the instance path.
23309 2002-01-18 Miguel de Icaza <miguel@ximian.com>
23311 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
23314 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
23315 Enum, ValueType, Delegate or Array for non-corlib compiles.
23317 * cs-tokenizer.cs: Catch long identifiers (645)
23319 * typemanager.cs (IndexerPropetyName): Ravi never tested this
23322 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
23323 fix, we were returning too early, so we were not registering
23324 pending methods from abstract classes.
23326 Do not register pending methods if the class is abstract.
23328 * expression.cs (Conditional.DoResolve): Report circular implicit
23329 conversions when we neecd to compute it for conditional
23332 (Is.DoResolve): If the expression is always of the provided type,
23333 flag warning 183. If the expression can not ever be of the
23334 provided type flag warning 184.
23336 * class.cs: Catch 169 as well.
23338 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
23341 2002-01-18 Nick Drochak <ndrochak@gol.com>
23343 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
23345 2002-01-17 Miguel de Icaza <miguel@ximian.com>
23347 * interface.cs: (PopulateMethod): Check for pointers being defined
23348 only if the unsafe context is active.
23349 (PopulateProperty): ditto.
23350 (PopulateIndexer): ditto.
23352 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
23353 specified. If pointers are present, make sure that they are
23354 present in an unsafe context.
23355 (Constructor, Constructor.Define): ditto.
23356 (Field, Field.Define): ditto.
23357 (Property, Property.Define): ditto.
23358 (Event, Event.Define): ditto.
23360 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
23361 hashtable if there are classes or structs defined.
23363 * expression.cs (LocalVariableReference.DoResolve): Simplify this
23364 code, as the constant resolution moved.
23366 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
23367 the metadata, so we can flag error 133.
23369 * decl.cs (MemberCore.UnsafeOK): New function to test that a
23370 pointer is being declared in an unsafe context.
23372 2002-01-16 Miguel de Icaza <miguel@ximian.com>
23374 * modifiers.cs (Modifiers.Check): Require a Location argument.
23375 Report error 227 for Unsafe use.
23377 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
23379 * statement.cs (For.Emit): If the test is null, then report that
23380 we do `return', as we wont reach anything afterwards.
23382 (Switch.SwitchGoverningType): Track the expression that matched
23385 * driver.cs: Allow negative numbers as an error code to flag.
23387 * cs-parser.jay: Handle 1551.
23389 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
23391 2002-01-15 Miguel de Icaza <miguel@ximian.com>
23393 * cs-parser.jay: Report 1518 (type declaration can only contain
23394 class, struct, interface, enum or delegate)
23396 (switch_label): Report 1523 (keywords `case' or `default' must
23399 (opt_switch_sections): Report 1522 (empty switch)
23401 * driver.cs: Report 1515 (response file specified multiple times)
23402 Report 1516 (Source file specified multiple times).
23404 * expression.cs (Argument.Resolve): Signal 1510
23406 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
23407 access not allowed in static code)
23409 2002-01-11 Ravi Pratap <ravi@ximian.com>
23411 * typemanager.cs (IsPointerType): Utility method which we are going
23414 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
23415 the object type, so we take care of that.
23417 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
23419 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
23420 added to non-params parameters :-)
23422 * typemanager.cs (CSharpName): Include 'void' type too.
23424 (void_ptr_type): Include in the set of core types.
23426 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
23429 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
23432 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
23433 completely forgotten about it.
23435 2002-01-10 Ravi Pratap <ravi@ximian.com>
23437 * cs-parser.jay (pointer_type): Add. This begins our implementation
23438 of parsing rules for unsafe code.
23440 (unsafe_statement): Implement.
23442 (embedded_statement): Modify to include the above.
23444 * statement.cs (Unsafe): Implement new class for unsafe blocks.
23446 * codegen.cs (EmitContext.InUnsafe): Add. This determines
23447 if the current context is an unsafe one.
23449 * cs-parser.jay (local_variable_pointer_type): Since local variable types
23450 are handled differently, we need separate rules for them.
23452 (local_variable_declaration): Update to use local_variable_pointer_type
23453 to allow variable declarations of unmanaged pointer types.
23455 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
23456 in unsafe contexts.
23458 * ../errors/cs0214.cs : Add.
23460 2002-01-16 Nick Drochak <ndrochak@gol.com>
23462 * makefile: remove 'response' file when cleaning.
23464 2002-01-15 Miguel de Icaza <miguel@ximian.com>
23466 * cs-parser.jay: Report 1524.
23468 2002-01-14 Miguel de Icaza <miguel@ximian.com>
23470 * typemanager.cs (RegisterMethod): drop checking if we have
23471 registered this from here
23473 2002-01-12 Miguel de Icaza <miguel@ximian.com>
23475 * class.cs (Method.EmitDestructor): Implement calling our base
23478 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
23479 value of InFinally.
23481 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
23482 this routine and will wrap the call in a try/catch block. Deal
23485 2002-01-11 Miguel de Icaza <miguel@ximian.com>
23487 * ecore.cs (Expression.MemberLookup): instead of taking a
23488 parameter `same_type' that was used to tell whether we could
23489 access private members we compute our containing type from the
23492 (FieldExpr): Added partial support for volatile fields. This does
23493 not work for volatile fields exposed from assemblies, as I can not
23494 figure out how to extract the modreq from it.
23496 Updated all the source files to use this.
23498 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
23499 because it is referenced by MemberLookup very often.
23501 2002-01-09 Ravi Pratap <ravi@ximian.com>
23503 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
23504 TypeBuilder.GetCustomAttributes to retrieve what we need.
23506 Get rid of redundant default_member_attr_type as this is the same as
23507 default_member_type which already exists.
23509 * interface.cs, attribute.cs : Update accordingly.
23511 2002-01-08 Miguel de Icaza <miguel@ximian.com>
23513 * typemanager.cs: Enable IndexerPropertyName again. It does not
23514 work for TYpeBuilders though. Ravi, can you please fix this?
23516 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
23518 * expression.cs (Argument.Emit): Handle the case of ref objects
23519 being passed to ref functions;
23521 (ParameterReference.EmitLoad): Loads the content of the pointer
23522 without dereferencing.
23524 2002-01-07 Miguel de Icaza <miguel@ximian.com>
23526 * cs-tokenizer.cs: Implemented the pre-processing expressions.
23528 2002-01-08 Ravi Pratap <ravi@ximian.com>
23530 * class.cs (Indexer.DefineMethod): Incorporate the interface
23531 type in the name of the method if we are doing explicit interface
23534 * expression.cs (ConversionExists): Remove as it is completely obsolete.
23536 (BetterConversion): Fix extremely trivial bug where we were referring to
23537 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
23540 * ../errors/bug16.cs : Add although we have fixed it.
23542 2002-01-07 Miguel de Icaza <miguel@ximian.com>
23544 * expression.cs (BaseIndexer): Begin implementation.
23546 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
23548 * cs-parser.jay (indexer_declarator): Use qualified_identifier
23549 production directly to remove a shift/reduce, and implement
23550 explicit interface implementation.
23552 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
23553 after a floating point suffix.
23555 * expression.cs (DoNumericPromotions): Improved the conversion for
23556 uint/uint. If we have a constant, we avoid doing a typecast to a
23559 * class.cs (Indexer): Implement explicit interface implementation
23562 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
23564 * class.cs: make the default instance constructor public and hidebysig.
23566 2001-01-03 Ravi Pratap <ravi@ximian.com>
23568 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
23569 so we can call it from elsewhere.
23571 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
23572 we emit it internally if the class has a defined indexer; otherwise the user
23573 emits it by decorating the class definition with the DefaultMemberAttribute.
23575 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
23576 attribute is not used on a type which defines an indexer.
23578 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
23579 character when we skip whitespace.
23581 * ../errors/cs0646.cs : Add.
23583 2002-01-03 Miguel de Icaza <miguel@ximian.com>
23585 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
23588 * makefile: Add practical target `mcs3.exe' which builds the third
23589 generation compiler.
23591 * expression.cs (New): Fix structures constructor calling.
23593 * class.cs (Property, Method, Indexer): Emit Final flag on the
23594 method if we are an interface implementation and we are not
23597 * ecore.cs (PropertyExpr): New public field `IsBase', tells
23598 whether this property is referencing a `base' method.
23600 * expression.cs (Invocation.EmitCall): take an extra argument:
23601 is_base, this is used to determine whether the `call' or
23602 `callvirt' opcode should be used.
23605 * delegate.cs: update EmitCall.
23607 * class.cs (Method.Define): Set NewSlot for the cases where we are
23608 not implementing an interface method.
23610 (Property.Define): ditto.
23612 2002-01-02 Miguel de Icaza <miguel@ximian.com>
23614 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
23615 'r'. Allows mcs to parse itself fully.
23617 2002-01-02 Ravi Pratap <ravi@ximian.com>
23619 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
23620 of the number of initializers that require the InitializeArray method.
23622 (CheckIndices): Store the Expression in all cases - not the plain value. Also
23623 update the above field where necessary.
23625 (MakeByteBlob): Update accordingly.
23627 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
23630 (EmitDynamicInitializers): Update in accordance with the new optimization.
23632 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
23633 same OpCode applies.
23635 * cs-parser.jay : Fix some glaring errors I introduced.
23637 2002-01-01 Ravi Pratap <ravi@ximian.com>
23639 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
23640 so that we can check for name clashes there too.
23642 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
23643 for interface indexers.
23645 * interfaces.cs (Define): Emit the default member attribute.
23647 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
23648 variable was being referred to while setting the value ;-)
23650 2002-01-01 Miguel de Icaza <miguel@ximian.com>
23652 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
23653 byte-by-byte information when we know the data is zero.
23655 Make the block always a multiple of 4, because
23656 DefineInitializedData has a bug.
23658 * assign.cs: Fix, we should assign from the temporary, not from
23661 * expression.cs (MakeByteBlob): Fix my incorrect code.
23663 2001-12-31 Miguel de Icaza <miguel@ximian.com>
23665 * typemanager.cs (EnumToUnderlying): This function is used to get
23666 the underlying type from an enumeration, because it does not
23669 * constant.cs: Use the I4_S form for values between -128 and 127.
23671 * statement.cs (Block.LookupLabel): Looks up a label.
23672 (Block): Drop support for labeled blocks.
23674 (LabeledStatement): New kind of statement that represents a label
23677 (Goto): Finally implement this bad boy.
23679 * cs-parser.jay: Update to reflect new mechanism to implement
23682 2001-12-30 Miguel de Icaza <miguel@ximian.com>
23684 * codegen.cs (EmitContext.This): a codegen property that keeps the
23685 a single instance of this instead of creating many different this
23688 * delegate.cs (Delegate.DoResolve): Update to use the property;
23690 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
23692 * expression.cs (BaseAccess.DoResolve): Ditto.
23694 2001-12-29 Ravi Pratap <ravi@ximian.com>
23696 * typemanager.cs (methodimpl_attr_type): Add to hold the type
23697 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
23699 (InitCoreTypes): Update accordingly.
23701 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
23702 so we can quickly store the state.
23704 (ApplyAttributes): Set the correct implementation flags
23705 for InternalCall methods.
23707 2001-12-29 Miguel de Icaza <miguel@ximian.com>
23709 * expression.cs (EmitCall): if a method is not virtual, then do
23710 not use callvirt on it.
23712 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
23713 user defined stuff) requires the use of stobj, which takes an
23714 address on the stack instead of an array and an index. So emit
23715 the Ldelema operation for it.
23717 (EmitStoreOpcode): Use stobj for valuetypes.
23719 (UnaryMutator.EmitCode): Use the right 1 value depending on
23720 whether we are dealing with int64/uint64, float or doubles.
23722 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
23723 constructors that I implemented last night.
23725 (Constructor.IsDefault): Fix to work properly for static
23728 * cs-parser.jay (CheckDef): report method signature errors.
23729 Update error number 103 to be 132.
23731 * decl.cs: New AdditionResult enumeration value: MethodExists.
23732 Although we do this check for methods later on in the semantic
23733 analysis, catching repeated default constructors is so easy that
23734 we catch these here.
23736 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
23739 (ParameterReference.EmitAssign, Emit): handle
23742 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
23743 (ArrayAccess.EmitStoreOpcode): ditto.
23745 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
23747 * expression.cs (MakeByteBlob): Complete all the missing types
23748 (uint, short, ushort, byte, sbyte)
23750 * class.cs: Only init instance field initializers on instance
23753 Rename `constructors' to instance_constructors.
23755 (TypeContainer.AddConstructor): Only add constructors to the list
23756 if it is not static.
23758 Make sure that we handle default_static_constructor independently
23759 everywhere where we handle instance_constructors
23761 2001-12-28 Miguel de Icaza <miguel@ximian.com>
23763 * class.cs: Do not lookup or create a base initializer for a
23764 static constructor.
23766 (ConstructorInitializer.Resolve): use the proper type to lookup
23769 * cs-parser.jay: Report error 1585 (modifiers between type and name).
23771 * enum.cs, interface.cs: Remove CloseType, this is taken care by
23774 * decl.cs: CloseType is now an virtual method, the default
23775 implementation just closes this type.
23777 2001-12-28 Ravi Pratap <ravi@ximian.com>
23779 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
23780 to PreserveSig by default. Also emit HideBySig on such methods.
23782 Basically, set the defaults to standard values.
23784 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
23785 argument, if candidate is better, it can't be worse than the best !
23787 (Invocation): Re-write bits to differentiate between methods being
23788 applicable in their expanded form and their normal form - for params
23791 Get rid of use_standard everywhere as only standard conversions are allowed
23792 in overload resolution.
23794 More spec conformance.
23796 2001-12-27 Miguel de Icaza <miguel@ximian.com>
23798 * driver.cs: Add --timestamp, to see where the compiler spends
23801 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
23802 `this' in static code.
23804 (SimpleName.DoResolve): Implement in terms of a helper function
23805 that allows static-references to be passed upstream to
23808 (Expression.ResolveWithSimpleName): Resolve specially simple
23809 names when called by MemberAccess to implement the special
23812 (Expression.ImplicitReferenceConversion): Handle conversions from
23813 Null to reference types before others, as Null's type is
23816 * expression.cs (Invocation.EmitCall): Handle the special case of
23817 calling methods declared on a reference type from a ValueType
23818 (Base classes System.Object and System.Enum)
23820 (MemberAccess.Resolve): Only perform lookups on Enumerations if
23821 the left hand side is a TypeExpr, not on every enumeration.
23823 (Binary.Resolve): If types are reference types, then do a cast to
23824 object on operators != and == of both arguments.
23826 * typemanager.cs (FindMembers): Extract instance and static
23827 members if requested.
23829 * interface.cs (PopulateProperty): Use void_type instead of null
23830 as the return type for the setter method.
23832 (PopulateIndexer): ditto.
23834 2001-12-27 Ravi Pratap <ravi@ximian.com>
23836 * support.cs (ReflectionParameters): Fix minor bug where we
23837 were examining the wrong parameter for the ParamArray attribute.
23839 Cope with requests for the type of the parameter at position
23840 greater than the params parameter's. We now return the element
23841 type of the params array as that makes more sense.
23843 * expression.cs (Invocation.IsParamsMethodApplicable): Update
23844 accordingly as we no longer have to extract the element type
23847 (Invocation.OverloadResolve): Update.
23849 2001-12-27 Miguel de Icaza <miguel@ximian.com>
23851 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
23852 against IEnumerator, test whether the return value is a descendant
23853 of the IEnumerator interface.
23855 * class.cs (Indexer.Define): Use an auxiliary method to implement
23856 the other bits of the method definition. Begin support for
23857 explicit interface implementation.
23859 (Property.DefineMethod): Use TypeManager.void_type instead of null
23860 for an empty return value.
23862 2001-12-26 Miguel de Icaza <miguel@ximian.com>
23864 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
23865 dealing with a FieldExpr which is composed of a FieldBuilder, in
23866 the code path we did extract the constant, but we should have
23867 obtained the underlying value to be able to cast it (otherwise we
23868 end up in an infinite loop, this is what Ravi was running into).
23870 (ArrayCreation.UpdateIndices): Arrays might be empty.
23872 (MemberAccess.ResolveMemberAccess): Add support for section
23873 14.5.4.1 that deals with the special case of E.I when E is a type
23874 and something else, that I can be a reference to a static member.
23876 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
23877 handle a particular array type to create byte blobs, it is just
23878 something we dont generate byteblobs for.
23880 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
23883 * location.cs (Push): remove the key from the hashtable that we
23884 are about to add. This happens for empty files.
23886 * driver.cs: Dispose files after we have parsed them.
23888 (tokenize): new function that only runs the tokenizer on its
23889 input, for speed testing.
23891 2001-12-26 Ravi Pratap <ravi@ximian.com>
23893 * class.cs (Event.Define): Define the private field only if there
23894 are no accessors defined.
23896 * expression.cs (ResolveMemberAccess): If there is no associated
23897 field with the event, that means we have an event defined with its
23898 own accessors and we should flag error cs0070 since transforming
23899 ourselves into a field is not valid in that case.
23901 * ecore.cs (SimpleName.DoResolve): Same as above.
23903 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
23904 and charset to sane values.
23906 2001-12-25 Ravi Pratap <ravi@ximian.com>
23908 * assign.cs (DoResolve): Perform check on events only if they
23909 are being accessed outside the declaring type.
23911 * cs-parser.jay (event_declarations): Update rules to correctly
23912 set the type of the implicit parameter etc.
23914 (add_accessor, remove_accessor): Set current local parameters.
23916 * expression.cs (Binary): For delegate addition and subtraction,
23917 cast the return value from the method into the appropriate delegate
23920 2001-12-24 Ravi Pratap <ravi@ximian.com>
23922 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
23923 of these as the workaround is unnecessary.
23925 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
23926 delegate data - none of that is needed at all.
23928 Re-write bits to extract the instance expression and the delegate method
23931 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
23934 * attribute.cs (ApplyAttributes): New method to take care of common tasks
23935 of attaching attributes instead of duplicating code everywhere.
23937 * everywhere : Update code to do attribute emission using the above method.
23939 2001-12-23 Miguel de Icaza <miguel@ximian.com>
23941 * expression.cs (IsParamsMethodApplicable): if there are not
23942 parameters, return immediately.
23944 * ecore.cs: The 0 literal can be implicity converted to an enum
23947 (SimpleName.DoResolve): First lookup the type, then lookup the
23950 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
23951 want to get its address. If the InstanceExpression is not
23952 addressable, store the result in a temporary variable, then get
23955 * codegen.cs: Only display 219 errors on warning level or above.
23957 * expression.cs (ArrayAccess): Make it implement the
23958 IMemoryLocation interface.
23960 (Binary.DoResolve): handle the operator == (object a, object b)
23961 and operator != (object a, object b) without incurring into a
23962 BoxedCast (because 5 != o should never be performed).
23964 Handle binary enumerator operators.
23966 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
23967 value type, otherwise use Ldelem_ref.
23969 Use precomputed names;
23971 (AddressOf): Implement address of
23973 * cs-parser.jay (labeled_statement): Fix recursive block
23974 addition by reworking the production.
23976 * expression.cs (New.DoEmit): New has a special case:
23978 If we are dealing with a ValueType, we have a few
23979 situations to deal with:
23981 * The target of New is a ValueType variable, that is
23982 easy, we just pass this as the variable reference
23984 * The target of New is being passed as an argument,
23985 to a boxing operation or a function that takes a
23988 In this case, we need to create a temporary variable
23989 that is the argument of New.
23992 2001-12-23 Ravi Pratap <ravi@ximian.com>
23994 * rootcontext.cs (LookupType): Check that current_type is not null before
23995 going about looking at nested types.
23997 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
23998 not implement the IAssignMethod interface any more.
24000 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
24001 where we tranform them into FieldExprs if they are being resolved from within
24002 the declaring type.
24004 * ecore.cs (SimpleName.DoResolve): Do the same here.
24006 * assign.cs (DoResolve, Emit): Clean up code considerably.
24008 * ../errors/bug10.cs : Add.
24010 * ../errors/cs0070.cs : Add.
24012 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
24014 * assign.cs : Get rid of EventIsLocal everywhere.
24016 2001-12-23 Miguel de Icaza <miguel@ximian.com>
24018 * ecore.cs (ConvertIntLiteral): finished the implementation.
24020 * statement.cs (SwitchLabel): Convert the value we are using as a
24021 key before looking up the table.
24023 2001-12-22 Miguel de Icaza <miguel@ximian.com>
24025 * codegen.cs (EmitTopBlock): Require a Location argument now.
24027 * cs-parser.jay (constructor_declarator): We need to setup
24028 current_local_parameters before we parse the
24029 opt_constructor_initializer, to allow the variables to be bound
24030 to the constructor arguments.
24032 * rootcontext.cs (LookupType): First lookup nested classes in our
24033 class and our parents before we go looking outside our class.
24035 * expression.cs (ConstantFold): Extract/debox the values at the
24038 * rootcontext.cs (EmitCode): Resolve the constants first before we
24039 resolve the types. This is not really needed, but it helps debugging.
24041 * statement.cs: report location.
24043 * cs-parser.jay: pass location to throw statement.
24045 * driver.cs: Small bug fix.
24047 * report.cs: Updated format to be 4-zero filled digits.
24049 2001-12-22 Ravi Pratap <ravi@ximian.com>
24051 * expression.cs (CheckIndices): Fix minor bug where the wrong
24052 variable was being referred to ;-)
24054 (DoEmit): Do not call EmitStaticInitializers when the
24055 underlying type is System.Object.
24057 2001-12-21 Ravi Pratap <ravi@ximian.com>
24059 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
24060 and do the usual workaround for SRE.
24062 * class.cs (MyEventBuilder.EventType): New member to get at the type
24063 of the event, quickly.
24065 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
24067 * assign.cs (Assign.DoResolve): Handle the case when the target
24068 is an EventExpr and perform the necessary checks.
24070 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
24073 (SimpleName.MemberStaticCheck): Include check for EventExpr.
24075 (EventExpr): Set the type in the constructor itself since we
24076 are meant to be born fully resolved.
24078 (EventExpr.Define): Revert code I wrote earlier.
24080 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
24081 instance expression is null. The instance expression is a This in that case
24082 or a null, depending on whether it is a static method or not.
24084 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
24085 refers to more than one method.
24087 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
24088 and accordingly flag errors.
24090 2001-12-21 Miguel de Icaza <miguel@ximian.com>
24092 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
24094 2001-12-22 Miguel de Icaza <miguel@ximian.com>
24096 * location.cs (ToString): Provide useful rutine.
24098 2001-12-21 Miguel de Icaza <miguel@ximian.com>
24100 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
24101 objects, return the actual integral boxed.
24103 * statement.cs (SwitchLabel): define an ILLabel for each
24106 (Switch.CheckSwitch): If the value is a Literal, extract
24107 the underlying literal.
24109 Also in the unused hashtable we had, add the SwitchLabel so we can
24110 quickly look this value up.
24112 * constant.cs: Implement a bunch of new constants. Rewrite
24113 Literal based on this. Made changes everywhere to adapt to this.
24115 * expression.cs (Expression.MakeByteBlob): Optimize routine by
24116 dereferencing array only once, and also copes with enumrations.
24118 bytes are two bytes wide, not one.
24120 (Cast): Perform constant conversions.
24122 * ecore.cs (TryImplicitIntConversion): Return literals instead of
24123 wrappers to the literals here.
24125 * expression.cs (DoNumericPromotions): long literals can converted
24126 to ulong implicity (this is taken care of elsewhere, but I was
24127 missing this spot).
24129 * ecore.cs (Expression.Literalize): Make the return type Literal,
24130 to improve type checking.
24132 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
24134 2001-12-20 Miguel de Icaza <miguel@ximian.com>
24136 * literal.cs: Revert code from ravi that checked the bounds. The
24137 bounds are sane by the definition of the type itself.
24139 * typemanager.cs: Fix implementation of ImplementsInterface. We
24140 need to actually look up in our parent hierarchy for interfaces
24143 * const.cs: Use the underlying type for enumerations
24145 * delegate.cs: Compute the basename for the delegate creation,
24146 that should fix the delegate test case, and restore the correct
24147 Type Lookup semantics in rootcontext
24149 * rootcontext.cs: Revert Ravi's last patch. The correct way of
24150 referencing a nested type with the Reflection API is using the "+"
24153 * cs-parser.jay: Do not require EOF token at the end.
24155 2001-12-20 Ravi Pratap <ravi@ximian.com>
24157 * rootcontext.cs (LookupType): Concatenate type names with
24158 a '.' instead of a '+' The test suite passes again.
24160 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
24161 field of the enumeration.
24163 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
24164 the case when the member is an EventExpr.
24166 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
24167 static has an associated instance expression.
24169 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
24171 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
24173 * class.cs (Event.Define): Register event and perform appropriate checks
24176 We define the Add and Remove methods even if the use provides none because
24177 in that case, we provide default implementations ourselves.
24179 Define a private field of the type of the event. This is done by the CSC compiler
24180 and we should be doing it too ;-)
24182 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
24183 More methods we use in code we generate.
24185 (multicast_delegate_type, delegate_type): Two separate types since the distinction
24188 (InitCoreTypes): Update accordingly for the above.
24190 * class.cs (Event.Emit): Generate code for default accessors that we provide
24192 (EmitDefaultMethod): Do the job in the above.
24194 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
24197 2001-12-20 Miguel de Icaza <miguel@ximian.com>
24199 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
24200 builders even if we were missing one.
24202 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
24203 pass the Basename as our class name instead of the Name. The
24204 basename will be correctly composed for us.
24206 * parameter.cs (Paramters): Now takes a Location argument.
24208 * decl.cs (DeclSpace.LookupType): Removed convenience function and
24209 make all the code call directly LookupType in RootContext and take
24210 this chance to pass the Location information everywhere.
24212 * Everywhere: pass Location information.
24214 2001-12-19 Miguel de Icaza <miguel@ximian.com>
24216 * class.cs (Constructor.Define): Updated way of detecting the
24217 length of the parameters.
24219 (TypeContainer.DefineType): Use basename as the type name for
24222 (TypeContainer.Define): Do not recursively define types here, as
24223 definition is taken care in order by the RootContext.
24225 * tree.cs: Keep track of namespaces in a per-file basis.
24227 * parameter.cs (Parameter.ComputeSignature): Update to use
24230 (Parameters.GetSignature): ditto.
24232 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
24233 instead of a TypeContainer.
24235 (Interface.SemanticAnalysis): Use `this' instead of our parent to
24236 resolve names. Because we need to be resolve in our context, not
24239 * driver.cs: Implement response files.
24241 * class.cs (TypeContainer.DefineType): If we are defined, do not
24242 redefine ourselves.
24244 (Event.Emit): Emit the code for add/remove handlers.
24245 (Event.Define): Save the MethodBuilders for add/remove.
24247 * typemanager.cs: Use pair here too.
24249 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
24250 DictionaryEntry requires the first argument to be non-null.
24252 (enum_declaration): Compute full name for registering the
24255 (delegate_declaration): Instead of using
24256 formal_parameter_list, use opt_formal_parameter_list as the list
24259 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
24260 (EventParsing): New property that controls whether `add' and
24261 `remove' are returned as tokens or identifiers (for events);
24263 2001-12-19 Ravi Pratap <ravi@ximian.com>
24265 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
24266 use MyEventBuilder only and let it wrap the real builder for us.
24268 (MyEventBuilder): Revamp constructor etc.
24270 Implement all operations that we perform on EventBuilder in precisely the same
24273 (FindMembers): Update to use the EventBuilder member.
24275 (Event.Emit): Update accordingly.
24277 2001-12-18 Ravi Pratap <ravi@ximian.com>
24279 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
24280 by calling the appropriate methods.
24282 (GetCustomAttributes): Make stubs as they cannot possibly do anything
24285 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
24287 2001-12-17 Ravi Pratap <ravi@ximian.com>
24289 * delegate.cs (Delegate.Populate): Check that the return type
24290 and various parameters types are indeed accessible.
24292 * class.cs (Constructor.Define): Same here.
24294 (Field.Define): Ditto.
24296 (Event.Define): Ditto.
24298 (Operator.Define): Check that the underlying Method defined itself
24299 correctly - so it's MethodBuilder should not be null.
24301 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
24302 expression happens to be null.
24304 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
24305 members but as of now we don't seem to be able to do anything really useful with it.
24307 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
24308 not the EventBuilder.
24310 2001-12-18 Miguel de Icaza <miguel@ximian.com>
24312 * cs-tokenizer.cs: Add support for defines.
24313 Add support for #if, #elif, #else, #endif
24315 (eval_var): evaluates a variable.
24316 (eval): stubbed for evaluating functions.
24318 * cs-parser.jay: Pass the defines information
24320 * driver.cs: Add --define command line option.
24322 * decl.cs: Move MemberCore here.
24324 Make it the base class for DeclSpace. This allows us to catch and
24325 report 108 and 109 for everything now.
24327 * class.cs (TypeContainer.Define): Extract all the members
24328 before populating and emit the warning 108 (new keyword required
24329 to override) instead of having each member implement this.
24331 (MemberCore.Define): New abstract method, we will be using this in
24332 the warning reporting engine in Populate.
24334 (Operator.Define): Adjust to new MemberCore protocol.
24336 * const.cs (Const): This does not derive from Expression, it is a
24337 temporary object we use to create fields, it is a MemberCore.
24339 * class.cs (Method.Define): Allow the entry point to be in a
24342 * driver.cs: Rewrite the argument handler to clean it up a bit.
24344 * rootcontext.cs: Made it just an auxiliary namespace feature by
24345 making everything static.
24347 * driver.cs: Adapt code to use RootContext type name instead of
24350 * delegate.cs: Remove RootContext argument.
24352 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
24355 * class.cs (Event.Define): The lookup can fail.
24357 * cs-tokenizer.cs: Begin implementation of pre-procesor.
24359 * expression.cs: Resolve the this instance before invoking the code.
24361 2001-12-17 Miguel de Icaza <miguel@ximian.com>
24363 * cs-parser.jay: Add a production in element_access that allows
24364 the thing to become a "type" reference. This way we can parse
24365 things like "(string [])" as a type.
24367 Note that this still does not handle the more complex rules of
24371 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
24373 * ecore.cs: (CopyNewMethods): new utility function used to
24374 assemble the list of methods from running FindMembers.
24376 (MemberLookup): Rework FindMembers so that
24378 2001-12-16 Miguel de Icaza <miguel@ximian.com>
24380 * class.cs (TypeContainer): Remove Delegates who fail to be
24383 * delegate.cs (Populate): Verify that we dont get null return
24384 values. TODO: Check for AsAccessible.
24386 * cs-parser.jay: Use basename to emit error 574 (destructor should
24387 have the same name as container class), not the full name.
24389 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
24390 possible representation.
24392 Also implements integer type suffixes U and L.
24394 2001-12-15 Miguel de Icaza <miguel@ximian.com>
24396 * expression.cs (ArrayCreation.DoResolve): We need to do the
24397 argument resolution *always*.
24399 * decl.cs: Make this hold the namespace. Hold the root context as
24401 (LookupType): Move here.
24403 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
24405 * location.cs (Row, Name): Fixed the code, it was always returning
24406 references to the first file.
24408 * interface.cs: Register properties defined through interfaces.
24410 * driver.cs: Add support for globbing on the command line
24412 * class.cs (Field): Make it derive from MemberCore as well.
24415 2001-12-15 Ravi Pratap <ravi@ximian.com>
24417 * class.cs (Event::Define): Check that the type of the event is a delegate
24418 type else flag error #66.
24420 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
24423 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
24424 values of EntryPoint, CharSet etc etc.
24426 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
24428 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
24429 be null and we should ignore this. I am not sure if this is really clean. Apparently,
24430 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
24431 which needs this to do its work.
24433 * ../errors/cs0066.cs : Add.
24435 2001-12-14 Miguel de Icaza <miguel@ximian.com>
24437 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
24440 * class.cs: (MethodSignature.MethodSignature): Removed hack that
24441 clears out the parameters field.
24442 (MemberSignatureCompare): Cleanup
24444 (MemberCore): New base class used to share code between MethodCore
24447 (RegisterRequiredImplementations) BindingFlags.Public requires
24448 either BindingFlags.Instace or Static. Use instance here.
24450 (Property): Refactored code to cope better with the full spec.
24452 * parameter.cs (GetParameterInfo): Return an empty array instead
24455 * class.cs (Property): Abstract or extern properties have no bodies.
24457 * parameter.cs (GetParameterInfo): return a zero-sized array.
24459 * class.cs (TypeContainer.MethodModifiersValid): Move all the
24460 method modifier validation to the typecontainer so we can reuse
24461 this on properties.
24463 (MethodCore.ParameterTypes): return an empty sized array of types.
24465 (Property.Define): Test property modifier validity.
24467 Add tests for sealed/override too.
24469 (Method.Emit): abstract or extern methods have no bodies.
24471 2001-12-14 Ravi Pratap <ravi@ximian.com>
24473 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
24476 (Method::Define, ::Emit): Modify accordingly.
24478 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
24480 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
24482 * makefile: Pass in /unsafe.
24484 2001-12-13 Miguel de Icaza <miguel@ximian.com>
24486 * class.cs (MakeKey): Kill routine.
24488 * class.cs (TypeContainer.Define): Correctly define explicit
24489 method implementations (they require the full interface name plus
24492 * typemanager.cs: Deply the PtrHashtable here and stop using the
24493 lame keys. Things work so much better.
24495 This of course broke everyone who depended on `RegisterMethod' to
24496 do the `test for existance' test. This has to be done elsewhere.
24498 * support.cs (PtrHashtable): A hashtable that avoid comparing with
24499 the object stupid Equals method (because, that like fails all over
24500 the place). We still do not use it.
24502 * class.cs (TypeContainer.SetRequiredInterface,
24503 TypeContainer.RequireMethods): Killed these two routines and moved
24504 all the functionality to RegisterRequiredImplementations.
24506 (TypeContainer.RegisterRequiredImplementations): This routine now
24507 registers all the implementations required in an array for the
24508 interfaces and abstract methods. We use an array of structures
24509 which can be computed ahead of time to reduce memory usage and we
24510 also assume that lookups are cheap as most classes will not
24511 implement too many interfaces.
24513 We also avoid creating too many MethodSignatures.
24515 (TypeContainer.IsInterfaceMethod): Update and optionally does not
24516 clear the "pending" bit if we find that there are problems with
24519 (TypeContainer.VerifyPendingMethods): Update to report errors of
24520 methods that look like implementations but are not.
24522 (TypeContainer.Define): Add support for explicit interface method
24525 2001-12-12 Miguel de Icaza <miguel@ximian.com>
24527 * typemanager.cs: Keep track of the parameters here instead of
24528 being a feature of the TypeContainer.
24530 * class.cs: Drop the registration of parameters here, as
24531 InterfaceMethods are also interface declarations.
24533 * delegate.cs: Register methods with the TypeManager not only with
24534 the TypeContainer. This code was buggy.
24536 * interface.cs: Full registation here.
24538 2001-12-11 Miguel de Icaza <miguel@ximian.com>
24540 * expression.cs: Remove reducer for binary expressions, it can not
24543 * const.cs: Put here the code that used to go into constant.cs
24545 * constant.cs: Put here the code for constants, this is a new base
24546 class for Literals.
24548 * literal.cs: Make Literal derive from Constant.
24550 2001-12-09 Miguel de Icaza <miguel@ximian.com>
24552 * statement.cs (Return.Emit): Report error 157 if the user
24553 attempts to return from a finally block.
24555 (Return.Emit): Instead of emitting a return, jump to the end of
24558 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
24559 LocalBuilder to store the result of the function. ReturnLabel is
24560 the target where we jump.
24563 2001-12-09 Radek Doulik <rodo@ximian.com>
24565 * cs-parser.jay: remember alias in current namespace
24567 * ecore.cs (SimpleName::DoResolve): use aliases for types or
24570 * class.cs (LookupAlias): lookup alias in my_namespace
24572 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
24574 (LookupAlias): lookup alias in this and if needed in parent
24577 2001-12-08 Miguel de Icaza <miguel@ximian.com>
24581 * rootcontext.cs: (ModuleBuilder) Made static, first step into
24582 making things static. I need this to avoid passing the
24583 TypeContainer when calling ParameterType.
24585 * support.cs (InternalParameters.ParameterType): Remove ugly hack
24586 that did string manipulation to compute the type and then call
24587 GetType. Use Parameter.ParameterType instead.
24589 * cs-tokenizer.cs: Consume the suffix for floating values.
24591 * expression.cs (ParameterReference): figure out whether this is a
24592 reference parameter or not. Kill an extra variable by computing
24593 the arg_idx during emission.
24595 * parameter.cs (Parameters.GetParameterInfo): New overloaded
24596 function that returns whether a parameter is an out/ref value or not.
24598 (Parameter.ParameterType): The type of the parameter (base,
24599 without ref/out applied).
24601 (Parameter.Resolve): Perform resolution here.
24602 (Parameter.ExternalType): The full type (with ref/out applied).
24604 * statement.cs (Using.Emit, Using.EmitExpression): Implement
24605 support for expressions on the using statement.
24607 2001-12-07 Miguel de Icaza <miguel@ximian.com>
24609 * statement.cs (Using.EmitLocalVariableDecls): Split the
24610 localvariable handling of the using statement.
24612 (Block.EmitMeta): Keep track of variable count across blocks. We
24613 were reusing slots on separate branches of blocks.
24615 (Try.Emit): Emit the general code block, we were not emitting it.
24617 Check the type of the declaration to be an IDisposable or
24618 something that can be implicity converted to it.
24620 Emit conversions if required.
24622 * ecore.cs (EmptyExpression): New utility class.
24623 (Expression.ImplicitConversionExists): New utility function.
24625 2001-12-06 Miguel de Icaza <miguel@ximian.com>
24627 * statement.cs (Using): Implement.
24629 * expression.cs (LocalVariableReference): Support read only variables.
24631 * statement.cs: Remove the explicit emit for the Leave opcode.
24632 (VariableInfo): Add a readonly field.
24634 2001-12-05 Miguel de Icaza <miguel@ximian.com>
24636 * ecore.cs (ConvCast): new class used to encapsulate the various
24637 explicit integer conversions that works in both checked and
24638 unchecked contexts.
24640 (Expression.ConvertNumericExplicit): Use new ConvCast class to
24641 properly generate the overflow opcodes.
24643 2001-12-04 Miguel de Icaza <miguel@ximian.com>
24645 * statement.cs: The correct type for the EmptyExpression is the
24646 element_type, not the variable type. Ravi pointed this out.
24648 2001-12-04 Ravi Pratap <ravi@ximian.com>
24650 * class.cs (Method::Define): Handle PInvoke methods specially
24651 by using DefinePInvokeMethod instead of the usual one.
24653 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
24654 above to do the task of extracting information and defining the method.
24656 2001-12-04 Ravi Pratap <ravi@ximian.com>
24658 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
24659 of the condition for string type.
24661 (Emit): Move that here.
24663 (ArrayCreation::CheckIndices): Keep string literals in their expression
24666 (EmitDynamicInitializers): Handle strings appropriately.
24668 2001-12-04 Miguel de Icaza <miguel@ximian.com>
24670 * codegen.cs (EmitContext): Replace multiple variables with a
24671 single pointer to the current Switch statement.
24673 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
24676 2001-12-03 Miguel de Icaza <miguel@ximian.com>
24680 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
24683 (Foreach.Emit): Foreach on arrays was not setting
24684 up the loop variables (for break/continue).
24686 (GotoCase): Semi-implented.
24688 2001-12-03 Ravi Pratap <ravi@ximian.com>
24690 * attribute.cs (CheckAttribute): Handle system attributes by using
24691 Attribute.GetAttributes to examine information we need.
24693 (GetValidPlaces): Same here.
24695 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
24697 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
24699 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
24701 (Method::Define): Set appropriate flags if we have a DllImport attribute.
24703 (Method::Emit): Handle the case when we are a PInvoke method.
24705 2001-12-03 Miguel de Icaza <miguel@ximian.com>
24707 * expression.cs: Use ResolveWithSimpleName on compound names.
24709 2001-12-02 Ravi Pratap <ravi@ximian.com>
24711 * constant.cs (EmitConstant): Make sure we resolve the associated expression
24712 before trying to reduce it.
24714 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
24716 * constant.cs (LookupConstantValue): Implement.
24718 (EmitConstant): Use the above in emitting the constant.
24720 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
24721 that are user-defined by doing a LookupConstantValue on them.
24723 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
24726 2001-11-29 Miguel de Icaza <miguel@ximian.com>
24728 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
24730 (BaseAccess.DoResolve): Implement.
24732 (MemberAccess.DoResolve): Split this routine into a
24733 ResolveMemberAccess routine that can be used independently
24735 2001-11-28 Miguel de Icaza <miguel@ximian.com>
24737 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
24738 As that share bits of the implementation. Is returns a boolean,
24739 while As returns the Type that is being probed.
24741 2001-12-01 Ravi Pratap <ravi@ximian.com>
24743 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
24744 instead of a Literal - much easier.
24746 (EnumInTransit): Remove - utterly useless :-)
24748 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
24750 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
24752 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
24753 chain when we have no associated expression.
24755 2001-11-30 Ravi Pratap <ravi@ximian.com>
24757 * constant.cs (Define): Use Location while reporting the errror.
24759 Also emit a warning when 'new' is used and there is no inherited
24762 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
24765 (LookupEnumValue): Implement to lookup an enum member's value and define it
24768 (Populate): Re-write accordingly to use the above routine.
24770 2001-11-27 Miguel de Icaza <miguel@ximian.com>
24772 * expression.cs (This): Fix prototype for DoResolveLValue to
24773 override the base class DoResolveLValue.
24775 * cs-parser.cs: Report errors cs574 and cs575 (destructor
24778 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
24779 (we need to load the address of the field here). This fixes
24782 (FieldExpr.DoResolveLValue): Call the DoResolve
24783 function to initialize the Instance expression.
24785 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
24786 correctly the GetEnumerator operation on a value type.
24788 * cs-parser.jay: Add more simple parsing error catches.
24790 * statement.cs (Switch): Add support for string switches.
24791 Handle null specially.
24793 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
24795 2001-11-28 Ravi Pratap <ravi@ximian.com>
24797 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
24799 (declare_local_constant): New helper function.
24801 * statement.cs (AddConstant): Keep a separate record of constants
24803 (IsConstant): Implement to determine if a variable is a constant.
24805 (GetConstantExpression): Implement.
24807 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
24809 * statement.cs (IsVariableDefined): Re-write.
24811 2001-11-27 Ravi Pratap <ravi@ximian.com>
24813 * class.cs (TypeContainer::FindMembers): Look for constants
24814 in the case when we are looking for MemberTypes.Field
24816 * expression.cs (MemberAccess::DoResolve): Check that in the
24817 case we are a FieldExpr and a Literal, we are not being accessed
24818 by an instance reference.
24820 * cs-parser.jay (local_constant_declaration): Implement.
24822 (declaration_statement): Implement for constant declarations.
24824 2001-11-26 Miguel de Icaza <miguel@ximian.com>
24826 * statement.cs (Switch): Catch double defaults.
24828 (Switch): More work on the switch() statement
24829 implementation. It works for integral values now, need to finish
24833 2001-11-24 Miguel de Icaza <miguel@ximian.com>
24835 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
24836 integer literals into other integer literals. To be used by
24839 2001-11-24 Ravi Pratap <ravi@ximian.com>
24841 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
24844 (EmitDynamicInitializers): Cope with the above since we extract data
24845 directly from ArrayData now.
24847 (ExpectInitializers): Keep track of whether initializers are mandatory
24850 (Bounds): Make it a hashtable to prevent the same dimension being
24851 recorded for every element in that dimension.
24853 (EmitDynamicInitializers): Fix bug which prevented the Set array method
24856 Also fix bug which was causing the indices to be emitted in the reverse
24859 2001-11-24 Miguel de Icaza <miguel@ximian.com>
24861 * expression.cs (ArrayCreation): Implement the bits that Ravi left
24862 unfinished. They do not work, because the underlying code is
24865 2001-11-22 Miguel de Icaza <miguel@ximian.com>
24867 * cs-parser.jay: Remove bogus fixme.
24869 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
24870 on Switch statement.
24872 2001-11-23 Ravi Pratap <ravi@ximian.com>
24874 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
24877 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
24878 parameter. Apparently, any expression is allowed.
24880 (ValidateInitializers): Update accordingly.
24882 (CheckIndices): Fix some tricky bugs thanks to recursion.
24884 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
24885 I was being completely brain-dead.
24887 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
24888 and re-write acordingly.
24890 (DelegateInvocation): Re-write accordingly.
24892 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
24894 (MakeByteBlob): Handle types more correctly.
24896 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
24897 initialization from expressions but it is incomplete because I am a complete
24900 2001-11-22 Miguel de Icaza <miguel@ximian.com>
24902 * statement.cs (If.Emit): Fix a bug that generated incorrect code
24903 on If. Basically, we have to return `true' (ie, we do return to
24904 our caller) only if both branches of the if return.
24906 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
24907 short-circuit operators, handle them as short circuit operators.
24909 (Cast.DoResolve): Resolve type.
24910 (Cast.Cast): Take an expression as the target type.
24912 * cs-parser.jay (cast_expression): Remove old hack that only
24913 allowed a limited set of types to be handled. Now we take a
24914 unary_expression and we resolve to a type during semantic
24917 Use the grammar productions from Rhys to handle casts (this is
24918 not complete like Rhys syntax yet, we fail to handle that corner
24919 case that C# has regarding (-x), but we will get there.
24921 2001-11-22 Ravi Pratap <ravi@ximian.com>
24923 * class.cs (EmitFieldInitializer): Take care of the case when we have a
24924 field which is an array type.
24926 * cs-parser.jay (declare_local_variables): Support array initialization too.
24928 * typemanager.cs (MakeKey): Implement.
24930 (everywhere): Use the above appropriately.
24932 * cs-parser.jay (for_statement): Update for array initialization while
24933 declaring variables.
24935 * ecore.cs : The error message was correct, it's the variable's names that
24936 were misleading ;-) Make the code more readable.
24938 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
24939 the correct type etc.
24941 (ConvertExplicit): Handle Enum types by examining the underlying type.
24943 2001-11-21 Ravi Pratap <ravi@ximian.com>
24945 * parameter.cs (GetCallingConvention): Always return
24946 CallingConventions.Standard for now.
24948 2001-11-22 Miguel de Icaza <miguel@ximian.com>
24950 * expression.cs (Binary.ResolveOperator): Update the values of `l'
24951 and `r' after calling DoNumericPromotions.
24953 * ecore.cs: Fix error message (the types were in the wrong order).
24955 * statement.cs (Foreach.ProbeCollectionType): Need to pass
24956 BindingFlags.Instance as well
24958 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
24959 implicit int literal conversion in an empty cast so that we
24960 propagate the right type upstream.
24962 (UnboxCast): new class used to unbox value types.
24963 (Expression.ConvertExplicit): Add explicit type conversions done
24966 (Expression.ImplicitNumericConversion): Oops, forgot to test for
24967 the target type before applying the implicit LongLiterals to ULong
24970 2001-11-21 Miguel de Icaza <miguel@ximian.com>
24972 * cs-parser.jay (for_statement): Reworked the way For works: now
24973 we declare manually any variables that are introduced in
24974 for_initializer to solve the problem of having out-of-band code
24975 emition (that is what got for broken).
24977 (declaration_statement): Perform the actual variable declaration
24978 that used to be done in local_variable_declaration here.
24980 (local_variable_declaration): Do not declare anything, just pass
24981 the information on a DictionaryEntry
24983 2001-11-20 Ravi Pratap <ravi@ximian.com>
24985 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
24986 re-write of the logic to now make it recursive.
24988 (UpdateIndices): Re-write accordingly.
24990 Store element data in a separate ArrayData list in the above methods.
24992 (MakeByteBlob): Implement to dump the array data into a byte array.
24994 2001-11-19 Ravi Pratap <ravi@ximian.com>
24996 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
24999 * constant.cs (Define): Implement.
25001 (EmitConstant): Re-write fully.
25003 Pass in location info.
25005 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
25008 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
25009 DictionaryEntry since we need location info too.
25011 (constant_declaration): Update accordingly.
25013 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
25014 code into another method : UpdateIndices.
25016 2001-11-18 Ravi Pratap <ravi@ximian.com>
25018 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
25019 some type checking etc.
25021 2001-11-17 Ravi Pratap <ravi@ximian.com>
25023 * expression.cs (ArrayCreation::ValidateInitializers): Implement
25024 bits to provide dimension info if the user skips doing that.
25026 Update second constructor to store the rank correctly.
25028 2001-11-16 Ravi Pratap <ravi@ximian.com>
25030 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
25031 and try to implement.
25033 * ../errors/cs0150.cs : Add.
25035 * ../errors/cs0178.cs : Add.
25037 2001-11-16 Miguel de Icaza <miguel@ximian.com>
25039 * statement.cs: Implement foreach on multi-dimensional arrays.
25041 * parameter.cs (Parameters.GetParameterByName): Also lookup the
25042 name of the params argument.
25044 * expression.cs: Use EmitStoreOpcode to get the right opcode while
25045 initializing the array.
25047 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
25048 we can use this elsewhere.
25050 * statement.cs: Finish implementation of foreach for single
25053 * cs-parser.jay: Use an out-of-band stack to pass information
25054 around, I wonder why I need this.
25056 foreach_block: Make the new foreach_block the current_block.
25058 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
25059 function used to return a static Parameters structure. Used for
25060 empty parameters, as those are created very frequently.
25062 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
25064 2001-11-15 Ravi Pratap <ravi@ximian.com>
25066 * interface.cs : Default modifier is private, not public. The
25067 make verify test passes again.
25069 2001-11-15 Ravi Pratap <ravi@ximian.com>
25071 * support.cs (ReflectionParameters): Fix logic to determine
25072 whether the last parameter is a params one. Test 9 passes again.
25074 * delegate.cs (Populate): Register the builders we define with
25075 RegisterParameterForBuilder. Test 19 passes again.
25077 * cs-parser.jay (property_declaration): Reference $6 instead
25078 of $$ to get at the location.
25080 (indexer_declaration): Similar stuff.
25082 (attribute): Ditto.
25084 * class.cs (Property): Register parameters for the Get and Set methods
25085 if they exist. Test 23 passes again.
25087 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
25088 call to EmitArguments as we are sure there aren't any params arguments.
25089 Test 32 passes again.
25091 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
25092 IndexOutOfRangeException.
25094 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
25095 Test 33 now passes again.
25097 2001-11-15 Miguel de Icaza <miguel@ximian.com>
25099 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
25100 broke a bunch of things. Will have to come up with a better way
25101 of tracking locations.
25103 * statement.cs: Implemented foreach for single dimension arrays.
25105 2001-11-09 Miguel de Icaza <miguel@ximian.com>
25107 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
25108 an error. This removes the lookup from the critical path.
25110 * cs-parser.jay: Removed use of temporary_loc, which is completely
25113 2001-11-14 Miguel de Icaza <miguel@ximian.com>
25115 * support.cs (ReflectionParameters.ParameterModifier): Report
25116 whether the argument is a PARAMS argument or not.
25118 * class.cs: Set the attribute `ParamArrayAttribute' on the
25119 parameter argument.
25121 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
25122 and cons_param_array_attribute (ConstructorInfo for
25123 ParamArrayAttribute).,
25125 * codegen.cs: Emit the return using the `Return' statement, that
25126 way we can report the error correctly for missing return values.
25128 * class.cs (Method.Emit): Clean up.
25130 * expression.cs (Argument.Resolve): Take another argument: the
25131 location where this argument is used. Notice that this is not
25132 part of the "Argument" class as to reduce the size of the
25133 structure (we know the approximate location anyways).
25135 Test if the argument is a variable-reference, if not, then
25136 complain with a 206.
25138 (Argument.Emit): Emit addresses of variables.
25140 (Argument.FullDesc): Simplify.
25142 (Invocation.DoResolve): Update for Argument.Resolve.
25144 (ElementAccess.DoResolve): ditto.
25146 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
25147 method should be virtual, as this method is always virtual.
25149 (NewDelegate.DoResolve): Update for Argument.Resolve.
25151 * class.cs (ConstructorInitializer.DoResolve): ditto.
25153 * attribute.cs (Attribute.Resolve): ditto.
25155 2001-11-13 Miguel de Icaza <miguel@ximian.com>
25157 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
25159 * expression.cs (ParameterReference): Drop IStackStorage and implement
25160 IAssignMethod instead.
25162 (LocalVariableReference): ditto.
25164 * ecore.cs (FieldExpr): Drop IStackStorage and implement
25165 IAssignMethod instead.
25167 2001-11-13 Miguel de Icaza <miguel@ximian.com>
25169 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
25170 enumerations that are used in heavily used structures derive from
25171 byte in a laughable and pathetic attempt to reduce memory usage.
25172 This is the kind of pre-optimzations that you should not do at
25173 home without adult supervision.
25175 * expression.cs (UnaryMutator): New class, used to handle ++ and
25176 -- separatedly from the other unary operators. Cleans up the
25177 code, and kills the ExpressionStatement dependency in Unary.
25179 (Unary): Removed `method' and `Arguments' from this class, making
25180 it smaller, and moving it all to SimpleCall, so I can reuse this
25181 code in other locations and avoid creating a lot of transient data
25182 strucutres when not required.
25184 * cs-parser.jay: Adjust for new changes.
25186 2001-11-11 Miguel de Icaza <miguel@ximian.com>
25188 * enum.cs (Enum.Populate): If there is a failure during
25191 * cs-parser.jay (opt_enum_base): we used to catch type errors
25192 here, but this is really incorrect. The type error should be
25193 catched during semantic analysis.
25195 2001-12-11 Ravi Pratap <ravi@ximian.com>
25197 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
25198 current_local_parameters as expected since I, in my stupidity, had forgotten
25201 * attribute.cs (GetValidPlaces): Fix stupid bug.
25203 * class.cs (Method::Emit): Perform check on applicability of attributes.
25205 (Constructor::Emit): Ditto.
25207 (Field::Emit): Ditto.
25209 (Field.Location): Store location information.
25211 (Property, Event, Indexer, Operator): Ditto.
25213 * cs-parser.jay (field_declaration): Pass in location for each field.
25215 * ../errors/cs0592.cs : Add.
25217 2001-11-12 Ravi Pratap <ravi@ximian.com>
25219 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
25221 (InitCoreTypes): Update accordingly.
25223 (RegisterAttrType, LookupAttr): Implement.
25225 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
25226 info about the same.
25228 (Resolve): Update to populate the above as necessary.
25230 (Error592): Helper.
25232 (GetValidPlaces): Helper to the above.
25234 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
25236 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
25238 2001-11-12 Ravi Pratap <ravi@ximian.com>
25240 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
25242 * ../errors/cs0617.cs : Add.
25244 2001-11-11 Ravi Pratap <ravi@ximian.com>
25246 * enum.cs (Emit): Rename to Populate to be more consistent with what
25247 we expect it to do and when exactly it is called.
25249 * class.cs, rootcontext.cs : Update accordingly.
25251 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
25252 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
25254 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
25256 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
25257 of a fieldinfo using the above, when dealing with a FieldBuilder.
25259 2001-11-10 Ravi Pratap <ravi@ximian.com>
25261 * ../errors/cs0031.cs : Add.
25263 * ../errors/cs1008.cs : Add.
25265 * ../errrors/cs0543.cs : Add.
25267 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
25270 (FindMembers): Implement.
25272 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
25273 enums and delegates too.
25275 (enum_types): Rename to builder_to_enum.
25277 (delegate_types): Rename to builder_to_delegate.
25279 * delegate.cs (FindMembers): Implement.
25281 2001-11-09 Ravi Pratap <ravi@ximian.com>
25283 * typemanager.cs (IsEnumType): Implement.
25285 * enum.cs (Emit): Re-write parts to account for the underlying type
25286 better and perform checking etc.
25288 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
25289 of the underlying type.
25291 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
25294 * enum.cs (error31): Helper to report error #31.
25296 * cs-parser.jay (enum_declaration): Store location of each member too.
25298 * enum.cs (member_to_location): New hashtable.
25300 (AddEnumMember): Update location hashtable.
25302 (Emit): Use the location of each member while reporting errors.
25304 2001-11-09 Miguel de Icaza <miguel@ximian.com>
25306 * cs-parser.jay: A for_initializer if is a
25307 local_variable_declaration really ammount to have an implicit
25308 block with the variable declaration and no initializer for for.
25310 * statement.cs (For.Emit): Cope with null initializers.
25312 This fixes the infinite loop on for initializers.
25314 2001-11-08 Miguel de Icaza <miguel@ximian.com>
25316 * enum.cs: More cleanup.
25318 * ecore.cs: Remove dead code.
25320 * class.cs (Property.Emit): More simplification.
25321 (Event.Emit): ditto.
25323 Reworked to have less levels of indentation.
25325 2001-11-08 Ravi Pratap <ravi@ximian.com>
25327 * class.cs (Property): Emit attributes.
25337 * enum.cs (Emit): Ditto.
25339 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
25342 * class.cs (Field, Event, etc.): Move attribute generation into the
25343 Emit method everywhere.
25345 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
25346 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
25347 as we had no way of defining nested enums !
25349 * rootcontext.cs : Adjust code accordingly.
25351 * typemanager.cs (AddEnumType): To keep track of enum types separately.
25353 2001-11-07 Ravi Pratap <ravi@ximian.com>
25355 * expression.cs (EvalConstantExpression): Move into ecore.cs
25357 * enum.cs (Enum): Rename some members and make them public and readonly
25358 according to our convention.
25360 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
25363 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
25365 (Enum::Emit): Write a simple version for now which doesn't try to compute
25366 expressions. I shall modify this to be more robust in just a while.
25368 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
25370 (TypeContainer::CloseType): Create the Enum types too.
25372 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
25374 * expression.cs (EvalConstantExpression): Get rid of completely.
25376 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
25377 user-defined values and other cases.
25379 (IsValidEnumLiteral): Helper function.
25381 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
25382 out there in the case we had a literal FieldExpr.
25384 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
25386 (Literalize): Revamp a bit to take two arguments.
25388 (EnumLiteral): New class which derives from Literal to wrap enum literals.
25390 2001-11-06 Ravi Pratap <ravi@ximian.com>
25392 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
25394 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
25396 (Resolve): Use the above to ensure we have proper initializers.
25398 2001-11-05 Ravi Pratap <ravi@ximian.com>
25400 * expression.cs (Expression::EvalConstantExpression): New method to
25401 evaluate constant expressions.
25403 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
25405 2001-11-07 Miguel de Icaza <miguel@ximian.com>
25407 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
25410 (Binary.ResolveOperator): Handle operator != (object a, object b)
25411 and operator == (object a, object b);
25413 (Binary.DoNumericPromotions): Indicate whether the numeric
25414 promotion was possible.
25416 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
25419 Made the ArrayAccess implement interface IAssignMethod instead of
25420 IStackStore as the order in which arguments are passed reflects
25423 * assign.cs: Instead of using expr.ExprClass to select the way of
25424 assinging, probe for the IStackStore/IAssignMethod interfaces.
25426 * typemanager.cs: Load InitializeArray definition.
25428 * rootcontext.cs (RootContext.MakeStaticData): Used to define
25429 static data that can be used to initialize arrays.
25431 2001-11-05 Miguel de Icaza <miguel@ximian.com>
25433 * expression.cs: Handle operator== and operator!= for booleans.
25435 (Conditioal.Reduce): Implement reducer for the ?: operator.
25437 (Conditional.Resolve): Implement dead code elimination.
25439 (Binary.Resolve): Catch string literals and return a new
25440 concatenated string.
25442 (Unary.Reduce): Implement reduction of unary expressions.
25444 * ecore.cs: Split out the expression core handling here.
25446 (Expression.Reduce): New method used to perform constant folding
25447 and CSE. This is needed to support constant-expressions.
25449 * statement.cs (Statement.EmitBoolExpression): Pass true and false
25450 targets, and optimize for !x.
25452 2001-11-04 Ravi Pratap <ravi@ximian.com>
25454 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
25455 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
25456 set custom atttributes.
25458 * literal.cs (Literal::GetValue): New abstract method to return the actual
25459 value of the literal, cast as an object.
25461 (*Literal): Implement GetValue method.
25463 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
25464 expressions to the arraylist but objects of type Argument.
25466 * class.cs (TypeContainer::Emit): Emit our attributes too.
25468 (Method::Emit, Constructor::Emit): Ditto.
25470 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
25471 to be ignoring earlier.
25473 2001-11-03 Ravi Pratap <ravi@ximian.com>
25475 * attribute.cs (AttributeSection::Define): Implement to do the business
25476 of constructing a CustomAttributeBuilder.
25478 (Attribute): New trivial class. Increases readability of code.
25480 * cs-parser.jay : Update accordingly.
25482 (positional_argument_list, named_argument_list, named_argument): New rules
25484 (attribute_arguments): Use the above so that we are more correct.
25486 2001-11-02 Ravi Pratap <ravi@ximian.com>
25488 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
25489 to perform all checks for a method with a params parameter.
25491 (Invocation::OverloadResolve): Update to use the above method and therefore
25492 cope correctly with params method invocations.
25494 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
25497 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
25498 constructors in our parent too because we can't afford to miss out on
25501 * attribute.cs (AttributeSection): New name for the class Attribute
25503 Other trivial changes to improve readability.
25505 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
25506 use the new class names.
25508 2001-11-01 Ravi Pratap <ravi@ximian.com>
25510 * class.cs (Method::Define): Complete definition for params types too
25512 (Indexer::Define): Ditto.
25514 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
25515 Cope everywhere with a request for info about the array parameter.
25517 2001-11-01 Ravi Pratap <ravi@ximian.com>
25519 * tree.cs (RecordNamespace): Fix up to check for the correct key.
25521 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
25522 local_variable_type to extract the string corresponding to the type.
25524 (local_variable_type): Fixup the action to use the new helper method.
25526 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
25529 * expression.cs : Clean out code which uses the above.
25531 2001-10-31 Ravi Pratap <ravi@ximian.com>
25533 * typemanager.cs (RegisterMethod): Check if we already have an existing key
25534 and bale out if necessary by returning a false.
25536 (RegisterProperty): Ditto.
25538 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
25539 and print out appropriate error messages.
25541 * interface.cs (everywhere): Ditto.
25543 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
25544 location to constructor.
25546 * class.cs (Property, Event, Indexer): Update accordingly.
25548 * ../errors/cs111.cs : Added.
25550 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
25551 of a method, as laid down by the spec.
25553 (Invocation::OverloadResolve): Use the above method.
25555 2001-10-31 Ravi Pratap <ravi@ximian.com>
25557 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
25558 now take a TypeContainer and a Parameters object.
25560 (ParameterData): Modify return type of ParameterModifier method to be
25561 Parameter.Modifier and not a string.
25563 (ReflectionParameters, InternalParameters): Update accordingly.
25565 * expression.cs (Argument::GetParameterModifier): Same here.
25567 * support.cs (InternalParameters::ParameterType): Find a better way of determining
25568 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
25569 symbol in it at all so maybe this is only for now.
25571 2001-10-30 Ravi Pratap <ravi@ximian.com>
25573 * support.cs (InternalParameters): Constructor now takes an extra argument
25574 which is the actual Parameters class.
25576 (ParameterDesc): Update to provide info on ref/out modifiers.
25578 * class.cs (everywhere): Update call to InternalParameters to pass in
25579 the second argument too.
25581 * support.cs (ParameterData): Add ParameterModifier, which is a method
25582 to return the modifier info [ref/out etc]
25584 (InternalParameters, ReflectionParameters): Implement the above.
25586 * expression.cs (Argument::ParameterModifier): Similar function to return
25587 info about the argument's modifiers.
25589 (Invocation::OverloadResolve): Update to take into account matching modifiers
25592 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
25593 a new SetFormalParameters object which we pass to InternalParameters.
25595 2001-10-30 Ravi Pratap <ravi@ximian.com>
25597 * expression.cs (NewArray): Merge into the ArrayCreation class.
25599 2001-10-29 Ravi Pratap <ravi@ximian.com>
25601 * expression.cs (NewArray): Merge classes NewBuiltinArray and
25602 NewUserdefinedArray into one as there wasn't much of a use in having
25605 * expression.cs (Argument): Change field's name to ArgType from Type.
25607 (Type): New readonly property which returns the proper type, taking into
25608 account ref/out modifiers.
25610 (everywhere): Adjust code accordingly for the above.
25612 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
25613 whether we are emitting for a ref or out parameter.
25615 * expression.cs (Argument::Emit): Use the above field to set the state.
25617 (LocalVariableReference::Emit): Update to honour the flag and emit the
25620 * parameter.cs (Attributes): Set the correct flags for ref parameters.
25622 * expression.cs (Argument::FullDesc): New function to provide a full desc.
25624 * support.cs (ParameterData): Add method ParameterDesc to the interface.
25626 (ReflectionParameters, InternalParameters): Implement the above method.
25628 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
25631 (Invocation::FullMethodDesc): Ditto.
25633 2001-10-29 Miguel de Icaza <miguel@ximian.com>
25635 * cs-parser.jay: Add extra production for the second form of array
25638 * expression.cs (ArrayCreation): Update to reflect the above
25641 * Small changes to prepare for Array initialization.
25643 2001-10-28 Miguel de Icaza <miguel@ximian.com>
25645 * typemanager.cs (ImplementsInterface): interface might be null;
25646 Deal with this problem;
25648 Also, we do store negative hits on the cache (null values), so use
25649 this instead of calling t.GetInterfaces on the type everytime.
25651 2001-10-28 Ravi Pratap <ravi@ximian.com>
25653 * typemanager.cs (IsBuiltinType): New method to help determine the same.
25655 * expression.cs (New::DoResolve): Get rid of array creation code and instead
25656 split functionality out into different classes.
25658 (New::FormArrayType): Move into NewBuiltinArray.
25660 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
25663 (NewBuiltinArray): New class to handle creation of built-in arrays.
25665 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
25666 account creation of one-dimensional arrays.
25668 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
25670 (NewUserdefinedArray::DoResolve): Implement.
25672 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
25674 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
25675 we maintain inside the TypeManager. This is necessary to perform lookups on the
25678 (LookupType): Update to perform GetType on the module builders too.
25680 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
25682 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
25684 2001-10-23 Ravi Pratap <ravi@ximian.com>
25686 * expression.cs (New::DoResolve): Implement guts of array creation.
25688 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
25690 2001-10-27 Miguel de Icaza <miguel@ximian.com>
25692 * expression.cs: Fix bug I introduced lsat night that broke
25695 (Expression.Resolve): Report a 246 error (can not resolve name)
25696 if we find a SimpleName in the stream.
25698 (Expression.ResolveLValue): Ditto.
25700 (Expression.ResolveWithSimpleName): This function is a variant of
25701 ResolveName, this one allows SimpleNames to be returned without a
25702 warning. The only consumer of SimpleNames is MemberAccess
25704 2001-10-26 Miguel de Icaza <miguel@ximian.com>
25706 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
25707 might arrive here. I have my doubts that this is correct.
25709 * statement.cs (Lock): Implement lock statement.
25711 * cs-parser.jay: Small fixes to support `lock' and `using'
25713 * cs-tokenizer.cs: Remove extra space
25715 * driver.cs: New flag --checked, allows to turn on integer math
25718 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
25719 Threading.Monitor.Exit
25721 2001-10-23 Miguel de Icaza <miguel@ximian.com>
25723 * expression.cs (IndexerAccess::DoResolveLValue): Set the
25724 Expression Class to be IndexerAccess.
25726 Notice that Indexer::DoResolve sets the eclass to Value.
25728 2001-10-22 Miguel de Icaza <miguel@ximian.com>
25730 * class.cs (TypeContainer::Emit): Emit code for indexers.
25732 * assign.cs (IAssignMethod): New interface implemented by Indexers
25733 and Properties for handling assignment.
25735 (Assign::Emit): Simplify and reuse code.
25737 * expression.cs (IndexerAccess, PropertyExpr): Implement
25738 IAssignMethod, clean up old code.
25740 2001-10-22 Ravi Pratap <ravi@ximian.com>
25742 * typemanager.cs (ImplementsInterface): New method to determine if a type
25743 implements a given interface. Provides a nice cache too.
25745 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
25748 (ConvertReferenceExplicit): Ditto.
25750 * delegate.cs (Delegate::Populate): Update to define the parameters on the
25751 various methods, with correct names etc.
25753 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
25754 Operator.UnaryNegation.
25756 * cs-parser.jay (operator_declarator): Be a little clever in the case where
25757 we have a unary plus or minus operator.
25759 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
25762 * everywhere : update accordingly.
25764 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
25767 * class.cs (Method::Define): For the case where we are implementing a method
25768 inherited from an interface, we need to set the MethodAttributes.Final flag too.
25769 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
25771 2001-10-21 Ravi Pratap <ravi@ximian.com>
25773 * interface.cs (FindMembers): Implement to work around S.R.E
25776 * typemanager.cs (IsInterfaceType): Implement.
25778 (FindMembers): Update to handle interface types too.
25780 * expression.cs (ImplicitReferenceConversion): Re-write bits which
25781 use IsAssignableFrom as that is not correct - it doesn't work.
25783 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
25784 and accordingly override EmitStatement.
25786 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
25787 using the correct logic :-)
25789 2001-10-19 Ravi Pratap <ravi@ximian.com>
25791 * ../errors/cs-11.cs : Add to demonstrate error -11
25793 2001-10-17 Miguel de Icaza <miguel@ximian.com>
25795 * assign.cs (Assign::Resolve): Resolve right hand side first, and
25796 then pass this as a hint to ResolveLValue.
25798 * expression.cs (FieldExpr): Add Location information
25800 (FieldExpr::LValueResolve): Report assignment to readonly
25803 (Expression::ExprClassFromMemberInfo): Pass location information.
25805 (Expression::ResolveLValue): Add new method that resolves an
25808 (Expression::DoResolveLValue): Default invocation calls
25811 (Indexers): New class used to keep track of indexers in a given
25814 (IStackStore): Renamed from LValue, as it did not really describe
25815 what this did. Also ResolveLValue is gone from this interface and
25816 now is part of Expression.
25818 (ElementAccess): Depending on the element access type
25820 * typemanager.cs: Add `indexer_name_type' as a Core type
25821 (System.Runtime.CompilerServices.IndexerNameAttribute)
25823 * statement.cs (Goto): Take a location.
25825 2001-10-18 Ravi Pratap <ravi@ximian.com>
25827 * delegate.cs (Delegate::VerifyDelegate): New method to verify
25828 if two delegates are compatible.
25830 (NewDelegate::DoResolve): Update to take care of the case when
25831 we instantiate a delegate from another delegate.
25833 * typemanager.cs (FindMembers): Don't even try to look up members
25834 of Delegate types for now.
25836 2001-10-18 Ravi Pratap <ravi@ximian.com>
25838 * delegate.cs (NewDelegate): New class to take care of delegate
25841 * expression.cs (New): Split the delegate related code out into
25842 the NewDelegate class.
25844 * delegate.cs (DelegateInvocation): New class to handle delegate
25847 * expression.cs (Invocation): Split out delegate related code into
25848 the DelegateInvocation class.
25850 2001-10-17 Ravi Pratap <ravi@ximian.com>
25852 * expression.cs (New::DoResolve): Implement delegate creation fully
25853 and according to the spec.
25855 (New::DoEmit): Update to handle delegates differently.
25857 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
25858 because of which we were printing out arguments in reverse order !
25860 * delegate.cs (VerifyMethod): Implement to check if the given method
25861 matches the delegate.
25863 (FullDelegateDesc): Implement.
25865 (VerifyApplicability): Implement.
25867 * expression.cs (Invocation::DoResolve): Update to accordingly handle
25868 delegate invocations too.
25870 (Invocation::Emit): Ditto.
25872 * ../errors/cs1593.cs : Added.
25874 * ../errors/cs1594.cs : Added.
25876 * delegate.cs (InstanceExpression, TargetMethod): New properties.
25878 2001-10-16 Ravi Pratap <ravi@ximian.com>
25880 * typemanager.cs (intptr_type): Core type for System.IntPtr
25882 (InitCoreTypes): Update for the same.
25884 (iasyncresult_type, asynccallback_type): Ditto.
25886 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
25889 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
25892 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
25893 the builders for the 4 members of a delegate type :-)
25895 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
25898 * expression.cs (New::DoResolve): Implement guts for delegate creation.
25900 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
25902 2001-10-15 Miguel de Icaza <miguel@ximian.com>
25904 * statement.cs (Break::Emit): Implement.
25905 (Continue::Emit): Implement.
25907 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
25908 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
25909 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
25910 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
25913 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
25914 properties that track the label for the current loop (begin of the
25915 loop and end of the loop).
25917 2001-10-15 Ravi Pratap <ravi@ximian.com>
25919 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
25920 use of emitting anything at all.
25922 * class.cs, rootcontext.cs : Get rid of calls to the same.
25924 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
25926 (Populate): Define the constructor correctly and set the implementation
25929 * typemanager.cs (delegate_types): New hashtable to hold delegates that
25932 (AddDelegateType): Implement.
25934 (IsDelegateType): Implement helper method.
25936 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
25938 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
25939 and accordingly handle it.
25941 * delegate.cs (Populate): Take TypeContainer argument.
25942 Implement bits to define the Invoke method. However, I still haven't figured out
25943 how to take care of the native int bit :-(
25945 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
25946 Qualify the name of the delegate, not its return type !
25948 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
25951 (StandardConversionExists): Checking for array types turns out to be recursive.
25953 (ConvertReferenceExplicit): Implement array conversion.
25955 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
25957 2001-10-12 Ravi Pratap <ravi@ximian.com>
25959 * cs-parser.jay (delegate_declaration): Store the fully qualified
25960 name as it is a type declaration.
25962 * delegate.cs (ReturnType, Name): Rename members to these. Make them
25965 (DefineDelegate): Renamed from Define. Does the same thing essentially,
25966 as TypeContainer::DefineType.
25968 (Populate): Method in which all the definition of the various methods (Invoke)
25971 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
25974 (CloseDelegate): Finally creates the delegate.
25976 * class.cs (TypeContainer::DefineType): Update to define delegates.
25977 (Populate, Emit and CloseType): Do the same thing here too.
25979 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
25980 delegates in all these operations.
25982 2001-10-14 Miguel de Icaza <miguel@ximian.com>
25984 * expression.cs: LocalTemporary: a new expression used to
25985 reference a temporary that has been created.
25987 * assign.cs: Handle PropertyAccess back here, so that we can
25988 provide the proper semantic access to properties.
25990 * expression.cs (Expression::ConvertReferenceExplicit): Implement
25991 a few more explicit conversions.
25993 * modifiers.cs: `NEW' modifier maps to HideBySig.
25995 * expression.cs (PropertyExpr): Make this into an
25996 ExpressionStatement, and support the EmitStatement code path.
25998 Perform get/set error checking, clean up the interface.
26000 * assign.cs: recognize PropertyExprs as targets, and if so, turn
26001 them into toplevel access objects.
26003 2001-10-12 Miguel de Icaza <miguel@ximian.com>
26005 * expression.cs: PropertyExpr::PropertyExpr: use work around the
26008 * typemanager.cs: Keep track here of our PropertyBuilders again to
26009 work around lameness in SRE.
26011 2001-10-11 Miguel de Icaza <miguel@ximian.com>
26013 * expression.cs (LValue::LValueResolve): New method in the
26014 interface, used to perform a second resolution pass for LValues.
26016 (This::DoResolve): Catch the use of this in static methods.
26018 (This::LValueResolve): Implement.
26020 (This::Store): Remove warning, assigning to `this' in structures
26023 (Invocation::Emit): Deal with invocation of
26024 methods on value types. We need to pass the address to structure
26025 methods rather than the object itself. (The equivalent code to
26026 emit "this" for structures leaves the entire structure on the
26027 stack instead of a pointer to it).
26029 (ParameterReference::DoResolve): Compute the real index for the
26030 argument based on whether the method takes or not a `this' pointer
26031 (ie, the method is static).
26033 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
26034 value types returned from functions when we need to invoke a
26035 method on the sturcture.
26038 2001-10-11 Ravi Pratap <ravi@ximian.com>
26040 * class.cs (TypeContainer::DefineType): Method to actually do the business of
26041 defining the type in the Modulebuilder or Typebuilder. This is to take
26042 care of nested types which need to be defined on the TypeBuilder using
26043 DefineNestedMethod.
26045 (TypeContainer::GetClassBases): Implement. Essentially the code from the
26046 methods in RootContext, only ported to be part of TypeContainer.
26048 (TypeContainer::GetInterfaceOrClass): Ditto.
26050 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
26052 * interface.cs (Interface::DefineInterface): New method. Does exactly
26053 what RootContext.CreateInterface did earlier, only it takes care of nested types
26056 (Interface::GetInterfaces): Move from RootContext here and port.
26058 (Interface::GetInterfaceByName): Same here.
26060 * rootcontext.cs (ResolveTree): Re-write.
26062 (PopulateTypes): Re-write.
26064 * class.cs (TypeContainer::Populate): Populate nested types too.
26065 (TypeContainer::Emit): Emit nested members too.
26067 * typemanager.cs (AddUserType): Do not make use of the FullName property,
26068 instead just use the name argument passed in as it is already fully
26071 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
26072 to TypeContainer mapping to see if a type is user-defined.
26074 * class.cs (TypeContainer::CloseType): Implement.
26076 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
26077 the default constructor.
26079 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
26082 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
26084 * interface.cs (CloseType): Create the type here.
26086 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
26089 Remove all the methods which are now in TypeContainer.
26091 2001-10-10 Ravi Pratap <ravi@ximian.com>
26093 * delegate.cs (Define): Re-write bits to define the delegate
26096 2001-10-10 Miguel de Icaza <miguel@ximian.com>
26098 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
26100 * expression.cs (ImplicitReferenceConversion): handle null as well
26101 as a source to convert to any reference type.
26103 * statement.cs (Return): Perform any implicit conversions to
26104 expected return type.
26106 Validate use of return statement.
26108 * codegen.cs (EmitContext): Pass the expected return type here.
26110 * class.cs (Method, Constructor, Property): Pass expected return
26111 type to EmitContext.
26113 2001-10-09 Miguel de Icaza <miguel@ximian.com>
26115 * expression.cs: Make DoResolve take an EmitContext instead of a
26118 Replaced `l' and `location' for `loc', for consistency.
26120 (Error, Warning): Remove unneeded Tc argument.
26122 * assign.cs, literal.cs, constant.cs: Update to new calling
26125 * codegen.cs: EmitContext now contains a flag indicating whether
26126 code is being generated in a static method or not.
26128 * cs-parser.jay: DecomposeQI, new function that replaces the old
26129 QualifiedIdentifier. Now we always decompose the assembled
26130 strings from qualified_identifier productions into a group of
26133 2001-10-08 Miguel de Icaza <miguel@ximian.com>
26135 * rootcontext.cs: Deal with field-less struct types correctly now
26136 by passing the size option to Define Type.
26138 * class.cs: Removed hack that created one static field.
26140 2001-10-07 Miguel de Icaza <miguel@ximian.com>
26142 * statement.cs: Moved most of the code generation here.
26144 2001-10-09 Ravi Pratap <ravi@ximian.com>
26146 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
26149 (ElementAccess): Remove useless bits for now - keep checks as the spec
26152 2001-10-08 Ravi Pratap <ravi@ximian.com>
26154 * expression.cs (ElementAccess::DoResolve): Remove my crap code
26155 and start performing checks according to the spec.
26157 2001-10-07 Ravi Pratap <ravi@ximian.com>
26159 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
26160 rank_specifiers instead.
26162 (rank_specifiers): Change the order in which the rank specifiers are stored
26164 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
26166 * expression.cs (ElementAccess): Implement the LValue interface too.
26168 2001-10-06 Ravi Pratap <ravi@ximian.com>
26170 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
26171 except that user defined conversions are not included.
26173 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
26174 perform the conversion of the return type, if necessary.
26176 (New::DoResolve): Check whether we are creating an array or an object
26177 and accordingly do the needful.
26179 (New::Emit): Same here.
26181 (New::DoResolve): Implement guts of array creation.
26183 (New::FormLookupType): Helper function.
26185 2001-10-07 Miguel de Icaza <miguel@ximian.com>
26187 * codegen.cs: Removed most of the code generation here, and move the
26188 corresponding code generation bits to the statement classes.
26190 Added support for try/catch/finalize and throw.
26192 * cs-parser.jay: Added support for try/catch/finalize.
26194 * class.cs: Catch static methods having the flags override,
26195 virtual or abstract.
26197 * expression.cs (UserCast): This user cast was not really doing
26198 what it was supposed to do. Which is to be born in fully resolved
26199 state. Parts of the resolution were being performed at Emit time!
26203 2001-10-05 Miguel de Icaza <miguel@ximian.com>
26205 * expression.cs: Implicity convert the result from UserCast.
26207 2001-10-05 Ravi Pratap <ravi@ximian.com>
26209 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
26210 prevented it from working correctly.
26212 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
26213 merely ConvertImplicit.
26215 2001-10-05 Miguel de Icaza <miguel@ximian.com>
26217 * typemanager.cs: Make the LookupTypeContainer function static,
26218 and not per-instance.
26220 * class.cs: Make static FindMembers (the one that takes a Type
26223 * codegen.cs: Add EmitForeach here.
26225 * cs-parser.jay: Make foreach a toplevel object instead of the
26226 inline expansion, as we need to perform semantic analysis on it.
26228 2001-10-05 Ravi Pratap <ravi@ximian.com>
26230 * expression.cs (Expression::ImplicitUserConversion): Rename to
26231 UserDefinedConversion.
26233 (Expression::UserDefinedConversion): Take an extra argument specifying
26234 whether we look for explicit user conversions too.
26236 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
26238 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
26240 (ExplicitUserConversion): Make it a call to UserDefinedConversion
26241 with the appropriate arguments.
26243 * cs-parser.jay (cast_expression): Record location too.
26245 * expression.cs (Cast): Record location info.
26247 (Expression::ConvertExplicit): Take location argument.
26249 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
26250 to determine if we are doing explicit conversions.
26252 (UserCast::Emit): Update accordingly.
26254 (Expression::ConvertExplicit): Report an error if everything fails.
26256 * ../errors/cs0030.cs : Add.
26258 2001-10-04 Miguel de Icaza <miguel@ximian.com>
26260 * modifiers.cs: If the ABSTRACT keyword is present, also set the
26261 virtual and newslot bits.
26263 * class.cs (TypeContainer::RegisterRequiredImplementations):
26264 Record methods we need.
26266 (TypeContainer::MakeKey): Helper function to make keys for
26267 MethodBases, since the Methodbase key is useless.
26269 (TypeContainer::Populate): Call RegisterRequiredImplementations
26270 before defining the methods.
26272 Create a mapping for method_builders_to_methods ahead of time
26273 instead of inside a tight loop.
26275 (::RequireMethods): Accept an object as the data to set into the
26276 hashtable so we can report interface vs abstract method mismatch.
26278 2001-10-03 Miguel de Icaza <miguel@ximian.com>
26280 * report.cs: Make all of it static.
26282 * rootcontext.cs: Drop object_type and value_type computations, as
26283 we have those in the TypeManager anyways.
26285 Drop report instance variable too, now it is a global.
26287 * driver.cs: Use try/catch on command line handling.
26289 Add --probe option to debug the error reporting system with a test
26292 * report.cs: Add support for exiting program when a probe
26293 condition is reached.
26295 2001-10-03 Ravi Pratap <ravi@ximian.com>
26297 * expression.cs (Binary::DoNumericPromotions): Fix the case when
26298 we do a forcible conversion regardless of type, to check if
26299 ForceConversion returns a null.
26301 (Binary::error19): Use location to report error.
26303 (Unary::error23): Use location here too.
26305 * ../errors/cs0019.cs : Check in.
26307 * ../errors/cs0023.cs : Check in.
26309 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
26310 case of a non-null MethodInfo object with a length of 0 !
26312 (Binary::ResolveOperator): Flag error if overload resolution fails to find
26313 an applicable member - according to the spec :-)
26314 Also fix logic to find members in base types.
26316 (Unary::ResolveOperator): Same here.
26318 (Unary::report23): Change name to error23 and make first argument a TypeContainer
26319 as I was getting thoroughly confused between this and error19 :-)
26321 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
26322 (::FindMostEncompassedType): Implement.
26323 (::FindMostEncompassingType): Implement.
26324 (::StandardConversionExists): Implement.
26326 (UserImplicitCast): Re-vamp. We now need info about most specific
26327 source and target types so that we can do the necessary conversions.
26329 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
26330 mathematical union with no duplicates.
26332 2001-10-03 Miguel de Icaza <miguel@ximian.com>
26334 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
26335 in order from base classes to child classes, so that we can in
26336 child classes look up in our parent for method names and
26337 attributes (required for handling abstract, virtual, new, override
26338 constructs: we need to instrospect our base class, and if we dont
26339 populate the classes in order, the introspection might be
26340 incorrect. For example, a method could query its parent before
26341 the parent has any methods and would determine that the parent has
26342 no abstract methods (while it could have had them)).
26344 (RootContext::CreateType): Record the order in which we define the
26347 2001-10-02 Miguel de Icaza <miguel@ximian.com>
26349 * class.cs (TypeContainer::Populate): Also method definitions can
26350 fail now, keep track of this.
26352 (TypeContainer::FindMembers): Implement support for
26353 DeclaredOnly/noDeclaredOnly flag.
26355 (Constructor::Emit) Return the ConstructorBuilder.
26357 (Method::Emit) Return the MethodBuilder.
26358 Check for abstract or virtual methods to be public.
26360 * rootcontext.cs (RootContext::CreateType): Register all the
26361 abstract methods required for the class to be complete and the
26362 interface methods that must be implemented.
26364 * cs-parser.jay: Report error 501 (method requires body if it is
26365 not marked abstract or extern).
26367 * expression.cs (TypeOf::Emit): Implement.
26369 * typemanager.cs: runtime_handle_type, new global type.
26371 * class.cs (Property::Emit): Generate code for properties.
26373 2001-10-02 Ravi Pratap <ravi@ximian.com>
26375 * expression.cs (Unary::ResolveOperator): Find operators on base type
26376 too - we now conform exactly to the spec.
26378 (Binary::ResolveOperator): Same here.
26380 * class.cs (Operator::Define): Fix minor quirk in the tests.
26382 * ../errors/cs0215.cs : Added.
26384 * ../errors/cs0556.cs : Added.
26386 * ../errors/cs0555.cs : Added.
26388 2001-10-01 Miguel de Icaza <miguel@ximian.com>
26390 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
26391 single integer which is really efficient
26393 2001-10-01 Ravi Pratap <ravi@ximian.com>
26395 * expression.cs (Expression::ImplicitUserConversion): Use location
26396 even in the case when we are examining True operators.
26398 * class.cs (Operator::Define): Perform extensive checks to conform
26399 with the rules for operator overloading in the spec.
26401 * expression.cs (Expression::ImplicitReferenceConversion): Implement
26402 some of the other conversions mentioned in the spec.
26404 * typemanager.cs (array_type): New static member for the System.Array built-in
26407 (cloneable_interface): For System.ICloneable interface.
26409 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
26410 we start resolving the tree and populating types.
26412 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
26414 2001-10-01 Miguel de Icaza <miguel@ximian.com>
26416 * expression.cs (Expression::ExprClassFromMemberInfo,
26417 Expression::Literalize): Create literal expressions from
26418 FieldInfos which are literals.
26420 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
26421 type casts, because they were wrong. The test suite in tests
26424 (ImplicitNumericConversion): ushort to ulong requires a widening
26427 Int32 constant to long requires widening cast as well.
26429 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
26430 for integers because the type on the stack is not i4.
26432 2001-09-30 Miguel de Icaza <miguel@ximian.com>
26434 * expression.cs (report118): require location argument.
26436 * parameter.cs: Do not dereference potential null value.
26438 * class.cs: Catch methods that lack the `new' keyword when
26439 overriding a name. Report warnings when `new' is used without
26440 anything being there to override.
26442 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
26444 * class.cs: Only add constructor to hashtable if it is non-null
26445 (as now constructors can fail on define).
26447 (TypeManager, Class, Struct): Take location arguments.
26449 Catch field instance initialization in structs as errors.
26451 accepting_filter: a new filter for FindMembers that is static so
26452 that we dont create an instance per invocation.
26454 (Constructor::Define): Catch errors where a struct constructor is
26457 * cs-parser.jay: Pass location information for various new
26460 * delegate.cs (Delegate): take a location argument.
26462 * driver.cs: Do not call EmitCode if there were problesm in the
26463 Definition of the types, as many Builders wont be there.
26465 * decl.cs (Decl::Decl): Require a location argument.
26467 * cs-tokenizer.cs: Handle properly hex constants that can not fit
26468 into integers, and find the most appropiate integer for it.
26470 * literal.cs: Implement ULongLiteral.
26472 * rootcontext.cs: Provide better information about the location of
26473 failure when CreateType fails.
26475 2001-09-29 Miguel de Icaza <miguel@ximian.com>
26477 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
26480 * expression.cs (Binary::CheckShiftArguments): Add missing type
26482 (Binary::ResolveOperator): Add type to the logical and and logical
26483 or, Bitwise And/Or and Exclusive Or code paths, it was missing
26486 (Binary::DoNumericPromotions): In the case where either argument
26487 is ulong (and most signed types combined with ulong cause an
26488 error) perform implicit integer constant conversions as well.
26490 2001-09-28 Miguel de Icaza <miguel@ximian.com>
26492 * expression.cs (UserImplicitCast): Method should always be
26494 (Invocation::BetterConversion): Simplified test for IntLiteral.
26496 (Expression::ImplicitNumericConversion): Split this routine out.
26497 Put the code that performs implicit constant integer conversions
26500 (Expression::Resolve): Become a wrapper around DoResolve so we can
26501 check eclass and type being set after resolve.
26503 (Invocation::Badness): Remove this dead function
26505 (Binary::ResolveOperator): Do not compute the expensive argumnets
26506 unless we have a union for it.
26508 (Probe::Emit): Is needs to do an isinst and then
26509 compare against null.
26511 (::CanConvert): Added Location argument. If the Location argument
26512 is null (Location.Null), then we do not report errors. This is
26513 used by the `probe' mechanism of the Explicit conversion. We do
26514 not want to generate an error for something that the user
26515 explicitly requested to be casted. But the pipeline for an
26516 explicit cast first tests for potential implicit casts.
26518 So for now, if the Location is null, it means `Probe only' to
26519 avoid adding another argument. Might have to revise this
26522 (ClassCast): New class used to type cast objects into arbitrary
26523 classes (used in Explicit Reference Conversions).
26525 Implement `as' as well.
26527 Reverted all the patches from Ravi below: they were broken:
26529 * The use of `level' as a mechanism to stop recursive
26530 invocations is wrong. That was there just to catch the
26531 bug with a strack trace but not as a way of addressing
26534 To fix the problem we have to *understand* what is going
26535 on and the interactions and come up with a plan, not
26536 just get things going.
26538 * The use of the type conversion cache that I proposed
26539 last night had an open topic: How does this work across
26540 protection domains. A user defined conversion might not
26541 be public in the location where we are applying the
26542 conversion, a different conversion might be selected
26543 (ie, private A->B (better) but public B->A (worse),
26544 inside A, A->B applies, but outside it, B->A will
26547 * On top of that (ie, even if the above is solved),
26548 conversions in a cache need to be abstract. Ie, `To
26549 convert from an Int to a Short use an OpcodeCast', not
26550 `To convert from an Int to a Short use the OpcodeCast on
26551 the variable 5' (which is what this patch was doing).
26553 2001-09-28 Ravi Pratap <ravi@ximian.com>
26555 * expression.cs (Invocation::ConversionExists): Re-write to use
26556 the conversion cache
26558 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
26559 cache all conversions done, not just user-defined ones.
26561 (Invocation::BetterConversion): The real culprit. Use ConversionExists
26562 to determine if a conversion exists instead of acutually trying to
26563 perform the conversion. It's faster too.
26565 (Expression::ConvertExplicit): Modify to use ConversionExists to check
26566 and only then attempt the implicit conversion.
26568 2001-09-28 Ravi Pratap <ravi@ximian.com>
26570 * expression.cs (ConvertImplicit): Use a cache for conversions
26571 already found. Check level of recursion and bail out if necessary.
26573 2001-09-28 Miguel de Icaza <miguel@ximian.com>
26575 * typemanager.cs (string_concat_string_string, string_concat_object_object):
26576 Export standard methods that we expect for string operations.
26578 * statement.cs (Block::UsageWarning): Track usage of variables and
26579 report the errors for not used variables.
26581 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
26584 2001-09-27 Miguel de Icaza <miguel@ximian.com>
26586 * codegen.cs: remove unnneded code
26588 * expression.cs: Removed BuiltinTypeAccess class
26590 Fix the order in which implicit conversions are
26593 The previous fixed dropped support for boxed conversions (adding a
26594 test to the test suite now)
26596 (UserImplicitCast::CanConvert): Remove test for source being null,
26597 that code is broken. We should not feed a null to begin with, if
26598 we do, then we should track the bug where the problem originates
26599 and not try to cover it up here.
26601 Return a resolved expression of type UserImplicitCast on success
26602 rather than true/false. Ravi: this is what I was talking about,
26603 the pattern is to use a static method as a "constructor" for
26606 Also, do not create arguments until the very last minute,
26607 otherwise we always create the arguments even for lookups that
26608 will never be performed.
26610 (UserImplicitCast::Resolve): Eliminate, objects of type
26611 UserImplicitCast are born in a fully resolved state.
26613 * typemanager.cs (InitCoreTypes): Init also value_type
26614 (System.ValueType).
26616 * expression.cs (Cast::Resolve): First resolve the child expression.
26618 (LValue): Add new method AddressOf to be used by
26621 Change the argument of Store to take an EmitContext instead of an
26622 ILGenerator, because things like FieldExpr need to be able to call
26623 their children expression to generate the instance code.
26625 (Expression::Error, Expression::Warning): Sugar functions for
26628 (Expression::MemberLookup): Accept a TypeContainer instead of a
26629 Report as the first argument.
26631 (Expression::ResolvePrimary): Killed. I still want to improve
26632 this as currently the code is just not right.
26634 (Expression::ResolveMemberAccess): Simplify, but it is still
26637 (Unary::Resolve): Catch errors in AddressOf operators.
26639 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
26640 index to a byte for the short-version, or the compiler will choose
26641 the wrong Emit call, which generates the wrong data.
26643 (ParameterReference::Emit, ::Store): same.
26645 (FieldExpr::AddressOf): Implement.
26647 * typemanager.cs: TypeManager: made public variable instead of
26650 * driver.cs: document --fatal.
26652 * report.cs (ErrorMessage, WarningMessage): new names for the old
26653 Error and Warning classes.
26655 * cs-parser.jay (member_access): Turn built-in access to types
26656 into a normal simplename
26658 2001-09-27 Ravi Pratap <ravi@ximian.com>
26660 * expression.cs (Invocation::BetterConversion): Fix to cope
26661 with q being null, since this was introducing a bug.
26663 * expression.cs (ConvertImplicit): Do built-in conversions first.
26665 2001-09-27 Ravi Pratap <ravi@ximian.com>
26667 * expression.cs (UserImplicitCast::Resolve): Fix bug.
26669 2001-09-27 Ravi Pratap <ravi@ximian.com>
26671 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
26672 I had introduced long ago (what's new ?).
26674 * expression.cs (UserImplicitCast::CanConvert): Static method to do
26675 the work of all the checking.
26676 (ConvertImplicit): Call CanConvert and only then create object if necessary.
26677 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
26679 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
26680 that is the right way.
26682 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
26683 overloading resolution. Use everywhere instead of cutting and pasting code.
26685 (Binary::ResolveOperator): Use MakeUnionSet.
26687 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
26688 we have to convert to bool types. Not complete yet.
26690 2001-09-27 Miguel de Icaza <miguel@ximian.com>
26692 * typemanager.cs (TypeManager::CSharpName): support ushort.
26694 * expression.cs (Expression::TryImplicitIntConversion): Attempts
26695 to provide an expression that performsn an implicit constant int
26696 conversion (section 6.1.6).
26697 (Expression::ConvertImplicitRequired): Reworked to include
26698 implicit constant expression conversions.
26700 (Expression::ConvertNumericExplicit): Finished.
26702 (Invocation::Emit): If InstanceExpression is null, then it means
26703 that we perform a call on this.
26705 2001-09-26 Miguel de Icaza <miguel@ximian.com>
26707 * expression.cs (Unary::Emit): Remove some dead code.
26708 (Probe): Implement Resolve and Emit for `is'.
26709 (Expression::ConvertImplicitRequired): Attempt to do constant
26710 expression conversions here. Maybe should be moved to
26711 ConvertImplicit, but I am not sure.
26712 (Expression::ImplicitLongConstantConversionPossible,
26713 Expression::ImplicitIntConstantConversionPossible): New functions
26714 that tell whether is it possible to apply an implicit constant
26715 expression conversion.
26717 (ConvertNumericExplicit): Started work on explicit numeric
26720 * cs-parser.jay: Update operator constants.
26722 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
26723 (Parameters::GetSignature): Hook up VerifyArgs here.
26724 (Parameters::VerifyArgs): Verifies that no two arguments have the
26727 * class.cs (Operator): Update the operator names to reflect the
26728 ones that the spec expects (as we are just stringizing the
26731 * expression.cs (Unary::ResolveOperator): Fix bug: Use
26732 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
26733 previous usage did only work for our methods.
26734 (Expression::ConvertImplicit): Handle decimal implicit numeric
26735 conversions as well.
26736 (Expression::InternalTypeConstructor): Used to invoke constructors
26737 on internal types for default promotions.
26739 (Unary::Emit): Implement special handling for the pre/post
26740 increment/decrement for overloaded operators, as they need to have
26741 the same semantics as the other operators.
26743 (Binary::ResolveOperator): ditto.
26744 (Invocation::ConversionExists): ditto.
26745 (UserImplicitCast::Resolve): ditto.
26747 2001-09-26 Ravi Pratap <ravi@ximian.com>
26749 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
26750 operator, return after emitting body. Regression tests pass again !
26752 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
26753 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
26754 (Invocation::OverloadResolve): Ditto.
26755 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
26757 * everywhere : update calls to the above methods accordingly.
26759 2001-09-26 Miguel de Icaza <miguel@ximian.com>
26761 * assign.cs (Assign): Make it inherit from ExpressionStatement.
26763 * expression.cs (ExpressionStatement): New base class used for
26764 expressions that can appear in statements, so that we can provide
26765 an alternate path to generate expression that do not leave a value
26768 (Expression::Emit, and all the derivatives): We no longer return
26769 whether a value is left on the stack or not. Every expression
26770 after being emitted leaves a single value on the stack.
26772 * codegen.cs (EmitContext::EmitStatementExpression): Use the
26773 facilties of ExpressionStatement if possible.
26775 * cs-parser.jay: Update statement_expression.
26777 2001-09-25 Miguel de Icaza <miguel@ximian.com>
26779 * driver.cs: Change the wording of message
26781 2001-09-25 Ravi Pratap <ravi@ximian.com>
26783 * expression.cs (Binary::ResolveOperator): Had forgottten to set
26784 the type of the expression to the return type of the method if
26785 we have an overloaded operator match ! The regression tests pass again !
26786 (Unary::ResolveOperator): Ditto.
26788 * expression.cs (Invocation::ConversionExists): Correct the member lookup
26789 to find "op_Implicit", not "implicit" ;-)
26790 (UserImplicitCast): New class to take care of user-defined implicit conversions.
26791 (ConvertImplicit, ForceConversion): Take TypeContainer argument
26793 * everywhere : Correct calls to the above accordingly.
26795 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
26796 (ConvertImplicit): Do user-defined conversion if it exists.
26798 2001-09-24 Miguel de Icaza <miguel@ximian.com>
26800 * assign.cs: track location.
26801 (Resolve): Use implicit conversions on assignment.
26803 * literal.cs: Oops. Not good, Emit of short access values should
26804 pass (Bytes) or the wrong argument will be selected.
26806 * expression.cs (Unary::Emit): Emit code for -expr.
26808 (Unary::ResolveOperator): Handle `Substract' for non-constants
26809 (substract from zero from the non-constants).
26810 Deal with Doubles as well.
26812 (Expression::ConvertImplicitRequired): New routine that reports an
26813 error if no implicit conversion exists.
26815 (Invocation::OverloadResolve): Store the converted implicit
26816 expressions if we make them
26818 2001-09-24 Ravi Pratap <ravi@ximian.com>
26820 * class.cs (ConstructorInitializer): Take a Location argument.
26821 (ConstructorBaseInitializer): Same here.
26822 (ConstructorThisInitializer): Same here.
26824 * cs-parser.jay : Update all calls accordingly.
26826 * expression.cs (Unary, Binary, New): Take location argument.
26827 Update accordingly everywhere.
26829 * cs-parser.jay : Update all calls to the above to take a location
26832 * class.cs : Ditto.
26834 2001-09-24 Ravi Pratap <ravi@ximian.com>
26836 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
26837 (Invocation::BetterConversion): Same here
26838 (Invocation::ConversionExists): Ditto.
26840 (Invocation::ConversionExists): Implement.
26842 2001-09-22 Ravi Pratap <ravi@ximian.com>
26844 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
26845 Also take an additional TypeContainer argument.
26847 * All over : Pass in TypeContainer as argument to OverloadResolve.
26849 * typemanager.cs (CSharpName): Update to check for the string type and return
26852 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
26855 2001-09-21 Ravi Pratap <ravi@ximian.com>
26857 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
26858 (Invocation::BetterFunction): Implement.
26859 (Invocation::BetterConversion): Implement.
26860 (Invocation::ConversionExists): Skeleton, no implementation yet.
26862 Okay, things work fine !
26864 2001-09-21 Miguel de Icaza <miguel@ximian.com>
26866 * typemanager.cs: declare and load enum_type, delegate_type and
26869 * expression.cs (Expression::Emit): Now emit returns a value that
26870 tells whether a value is left on the stack or not. This strategy
26871 might be reveted tomorrow with a mechanism that would address
26872 multiple assignments.
26873 (Expression::report118): Utility routine to report mismatches on
26876 (Unary::Report23): Report impossible type/operator combination
26879 (Unary::IsIncrementableNumber): Whether the type can be
26880 incremented or decremented with add.
26881 (Unary::ResolveOperator): Also allow enumerations to be bitwise
26883 (Unary::ResolveOperator): Implement ++, !, ~,
26885 (Invocation::Emit): Deal with new Emit convetion.
26887 * All Expression derivatives: Updated their Emit method to return
26888 whether they leave values on the stack or not.
26890 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
26891 stack for expressions that are statements.
26893 2001-09-20 Miguel de Icaza <miguel@ximian.com>
26895 * expression.cs (LValue): New interface. Must be implemented by
26897 (LocalVariableReference, ParameterReference, FieldExpr): Implement
26900 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
26901 interface for generating code, simplifies the code.
26903 2001-09-20 Ravi Pratap <ravi@ximian.com>
26905 * expression.cs (everywhere): Comment out return statements in ::Resolve
26906 methods to avoid the warnings.
26908 2001-09-20 Miguel de Icaza <miguel@ximian.com>
26910 * driver.cs (parse): Report error 2001 if we can not open the
26913 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
26916 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
26919 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
26920 otherwise nested blocks end up with the same index.
26922 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
26924 * expression.cs: Instead of having FIXMEs in the Resolve
26925 functions, throw exceptions so it is obvious that we are facing a
26928 * cs-parser.jay (invocation_expression): Pass Location information.
26930 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
26931 Use a basename for those routines because .NET does not like paths
26934 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
26937 2001-09-19 Miguel de Icaza <miguel@ximian.com>
26939 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
26940 are loading the correct data types (throws an exception if not).
26941 (TypeManager::InitCoreTypes): Use CoreLookupType
26943 * expression.cs (Unary::ResolveOperator): return the child
26944 expression for expressions which are just +expr.
26945 (Unary::ResolveOperator): Return negative literals for -LITERAL
26946 expressions (otherwise they are Unary {Literal}).
26947 (Invocation::Badness): Take into account `Implicit constant
26948 expression conversions'.
26950 * literal.cs (LongLiteral): Implement long literal class.
26951 (IntLiteral): export the `Value' of the intliteral.
26953 2001-09-19 Ravi Pratap <ravi@ximian.com>
26955 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
26957 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
26958 instead of 'Operator'
26960 * expression.cs (Binary::ResolveOperator): Update accordingly.
26961 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
26964 * cs-parser.jay (unary_expression): Update to use the new names.
26966 * gen-treedump.cs (GetUnary): Same here.
26968 * expression.cs (Unary::Resolve): Implement.
26969 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
26970 operators are found instead of making noise ;-)
26971 (Unary::ResolveOperator): New method to do precisely the same thing which
26972 Binary::ResolveOperator does for Binary expressions.
26973 (Unary.method, .Arguments): Add.
26974 (Unary::OperName): Implement.
26975 (Unary::ForceConversion): Copy and Paste !
26977 * class.cs (Operator::Define): Fix a small bug for the case when we have
26980 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
26981 for the inbuilt operators. Only overloading works for now ;-)
26983 2001-09-18 Miguel de Icaza <miguel@ximian.com>
26985 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
26986 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
26988 * expression.cs (This::Emit): Implement.
26989 (This::Resolve): Implement.
26990 (TypeOf:Resolve): Implement.
26991 (Expression::ResolveSimpleName): Add an implicit this to instance
26993 (MemberAccess::Resolve): Deal with Parameters and Fields.
26994 Bind instance variable to Field expressions.
26995 (FieldExpr::Instance): New field used to track the expression that
26996 represents the object instance.
26997 (FieldExpr::Resolve): Track potential errors from MemberLookup not
26999 (FieldExpr::Emit): Implement.
27001 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
27002 the last instruction contains a return opcode to avoid generating
27003 the last `ret' instruction (this generates correct code, and it is
27004 nice to pass the peverify output).
27006 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
27007 initializer for static and instance variables.
27008 (Constructor::Emit): Allow initializer to be null in the case of
27009 static constructors. Only emit initializer for instance
27012 (TypeContainer::FindMembers): Return a null array if there are no
27015 Also fix the code for the MemberTypes.Method branch, as it was not
27016 scanning that for operators (or tried to access null variables before).
27018 * assign.cs (Assign::Emit): Handle instance and static fields.
27022 * driver.cs: Stop compilation if there are parse errors.
27024 * cs-parser.jay (constructor_declaration): Provide default base
27025 initializer for non-static constructors.
27026 (constructor_declarator): Do not provide a default base
27027 initializers if none was specified.
27028 Catch the fact that constructors should not have parameters.
27030 * class.cs: Do not emit parent class initializers for static
27031 constructors, that should be flagged as an error.
27033 2001-09-18 Ravi Pratap <ravi@ximian.com>
27035 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
27036 Move back code into TypeContainer::Populate.
27038 2001-09-18 Ravi Pratap <ravi@ximian.com>
27040 * class.cs (TypeContainer::AddConstructor): Fix the check to
27041 compare against Name, not Basename.
27042 (Operator::OpType): Change Plus and Minus to Add and Subtract.
27044 * cs-parser.jay : Update accordingly.
27046 * class.cs (TypeContainer::FindMembers): For the case where we are searching
27047 for methods, don't forget to look into the operators too.
27048 (RegisterMethodBuilder): Helper method to take care of this for
27049 methods, constructors and operators.
27050 (Operator::Define): Completely revamp.
27051 (Operator.OperatorMethod, MethodName): New fields.
27052 (TypeContainer::Populate): Move the registering of builders into
27053 RegisterMethodBuilder.
27054 (Operator::Emit): Re-write.
27056 * expression.cs (Binary::Emit): Comment out code path to emit method
27057 invocation stuff for the case when we have a user defined operator. I am
27058 just not able to get it right !
27060 2001-09-17 Miguel de Icaza <miguel@ximian.com>
27062 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
27065 (Expression::MemberLookup): Provide a version that allows to
27066 specify the MemberTypes and BindingFlags.
27068 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
27069 so it was not fetching variable information from outer blocks.
27071 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
27072 Beforefieldinit as it was buggy.
27074 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
27075 that Ravi put here.
27077 * class.cs (Constructor::Emit): Only emit if block is not null.
27078 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
27079 deal with this by semantically definining it as if the user had
27082 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
27083 constructors as we now "emit" them at a higher level.
27085 (TypeContainer::DefineDefaultConstructor): Used to define the
27086 default constructors if none was provided.
27088 (ConstructorInitializer): Add methods Resolve and Emit.
27090 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
27092 2001-09-17 Ravi Pratap <ravi@ximian.com>
27094 * class.cs (TypeContainer::EmitDefaultConstructor): Register
27095 the default constructor builder with our hashtable for methodbuilders
27098 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
27099 and argument_count is 0 in which case we have a match.
27100 (Binary::ResolveOperator): More null checking and miscellaneous coding
27103 2001-09-17 Ravi Pratap <ravi@ximian.com>
27105 * rootcontext.cs (IsNameSpace): Compare against null.
27107 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
27109 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
27110 and Unary::Operator.
27112 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
27115 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
27116 we have overloaded operators.
27117 (Binary::ResolveOperator): Implement the part which does the operator overload
27120 * class.cs (Operator::Emit): Implement.
27121 (TypeContainer::Emit): Emit the operators we have too.
27123 * expression.cs (Binary::Emit): Update to emit the appropriate code for
27124 the case when we have a user-defined operator.
27126 2001-09-17 Miguel de Icaza <miguel@ximian.com>
27128 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
27130 2001-09-16 Ravi Pratap <ravi@ximian.com>
27132 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
27133 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
27134 (Constructor::Emit): Implement.
27135 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
27136 if we have no work to do.
27137 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
27140 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
27141 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
27143 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
27146 2001-09-15 Ravi Pratap <ravi@ximian.com>
27148 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
27150 (Tree::RecordNamespace): Method to do what the name says ;-)
27151 (Tree::Namespaces): Property to get at the namespaces hashtable.
27153 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
27156 * rootcontext.cs (IsNamespace): Fixed it :-)
27158 2001-09-14 Miguel de Icaza <miguel@ximian.com>
27160 * class.cs (TypeContainer::FindMembers): Add support for
27162 (MethodCore): New class that encapsulates both the shared aspects
27163 of a Constructor and a Method.
27164 (Method, Constructor): Factored pieces into MethodCore.
27166 * driver.cs: Added --fatal which makes errors throw exceptions.
27167 Load System assembly as well as part of the standard library.
27169 * report.cs: Allow throwing exceptions on errors for debugging.
27171 * modifiers.cs: Do not use `parent', instead use the real type
27172 container to evaluate permission settings.
27174 * class.cs: Put Ravi's patch back in. He is right, and we will
27175 have to cope with the
27177 2001-09-14 Ravi Pratap <ravi@ximian.com>
27179 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
27180 FamORAssem, not FamANDAssem.
27182 2001-09-14 Miguel de Icaza <miguel@ximian.com>
27184 * driver.cs: Added --parse option that only parses its input files
27187 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
27188 incorrect. IsTopLevel is not used to tell whether an object is
27189 root_types or not (that can be achieved by testing this ==
27190 root_types). But to see if this is a top-level *class* (not
27191 necessarly our "toplevel" container).
27193 2001-09-14 Ravi Pratap <ravi@ximian.com>
27195 * enum.cs (Enum::Define): Modify to call the Lookup method on the
27196 parent instead of a direct call to GetType.
27198 2001-09-14 Ravi Pratap <ravi@ximian.com>
27200 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
27201 Modifiers.TypeAttr. This should just be a call to that method.
27203 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
27204 object so that we can determine if we are top-level or not.
27206 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
27209 * enum.cs (Enum::Define): Ditto.
27211 * modifiers.cs (FieldAttr): Re-write.
27213 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
27214 (TypeContainer::HaveStaticConstructor): New property to provide access
27215 to precisely that info.
27217 * modifiers.cs (MethodAttr): Re-write.
27218 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
27220 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
27221 of top-level types as claimed.
27223 2001-09-13 Miguel de Icaza <miguel@ximian.com>
27225 * expression.cs (MemberLookup): Fruitless attempt to lookup
27226 constructors. Maybe I need to emit default constructors? That
27227 might be it (currently .NET emits this for me automatically).
27228 (Invocation::OverloadResolve): Cope with Arguments == null.
27229 (Invocation::EmitArguments): new function, shared by the new
27230 constructor and us.
27231 (Invocation::Emit): Handle static and instance methods. Emit
27232 proper call instruction for virtual or non-virtual invocations.
27233 (New::Emit): Implement.
27234 (New::Resolve): Implement.
27235 (MemberAccess:Resolve): Implement.
27236 (MethodGroupExpr::InstanceExpression): used conforming to the spec
27237 to track instances.
27238 (FieldExpr::Resolve): Set type.
27240 * support.cs: Handle empty arguments.
27242 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
27243 SimpleLookup): Auxiliary routines to help parse a qualifier
27246 Update qualifier_identifier rule.
27248 * codegen.cs: Removed debugging messages.
27250 * class.cs: Make this a global thing, this acts just as a "key" to
27251 objects that we might have around.
27253 (Populate): Only initialize method_builders_to_methods once.
27255 * expression.cs (PropertyExpr): Initialize type from the
27258 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
27259 Resolve pattern. Attempt to implicitly convert value to boolean.
27262 * expression.cs: Set the type for the int32/int32 argument case.
27263 (Binary::ResolveOperator): Set the return type to boolean for
27264 comparission operators
27266 * typemanager.cs: Remove debugging print code.
27268 (Invocation::Resolve): resolve type.
27270 * class.cs: Allocate a MemberInfo of the correct size, as the code
27271 elsewhere depends on the test to reflect the correct contents.
27273 (Method::) Keep track of parameters, due to System.Reflection holes
27275 (TypeContainer::Populate): Keep track of MethodBuilders to Method
27278 (TypeContainer::FindMembers): Use ArrayList and then copy an array
27279 of the exact size and return that.
27281 (Class::LookupMethodByBuilder): New function that maps
27282 MethodBuilders to its methods. Required to locate the information
27283 on methods because System.Reflection bit us again.
27285 * support.cs: New file, contains an interface ParameterData and
27286 two implementations: ReflectionParameters and InternalParameters
27287 used to access Parameter information. We will need to grow this
27290 * expression.cs (Invocation::GetParameterData): implement a cache
27291 and a wrapper around the ParameterData creation for methods.
27292 (Invocation::OverloadResolve): Use new code.
27294 2001-09-13 Ravi Pratap <ravi@ximian.com>
27296 * class.cs (TypeContainer::EmitField): Remove and move into
27297 (Field::Define): here and modify accordingly.
27298 (Field.FieldBuilder): New member.
27299 (TypeContainer::Populate): Update accordingly.
27300 (TypeContainer::FindMembers): Implement.
27302 2001-09-13 Miguel de Icaza <miguel@ximian.com>
27304 * statement.cs: (VariableInfo::VariableType): New field to be
27305 initialized with the full type once it is resolved.
27307 2001-09-12 Miguel de Icaza <miguel@ximian.com>
27309 * parameter.cs (GetParameterInfo): Use a type cache to compute
27310 things only once, and to reuse this information
27312 * expression.cs (LocalVariableReference::Emit): Implement.
27313 (OpcodeCast::Emit): fix.
27315 (ParameterReference::Resolve): Implement.
27316 (ParameterReference::Emit): Implement.
27318 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
27319 that are expressions need to stay as Expressions.
27321 * typemanager.cs (CSharpName): Returns the C# name of a type if
27324 * expression.cs (Expression::ConvertImplicit): New function that
27325 implements implicit type conversions.
27327 (Expression::ImplicitReferenceConversion): Implements implicit
27328 reference conversions.
27330 (EmptyCast): New type for transparent casts.
27332 (OpcodeCast): New type for casts of types that are performed with
27333 a sequence of bytecodes.
27335 (BoxedCast): New type used for casting value types into reference
27336 types. Emits a box opcode.
27338 (Binary::DoNumericPromotions): Implements numeric promotions of
27339 and computation of the Binary::Type.
27341 (Binary::EmitBranchable): Optimization.
27343 (Binary::Emit): Implement code emission for expressions.
27345 * typemanager.cs (TypeManager): Added two new core types: sbyte
27348 2001-09-12 Ravi Pratap <ravi@ximian.com>
27350 * class.cs (TypeContainer::FindMembers): Method which does exactly
27351 what Type.FindMembers does, only we don't have to use reflection. No
27352 implementation yet.
27354 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
27355 typecontainer objects as we need to get at them.
27356 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
27358 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
27359 typecontainer object.
27361 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
27362 of just a Report object.
27364 2001-09-11 Ravi Pratap <ravi@ximian.com>
27366 * class.cs (Event::Define): Go back to using the prefixes "add_" and
27368 (TypeContainer::Populate): Now define the delegates of the type too.
27369 (TypeContainer.Delegates): Property to access the list of delegates defined
27372 * delegates.cs (Delegate::Define): Implement partially.
27374 * modifiers.cs (TypeAttr): Handle more flags.
27376 2001-09-11 Ravi Pratap <ravi@ximian.com>
27378 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
27380 (Operator::Define): Re-write logic to get types by using the LookupType method
27381 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
27382 (Indexer::Define): Ditto.
27383 (Event::Define): Ditto.
27384 (Property::Define): Ditto.
27386 2001-09-10 Ravi Pratap <ravi@ximian.com>
27388 * class.cs (TypeContainer::Populate): Now define operators too.
27389 (TypeContainer.Operators): New property to access the list of operators
27391 (Operator.OperatorMethodBuilder): New member to hold the method builder
27392 for the operator we are defining.
27393 (Operator::Define): Implement.
27395 2001-09-10 Ravi Pratap <ravi@ximian.com>
27397 * class.cs (Event::Define): Make the prefixes of the accessor methods
27398 addOn_ and removeOn_
27400 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
27401 of the location being passed in too. Ideally, this should go later since all
27402 error reporting should be done through the Report object.
27404 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
27405 (Populate): Iterate thru the indexers we have and define them too.
27406 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
27407 for the get and set accessors.
27408 (Indexer::Define): Implement.
27410 2001-09-09 Miguel de Icaza <miguel@ximian.com>
27412 * expression.cs (Binary::Resolve): Beginning of it. I scratched
27413 my previous implementation, did not work.
27415 * typemanager.cs: Add a couple of missing types (the longs).
27417 * literal.cs: Use TypeManager.bool_type instead of getting it.
27419 * expression.cs (EventExpr): New kind of expressions.
27420 (Expressio::ExprClassFromMemberInfo): finish
27422 2001-09-08 Miguel de Icaza <miguel@ximian.com>
27424 * assign.cs: Emit stores to static fields differently.
27426 2001-09-08 Ravi Pratap <ravi@ximian.com>
27428 * Merge in changes and adjust code to tackle conflicts. Backed out my
27429 code in Assign::Resolve ;-)
27431 2001-09-08 Ravi Pratap <ravi@ximian.com>
27433 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
27434 instead Report.Error and also pass in the location.
27435 (CSharpParser::Lexer): New readonly property to return the reference
27436 to the Tokenizer object.
27437 (declare_local_variables): Use Report.Error with location instead of plain
27441 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
27442 (Operator.CheckBinaryOperator): Ditto.
27444 * cs-parser.jay (operator_declarator): Update accordingly.
27446 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
27447 (CheckBinaryOperator): Same here.
27449 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
27450 on the name without any prefixes of namespace names etc. This is because we
27451 already might have something already fully qualified like
27452 'System.Console.WriteLine'
27454 * assign.cs (Resolve): Begin implementation. Stuck ;-)
27456 2001-09-07 Ravi Pratap <ravi@ximian.com>
27458 * cs-tokenizer.cs (location): Return a string which also contains
27461 * expression.cs (ElementAccess): New class for expressions of the
27462 type 'element access.'
27463 (BaseAccess): New class for expressions of the type 'base access.'
27464 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
27467 * cs-parser.jay (element_access): Implement action.
27468 (base_access): Implement actions.
27469 (checked_expression, unchecked_expression): Implement.
27471 * cs-parser.jay (local_variable_type): Correct and implement.
27472 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
27474 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
27476 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
27477 name and the specifiers.
27479 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
27481 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
27482 making them all public ;-)
27484 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
27487 2001-09-07 Miguel de Icaza <miguel@ximian.com>
27489 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
27491 (FieldExpr, PropertyExprs): New resolved expressions.
27492 (SimpleName::MemberStaticCheck): Perform static checks for access
27493 to non-static fields on static methods. Maybe this should be
27494 generalized for MemberAccesses.
27495 (SimpleName::ResolveSimpleName): More work on simple name
27498 * cs-parser.jay (primary_expression/qualified_identifier): track
27499 the parameter index.
27501 * codegen.cs (CodeGen::Save): Catch save exception, report error.
27502 (EmitContext::EmitBoolExpression): Chain to expression generation
27503 instead of temporary hack.
27504 (::EmitStatementExpression): Put generic expression code generation.
27506 * assign.cs (Assign::Emit): Implement variable assignments to
27507 local variables, parameters and fields.
27509 2001-09-06 Miguel de Icaza <miguel@ximian.com>
27511 * statement.cs (Block::GetVariableInfo): New method, returns the
27512 VariableInfo for a variable name in a block.
27513 (Block::GetVariableType): Implement in terms of GetVariableInfo
27515 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
27516 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
27518 2001-09-06 Ravi Pratap <ravi@ximian.com>
27520 * cs-parser.jay (operator_declaration): Continue on my quest : update
27521 to take attributes argument.
27522 (event_declaration): Ditto.
27523 (enum_declaration): Ditto.
27524 (indexer_declaration): Ditto.
27526 * class.cs (Operator::Operator): Update constructor accordingly.
27527 (Event::Event): Ditto.
27529 * delegate.cs (Delegate::Delegate): Same here.
27531 * enum.cs (Enum::Enum): Same here.
27533 2001-09-05 Ravi Pratap <ravi@ximian.com>
27535 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
27537 * ../tests/cs0658.cs : New file to demonstrate error 0658.
27539 * attribute.cs (Attributes): New class to encapsulate all attributes which were
27540 being passed around as an arraylist.
27541 (Attributes::AddAttribute): Method to add attribute sections.
27543 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
27544 (struct_declaration): Update accordingly.
27545 (constant_declaration): Update.
27546 (field_declaration): Update.
27547 (method_header): Update.
27548 (fixed_parameter): Update.
27549 (parameter_array): Ditto.
27550 (property_declaration): Ditto.
27551 (destructor_declaration): Ditto.
27553 * class.cs (Struct::Struct): Update constructors accordingly.
27554 (Class::Class): Ditto.
27555 (Field::Field): Ditto.
27556 (Method::Method): Ditto.
27557 (Property::Property): Ditto.
27558 (TypeContainer::OptAttribute): update property's return type.
27560 * interface.cs (Interface.opt_attributes): New member.
27561 (Interface::Interface): Update to take the extra Attributes argument.
27563 * parameter.cs (Parameter::Parameter): Ditto.
27565 * constant.cs (Constant::Constant): Ditto.
27567 * interface.cs (InterfaceMemberBase): New OptAttributes field.
27568 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
27569 the attributes as a parameter.
27570 (InterfaceProperty): Update constructor call.
27571 (InterfaceEvent): Ditto.
27572 (InterfaceMethod): Ditto.
27573 (InterfaceIndexer): Ditto.
27575 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
27576 pass the attributes too.
27577 (interface_event_declaration): Ditto.
27578 (interface_property_declaration): Ditto.
27579 (interface_method_declaration): Ditto.
27580 (interface_declaration): Ditto.
27582 2001-09-05 Miguel de Icaza <miguel@ximian.com>
27584 * class.cs (Method::Define): Track the "static Main" definition to
27585 create an entry point.
27587 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
27588 EntryPoint if we find it.
27590 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
27591 (EmitContext::ig): Make this variable public.
27593 * driver.cs: Make the default output file be the first file name
27594 with the .exe extension.
27596 Detect empty compilations
27598 Handle various kinds of output targets. Handle --target and
27599 rename -t to --dumper.
27601 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
27602 methods inherited from Expression return now an Expression. This
27603 will is used during the tree rewriting as we resolve them during
27606 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
27607 the spec. Missing entirely is the information about
27608 accessability of elements of it.
27610 (Expression::ExprClassFromMemberInfo): New constructor for
27611 Expressions that creates a fully initialized Expression based on
27612 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
27615 (Invocation::Resolve): Begin implementing resolution of invocations.
27617 * literal.cs (StringLiteral): Implement Emit.
27619 2001-09-05 Ravi Pratap <ravi@ximian.com>
27621 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
27624 2001-09-04 Ravi Pratap <ravi@ximian.com>
27626 * cs-parser.jay (attribute_arguments): Implement actions.
27627 (attribute): Fix bug in production. Implement action.
27628 (attribute_list): Implement.
27629 (attribute_target): Implement.
27630 (attribute_target_specifier, opt_target_specifier): Implement
27631 (CheckAttributeTarget): New method to check if the attribute target
27633 (attribute_section): Implement.
27634 (opt_attributes): Implement.
27636 * attribute.cs : New file to handle attributes.
27637 (Attribute): Class to hold attribute info.
27639 * cs-parser.jay (opt_attribute_target_specifier): Remove production
27640 (attribute_section): Modify production to use 2 different rules to
27641 achieve the same thing. 1 s/r conflict down !
27642 Clean out commented, useless, non-reducing dimension_separator rules.
27644 * class.cs (TypeContainer.attributes): New member to hold list
27645 of attributes for a type.
27646 (Struct::Struct): Modify to take one more argument, the attribute list.
27647 (Class::Class): Ditto.
27648 (Field::Field): Ditto.
27649 (Method::Method): Ditto.
27650 (Property::Property): Ditto.
27652 * cs-parser.jay (struct_declaration): Update constructor call to
27653 pass in the attributes too.
27654 (class_declaration): Ditto.
27655 (constant_declaration): Ditto.
27656 (field_declaration): Ditto.
27657 (method_header): Ditto.
27658 (fixed_parameter): Ditto.
27659 (parameter_array): Ditto.
27660 (property_declaration): Ditto.
27662 * constant.cs (Constant::Constant): Update constructor similarly.
27663 Use System.Collections.
27665 * parameter.cs (Parameter::Parameter): Update as above.
27667 2001-09-02 Ravi Pratap <ravi@ximian.com>
27669 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
27670 (TypeContainer.delegates): New member to hold list of delegates.
27672 * cs-parser.jay (delegate_declaration): Implement the action correctly
27673 this time as I seem to be on crack ;-)
27675 2001-09-02 Miguel de Icaza <miguel@ximian.com>
27677 * rootcontext.cs (RootContext::IsNamespace): new function, used to
27678 tell whether an identifier represents a namespace.
27680 * expression.cs (NamespaceExpr): A namespace expression, used only
27681 temporarly during expression resolution.
27682 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
27683 utility functions to resolve names on expressions.
27685 2001-09-01 Miguel de Icaza <miguel@ximian.com>
27687 * codegen.cs: Add hook for StatementExpressions.
27689 * class.cs: Fix inverted test for static flag in methods.
27691 2001-09-02 Ravi Pratap <ravi@ximian.com>
27693 * class.cs (Operator::CheckUnaryOperator): Correct error number used
27694 to make it coincide with MS' number.
27695 (Operator::CheckBinaryOperator): Ditto.
27697 * ../errors/errors.txt : Remove error numbers added earlier.
27699 * ../errors/cs1019.cs : Test case for error # 1019
27701 * ../errros/cs1020.cs : Test case for error # 1020
27703 * cs-parser.jay : Clean out commented cruft.
27704 (dimension_separators, dimension_separator): Comment out. Ostensibly not
27705 used anywhere - non-reducing rule.
27706 (namespace_declarations): Non-reducing rule - comment out.
27708 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
27709 with TypeContainer::AddEnum.
27711 * delegate.cs : New file for delegate handling classes.
27712 (Delegate): Class for declaring delegates.
27714 * makefile : Update.
27716 * cs-parser.jay (delegate_declaration): Implement.
27718 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
27720 * class.cs (Event::Define): Implement.
27721 (Event.EventBuilder): New member.
27723 * class.cs (TypeContainer::Populate): Update to define all enums and events
27725 (Events): New property for the events arraylist we hold. Shouldn't we move to using
27726 readonly fields for all these cases ?
27728 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
27730 * class.cs (Property): Revamp to use the convention of making fields readonly.
27731 Accordingly modify code elsewhere.
27733 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
27734 the Define method of the Property class.
27736 * class.cs : Clean up applied patch and update references to variables etc. Fix
27738 (TypeContainer::Populate): Update to define all the properties we have. Also
27739 define all enumerations.
27741 * enum.cs (Define): Implement.
27743 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
27745 * cs-parser.jay (overloadable_operator): The semantic value is an
27746 enum of the Operator class.
27747 (operator_declarator): Implement actions.
27748 (operator_declaration): Implement.
27750 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
27751 validity of definitions.
27752 (Operator::CheckBinaryOperator): Static method to check for binary operators
27753 (TypeContainer::AddOperator): New method to add an operator to a type.
27755 * cs-parser.jay (indexer_declaration): Added line to actually call the
27756 AddIndexer method so it gets added ;-)
27758 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
27759 already taken care of by the MS compiler ?
27761 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
27763 * class.cs (Operator): New class for operator declarations.
27764 (Operator::OpType): Enum for the various operators.
27766 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
27768 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
27769 ostensibly handle this in semantic analysis.
27771 * cs-parser.jay (general_catch_clause): Comment out
27772 (specific_catch_clauses, specific_catch_clause): Ditto.
27773 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
27774 (catch_args, opt_catch_args): New productions.
27775 (catch_clause): Rewrite to use the new productions above
27776 (catch_clauses): Modify accordingly.
27777 (opt_catch_clauses): New production to use in try_statement
27778 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
27779 and re-write the code in the actions to extract the specific and
27780 general catch clauses by being a little smart ;-)
27782 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
27783 Hooray, try and catch statements parse fine !
27785 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27787 * statement.cs (Block::GetVariableType): Fix logic to extract the type
27788 string from the hashtable of variables.
27790 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
27791 I end up making that mistake ;-)
27792 (catch_clauses): Fixed gross error which made Key and Value of the
27793 DictionaryEntry the same : $1 !!
27795 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27797 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
27799 * cs-parser.jay (event_declaration): Correct to remove the semicolon
27800 when the add and remove accessors are specified.
27802 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27804 * cs-parser.jay (IndexerDeclaration): New helper class to hold
27805 information about indexer_declarator.
27806 (indexer_declarator): Implement actions.
27807 (parsing_indexer): New local boolean used to keep track of whether
27808 we are parsing indexers or properties. This is necessary because
27809 implicit_parameters come into picture even for the get accessor in the
27810 case of an indexer.
27811 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
27813 * class.cs (Indexer): New class for indexer declarations.
27814 (TypeContainer::AddIndexer): New method to add an indexer to a type.
27815 (TypeContainer::indexers): New member to hold list of indexers for the
27818 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
27820 * cs-parser.jay (add_accessor_declaration): Implement action.
27821 (remove_accessor_declaration): Implement action.
27822 (event_accessors_declaration): Implement
27823 (variable_declarators): swap statements for first rule - trivial.
27825 * class.cs (Event): New class to hold information about event
27827 (TypeContainer::AddEvent): New method to add an event to a type
27828 (TypeContainer::events): New member to hold list of events.
27830 * cs-parser.jay (event_declaration): Implement actions.
27832 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
27834 * cs-parser.jay (dim_separators): Implement. Make it a string
27835 concatenating all the commas together, just as they appear.
27836 (opt_dim_separators): Modify accordingly
27837 (rank_specifiers): Update accordingly. Basically do the same
27838 thing - instead, collect the brackets here.
27839 (opt_rank_sepcifiers): Modify accordingly.
27840 (array_type): Modify to actually return the complete type string
27841 instead of ignoring the rank_specifiers.
27842 (expression_list): Implement to collect the expressions
27843 (variable_initializer): Implement. We make it a list of expressions
27844 essentially so that we can handle the array_initializer case neatly too.
27845 (variable_initializer_list): Implement.
27846 (array_initializer): Make it a list of variable_initializers
27847 (opt_array_initializer): Modify accordingly.
27849 * expression.cs (New::NType): Add enumeration to help us
27850 keep track of whether we have an object/delegate creation
27851 or an array creation.
27852 (New:NewType, New::Rank, New::Indices, New::Initializers): New
27853 members to hold data about array creation.
27854 (New:New): Modify to update NewType
27855 (New:New): New Overloaded contructor for the array creation
27858 * cs-parser.jay (array_creation_expression): Implement to call
27859 the overloaded New constructor.
27861 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
27863 * class.cs (TypeContainer::Constructors): Return member
27864 constructors instead of returning null.
27866 2001-08-26 Miguel de Icaza <miguel@ximian.com>
27868 * typemanager.cs (InitCoreTypes): Initialize the various core
27869 types after we have populated the type manager with the user
27870 defined types (this distinction will be important later while
27871 compiling corlib.dll)
27873 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
27874 on Expression Classification. Now all expressions have a method
27875 `Resolve' and a method `Emit'.
27877 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
27878 generation from working. Also add some temporary debugging
27881 2001-08-24 Miguel de Icaza <miguel@ximian.com>
27883 * codegen.cs: Lots of code generation pieces. This is only the
27884 beginning, will continue tomorrow with more touches of polish. We
27885 handle the fundamentals of if, while, do, for, return. Others are
27886 trickier and I need to start working on invocations soon.
27888 * gen-treedump.cs: Bug fix, use s.Increment here instead of
27891 * codegen.cs (EmitContext): New struct, used during code
27892 emission to keep a context. Most of the code generation will be
27895 * cs-parser.jay: Add embedded blocks to the list of statements of
27896 this block. So code generation proceeds in a top down fashion.
27898 2001-08-23 Miguel de Icaza <miguel@ximian.com>
27900 * statement.cs: Add support for multiple child blocks.
27902 2001-08-22 Miguel de Icaza <miguel@ximian.com>
27904 * codegen.cs (EmitCode): New function, will emit the code for a
27905 Block of code given a TypeContainer and its ILGenerator.
27907 * statement.cs (Block): Standard public readonly optimization.
27908 (Block::Block constructors): Link children.
27909 (Block::Child): Child Linker.
27910 (Block::EmitVariables): Emits IL variable declarations.
27912 * class.cs: Drop support for MethodGroups here, delay until
27914 (Method::): Applied the same simplification that I did before, and
27915 move from Properties to public readonly fields.
27916 (Method::ParameterTypes): Returns the parameter types for the
27917 function, and implements a cache that will be useful later when I
27918 do error checking and the semantic analysis on the methods is
27920 (Constructor::GetCallingConvention): Renamed from CallingConvetion
27921 and made a method, optional argument tells whether this is a class
27922 or a structure to apply the `has-this' bit.
27923 (Method::GetCallingConvention): Implement, returns the calling
27925 (Method::Define): Defines the type, a second pass is performed
27926 later to populate the methods.
27928 (Constructor::ParameterTypes): implement a cache similar to the
27929 one on Method::ParameterTypes, useful later when we do semantic
27932 (TypeContainer::EmitMethod): New method. Emits methods.
27934 * expression.cs: Removed MethodGroup class from here.
27936 * parameter.cs (Parameters::GetCallingConvention): new method.
27938 2001-08-21 Miguel de Icaza <miguel@ximian.com>
27940 * class.cs (TypeContainer::Populate): Drop RootContext from the
27943 (Constructor::CallingConvention): Returns the calling convention.
27944 (Constructor::ParameterTypes): Returns the constructor parameter
27947 (TypeContainer::AddConstructor): Keep track of default constructor
27948 and the default static constructor.
27950 (Constructor::) Another class that starts using `public readonly'
27951 instead of properties.
27953 (Constructor::IsDefault): Whether this is a default constructor.
27955 (Field::) use readonly public fields instead of properties also.
27957 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
27958 track of static constructors; If none is used, turn on
27959 BeforeFieldInit in the TypeAttributes.
27961 * cs-parser.jay (opt_argument_list): now the return can be null
27962 for the cases where there are no arguments.
27964 (constructor_declarator): If there is no implicit `base' or
27965 `this', then invoke the default parent constructor.
27967 * modifiers.cs (MethodAttr): New static function maps a set of
27968 modifiers flags into a MethodAttributes enum
27969 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
27970 MethodAttr, TypeAttr to represent the various mappings where the
27971 modifiers are used.
27972 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
27974 2001-08-19 Miguel de Icaza <miguel@ximian.com>
27976 * parameter.cs (GetParameterInfo): Fix bug where there would be no
27979 * interface.cs (PopulateIndexer): Implemented the code generator
27980 for interface indexers.
27982 2001-08-17 Miguel de Icaza <miguel@ximian.com>
27984 * interface.cs (InterfaceMemberBase): Now we track the new status
27987 (PopulateProperty): Implement property population. Woohoo! Got
27988 Methods and Properties going today.
27990 Removed all the properties for interfaces, and replaced them with
27991 `public readonly' fields.
27993 2001-08-16 Miguel de Icaza <miguel@ximian.com>
27995 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
27996 initialize their hashtables/arraylists only when they are needed
27997 instead of doing this always.
27999 * parameter.cs: Handle refs and out parameters.
28001 * cs-parser.jay: Use an ArrayList to construct the arguments
28002 instead of the ParameterCollection, and then cast that to a
28005 * parameter.cs: Drop the use of ParameterCollection and use
28006 instead arrays of Parameters.
28008 (GetParameterInfo): Use the Type, not the Name when resolving
28011 2001-08-13 Miguel de Icaza <miguel@ximian.com>
28013 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
28014 and instead use public readonly fields.
28016 * class.cs: Put back walking code for type containers.
28018 2001-08-11 Miguel de Icaza <miguel@ximian.com>
28020 * class.cs (MakeConstant): Code to define constants.
28022 * rootcontext.cs (LookupType): New function. Used to locate types
28025 2001-08-08 Miguel de Icaza <miguel@ximian.com>
28027 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
28028 this System.Reflection code is. Kudos to Microsoft
28030 * typemanager.cs: Implement a type cache and avoid loading all
28031 types at boot time. Wrap in LookupType the internals. This made
28032 the compiler so much faster. Wow. I rule!
28034 * driver.cs: Make sure we always load mscorlib first (for
28035 debugging purposes, nothing really important).
28037 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
28038 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
28040 * rootcontext.cs: Lookup types on their namespace; Lookup types
28041 on namespaces that have been imported using the `using' keyword.
28043 * class.cs (TypeContainer::TypeAttr): Virtualize.
28044 (Class::TypeAttr): Return attributes suitable for this bad boy.
28045 (Struct::TypeAttr): ditto.
28046 Handle nested classes.
28047 (TypeContainer::) Remove all the type visiting code, it is now
28048 replaced with the rootcontext.cs code
28050 * rootcontext.cs (GetClassBases): Added support for structs.
28052 2001-08-06 Miguel de Icaza <miguel@ximian.com>
28054 * interface.cs, statement.cs, class.cs, parameter.cs,
28055 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
28056 Drop use of TypeRefs, and use strings instead.
28058 2001-08-04 Miguel de Icaza <miguel@ximian.com>
28062 * class.cs (Struct::Struct): set the SEALED flags after
28063 checking the modifiers.
28064 (TypeContainer::TypeAttr): new property, returns the
28065 TypeAttributes for a class.
28067 * cs-parser.jay (type_list): Oops, list production was creating a
28068 new list of base types.
28070 * rootcontext.cs (StdLib): New property.
28071 (GetInterfaceTypeByName): returns an interface by type name, and
28072 encapsulates error handling here.
28073 (GetInterfaces): simplified.
28074 (ResolveTree): Encapsulated all the tree resolution here.
28075 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
28078 * driver.cs: Add support for --nostdlib, to avoid loading the
28079 default assemblies.
28080 (Main): Do not put tree resolution here.
28082 * rootcontext.cs: Beginning of the class resolution.
28084 2001-08-03 Miguel de Icaza <miguel@ximian.com>
28086 * rootcontext.cs: Provide better error reporting.
28088 * cs-parser.jay (interface_base): set our $$ to be interfaces.
28090 * rootcontext.cs (CreateInterface): Handle the case where there
28091 are no parent interfaces.
28093 (CloseTypes): Routine to flush types at the end.
28094 (CreateInterface): Track types.
28095 (GetInterfaces): Returns an array of Types from the list of
28096 defined interfaces.
28098 * typemanager.c (AddUserType): Mechanism to track user types (puts
28099 the type on the global type hash, and allows us to close it at the
28102 2001-08-02 Miguel de Icaza <miguel@ximian.com>
28104 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
28105 RecordInterface instead.
28107 * cs-parser.jay: Updated to reflect changes above.
28109 * decl.cs (Definition): Keep track of the TypeBuilder type that
28110 represents this type here. Not sure we will use it in the long
28111 run, but wont hurt for now.
28113 * driver.cs: Smaller changes to accomodate the new code.
28115 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
28118 * rootcontext.cs (CreateInterface): New method, used to create
28119 the System.TypeBuilder type for interfaces.
28120 (ResolveInterfaces): new entry point to resolve the interface
28122 (CodeGen): Property, used to keep track of the code generator.
28124 2001-07-26 Miguel de Icaza <miguel@ximian.com>
28126 * cs-parser.jay: Add a second production for delegate_declaration
28129 (enum_body): Put an opt_comma here instead of putting it on
28130 enum_body or enum_member_declarations so we can handle trailing
28131 commas on enumeration members. Gets rid of a shift/reduce.
28133 (type_list): Need a COMMA in the middle.
28135 (indexer_declaration): Tell tokenizer to recognize get/set
28137 * Remove old targets.
28139 * Re-add the parser target.
28141 2001-07-13 Simon Cozens <simon@simon-cozens.org>
28143 * cs-parser.jay: Add precendence rules for a number of operators
28144 ot reduce the number of shift/reduce conflicts in the grammar.
28146 2001-07-17 Miguel de Icaza <miguel@ximian.com>
28148 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
28151 Get rid of old crufty code.
28153 * rootcontext.cs: Use this to keep track of the parsed
28154 representation and the defined types available to the program.
28156 * gen-treedump.cs: adjust for new convention.
28158 * type.cs: Split out the type manager, and the assembly builder
28161 * typemanager.cs: the type manager will live here now.
28163 * cil-codegen.cs: And the code generator here.
28165 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
28167 * makefile: Fixed up for easy making.
28169 2001-07-13 Simon Cozens <simon@simon-cozens.org>
28171 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
28174 (unary_expression): Expand pre_increment_expression and
28175 post_decrement_expression to reduce a shift/reduce.
28177 2001-07-11 Simon Cozens
28179 * cs-tokenizer.cs: Hex numbers should begin with a 0.
28181 Improve allow_keyword_as_indent name.
28183 2001-06-19 Miguel de Icaza <miguel@ximian.com>
28185 * Adjustments for Beta2.
28187 2001-06-13 Miguel de Icaza <miguel@ximian.com>
28189 * decl.cs: Added `Define' abstract method.
28190 (InTransit): new property, used to catch recursive definitions.
28192 * interface.cs: Implement `Define'.
28194 * modifiers.cs: Map Modifiers.constants to
28195 System.Reflection.TypeAttribute flags.
28197 * class.cs: Keep track of types and user-defined types.
28198 (BuilderInit): New method for creating an assembly
28199 (ResolveType): New function to launch the resolution process, only
28200 used by interfaces for now.
28202 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
28203 that are inserted into the name space.
28205 2001-06-08 Miguel de Icaza <miguel@ximian.com>
28207 * ARGH. I have screwed up my tree so many times due to the use of
28208 rsync rather than using CVS. Going to fix this at once.
28210 * driver.cs: Objetify driver. Load assemblies, use assemblies to
28213 2001-06-07 Miguel de Icaza <miguel@ximian.com>
28215 * Experiment successful: Use System.Type rather that our own
28218 2001-05-25 Miguel de Icaza <miguel@ximian.com>
28220 * cs-parser.jay: Removed nsAliases from here.
28222 Use new namespaces, handle `using XXX;'
28224 * namespace.cs: Reimplemented namespace handling, use a recursive
28225 definition of the class. Now we can keep track of using clauses
28226 and catch invalid using clauses.
28228 2001-05-24 Miguel de Icaza <miguel@ximian.com>
28230 * gen-treedump.cs: Adapted for all the renaming.
28232 * expression.cs (Expression): this class now has a Type property
28233 which returns an expression Type.
28235 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
28236 `Type', as this has a different meaning now in the base
28238 2001-05-22 Miguel de Icaza <miguel@ximian.com>
28240 * interface.cs, class.cs: Removed from all the sources the
28241 references to signature computation, as we can not do method
28242 signature computation during the parsing time, as we are not
28243 trying to solve at that point distinguishing:
28247 void a (NS.Blah x) {}
28250 Which depending on the context might be valid or not, as we do not
28251 know if Blah is the same thing as NS.Blah at that point.
28253 * Redid everything so the code uses TypeRefs now instead of
28254 Types. TypeRefs are just temporary type placeholders, that need
28255 to be resolved. They initially have a pointer to a string and the
28256 current scope in which they are used. This is used later by the
28257 compiler to resolve the reference to an actual Type.
28259 * DeclSpace is no longer a CIR.Type, and neither are
28260 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
28261 are all DeclSpaces, but no Types.
28263 * type.cs (TypeRefManager): This implements the TypeRef manager,
28264 which keeps track of all the types that need to be resolved after
28265 the parsing has finished.
28267 2001-05-13 Miguel de Icaza <miguel@ximian.com>
28269 * ARGH. We are going to have to store `foreach' as a class rather
28270 than resolving it, as we need to verify error 1579 after name
28271 resolution. *OR* we could keep a flag that says `This request to
28272 IEnumerator comes from a foreach statement' which we can then use
28273 to generate the error.
28275 2001-05-10 Miguel de Icaza <miguel@ximian.com>
28277 * class.cs (TypeContainer.AddMethod): we now add methods to the
28278 MethodGroup instead of the method hashtable.
28280 * expression.cs: Add MethodGroup abstraction, which gets us one
28281 step closer to the specification in the way we handle method
28284 * cs-parser.jay (primary_expression): qualified_identifier now
28285 tried to match up an identifier to a local variable reference or
28286 to a parameter reference.
28288 current_local_parameters is now a parser global variable that
28289 points to the current parameters for the block, used during name
28292 (property_declaration): Now creates an implicit `value' argument to
28295 2001-05-09 Miguel de Icaza <miguel@ximian.com>
28297 * parameter.cs: Do not use `param' arguments as part of the
28298 signature, per the spec.
28300 2001-05-08 Miguel de Icaza <miguel@ximian.com>
28302 * decl.cs: Base class for classes, structs and interfaces. This
28303 is the "Declaration Space"
28305 * cs-parser.jay: Use CheckDef for checking declaration errors
28306 instead of having one on each function.
28308 * class.cs: Factor out some code for handling error handling in
28309 accordance to the "Declarations" section in the "Basic Concepts"
28310 chapter in the ECMA C# spec.
28312 * interface.cs: Make all interface member classes derive from
28313 InterfaceMemberBase.
28315 2001-05-07 Miguel de Icaza <miguel@ximian.com>
28317 * Many things: all interfaces are parsed and generated in
28318 gen-treedump. Support for member variables, constructors,
28319 destructors, properties, constants is there.
28321 Beginning of the IL backend, but very little done, just there for
28324 2001-04-29 Miguel de Icaza <miguel@ximian.com>
28326 * cs-parser.jay: Fix labeled statement.
28328 * cs-tokenizer.cs (escape): Escape " and ' always.
28329 ref_line, ref_name: keep track of the line/filename as instructed
28330 by #line by the compiler.
28333 2001-04-27 Miguel de Icaza <miguel@ximian.com>
28335 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
28336 to match the values in System.CodeDOM.
28338 Divid renamed to Divide.
28340 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
28342 (Statements.set): remove.
28344 * System.CodeDOM/CodeCatchClause.cs: always have a valid
28347 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
28348 falseStatements always have valid values.
28350 * cs-parser.jay: Use System.CodeDOM now.